Accounting Module API

ROFL accounting service for deposits, withdrawals, and fund management

Sapphire Testnet

API Endpoints

POST /v1/accounting/quote/deposit
Generate deposit instructions and transaction data for a user/token/amount combination.

Request Parameters

user_address string required
EVM address of the user
token_id string required
Bytes32 token identifier (hex)
amount integer required
Amount to deposit in base units (e.g., wei for ETH)

Response

user_address string
Checksummed address
token_id string
Normalised bytes32 token identifier
amount integer
Amount to deposit
deposit_address string
ROFL-controlled destination address
transaction object
Transaction data to execute (to, value, data, chain_id)
instructions string
Deposit guidance for clients
POST /v1/accounting/deposits
Submit a deposit inclusion transaction (automatically detects native/ERC20 based on token_id).

Request Parameters

user_address string required
Depositor address
token_id string required
Bytes32 token identifier (hex)
evm_transaction_data string required
RLP-encoded transaction payload
rlp_block_header string optional
RLP-encoded block header
transaction_index_rlp string optional
RLP-encoded transaction index
transaction_proof_stack string optional
Merkle proof stack

Response

submission_id string
ROFL submission identifier
status string
Submission status, e.g. submitted
POST /v1/accounting/funds/lock
Lock user funds for a service using the user's EIP-712 signature.

Request Parameters

user_address string required
service_address string required
token_id string required
amount integer required
expiry integer required
Unix timestamp
signature string required
User EIP-712 Lock signature

Response

submission_id string
status string
detail string optional
GET /v1/accounting/funds/locked/{user_address}
Get locked funds for a user, optionally filtered by service address.

Query Parameters

service_address string optional
Filter locks by service address

Response

user_address string
Checksummed user address
service_address string optional
Service address filter if provided
locks array
List of lock information (lock_index, user_address, service_address, token_id, amount, expiry, is_expired)
total_locked integer
Total amount locked across all locks
POST /v1/accounting/funds/transfer
Transfer balances between users with the originator's EIP-712 signature.

Request Parameters

user_address string required
to_address string required
token_id string required
amount integer required
signature string required
User EIP-712 Transfer signature

Response

submission_id string
status string
detail string optional
POST /v1/accounting/funds/transfer-locked
Consume or release locked funds using the service's EIP-712 signature.

Request Parameters

user_address string required
Owner of the lock
lock_index integer required
to_address string required
amount integer required
signature string required
Service EIP-712 TransferLocked signature

Response

submission_id string
status string
detail string optional
POST /v1/accounting/funds/unlock
Unlock an expired lock without a signature.

Request Parameters

user_address string required
lock_index integer required

Response

submission_id string
status string
detail string optional
POST /v1/accounting/withdraw
Initiate a withdrawal based on the user's EIP-712 signature. The service verifies the signature, generates the withdrawal transaction via the contract, and relays it to the chain RPC mapped to the token.

Request Parameters

user_address string required
token_id string required
amount integer required
signature string required
User EIP-712 Withdraw signature

Response

submission_id string
Hash of the relayed transaction
status string
Submission status, e.g. submitted
detail string optional
Metadata such as chain_id and token_address
GET /v1/accounting/balances/{user_address}/{token_id}
Get the user's balance for a specific token from the contract.

Response

user_address string
Checksummed address
token_id string
Token identifier
balance string
User's balance in base units (wei for ETH)
token_symbol string
Token symbol
chain_id string
Default Sapphire chain ID