Jump to content

Ripple API Offline Wallet/Address Creation


Recommended Posts


New to this forum, not sure if this is the right place to post but wasn't able to post in other sub forums.

I have created an offline Linux Ubuntu environment running nodejs. 

I was hoping if someone could please verify my code/steps and provide further guidance. 

So far I have been able to generate a secret and address using the below code.:

const RippleAPI = require('ripple-lib').RippleAPI;
const api = new RippleAPI();

Which returns the following output:

{ secret: 's****************************',
  address: 'r*********************************' }

Then I have created a payment using the following code:

const RippleAPI = require('ripple-lib').RippleAPI;
const api = new RippleAPI();
const address = 'r9********************************';
const secret = 's****************************';

const payment = {
  "source": {
    "address": "r9********************************",
    "maxAmount": {
      "value": "50",
      "currency": "XRP",
  "destination": {
    "address": "rp********************************",
    "amount": {
      "value": "50",
      "currency": "XRP",

const instructions = {
fee: '0.000032',
sequence: 98866,
maxLedgerVersion: 25670000

//api.connect().then(() => {
return api.preparePayment(address, payment, instructions).then(prepared => {
const {signedTransaction} = api.sign(prepared.txJSON, secret);
const {id} = api.sign(prepared.txJSON, secret);


Which outputs the following incl. tx blob?

{ txJSON: '{"TransactionType":"Payment","Account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59","Destination":"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo","Amount":"50000000","Flags":2147483648,"LastLedgerSequence":25670000,"Fee":"32","Sequence":98866}',
  instructions: { fee: '0.000032', sequence: 98866, maxLedgerVersion: 25670000 } }


Would really appreciate if someone could please review the above and let me know if it is correct and if anything should be changed, and also what is the next step easiest way to take this tx blob and submit it online somewhere to process the transaction?

Thanks in advance. 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...