enum<string>
required
Enum options:
ACTIVITY_TYPE_CREATE_VELOCITY_CONTROLstring
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
object
required
dataSource field
Show details
Show details
object
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_velocity_control \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <string> (see Authorizations)" \
--data '{
"type": "ACTIVITY_TYPE_CREATE_VELOCITY_CONTROL",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"name": "<string>",
"dataSource": {
"chainAssetTransfer": {
"definition": [
{
"caip19": "<string>",
"decimals": "<string>"
}
],
"filter": {
"activity": [
{
"activityType": "<string>"
}
]
},
"phase": {
"signature": "<object>",
"submission": "<object>"
}
},
"activityExecution": {
"filter": {
"activity": [
{
"activityType": "<string>"
}
]
}
}
},
"aggregation": {
"method": "<VELOCITY_CONTROL_AGGREGATION_METHOD_SUM>",
"operator": "<VELOCITY_CONTROL_AGGREGATION_OPERATOR_LESS_THAN>",
"threshold": "<string>",
"window": {
"rolling": {
"duration": "<string>"
},
"infinite": "<object>"
},
"groupBy": {
"organization": "<object>",
"user": "<object>",
"wallet": "<object>"
}
},
"identifier": "<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().createVelocityControl({
name: "<string> (Human-readable name for the Velocity Control.)",
dataSource: { // dataSource field,
chainAssetTransfer: { // chainAssetTransfer field,
definition: [{ // Assets whose transfers are included in the data source.,
caip19: "<string> (CAIP-19 identifier for the asset.)",
decimals: "<string> (Base-10 integer string from 0 through 255 that specifies the number of decimal places for the asset.)",
}],
filter: { // filter field,
activity: ["<string>"] // Activity types whose asset transfers are included.,
},
phase: { // phase field,
signature: { /* object */ } // signature field,
submission: { /* object */ } // submission field,
},
},
activityExecution: { // activityExecution field,
filter: { // filter field,
activity: ["<string>"] // Activity types whose executions are included.,
},
},
},
aggregation: { // aggregation field,
method: "<VELOCITY_CONTROL_AGGREGATION_METHOD_SUM>" // method field,
operator: "<VELOCITY_CONTROL_AGGREGATION_OPERATOR_LESS_THAN>" // operator field,
threshold: "<string> (Non-negative base-10 decimal string with at most 38 total digits and 18 fractional digits.)",
window: { // window field,
rolling: { // rolling field,
duration: "<string> (Duration of the rolling window, in seconds, as a base-10 integer string.)",
},
infinite: { /* object */ } // infinite field,
},
groupBy: { // groupBy field,
organization: { /* object */ } // organization field,
user: { /* object */ } // user field,
wallet: { /* object */ } // wallet field,
},
},
identifier: "<string> (Identifier for the Velocity Control. Policies reference it as `controls.<identifier>`. It must be unique within the Organization.)"
});
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_CREATE_VELOCITY_CONTROL",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"id": "<string>",
"organizationId": "<string>",
"status": "<string>",
"type": "<string>",
"intent": {
"createVelocityControlIntent": {
"name": "<string>",
"dataSource": {
"chainAssetTransfer": {
"definition": [
{
"caip19": "<string>",
"decimals": "<string>"
}
],
"filter": {
"activity": [
{
"activityType": "<string>"
}
]
},
"phase": {
"signature": "<object>",
"submission": "<object>"
}
},
"activityExecution": {
"filter": {
"activity": [
{
"activityType": "<string>"
}
]
}
}
},
"aggregation": {
"method": "<VELOCITY_CONTROL_AGGREGATION_METHOD_SUM>",
"operator": "<VELOCITY_CONTROL_AGGREGATION_OPERATOR_LESS_THAN>",
"threshold": "<string>",
"window": {
"rolling": {
"duration": "<string>"
},
"infinite": "<object>"
},
"groupBy": {
"organization": "<object>",
"user": "<object>",
"wallet": "<object>"
}
},
"identifier": "<string>"
}
},
"result": {
"createVelocityControlResult": {
"velocityControlId": "<string>"
}
},
"votes": "<array>",
"fingerprint": "<string>",
"canApprove": "<boolean>",
"canReject": "<boolean>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}