-
Notifications
You must be signed in to change notification settings - Fork 0
API : Feature
王辰 edited this page Jan 6, 2020
·
2 revisions
- signTxByPrivKey
- signTxByCrypto
- makeBoxTxByCryptoUseBoxd
- makeBoxTxByCrypto
- makeSplitTxByCrypto
- issueTokenByCrypto
- makeTokenTxByCrypto
- makeContractTxByPrivKey
- makeContractTxByCrypto
- callContract
const api = new boxdjs.Api(fetch, <http://xxx>, 'http')
boxdjs.Contract.setProvider('http://xxx', from, privateKey)
Sign transaction by private-key.
unsigned-transaction: UnsignedTx
private-key-hex: <string>
signed-transaction
Sign transaction by crypto.json.
* SignedTxByCryptoReq {
unsignedTx: [UnsignedTx](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#unsignedtx)
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
Make BOX transaction by crypto.json [Backend Serialization].
* MakeBoxTxByCryptoReq
{
tx: {
from: <string>
to: <string[]>
amounts: <number[]>
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
hash: <string>
Make BOX transaction by crypto.json [Local Serialization].
* MakeBoxTxByCryptoReq
{
tx: {
from: <string>
to: <string[]>
amounts: <number[]>
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
hash: <string>
Make split transaction by crypto.json.
* MakeSplitTxByCryptoReq
{
tx: {
from: <string>
addrs: <string[]>
weights: <number[]>
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
splitAddr: <string>
hash: <string>
Issue token by crypto.json.
* IssueTokenByCryptoReq
{
tx: {
issuer: <string>;
owner: <string>;
tag: {
decimal: <number>;
name: <string>;
supply: <number>;
symbol: <string>;
};
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
hash: <string>
Make token transaction by crypto.json.
* MakeTokenTxByCryptoReq
{
tx: {
amounts: <number[]>;
from: <string>;
to: <string[]>;
token_hash: <string>;
token_index: <number>;
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
hash: <string>
Make contract transaction by private_key.
* OriginalContractReq
{
tx: {
from: <string>;
to: <string>;
amount: <number>;
gasLimit: <number>;
nonce: <number>;
isDeploy: <boolean>;
data: <string>;
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
hash: <string>
contractAddr: <string>
Make contract transaction by crypto.json.
* ContractTxByCryptoReq
{
tx: {
from: <string>;
to: <string>;
amount: <number>;
gasLimit: <number>;
nonce: <number>;
isDeploy: <boolean>;
data: <string>;
}
crypto: [Crypto](https://github.com/BOXFoundation/box-js/wiki/API-:-Interface#crypto)
pwd: <string>
}
hash: <string>
contractAddr: <string>
Call Contract.
* CallContractReq
{
from: <string>;
to: <string>;
data: <string>;
height: <number>;
timeout: <number>;
}
output: <string>
By Contentbox