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.
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 Code | Response |
---|---|
202 Accepted | { "tx_hashes_by_network": { "network_id_1": ["string"], "network_id_2": ["string"] } } |
400 Bad Request | Error 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 Code | Response |
---|---|
201 Created | { "recordingId": "string", "message": "string" } |
400 Bad Request | Error |
POST /v1alpha1/transaction/recording/stop
Stop an active recording session.
Request body
{
"recordingId": "string"
}
Responses
HTTP Code | Response |
---|---|
200 OK | Recording details |
404 Not Found | Error |
400 Bad Request | Error |
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 Code | Response |
---|---|
200 OK | Array of recordings |
GET /v1alpha1/transaction/recording/{id}
Get a specific recording by ID.
Responses
HTTP Code | Response |
---|---|
200 OK | Recording details |
404 Not Found | Error |
GET /v1alpha1/transaction/recording/active/{userAddress}
Get active recordings for a specific user.
Responses
HTTP Code | Response |
---|---|
200 OK | Array 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 Code | Response |
---|---|
200 OK | { "success": boolean, "transactions": object, "networks": array, "totalTransactions": number, "appliedNetworkMapping": object } |
400 Bad Request | Error |
404 Not Found | Error |
API Objects
Recording
Field | Type | Description |
---|---|---|
id | string | Unique ID |
user_address | string | User wallet address |
network_ids | array<string> | Network IDs |
start_timestamp | string (ISO) | Start time |
end_timestamp | string (ISO) | End time |
state | "recording" | "recorded" |
recorded_data | object | Recorded transactions |
created_at | string (ISO) | Creation time |
// ... Add more objects as needed from DTOs ...