@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
58 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExchangeError = void 0;
exports.createWrongSwapParams = createWrongSwapParams;
exports.createWrongSellParams = createWrongSellParams;
exports.createWrongFundParams = createWrongFundParams;
exports.createAccounIdNotFound = createAccounIdNotFound;
function createWrongSwapParams(params) {
return {
code: "WRONG_SWAP_PARAMS",
message: "swap params are not correctly set",
data: {
params,
},
};
}
function createWrongSellParams(params) {
return {
code: "WRONG_SELL_PARAMS",
message: "sell params are not correctly set",
data: {
params,
},
};
}
function createWrongFundParams(params) {
return {
code: "WRONG_FUND_PARAMS",
message: "fund params are not correctly set",
data: {
params,
},
};
}
function createAccounIdNotFound(accountId) {
return {
code: "ACCOUNT_ID_NOT_FOUND",
message: "unable to find account id in current wallet",
data: {
accountId,
},
};
}
class ExchangeError {
name = "ExchangeError";
get message() {
return this.context.message;
}
get cause() {
return this.context.code;
}
context;
constructor(context) {
this.context = context;
}
}
exports.ExchangeError = ExchangeError;
//# sourceMappingURL=error.js.map