Skip to main content

ERC20 Token Support Example

Some Rosetta implementations require support for ERC20 tokens. You can use the Operation object to create token arrays. The example below shows what an ERC20 token support code looks like. You can use the Operation object format in both Data API and Construction API configurations.

Example

{
"operation_identifier":{
"index": 0
},
"type":"ERC20_TRANSFER",
"status":"SUCCESS",
"account":{
"address":"0x97158A00a4D227Ec7fe3234B52f21e5608FeE3d1"
},
"amount":{
"value":"-100",
"currency":{
"symbol":"USDC",
"decimals":6,
"metadata":{
"contractAddress":"0x1E77ad77925Ac0075CF61Fb76bA35D884985019d"
}
}
}
},
{
"operation_identifier":{
"index":1
},
"type":"ERC20_TRANSFER",
"status":"SUCCESS",
"account":{
"address":"0xd51E59077d0C90Ee0e8Bb360FEd0320e89d66C19"
},
"amount":{
"value":"100",
"currency":{
"symbol":"USDC",
"decimals":6,
"metadata":{
"contractAddress":"0x1E77ad77925Ac0075CF61Fb76bA35D884985019d"
}
}
}
}

For more information, including the object properties and descriptions, read the Operation documentation.

Was this helpful?