Payment
- asset
string
optional Hash of unit where the asset was defined. - outputs
array
required Outputs is an array of outputs that say who receives the money.- address
string
required The Byteball address of the recipient. - amount
integrer
required The amount he receives.
Returns the unit hash.
const params = {
outputs: [
{ address: 'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU', amount: 1000 }
]
};
client.post.payment(params, wif, function(err, result) {
if (err) return console.error(err);
console.log(result);
});
const params = {
outputs: [
{ address: 'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU', amount: 1000 },
{ address: 'ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q', amount: 2000 }
]
};
client.post.payment(params, wif, function(err, result) {
if (err) return console.error(err);
console.log(result);
});
const params = {
asset: 'Hh22Wmd+xAYhgjCBACAxKXWErh/zJuwGc2w2DCB9H24=',
outputs: [
{ address: 'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU', amount: 500 }
]
};
client.post.payment(params, wif, function(err, result) {
if (err) return console.error(err);
console.log(result);
});
Last modified 2yr ago