@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
36 lines • 987 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = makeCliTools;
const invariant_1 = __importDefault(require("invariant"));
const options = [
{
name: "fee",
type: String,
desc: "how much fee",
},
{
name: "tag",
type: Number,
desc: "ripple tag",
},
];
function inferTransactions(transactions, opts, { inferAmount, }) {
return transactions.flatMap(({ transaction, account }) => {
(0, invariant_1.default)(transaction.family === "xrp", "XRP family");
return {
...transaction,
fees: inferAmount(account, opts.fee || "0.001xrp"),
tag: opts.tag,
};
});
}
function makeCliTools() {
return {
options,
inferTransactions,
};
}
//# sourceMappingURL=cli.js.map