Skip to main content

Transaction API

Introduction

The Transaction API provides a robust interface for handling transactions on Bloctopus networks, supporting everything from basic transfers to advanced protocol-level operations and multi-chain transactions.

The /v1alpha1/transaction/ parent route provides general low-level transaction submission and recording capabilities, while its subroutes, such as /v1alpha1/transaction/token, offer higher-level abstractions designed for common use cases.

info

All transactions are securely submitted using the default private key associated with the user account initiating the API call. In the future, we plan to offer a signing SDK or an MPC (Multi-Party Computation) wallet designed to work seamlessly with this API. This will combine the ability to facilitate complex multichain transaction flows with full self-sovereignty.

Advanced Features

  • Record/Replay Transactions: Capture any set of transactions executed across multiple chains and replay them as needed. Ideal for testing, debugging, migrating operations between testnets and mainnets, or automating repetitive workflows.

  • Complex Protocols Interactions & Transaction Workflows:

    • Token Manager: Deploy, manage, and interact with tokens across multiple networks, simplifying token creation, deployment, and cross-chain management of a wide range of token types (CCT, OFT, ERC3643, ... ).
    • Protocol Interactions: Execute complex, multi-step interactions with DeFi protocols, cross-chain bridges, and more through straightforward API calls.
  • Transaction Submission: Submit transactions to any Bloctopus network using simple API calls. (Advanced capabilities include parallel multi-chain execution, MPC, multisig transactions, and more.)

Operations

POST /v1alpha1/transaction/submit

Submit transactions grouped by network.

Request body

{
"transactions_by_network": {
"network_id_1": [
{
"from": "string",
"to": "string (optional for contract creation)",
"value": "string (wei)",
"data": "string (hex)",
"gas_limit": "number (optional)",
"max_fee_per_gas": "string (optional)",
"max_priority_fee_per_gas": "string (optional)"
}
],
"network_id_2": [
// More transactions for another network
]
}
}

Responses

HTTP CodeResponse
202 Accepted{ "tx_hashes_by_network": { "network_id_1": ["string"], "network_id_2": ["string"] } }
400 Bad RequestError message

Note: Transactions and their hashes are now grouped by network ID, allowing for organized batch processing and parallel execution.

POST /v1alpha1/transaction/recording/start

Start a new recording session.

Request body

{
"userAddress": "string",
"networkIds": ["string"]
}

Responses

HTTP CodeResponse
201 Created{ "recordingId": "string", "message": "string" }
400 Bad RequestError

POST /v1alpha1/transaction/recording/stop

Stop an active recording session.

Request body

{
"recordingId": "string"
}

Responses

HTTP CodeResponse
200 OKRecording details
404 Not FoundError
400 Bad RequestError

GET /v1alpha1/transaction/recording/list-all

List all recordings with optional filters.

Query parameters

  • userAddress: string (optional)
  • state: "recording" | "recorded" (optional)
  • networkId: string (optional)

Responses

HTTP CodeResponse
200 OKArray of recordings

GET /v1alpha1/transaction/recording/{id}

Get a specific recording by ID.

Responses

HTTP CodeResponse
200 OKRecording details
404 Not FoundError

GET /v1alpha1/transaction/recording/active/{userAddress}

Get active recordings for a specific user.

Responses

HTTP CodeResponse
200 OKArray of active recordings

POST /v1alpha1/transaction/recording/replay

Replay recorded transactions.

Request body

{
"recordingId": "string (optional)",
"replayDocument": "object (optional)",
"networkMapping": { "string": "string" } (optional)
}

Responses

HTTP CodeResponse
200 OK{ "success": boolean, "transactions": object, "networks": array, "totalTransactions": number, "appliedNetworkMapping": object }
400 Bad RequestError
404 Not FoundError

API Objects

Recording

FieldTypeDescription
idstringUnique ID
user_addressstringUser wallet address
network_idsarray<string>Network IDs
start_timestampstring (ISO)Start time
end_timestampstring (ISO)End time
state"recording""recorded"
recorded_dataobjectRecorded transactions
created_atstring (ISO)Creation time

// ... Add more objects as needed from DTOs ...