ERC20

/gettokendetails

Get the name, symbol and decimals of provided token address. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Base, and zkSync.

GET https://api.expand.network/fungibletoken/gettokendetails

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

tokenAddress*

String

Address of token.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

https://api.expand.network/fungibletoken/gettokendetails?tokenAddress=0xEB1112Ac78D537853150E2a07E8b765E29d3F019

/getuserallowance

Get the amount that the spender is allowed to withdraw on behalf of the owner. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Base, and zkSync.

GET https://api.expand.network/fungibletoken/getuserallowance

Query Parameters

NameTypeDescription

tokenAddress*

String

Address of the token.

owner*

String

Public address of the owner.

spender*

String

Public address of the spender.

rpc

String

Remote procedural call URL.

chainId

String

Refer to the Chain ID page for more details.

chainSymbol

String

Refer to the Chain ID page for more details.

https://api.expand.network/fungibletoken/getuserallowance?owner=0x6Fb447Ae94F5180254D436A693907a1f57696900&tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&spender=0xBA12222222228d8Ba445958a75a0704d566BF2C8

/getuserbalance

Get the balance of the given token. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Base, and zkSync.

GET https://api.expand.network/fungibletoken/getuserbalance

Query Parameters

NameTypeDescription

chainId*

String

Refer to the Chain ID page for details.

tokenAddress*

String

Address of the token.

address*

String

Public Address of the user

chainSymbol

String

Refer to the Chain ID page for details.

https://api.expand.network/fungibletoken/getuserbalance?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&address=0x63056E00436Da25BcF48A40dfBbDcc7089351006&chainId=1

/historical/transactions

Retrieves all the transfers for the given address in the given range.

GET https://api.expand.network/fungibletoken/historical/transactions

Query Parameters

NameTypeDescription

chainId

String

Refer to the Chain ID page for details.

address

String

Public Address of the user

chainSymbol

String

Refer to the Chain ID page for details.

startBlock

String

Starting block of the range.

by default latestBlock -100

endBlock

String

Last block of the range.

by default its latestBlock

page

String

page to get response on,

by default its 1

sort

String

asc/desc sorting method,

by default its desc

tokenAddress*

String

address of the erc20 token

https://api.expand.network/fungibletoken/historical/transactions?tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f

/historical/weth

Retrieves all the WETH transfers for the given address in the given range.

GET https://api.expand.network/fungibletoken/historical/weth

Query Parameters

NameTypeDescription

chainId

String

Refer to the Chain ID page for details.

address

String

Public Address of the user

chainSymbol

String

Refer to the Chain ID page for details.

startBlock

String

Starting block of the range.

by default latestBlock -100

endBlock

String

Last block of the range.

by default its latestBlock

page

String

page to get response on,

by default its 1

sort

String

asc/desc sorting method,

by default its desc

https://api.expand.network/fungibletoken/historical/weth

/historical/logs

Retrieves all the logs for the given address in the given range.

GET https://api.expand.network/fungibletoken/historical/logs

Query Parameters

NameTypeDescription

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

startBlock

String

Starting block of the range.

by default its (latestBlock -100)

endBlock

String

Last block of the range.

by default its latestBlock

tokenAddress*

String

address of the erc20 token

type*

String

Approval/Transfer logs

https://api.expand.network/fungibletoken/historical/logs?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&type=Approval

/approve

Sets amount as the allowance of spender over the user’s tokens. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Base, and zkSync.

POST https://api.expand.network/fungibletoken/approve

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

from*

String

Address of the sender of the token.

tokenAddress*

String

Address of token.

amount*

String

Number of tokens.

to*

String

Address to get approval of.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

gasPriority

String

low, medium, or high.

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006", 
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",  
    "amount": "1000000000000000000000",                  
    "to": "0x828b154032950c8ff7cf8085d841723db2696056", 
    "gas": "100000",
    "chainId": "1"
}

With gasPriority:

{
    "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a", 
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",  
    "amount": "1000000000000000000000",
    "to": "0x828b154032950c8ff7cf8085d841723db2696056", 
    "gas": "100000",
    "gasPriority":"medium",
    "chainId": "1"
}

/transfer

Moves amount tokens from the user’s account to the recipient. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Base, and zkSync.

POST https://api.expand.network/fungibletoken/transfer

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

from*

String

Address of the sender of the token.

tokenAddress*

String

Address of token.

amount*

String

Number of tokens.

to*

String

Address of the recipient of the token.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

gasPriority

String

low, medium, or high.

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "1", 
    "to": "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38",
    "gas": "2307200"
}

With gasPriority:

{
    "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
    "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "1000000000000", 
    "to": "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38",
    "gas": "2307200",
    "gasPriority":"medium"
}

/transferfrom

Transfers tokens from sender to recipient using the allowance mechanism. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Starknet, Base, and zkSync.

POST https://api.expand.network/fungibletoken/transferfrom

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

from*

String

Address of the sender of the token.

tokenAddress*

String

Address of token.

amount*

String

Number of tokens.

to*

String

Address, on whose behalf, tokens are spent.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

reciever*

String

Receiver of the tokens.

gasPriority

String

low, medium, or high.

{
       "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
       "tokenAddress": "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656",
       "amount": "10000000000000",
       "reciever":"0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7",
       "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
       "gas": "390000"
}

With gasPriority:

{
       "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
       "tokenAddress": "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656",
       "amount": "10000000000000",
       "reciever":"0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7",
       "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
       "gas": "390000"
}

/convertbasetokentowraptoken

Converts base token to wrap token. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Starknet, Base, and zkSync.

POST https://api.expand.network/fungibletoken/convertbasetokentowraptoken

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

from*

String

Address of the sender of the token.

tokenAddress*

String

Address of token.

amount*

String

Number of tokens.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

gasPriority

String

low, medium, or high.

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 
    "gas": "2307200",
    "chainId": "1",
    "amount":"10"
}

With gasPriority:

{
    "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 
    "gas": "2307200",
    "gasPriority":"medium",
    "chainId": "1",
    "amount":"10"
}

/convertwraptokentobasetoken

Converts wrap token to base token. Currently available on Ethereum, Binance Smart Chain, Avalanche, Polygon, Cronos, Arbitrum, Fantom, Optimism, Starknet, Base, and zkSync.

POST https://api.expand.network/fungibletoken/convertwraptokentobasetoken

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

from*

String

Address of the sender of the token.

tokenAddress*

String

Address of token.

amount*

String

Number of tokens.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

gasPriority

String

low, medium, or high.

{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "5", 
    "gas": "2307200",
    "chainId": "1"
}

With gasPriority(medium):

{
    "from": "0xE4c0ddb2695415466be83f2A99b44b043CB55590",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "100000000000",
    "gas": "2307200",
    "gasPriority":"medium",
    "chainId": "1"
}

Last updated