Obyte.js
GitHub
Discord
Search…
0.1.19
Obyte.js
Getting started
Quick start
Testnet
API
Get witnesses
Get peers
Get joint
Get last MCI
Get history
Get attestation
Get attestations
Get bots
Get asset metadata
Get definition
Get balances
Get profile units
Get data feed
Autonomous Agents
Core
Post
Address definition change
Attestation
Asset
Asset attestors
Data
Data feed
Definition
Definition template
Payment
Poll
Vote
Profile
Text
Multi
Client
Subscribe
Just saying
Requests
Utils
Sign a message
Validate signed message
Generate a random address
Get definition address
Is valid address
Keep connection alive
About
About
Links
Tutorials
Powered By
GitBook
Payment
Arguments
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
Returns the unit hash.
Examples
Spend bytes
1
const
params
=
{
2
outputs
:
[
3
{
address
:
'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU'
,
amount
:
1000
}
4
]
5
};
6
7
client
.
post
.
payment
(
params
,
wif
,
function
(
err
,
result
)
{
8
if
(
err
)
return
console
.
error
(
err
);
9
console
.
log
(
result
);
10
});
Copied!
Send bytes to multiple recipients
1
const
params
=
{
2
outputs
:
[
3
{
address
:
'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU'
,
amount
:
1000
},
4
{
address
:
'ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q'
,
amount
:
2000
}
5
]
6
};
7
8
client
.
post
.
payment
(
params
,
wif
,
function
(
err
,
result
)
{
9
if
(
err
)
return
console
.
error
(
err
);
10
console
.
log
(
result
);
11
});
Copied!
Spend asset
1
const
params
=
{
2
asset
:
'Hh22Wmd+xAYhgjCBACAxKXWErh/zJuwGc2w2DCB9H24='
,
3
outputs
:
[
4
{
address
:
'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU'
,
amount
:
500
}
5
]
6
};
7
8
client
.
post
.
payment
(
params
,
wif
,
function
(
err
,
result
)
{
9
if
(
err
)
return
console
.
error
(
err
);
10
console
.
log
(
result
);
11
});
Copied!
Learn more
"12. Unit structure" (page 15)
https://obyte.org/Byteball.pdf
Post - Previous
Definition template
Next - Post
Poll
Last modified
1yr ago
Copy link
Contents
Arguments
Returns
Examples
Learn more