curl --request POST \
--url https://api.turnkey.com/public/v1/submit/earn_deposit \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_EARN_DEPOSIT",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"wrapperAddress": "<string>",
"signWith": "<string>",
"assets": "<string>",
"caip2": "<eip155:1>",
"sponsor": "<boolean>"
}
}'
import { Turnkey } from "@turnkey/sdk-server";
const turnkeyClient = new Turnkey({
apiBaseUrl: "https://api.turnkey.com",
apiPublicKey: process.env.API_PUBLIC_KEY!,
apiPrivateKey: process.env.API_PRIVATE_KEY!,
defaultOrganizationId: process.env.ORGANIZATION_ID!,
});
const response = await turnkeyClient.apiClient().earnDeposit({
wrapperAddress: "<string> (Address of the deployed Earn wrapper to deposit into, from ListEarnVaults/ListEarnPositions. Must be one of the org's deployed wrappers.)",
signWith: "<string> (A Wallet account address or Private Key address to deposit from and sign with. Must be an on-chain address; Private Key identifiers are not supported.)",
assets: "<string> (Amount of the underlying asset to deposit, in raw on-chain units (e.g., '1000000' for 1 USDC at 6 decimals).)",
caip2: "<eip155:1>" // CAIP-2 chain ID the vault lives on (e.g., 'eip155:8453' for Base).,
sponsor: true // Whether to sponsor this transaction via Gas Station.
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_EARN_DEPOSIT",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"earnDepositIntent": {
"wrapperAddress": "<string>",
"signWith": "<string>",
"assets": "<string>",
"caip2": "<eip155:1>",
"sponsor": "<boolean>"
}
},
"result": {
"earnDepositResult": {
"depositRequestId": "<string>"
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}
Activities
Deposit into Earn vault
Deposit assets from a wallet into an enabled yield vault.
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/earn_deposit \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_EARN_DEPOSIT",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"wrapperAddress": "<string>",
"signWith": "<string>",
"assets": "<string>",
"caip2": "<eip155:1>",
"sponsor": "<boolean>"
}
}'
import { Turnkey } from "@turnkey/sdk-server";
const turnkeyClient = new Turnkey({
apiBaseUrl: "https://api.turnkey.com",
apiPublicKey: process.env.API_PUBLIC_KEY!,
apiPrivateKey: process.env.API_PRIVATE_KEY!,
defaultOrganizationId: process.env.ORGANIZATION_ID!,
});
const response = await turnkeyClient.apiClient().earnDeposit({
wrapperAddress: "<string> (Address of the deployed Earn wrapper to deposit into, from ListEarnVaults/ListEarnPositions. Must be one of the org's deployed wrappers.)",
signWith: "<string> (A Wallet account address or Private Key address to deposit from and sign with. Must be an on-chain address; Private Key identifiers are not supported.)",
assets: "<string> (Amount of the underlying asset to deposit, in raw on-chain units (e.g., '1000000' for 1 USDC at 6 decimals).)",
caip2: "<eip155:1>" // CAIP-2 chain ID the vault lives on (e.g., 'eip155:8453' for Base).,
sponsor: true // Whether to sponsor this transaction via Gas Station.
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_EARN_DEPOSIT",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"earnDepositIntent": {
"wrapperAddress": "<string>",
"signWith": "<string>",
"assets": "<string>",
"caip2": "<eip155:1>",
"sponsor": "<boolean>"
}
},
"result": {
"earnDepositResult": {
"depositRequestId": "<string>"
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}
A successful response returns the following fields:
Was this page helpful?