Net
Token Net APIs support HTTP protocol. It uses net_ namespace.
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 |
Create Token | create |
Burn | burn |
Transfer | transfer |
Approve | approve |
Mint | mintNFT |
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 |
Example
net_getBalance
Return an address PRT balance.
Parameters
Name | Type | Description |
---|---|---|
address | String | Address |
Return Value
Name | Type | Description |
---|---|---|
balance | BigDecimal | balance of address. |
Example
net_transfer
Transfer PRT from from-address to to-address.
Parameters
Name | Type | Description |
---|---|---|
sender | String | Sender address |
toAddress | String | To address |
amount | BigDecimal | Transfer amount. |
comment | String | Comment Max length : 200 |
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 |
In order to perform a transaction, the from address must have a balance of at least 50 MFEI for gas cost.
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | Transaction Id |
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
net_getTokenInfo
Returns a token information.
Parameters
Name | Type | Description |
---|---|---|
contractAddress | String | Contract address of token |
Return Value
Name | Type | Description |
---|---|---|
contractAddress | String | Transaction Id |
tokenType | String | Type of Token : "ERC20" or "ERC721" |
owner | String | Owner's address |
name | String | Token name |
symbol | String | Token symbol |
decimals | Integer | Token decimals |
initialSupply | BigInteger | Initial supply amount |
txId | String | Transaction Id |
blockNumber | Long | The block number containing the transaction. |
txTime | String | Time the transaction was created. |
status | Integer | Transaction status value, see getTransactionStatus API. |
gasValue | BigDecimal String | The gas used by the transaction. |
Example
Last updated