ERC20 API
API for ERC20 Contracts. Every ABI item below is callable as its own Spectrum JSON-RPC method. See the Marketplace overview for how the method names are built.
Tokens
Method names here carry no chain, so every call must pass chain and the contract address that implements this ABI.
Methods
Functions
Readnamespectrum_erc20_erc20api_call_name
Fetches the name for the token
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_call_name",
"params": {
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_call_name',
{
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_call_name",
"abiName": "name",
"deploymentName": "erc20api",
"operation": "call",
"abiType": "function",
"outputs": [
""
]
}
}Outputs
| Name | Type |
|---|---|
output_0 | string |
ReadtotalSupplyspectrum_erc20_erc20api_call_totalSupply
Fetches the total supply for the token
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_call_totalSupply",
"params": {
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_call_totalSupply',
{
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_call_totalSupply",
"abiName": "totalSupply",
"deploymentName": "erc20api",
"operation": "call",
"abiType": "function",
"outputs": [
"0"
]
}
}Outputs
| Name | Type |
|---|---|
output_0 | uint256 |
Readsymbolspectrum_erc20_erc20api_call_symbol
Fetches the symbol for the token
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_call_symbol",
"params": {
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_call_symbol',
{
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_call_symbol",
"abiName": "symbol",
"deploymentName": "erc20api",
"operation": "call",
"abiType": "function",
"outputs": [
""
]
}
}Outputs
| Name | Type |
|---|---|
output_0 | string |
Readallowancespectrum_erc20_erc20api_call_allowance
Fetches the allowance of an address for a spender
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_call_allowance",
"params": {
"args": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000001"
],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_call_allowance',
{
"args": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000001"
],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_call_allowance",
"abiName": "allowance",
"deploymentName": "erc20api",
"operation": "call",
"abiType": "function",
"outputs": [
"0"
]
}
}Inputs
| Name | Type |
|---|---|
owner | address |
spender | address |
Outputs
| Name | Type |
|---|---|
output_0 | uint256 |
ReadbalanceOfspectrum_erc20_erc20api_call_balanceOf
Fetches the balance of an address for the token
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_call_balanceOf",
"params": {
"args": [
"0x0000000000000000000000000000000000000001"
],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_call_balanceOf',
{
"args": [
"0x0000000000000000000000000000000000000001"
],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_call_balanceOf",
"abiName": "balanceOf",
"deploymentName": "erc20api",
"operation": "call",
"abiType": "function",
"outputs": [
"0"
]
}
}Inputs
| Name | Type |
|---|---|
account | address |
Outputs
| Name | Type |
|---|---|
output_0 | uint256 |
Readdecimalsspectrum_erc20_erc20api_call_decimals
Fetches the decimals for the token
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_call_decimals",
"params": {
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_call_decimals',
{
"args": [],
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_call_decimals",
"abiName": "decimals",
"deploymentName": "erc20api",
"operation": "call",
"abiType": "function",
"outputs": [
"0"
]
}
}Outputs
| Name | Type |
|---|---|
output_0 | uint8 |
Events
EventTransferspectrum_erc20_erc20api_getLogs_Transfer
Event emitted when a transfer is made
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_getLogs_Transfer",
"params": {
"args": [
null,
null,
null
],
"fromBlock": "latest",
"toBlock": "latest",
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_getLogs_Transfer',
{
"args": [
null,
null,
null
],
"fromBlock": "latest",
"toBlock": "latest",
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_getLogs_Transfer",
"abiName": "Transfer",
"deploymentName": "erc20api",
"operation": "getLogs",
"abiType": "event",
"count": 1,
"limit": 100,
"hasMore": false,
"cursor": null,
"logs": [
{
"address": "0x0000000000000000000000000000000000000001",
"blockNumber": 24510927,
"transactionHash": "0x867cbb7b...",
"logIndex": 1,
"args": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000001",
"0"
]
}
]
}
}Event arguments
| Name | Type | Indexed |
|---|---|---|
from | address | yes |
to | address | yes |
value | uint256 | no |
EventApprovalspectrum_erc20_erc20api_getLogs_Approval
Event emitted when an approval is made
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "spectrum_erc20_erc20api_getLogs_Approval",
"params": {
"args": [
null,
null,
null
],
"fromBlock": "latest",
"toBlock": "latest",
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
"id": 1
}'spectrum.marketplace.call(
'spectrum_erc20_erc20api_getLogs_Approval',
{
"args": [
null,
null,
null
],
"fromBlock": "latest",
"toBlock": "latest",
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001"
},
){
"data": {
"chain": "ethereum",
"address": "0x0000000000000000000000000000000000000001",
"method": "spectrum_erc20_erc20api_getLogs_Approval",
"abiName": "Approval",
"deploymentName": "erc20api",
"operation": "getLogs",
"abiType": "event",
"count": 1,
"limit": 100,
"hasMore": false,
"cursor": null,
"logs": [
{
"address": "0x0000000000000000000000000000000000000001",
"blockNumber": 24510927,
"transactionHash": "0x867cbb7b...",
"logIndex": 1,
"args": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000001",
"0"
]
}
]
}
}Event arguments
| Name | Type | Indexed |
|---|---|---|
owner | address | yes |
spender | address | yes |
value | uint256 | no |
