Net

Chain base coin (ETH, BNB) APIs

Endpoint

{Server URL}/v1/chain/net

getTempKey

Returns a generated tempKey by address

Parameters

NameTypeDescription

address

String

Address

keyType

String

See below keyType section.

keyType

Transaction TypekeyType String

Export Address

exportAddress

Create Token

create

Burn

burn

Transfer

transfer

Approve

approve

Mint

mint

Return Value

NameTypeDescription

tempKey

String

tempKey

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": { 
            "tempKey": "ffd5b9f7f4650366bd7043271bfcf0eb",
        }
    }
}

getTransactionStatus

Returns a status of transaction.

Parameters

NameTypeDescription

transactionId

String

Transaction Id

Return Value

NameTypeDescription

status

Integer

See below status type.

revertReason

String

Reverted reason, if transaction fail.

Status type

StatusDescription

1

Success

0

Fail

2

Invalid

-1

Pending or invalid Transaction Id

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "status": 0,
            "revertReason":"&ERC20: transfer amount exceeds balance"
        }
    }
}

getBalance

Return an address ETH / BNB balance.

Parameters

NameTypeDescription

address

String

Address

Return Value

NameTypeDescription

balance

BigDecimal

balance of address.

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "balance": "100.12"
        }
    }
}

getGasPrice

Returns the average gas value from the corresponding Onchain.

Parameters

Return Value

NameTypeDescription

gasPrice

BigDecimal

gasPrice

Example

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "gasPrice": "0.000000004"
        }
    }
}

transfer

Transfer ETH / BNB from from-address to to-address.

Parameters

NameTypeDescription

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

NameTypeDescription

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

{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "transactionId": "0xf7d37be47ce8b563b07aa5e81e17e9722bab2e71374d970a558b45c0ed51df7b",
            "nonce": "32"
        }
    }
}

Last updated