Typescript
import { CompassApiSDK } from "@compass-labs/api-sdk"; const compassApiSDK = new CompassApiSDK({ apiKeyAuth: "<YOUR_API_KEY_HERE>", }); async function run() { const result = await compassApiSDK.token.tokenTransfer({ to: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc44", token: "<value>", amount: 1.5, chain: "ethereum", sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B", }); console.log(result); } run();
{ "transaction": { "chainId": 123, "data": "<string>", "from": "<string>", "gas": 123, "to": "<string>", "value": 123, "nonce": 123, "maxFeePerGas": 123, "maxPriorityFeePerGas": 123 } }
Sends native ETH or ERC20 tokens from the sender’s address to another address.
Your Compass API Key. Get your key here.
Request model for transferring ETH or ERC20 tokens.
Successful Response
The response is of type object.
object
Was this page helpful?