enum<string>
required
Enum options:
ACTIVITY_TYPE_CREATE_SWAP_QUOTEstring
required
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
string
required
Unique identifier for a given Organization.
object
required
The parameters object containing the specific intent data for this activity.
Show details
Show details
boolean
Enable to have your activity generate and return App Proofs, enabling verifiability.
object
required
The activity object containing type, intent, and result
Show activity details
Show activity details
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/create_swap_quote \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_CREATE_SWAP_QUOTE",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"signWith": "<string>",
"inputToken": "<string>",
"outputToken": "<string>",
"inputAmount": "<string>",
"slippageBps": "<string>"
}
}'
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().createSwapQuote({
signWith: "<string> (Wallet account or Private Key address used to price the executable provider quote. Private Key identifiers are not supported.)",
inputToken: "<string> (CAIP-19 asset ID for the input asset. The chain is derived from this value.)",
outputToken: "<string> (CAIP-19 asset ID for the output asset.)",
inputAmount: "<string> (Base-unit amount of the input asset.)",
slippageBps: "<string> (Provider-neutral maximum allowed slippage in basis points. Turnkey converts this value to each provider's request format. When omitted, each provider applies its default slippage behavior.)"
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_CREATE_SWAP_QUOTE",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"createSwapQuoteIntentV3": {
"signWith": "<string>",
"inputToken": "<string>",
"outputToken": "<string>",
"inputAmount": "<string>",
"slippageBps": "<string>",
"destinationAddress": "<string>",
"feeSponsorship": "<boolean>",
"fixedRate": "<boolean>"
}
},
"result": {
"createSwapQuoteResultV2": {
"quotes": [
{
"quoteId": "<string>",
"provider": "<string>",
"outputAmount": "<string>",
"minOutputAmount": "<string>",
"expiresAt": "<string>",
"slippageBps": "<string>",
"clientFeeBps": "<string>",
"estimatedTimeSeconds": "<string>",
"feeSponsorship": "<boolean>",
"fixedRate": "<boolean>",
"turnkeyFeeCollection": "<string>",
"sponsoredFeeComponents": [
"<string>"
],
"remainingFeeComponents": [
"<string>"
]
}
]
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}