Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


Fee Bump Example

node v10.24.1
version: 1.0.0
const { TransactionBuilder, Server, Keypair, BASE_FEE, Networks, Operation, StrKey } = require('stellar-sdk') const axios = require('axios') const server = new Server('https://horizon-testnet.stellar.org') const keypair = Keypair.fromSecret('SAIO6VONEI2GY2LD32LECMHTKJYANHTOPBXDSPQ7BEXBMQ3PTI2NJMKN') const baseFee = BASE_FEE const networkPassphrase = Networks.TESTNET const feeSource = Keypair.fromSecret('SDH2PWNRWGLOKY4D5IEJH6I7BTQ3JZ3FMCLW64ZL3TBKDOJSEBVNIXRZ') try { await server .friendbot(keypair.publicKey()) .call() await server .friendbot(feeSource.publicKey()) .call() } catch(err) {} server .loadAccount(keypair.publicKey()) .then((account) => { const innerTx = new TransactionBuilder(account, { fee: baseFee, networkPassphrase, v1: true }) .addOperation(Operation.bumpSequence({ bumpTo: '0' })) .setTimeout(0) .build() innerTx.sign(keypair) const feeBumpTxn = new TransactionBuilder.buildFeeBumpTransaction( feeSource, baseFee, innerTx, networkPassphrase ) feeBumpTxn.sign(feeSource) return feeBumpTxn.toXDR() }) .then((res) => console.log(res)) .catch((err) => console.error(err))

no comments

    sign in to comment