/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
Remote procedural call URL.
Sample Request Sample Response
Copy https://api.expand.network/fungibletoken/gettokendetails?tokenAddress=0xEB1112Ac78D537853150E2a07E8b765E29d3F019
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
Public address of the owner.
Public address of the spender.
Remote procedural call URL.
Sample Request Sample Response
Copy https://api.expand.network/fungibletoken/getuserallowance?owner=0x6Fb447Ae94F5180254D436A693907a1f57696900&tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&spender=0xBA12222222228d8Ba445958a75a0704d566BF2C8
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
Public Address of the user
Sample Request Sample Response
Copy https://api.expand.network/fungibletoken/getuserbalance?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&address=0x63056E00436Da25BcF48A40dfBbDcc7089351006&chainId=1
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
Public Address of the user
Starting block of the range.
by default latestBlock -100
Last block of the range.
by default its latestBlock
page to get response on,
by default its 1
asc/desc sorting method,
by default its desc
address of the erc20 token
Sample Request Sample Response
Copy https://api.expand.network/fungibletoken/historical/transactions?tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f
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
Public Address of the user
Starting block of the range.
by default latestBlock -100
Last block of the range.
by default its latestBlock
page to get response on,
by default its 1
asc/desc sorting method,
by default its desc
Sample Request Sample Response
Copy https://api.expand.network/fungibletoken/historical/weth
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
Starting block of the range.
by default its (latestBlock -100)
Last block of the range.
by default its latestBlock
address of the erc20 token
Sample Request Sample Response
Copy https://api.expand.network/fungibletoken/historical/logs?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&type=Approval
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
Remote procedural call URL.
Address of the sender of the token.
Address to get approval of.
Maximum gas limit provided by the sender, for the transaction.
Sample Request Sample Response
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1000000000000000000000" ,
"to" : "0x828b154032950c8ff7cf8085d841723db2696056" ,
"gas" : "100000" ,
"chainId" : "1"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "100000" ,
"data" : "0x095ea7b3000000000000000000000000828b154032950c8ff7cf8085d841723db269605600000000000000000000000000000000000000000000003635c9adc5dea00000" ,
"referenceId" : "ab50faa439b64b66beae1a894e1f0a0a"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1000000000000000000000" ,
"to" : "0x828b154032950c8ff7cf8085d841723db2696056" ,
"gas" : "100000" ,
"gasPriority" : "medium" ,
"chainId" : "1"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "100000" ,
"data" : "0x095ea7b3000000000000000000000000828b154032950c8ff7cf8085d841723db269605600000000000000000000000000000000000000000000003635c9adc5dea00000" ,
"gasPrice" : "4041564215" ,
"referenceId" : "bdf577b2ea2141ad96822cc9be56563e"
}
}
/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
Remote procedural call URL.
Address of the sender of the token.
Address of the recipient of the token.
Maximum gas limit provided by the sender, for the transaction.
Sample Request Sample Response
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1" ,
"to" : "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38" ,
"gas" : "2307200"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data" : "0xa9059cbb0000000000000000000000003e1ca9fe2fc3021408d0e869bd3afb167f889f380000000000000000000000000000000000000000000000000000000000000001" ,
"referenceId" : "03b43cb740914e9d91e4be1de40d3795"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "1000000000000" ,
"to" : "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38" ,
"gas" : "2307200" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data" : "0xa9059cbb0000000000000000000000003e1ca9fe2fc3021408d0e869bd3afb167f889f38000000000000000000000000000000000000000000000000000000e8d4a51000" ,
"gasPrice" : "4117306380" ,
"referenceId" : "666d67bc71184619b73157ad4571817f"
}
}
/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
Remote procedural call URL.
Address of the sender of the token.
Address, on whose behalf, tokens are spent.
Maximum gas limit provided by the sender, for the transaction.
Sample Request Sample Response
Copy {
"from" : "0x6Fb447Ae94F5180254D436A693907a1f57696900" ,
"tokenAddress" : "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656" ,
"amount" : "10000000000000" ,
"reciever" : "0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7" ,
"to" : "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994" ,
"gas" : "390000"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x6Fb447Ae94F5180254D436A693907a1f57696900" ,
"to" : "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656" ,
"value" : "0" ,
"gas" : "390000" ,
"data" : "0x23b872dd000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000056d2208efd27fe9c67e3879debce35833b9d4cc7000000000000000000000000000000000000000000000000000009184e72a000" ,
"referenceId" : "ad4b0020353440d9bebc194695e204e1"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"from" : "0x6Fb447Ae94F5180254D436A693907a1f57696900" ,
"tokenAddress" : "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656" ,
"amount" : "10000000000000" ,
"reciever" : "0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7" ,
"to" : "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994" ,
"gas" : "390000" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x6Fb447Ae94F5180254D436A693907a1f57696900" ,
"to" : "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656" ,
"value" : "0" ,
"gas" : "390000" ,
"data" : "0x23b872dd000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000056d2208efd27fe9c67e3879debce35833b9d4cc7000000000000000000000000000000000000000000000000000009184e72a000" ,
"gasPrice" : "4119327710" ,
"referenceId" : "36215433fb864b738d885304f0956858"
}
}
/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
Remote procedural call URL.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
Sample Request Sample Response
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"gas" : "2307200" ,
"chainId" : "1" ,
"amount" : "10"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0xa" ,
"gas" : "2307200" ,
"data" : "0xd0e30db0" ,
"referenceId" : "2418a38f53a047a6abb50dd26aa34621"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"gas" : "2307200" ,
"gasPriority" : "medium" ,
"chainId" : "1" ,
"amount" : "10"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0xa" ,
"gas" : "2307200" ,
"data" : "0xd0e30db0" ,
"gasPrice" : "4126473966" ,
"referenceId" : "4792b75c3a64401596f7366a0ce5b69a"
}
}
/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
Remote procedural call URL.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
Sample Request Sample Response
Copy {
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "5" ,
"gas" : "2307200" ,
"chainId" : "1"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data" : "0x2e1a7d4d0000000000000000000000000000000000000000000000000000000000000005" ,
"referenceId" : "e911c9db36b54dfe889f10875af33fd4"
}
}
Sample Request Sample Response
With gasPriority(medium):
Copy {
"from" : "0xE4c0ddb2695415466be83f2A99b44b043CB55590" ,
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "100000000000" ,
"gas" : "2307200" ,
"gasPriority" : "medium" ,
"chainId" : "1"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xE4c0ddb2695415466be83f2A99b44b043CB55590" ,
"to" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"value" : "0" ,
"gas" : "2307200" ,
"data" : "0x2e1a7d4d000000000000000000000000000000000000000000000000000000174876e800" ,
"gasPrice" : "4075756054" ,
"referenceId" : "396438be736f4b13834f3fc095919e70"
}
}