2.0.4 • Published 3 years ago

gmd-nodejs-sdk v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Examples on hot to call the GMD node API

GMD = require('gmd-nodejs-sdk');
GMD.setURL('https://node.thecoopnetwork.io')
  • Creating GMD transfers each 15 minutes:
require('node-cron').schedule('0,15,30,45 * * * *', () => {
  const dataSendMoney = {
    requestType: 'sendMoney',
    recipient: 'GMD-43MP-76UW-L69N-ALW39',
    amountNQT: '10000000000',
    secretPhrase: 'my secret passphrase that will not be sent on the wire but only be used for local signing',
    feeNQT: '1000000000',
    deadline: '15'
  };

  GMD.apiCall('post', dataSendMoney, (res)=> {
    console.log('This is a callback example. Data received back on api calls:\n'+JSON.stringify(res, null, 2));
  });
});
  • Getting last transactions:
    • optional parameters allow filtering by transaction type, subtype, sender or receiver.
const paramsGetTransactions = { 
    requestType: 'getTransactionsBulk',
    pageSize: 5,
    page: 0
}
GMD.apiCall('get', paramsGetTransactions, (res)=>{
    console.log('Result trasnactions: \n'+JSON.stringify(res, null, 2));
})
  • Getting accounts (ordered by balance):
const paramsGetAccounts = {
    requestType: 'getAccountsBulk',
    pageSize: 5,
    page: 0
}
GMD.apiCall('get', paramsGetAccounts, (res)=>{
    console.log('Result trasnactions: \n'+JSON.stringify(res, null, 2));
})
2.0.5-1

3 years ago

2.0.4-2

3 years ago

2.0.3

3 years ago

2.0.5-0

3 years ago

2.0.4-1

3 years ago

2.0.4-0

3 years ago

2.0.4

3 years ago

2.0.4-7

3 years ago

2.0.4-6

3 years ago

2.0.4-5

3 years ago

2.0.5-3

3 years ago

2.0.4-4

3 years ago

2.0.5-2

3 years ago

2.0.4-3

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.3-0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago