Skip to main content
POST
/
instruction
/
build
cURL
curl --request POST \
  --url https://api.otim.com/instruction/build \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "address": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
  "chainId": 11155111,
  "salt": 1234567890,
  "maxExecutions": 10,
  "actionArguments": {
    "refuelERC20": {
      "token": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
      "target": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
      "threshold": 1000000000000000000,
      "endBalance": 2000000000000000000,
      "fee": {
        "token": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
        "maxBaseFeePerGas": 0,
        "maxPriorityFeePerGas": 15000000000,
        "executionFee": 0
      }
    }
  }
}'
{
  "salt": 1234567890,
  "maxExecutions": 10,
  "action": "0x838c90f3e8d4892dCfA67721CbbA7C86D3C059ef",
  "arguments": "0x0000000000000000000000001c7d4b196cb0c7b01d743fbc6116a902379c72380000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
Building an Otim Instruction is quite simple if you just want to fill in the blanks and form your payload. But, if you want a walkthrough that includes both the build and new endpoints together to activate an Instruction, head over to Activate an instruction.

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

actionArguments
object
required
  • RefuelERC20
  • Refuel
  • TransferERC20
  • Transfer
  • SweepDepositAccount
  • SweepDepositAccountERC20
  • UniswapV3ExactInput

Response

200 - application/json

Instruction built successfully

salt
integer

Salt to ensure instruction is unique

Example:

1234567890

maxExecutions
integer

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

Example:

10

action
string<address>

Action contract address

Example:

"0x838c90f3e8d4892dCfA67721CbbA7C86D3C059ef"

arguments
string<bytes>

Arguments to execute on the action contract

Example:

"0x0000000000000000000000001c7d4b196cb0c7b01d743fbc6116a902379c72380000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000a0Ee7A142d267C1f36714E4a8F75612F20a79720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"