Skip to main content
POST
/
order
Register agent wallet
curl -X POST https://exchange-api.bulk.trade/api/v1/order \
  -H "Content-Type: application/json" \
  -d '{"actions":[{"agentWalletCreation":{"a":"5Am6JkEHAjYG1itNWRMGpQrxvY8AaqkXCo1TZvenqVux","d":false}}],"nonce":1704067200000,"account":"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7","signer":"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7","signature":"5JXWgp1fW6px2Gjhw6YHhQ4..."}'
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "agentWallet": {
            "agent_wallet": "5Am6JkEHAjYG1itNWRMGpQrxvY8AaqkXCo1TZvenqVux"
          }
        }
      ]
    }
  }
}
Agent wallet management uses the unified POST /order endpoint. Send a transaction with an agentWalletCreation action in the actions array.
If signer != account, the signer must be pre-authorized. Agent wallets allow the agent to trade on behalf of the account; register the agent with this action before the agent submits orders.

Transaction Envelope

Every request to POST /order has this shape:
{
  "actions": [Action, ...],
  "nonce": 1704067200000,
  "account": "base58_pubkey",
  "signer": "base58_pubkey",
  "signature": "base58_signature"
}
For agent wallet, the action is a single agentWalletCreation object.

Agent Wallet Action

FieldTypeDescription
astringAgent public key to authorize (base58).
dbooleanfalse = add/register agent, true = remove agent.

Request Examples

Register an agent

{
  "actions": [
    {"agentWalletCreation": {"a": "5Am6JkEHAjYG1itNWRMGpQrxvY8AaqkXCo1TZvenqVux", "d": false}}
  ],
  "nonce": 1704067200000,
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5JXWgp1fW6px2Gjhw6YHhQ4..."
}

Remove an agent

{"agentWalletCreation": {"a": "5Am6JkEHAjYG1itNWRMGpQrxvY8AaqkXCo1TZvenqVux", "d": true}}

Response

Same OrderResponse format as other actions. Success may return agentWallet status:
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [{"agentWallet": {"agent_wallet": "5Am6JkEHAjYG1itNWRMGpQrxvY8AaqkXCo1TZvenqVux"}}]
    }
  }
}
Failure returns agentWalletFailed:
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [{"agentWalletFailed": {"message": "Unauthorized"}}]
    }
  }
}

Before You Start

See the Transaction Signing guide for how to sign your requests.Nonce: Use a unique value (e.g. timestamp in nanoseconds): BigInt(Date.now()) * 1_000_000n

Body

application/json

Transaction with a single agentWalletCreation action

actions
Agent wallet (agentWalletCreation) · object[]
required

Must contain exactly one agentWalletCreation action

nonce
integer<int64>
required

Unique nonce (e.g. nanoseconds)

account
string
required

Account public key (base58)

signer
string
required

Signer public key (base58)

signature
string
required

Ed25519 signature (base58)

Response

200 - application/json

Agent wallet registered or removed

status
enum<string>
Available options:
ok,
error
response
object