@okxweb3/coin-stellar
Version:
@ok/coin-stellar is a Stellar SDK for building Web3 wallets and applications. It supports Stellar and PI blockchains, enabling private key management, address generation, transaction signing, trustline creation, and asset transfers
29 lines • 1.14 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.bumpSequence = void 0;
const js_xdr_1 = require("@stellar/js-xdr");
const bignumber_1 = __importDefault(require("../util/bignumber"));
const xdr_1 = __importDefault(require("../xdr"));
function bumpSequence(opts) {
const attributes = {};
if (typeof opts.bumpTo !== 'string') {
throw new Error('bumpTo must be a string');
}
try {
new bignumber_1.default(opts.bumpTo);
}
catch (e) {
throw new Error('bumpTo must be a stringified number');
}
attributes.bumpTo = js_xdr_1.Hyper.fromString(opts.bumpTo);
const bumpSequenceOp = new xdr_1.default.BumpSequenceOp(attributes);
const opAttributes = {};
opAttributes.body = xdr_1.default.OperationBody.bumpSequence(bumpSequenceOp);
this.setSourceAccount(opAttributes, opts);
return new xdr_1.default.Operation(opAttributes);
}
exports.bumpSequence = bumpSequence;
//# sourceMappingURL=bump_sequence.js.map