Skip to main content
POST
/
instruction
/
new
cURL
curl --request POST \
  --url https://api.otim.com/instruction/new \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "address": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
  "chainId": 11155111,
  "salt": 1234567890,
  "maxExecutions": 10,
  "action": "0x838c90f3e8d4892dCfA67721CbbA7C86D3C059ef",
  "arguments": "0x0000000000000000000000001c7d4b196cb0c7b01d743fbc6116a902379c72380000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "activationSignature": {
    "yParity": 0,
    "r": "0x...",
    "s": "0x..."
  },
  "nickname": "My cool instruction"
}'
{
  "instructionId": "0x97fbe0031494c55eb0e1d182988e110af02f5db3adb95065733e7dc8447581f9"
}
After building your Instruction, you need to:
  1. sign 712 typed hash associated with your chosen Action (check out How to Construct Instruction Activation and Deactivation EIP-712 Hashes)
  2. submit the signature and your Instruction parameters from the build step when calling this endpoint
Below is an example workflow of how to retrieve all parameters needed for activating an end-to-end USDT Sweep Instruction + showing you the designated deposit address to send USDT to:

Authorizations

Authorization
string
header
required

JWT token for API authentication

Body

application/json
address
string<address>
required

Address of the user

Example:

"0xa0Ee7A142d267C1f36714E4a8F75612F20a79720"

chainId
integer
required

Chain ID

Example:

11155111

salt
integer
required

Salt to ensure instruction is unique

Example:

1234567890

maxExecutions
integer
required

Maximum number of times this instruction can be executed (0 for unlimited)

Example:

10

action
string<address>
required

Action contract address

Example:

"0x838c90f3e8d4892dCfA67721CbbA7C86D3C059ef"

arguments
string<bytes>
required

Arguments to execute on the action contract

Example:

"0x0000000000000000000000001c7d4b196cb0c7b01d743fbc6116a902379c72380000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

activationSignature
object
required

User signature over the activation hash

nickname
string

Nickname for the instruction

Example:

"My cool instruction"

Response

201 - application/json

Instruction created successfully

instructionId
string<bytes32>
required

Unique identifier for the created instruction

Example:

"0x97fbe0031494c55eb0e1d182988e110af02f5db3adb95065733e7dc8447581f9"