v1

latestOpenAPI 3.0.32026-07-1320201.0 MB
Ethereum Transactions

Create ERC20 transaction

This method creates a new ERC20 transaction. <br>

post/api/v2/ethereum/transactions/erc20

Headers

X-Network'testnet' | 'mainnet'

Specify "testnet" for test network or leave empty for main network. Defaults to "mainnet" if not provided.

Authorizationstring required

Bearer token for authorization. Required for authenticated endpoints.

Content-Type'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' required

The MIME type of the request body.

Request body

fromstring required

The address to send the transaction from. Must match the regex /^(0x)?[0-9a-f]{40}$/i.

contractaddressstring required

The address of the ERC20 contract. Must match the regex /^(0x)?[0-9a-f]{40}$/i.

tostring required

The address to send the transaction to. Must match the regex /^(0x)?[0-9a-f]{40}$/i.

gasinteger

The gas limit for the transaction.

gaspricenumber

The gas price for the transaction.

maxPriorityFeePerGasnumber

The maximum priority fee per gas for the transaction.

maxFeePerGasnumber

The maximum fee per gas for the transaction.

passwordstring

The password to unlock the wallet if you working with a password protected wallet created with chaingateway. . This field is required when <code>privatekey</code> is not present.

privatekeystring

The private key to sign the transaction, only needed if working with non-secure chaingateway wallet.

noncestring

The nonce for the transaction.

amountnumber required

The amount of the ERC20 token to send.

Example request

{
  "from": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
  "contractaddress": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
  "to": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
  "gas": 21000,
  "gasprice": 1000000000,
  "maxPriorityFeePerGas": 1000000000,
  "maxFeePerGas": 1000000000,
  "password": "password123",
  "privatekey": "0x123456",
  "nonce": "0x123456",
  "amount": 100
}

Response

Succesfully created

statusinteger
okboolean
messagestring

Example response

{
  "status": 201,
  "ok": true,
  "message": "Succesfully created",
  "data": {
    "adderess": "0x7d3bC832A0860fD882FF4C2359e10268f4E5CCf8"
  }
}