@bithomp/xrpl-api
Version:
A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger
27 lines (26 loc) • 990 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BatchFlagsKeys = void 0;
exports.getBatchFlagsKeys = getBatchFlagsKeys;
const batch_1 = require("xrpl/dist/npm/models/transactions/batch");
const global_1 = require("./global");
const common_1 = require("../common");
const nativeCurrencyBatchFlags = {};
exports.BatchFlagsKeys = {
allOrNothing: batch_1.BatchFlags.tfAllOrNothing,
onlyOne: batch_1.BatchFlags.tfOnlyOne,
untilFailure: batch_1.BatchFlags.tfUntilFailure,
independent: batch_1.BatchFlags.tfIndependent,
};
function getBatchFlagsKeys(nativeCurrency) {
if (!nativeCurrency) {
nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
}
if (!nativeCurrencyBatchFlags[nativeCurrency]) {
nativeCurrencyBatchFlags[nativeCurrency] = {
...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
...exports.BatchFlagsKeys,
};
}
return nativeCurrencyBatchFlags[nativeCurrency];
}
;