Token
Transfer ETH or ERC20 Tokens
Token
Transfer ETH or ERC20 Tokens
Sends native ETH or ERC20 tokens from the sender’s address to another address.
POST
/
v0
/
token
/
transfer
from compassapisdk import CompassAPISDK, models
with CompassAPISDK(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api_sdk:
res = compass_api_sdk.token.transfer(amount=1.5, token=models.TokenEnum.WETH, to="0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc44", chain=models.Chain.BASE_MAINNET, sender="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B")
# Handle response
print(res)
{
"chainId": 123,
"data": "<string>",
"from": "<string>",
"gas": 123,
"to": "<string>",
"value": 123,
"nonce": 123,
"maxFeePerGas": 123,
"maxPriorityFeePerGas": 123
}
Body
application/json
Request model for transferring ETH or ERC20 tokens.
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
from compassapisdk import CompassAPISDK, models
with CompassAPISDK(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api_sdk:
res = compass_api_sdk.token.transfer(amount=1.5, token=models.TokenEnum.WETH, to="0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc44", chain=models.Chain.BASE_MAINNET, sender="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B")
# Handle response
print(res)
{
"chainId": 123,
"data": "<string>",
"from": "<string>",
"gas": 123,
"to": "<string>",
"value": 123,
"nonce": 123,
"maxFeePerGas": 123,
"maxPriorityFeePerGas": 123
}