ERC20 Token

Token ERC20 APIs support HTTP protocol. It uses erc20_ namespace.

erc20_create

Create an ERC20 token.

Parameters

NameTypeDescription

sender

String

Sender Address

name

String

Token name Max length : 30

symbol

String

Token symbol. Consists of only alphanumeric characters and can contain up to 4 characters. Max length : 4

initialSupply

BigInteger

Initial supply amount of token. It's must be Interger Type. The maximum number of digits is 11.

decimals

Integer

decimals. Minimum 0 to maximum 18.

tempKey

String

tempKey for "create"

hashKey

String

hash(tempKey | secretKey)

signature

String

sign( hash( sender | name | symbol | initialSupply | decimals | tempKey | hashKey ) ) by sender's privateKey using signData API

In order to perform a transaction, the owner must have a balance of at least 4 GFEI for gas cost.

Return Value

NameTypeDescription

transactionId

String

Transaction Id

contractAddress

String

Token contract address

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 net_getTransactionStatus.

Example

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

erc20_mint

Add token issuance. Only the token owner can do this.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token

sender

String

Sender Address (It's must be owner)

amount

BigDecimal

Mint amount of token.

comment

String

Comment Max length : 200

tempKey

String

tempKey for "mint"

hashKey

String

hash(tempKey | secretKey)

signature

String

sign( hash( contractAddress | owner | amount | tempKey | hashKey ) ) by sender's privateKey using signData API

In order to perform a transaction, the owner must have a balance of at least 100,000,000 fei for gas cost.

Return Value

NameTypeDescription

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 net_getTransactionStatus.

Example

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

erc20_burn

Burn the initial supply of token. Only the token owner can do this.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token

sender

String

Sender Address (It's must be owner)

amount

BigDecimal

Burn amount of token.

comment

String

Comment Max length : 200

tempKey

String

tempKey for "burn"

hashKey

String

hash(tempKey | secretKey)

signature

String

sign( hash( contractAddress | owner | amount | tempKey | hashKey ) ) by sender's privateKey using signData API

In order to perform a transaction, the owner must have a balance of at least 100 MFEI for gas cost.

Return Value

NameTypeDescription

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 net_getTransactionStatus.

Example

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

erc20_getBalance

Return an address Token balance.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token.

address

String

Address

Return Value

NameTypeDescription

balance

BigDecimal

Token balance of address.

Example

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

erc20_transfer

Transfer Token from from-address to to-address.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token

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( contractAddress | sender | toAddress | amount | tempKey | hashKey ) ) by sender's privateKey using signData API

In order to perform a transaction, the from address must have a balance of at least 100 MFEI for gas cost.

Return Value

NameTypeDescription

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 net_getTransactionStatus.

Example

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

erc20_transferFrom

Transfer Token from from-address to to-address by spender.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token

sender

String

Sender address (spender)

fromAddress

String

From 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( contractAddress | sender | fromAddress | toAddress | amount | tempKey | hashKey ) ) by sender's privateKey using signData API

In order to perform a transaction, the spender address must have a balance of at least 100 MFEI for gas cost.

Return Value

NameTypeDescription

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 net_getTransactionStatus.

Example

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

erc20_approve

Approve Token from owner-address to spender-address.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token

sender

String

Sender address

spender

String

Spender address

amount

BigDecimal

Approve amount.

comment

String

Comment Max length : 200

tempKey

String

tempKey for "approve"

hashKey

String

hash(tempKey | fromAddress' secretKey)

signature

String

sign( hash ( contractAddress | sender | spender | amount | tempKey | hashKey ) ) by sender's privateKey using signData API

In order to perform a transaction, the from address must have a balance of at least 100 MFEI for gas cost.

Return Value

NameTypeDescription

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 net_getTransactionStatus.

Example

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

erc20_getAllowance

Returns an allowed Token amount from owner address to to spender address.

Parameters

NameTypeDescription

contractAddress

String

Contract address of token.

address

String

Allower address

spender

String

Spender address

Return Value

NameTypeDescription

amount

BigDecimal

Allowed Token amount.

Example

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

Last updated