/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
Sample Request
Copy https://api.expand.network/fungibletoken/gettokendetails?tokenAddress=0xEB1112Ac78D537853150E2a07E8b765E29d3F019
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"symbol" : "HASH" ,
"name" : "HASH" ,
"decimal" : "18"
}
}
/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
Sample Request
Copy https://api.expand.network/fungibletoken/getuserallowance?owner=0x6Fb447Ae94F5180254D436A693907a1f57696900&tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&spender=0xBA12222222228d8Ba445958a75a0704d566BF2C8
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"allowance" : "999000000000000000000"
}
}
/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
Sample Request
Copy https://api.expand.network/fungibletoken/getuserbalance?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&address=0x63056E00436Da25BcF48A40dfBbDcc7089351006&chainId=1
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"balance" : "90344000000000000000"
}
}
/historical/transactions
Retrieves all the transfers for the given address in the given range.
GET
https://api.expand.network/fungibletoken/historical/transactions
Query Parameters
Sample Request
Copy https://api.expand.network/fungibletoken/historical/transactions?tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"transactions" : [
{
"blockNumber" : "18968825" ,
"timeStamp" : "1704796271" ,
"hash" : "0x6df96285db80a5c1792a056bf9f38c63e9f250572c2f5afac945bcf996a145e5" ,
"nonce" : "21" ,
"blockHash" : "0xe8cf4dda5e648b707ff2837741708176122cb2196559c20c8618debf8c991997" ,
"from" : "0x3f2488a54c8b397525ff85ce5d32ac5f27dd8ce5" ,
"contractAddress" : "0x6b175474e89094c44da98b954eedeac495271d0f" ,
"to" : "0x1715a3e4a142d8b698131108995174f37aeba10d" ,
"value" : "193485657300000000000" ,
"tokenName" : "Dai Stablecoin" ,
"tokenSymbol" : "DAI" ,
"tokenDecimal" : "18" ,
"transactionIndex" : "114" ,
"gas" : "216896" ,
"gasPrice" : "12898560151" ,
"gasUsed" : "189283" ,
"cumulativeGasUsed" : "10458631" ,
"input" : "deprecated" ,
"confirmations" : "67" ,
"methodId" : "0xad58bdd1" ,
"methodSignature" : "relayTokens(address,address,uint256)"
} ,
]
}
}
/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
Sample Request
Copy https://api.expand.network/fungibletoken/historical/weth
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"transactions" : [
{
"blockNumber" : "17320271" ,
"timeStamp" : "1684824623" ,
"hash" : "0x051aac77f464921c72bb628fea7e1f57663b28e0286d20c69e830498307f15d5" ,
"nonce" : "367" ,
"blockHash" : "0x3dc921095193718262dcf3f07b52f1921351bef675a8617dd6f1badde6093f19" ,
"from" : "0x55d5c232d921b9eaa6b37b5845e439acd04b4dba" ,
"contractAddress" : "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" ,
"to" : "0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b" ,
"value" : "449713740022466855" ,
"tokenName" : "Wrapped Ether" ,
"tokenSymbol" : "WETH" ,
"tokenDecimal" : "18" ,
"transactionIndex" : "112" ,
"gas" : "212952" ,
"gasPrice" : "37761736473" ,
"gasUsed" : "149768" ,
"cumulativeGasUsed" : "10771742" ,
"input" : "deprecated" ,
"confirmations" : "1"
}
]
}
}
/historical/logs
Retrieves all the logs for the given address in the given range.
GET
https://api.expand.network/fungibletoken/historical/logs
Query Parameters
Sample Request
Copy https://api.expand.network/fungibletoken/historical/logs?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&type=Approval
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"logs" : [
{
"address" : "0x6b175474e89094c44da98b954eedeac495271d0f" ,
"topics" : [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" ,
"0x000000000000000000000000975f7b8e68e99c04807e94f72d63e98ec21f5ad5" ,
"0x0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d"
] ,
"params" : {
"src" : "0x975f7b8e68e99c04807e94f72d63e98ec21f5ad5" ,
"guy" : "0x1715a3e4a142d8b698131108995174f37aeba10d" ,
"wad" : "127000000000000000000"
} ,
"data" : "0x000000000000000000000000000000000000000000000006e27aa3200a9c0000" ,
"blockNumber" : "17320089" ,
"blockHash" : "0x39b65a913a44fefa4f1432dc00927839cf8ba6bcbc778afb3effaf5c91a2a5d1" ,
"timeStamp" : "1684822391" ,
"gasPrice" : "37991235385" ,
"gasUsed" : "46158" ,
"logIndex" : "302" ,
"transactionHash" : "0x8b9159d1fc58b9dd33a0f8ebcb6980bca0416c3836bb08771c2cac5737dbadba" ,
"transactionIndex" : "109"
}
]
}
}
/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
Sample Request
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1000000000000000000000" ,
"to" : "0x828b154032950c8ff7cf8085d841723db2696056" ,
"gas" : "100000" ,
"chainId" : "1"
}
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "100000" ,
"data": "0x095ea7b3000000000000000000000000828b154032950c8ff7cf8085d841723db269605600000000000000000000000000000000000000000000003635c9adc5dea00000"
}
}
Sample Request
With gasPriority:
Copy {
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1000000000000000000000" ,
"to" : "0x828b154032950c8ff7cf8085d841723db2696056" ,
"gas" : "100000" ,
"gasPriority" : "medium" ,
"chainId" : "1"
}
Sample Response
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "55277" ,
"data": "0x095ea7b3000000000000000000000000828b154032950c8ff7cf8085d841723db269605600000000000000000000000000000000000000000000003635c9adc5dea00000"
}
}
/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
Sample Request
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1" ,
"to" : "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38" ,
"gas" : "2307200"
}
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data": "0xa9059cbb0000000000000000000000003e1ca9fe2fc3021408d0e869bd3afb167f889f380000000000000000000000000000000000000000000000000000000000000001"
}
}
Sample Request
With gasPriority:
Copy {
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1000000000000" ,
"to" : "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38" ,
"gas" : "2307200" ,
"gasPriority" : "medium"
}
Sample Response
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "61884" ,
"data": "0xa9059cbb0000000000000000000000003e1ca9fe2fc3021408d0e869bd3afb167f889f38000000000000000000000000000000000000000000000000000000e8d4a51000"
}
}
/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
Sample Request
Copy {
"from" : "0x6Fb447Ae94F5180254D436A693907a1f57696900" ,
"tokenAddress" : "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656" ,
"amount" : "10000000000000" ,
"reciever" : "0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7" ,
"to" : "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994" ,
"gas" : "390000"
}
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data": "0x23b872dd00000000000000000000000063056e00436da25bcf48a40dfbbdcc708935100600000000000000000000000094a5e554dc172a472421291ae6e6c0e3c150286f0000000000000000000000000000000000000000000000000000000000000046"
}
}
Sample Request
With gasPriority:
Copy {
"from" : "0x6Fb447Ae94F5180254D436A693907a1f57696900" ,
"tokenAddress" : "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656" ,
"amount" : "10000000000000" ,
"reciever" : "0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7" ,
"to" : "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994" ,
"gas" : "390000"
}
Sample Response
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "62126" ,
"data": "0x23b872dd000000000000000000000000debb1a42a27051fd18d6d6c2055a44d330a4d80a00000000000000000000000094a5e554dc172a472421291ae6e6c0e3c150286f0000000000000000000000000000000000000000000000000000000000000046"
}
}
/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
Sample Request
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"gas" : "2307200" ,
"chainId" : "1" ,
"amount" : "10"
}
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0xa" ,
"gas" : "2307200" ,
"data" : "0xd0e30db0"
}
}
Sample Request
With gasPriority:
Copy {
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"gas" : "2307200" ,
"gasPriority" : "medium" ,
"chainId" : "1" ,
"amount" : "10"
}
Sample Response
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0xa" ,
"gas" : "31058" ,
"data" : "0xd0e30db0"
}
}
/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
Sample Request
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "5" ,
"gas" : "2307200" ,
"chainId" : "1"
}
Sample Response
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data" : "0x2e1a7d4d0000000000000000000000000000000000000000000000000000000000000005"
}
}
Sample Request
With gasPriority(medium):
Copy {
"from" : "0xE4c0ddb2695415466be83f2A99b44b043CB55590" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "100000000000" ,
"gas" : "2307200" ,
"gasPriority" : "medium" ,
"chainId" : "1"
}
Sample Response
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xE4c0ddb2695415466be83f2A99b44b043CB55590" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "43189" ,
"data" : "0x2e1a7d4d000000000000000000000000000000000000000000000000000000174876e800"
}
}