Net
Chain base coin (ETH, BNB) APIs
net_getTempKey
Returns a generated tempKey by address
Parameters
Name | Type | Description |
---|---|---|
address | String | Address |
keyType | String | See below keyType section. |
keyType
Transaction Type | keyType String |
---|---|
Export Address | exportAddress |
Burn | burn |
Transfer | transfer |
Approve | approve |
Mint | mint |
Return Value
Name | Type | Description |
---|---|---|
tempKey | String | tempKey |
Example
net_getTransactionStatus
Returns a status of transaction.
Parameters
Name | Type | Description |
---|---|---|
transactionId | String | Transaction Id |
Return Value
Name | Type | Description |
---|---|---|
status | Integer | See below status type. |
revertReason | String | Reverted reason, if transaction fail. |
Status type
Status | Description |
---|---|
1 | Success |
0 | Fail |
2 | Invalid |
-1 | Pending or invalid Transaction Id |
Example
net_getBalance
Return an address ETH / BNB balance.
Parameters
Name | Type | Description |
---|---|---|
address | String | Address |
Return Value
Name | Type | Description |
---|---|---|
balance | BigDecimal | balance of address. |
Example
net_getGasPrice
Returns the average gas value from the corresponding Onchain.
Parameters
Return Value
Name | Type | Description |
---|---|---|
gasPrice | BigDecimal | gasPrice |
Example
net_transfer
Transfer ETH / BNB from from-address to to-address.
Parameters
Name | Type | Description |
---|---|---|
sender | String | Sender address |
toAddress | String | To address |
amount | BigDecimal | Transfer amount. |
tempKey | String | tempKey for "transfer" |
hashKey | String | hash(tempKey | fromAddress' secretKey) |
signature | String | sign( hash (sender | toAddress | amount | tempKey | hashKey) ) by formAddress's privateKey using signData API |
gasPrice | BigDecimal | gasPrice. |
nonce | BigInteger | nonce value. If it is null, it will be filled in automatically. If acceleration is needed, use the nonce value generated when performing the transaction and use a higher gasPrice than the previous transaction. |
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | Transaction Id |
nonce | BigInteger | nonce value |
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using getTransactionStatus.
Example
Last updated