History & Status
Use the history endpoint for account-level reconciliation and the status endpoints to locate a transfer by its external or ValueChain identifier.
Deposit and withdrawal history
GET /user/{userAddress}/deposit-withdrawals
curl "https://mainnet-gw.sodex.dev/api/v1/user/0x1111111111111111111111111111111111111111/deposit-withdrawals?side=withdraw&pending=true&limit=10" \
-H "Accept: application/json"Query parameters
start
int32
No
Pagination offset. Minimum 0.
startTime
int64
No
Start-time filter. Minimum 0.
endTime
int64
No
End-time filter. Minimum 0.
limit
int32
No
Page size from 1 to 10; default 10.
side
string
No
deposit or withdraw.
token
string
No
Token identifier or address.
pending
boolean
No
Select pending or non-pending records.
chain
string
No
External chain identifier.
coinSymbol
string
No
Coin symbol.
data.records contains the current page and data.total contains the total number of matches. A record includes account, amount, coin, chain, decimals, sender, receiver, status, timestamps, token, and current transaction hash. It can also include originTxHash, withdrawFee, withdrawId, failCode, and failReason.
Transfer status endpoints
These APIs return external deposit or withdrawal records that match a transfer identifier.
Deposit status
Return deposit records for an external-chain transaction hash.
Request
Query Parameters
chain
string
true
External chain identifier.
txHash
string
true
External-chain deposit transaction hash.
Request Example
Additional Information:
The same deposit transaction hash may match multiple records with different
nvalues.If
chaindoes not match the record, the API returns an empty result instead of an error.
Bridge deposit AML status
Call deposit status with chain and the original bridge txHash. Gateway looks up formal deposits first. While no formal records exist, a source chain on the AML list is enough to trigger the order lookup. Once records exist, Gateway checks all returned records for a possible bridge deposit on a listed route. It also attempts the lookup when the list or a candidate record’s coin is unknown.
Read data.records and data.total for formal deposits. When AML orders match, data.aml.orders and data.aml.total describe those orders. Each order has its own eventIndex and amlStatus. The creditToSpot flag indicates whether the deposit targets Spot.
For a transaction with multiple events, an indexed custody deposit or an unlisted bridge coin can be the only formal record visible while a different event is under review. Gateway can skip the AML lookup in that case. An absent data.aml means this response contains no AML result. Confirm credit using a matching formal record, and refund completion using a matching Refunded order.
If the AML lookup fails, Gateway returns the formal records with top-level code zero and reports the failure in data.aml.error. If the formal lookup fails, Gateway returns a top-level error and skips the AML lookup.
Deposit refund request
Submit POST /api/v1/user/deposit/refund for a Rejected AML order. Set Content-Type: application/json. The original payer signs the refund message and sends the following required strings in the JSON body.
account, refundAddress
Original payer's wallet address for this flow.
chain, token, txHash
Copy from the rejected order. For Base USDC, use token ID BASE_USDC and the original bridge hash.
eventIndex
Copy from the rejected order, including an explicitly empty string.
nonce
16 random bytes encoded as 32 lowercase hex characters without a prefix. Keep leading zeros.
expiryTime
Signature expiry as decimal Unix seconds without leading zeros.
accountSign
The original payer’s 65-byte EIP-191 signature over the refund message, hex-encoded with a 0x prefix.
The wallet signs eventIndex under the name n and refundAddress under to. Mirror validates refund fields and the payer signature. On rejection, Gateway returns Mirror’s HTTP status and response body, including its error code and message. A successful submission returns code: 0 and data: {}. Poll deposit status with the original hash until the matching order reports Refunded.
Mirror can report a business rejection with HTTP 200. For example, the refund endpoint can return the following body verbatim. Check the numeric Gateway success code (code === 0) before treating the request as accepted.
Wallet example
Use the selected rejected order and an ethers v6 signer for the original payer. Sign the UTF-8 text with LF between lines and no trailing newline. Keep the address and hash casing used in the request. The example uses the mainnet audience.
Keep the signed body in the calling application before the first submission.
If the response is lost, query H1 and match the order’s eventIndex. For RefundPending or Refunded, continue tracking that order. If it still reports Rejected and a retry is needed before expiryTime, call submitRefund(signedBody) again with the saved string. After expiry, refresh status before asking the payer to sign again.
Withdrawal status
Return withdrawal records by withdrawal ID or by the ValueChain transaction hash of the withdrawal request.
Request
Query Parameters
chain
string
true
External chain identifier.
withdrawId
string
false
Withdrawal request identifier. Required when txHash is omitted.
txHash
string
false
ValueChain transaction hash of the withdrawal request. Required when withdrawId is omitted.
Request Examples
Query by withdrawal ID:
Query by the ValueChain withdrawal-request transaction hash:
Additional Information:
At least one of
withdrawIdandtxHashis required.Prefer
withdrawId. When both parameters are provided,withdrawIdtakes precedence andtxHashis ignored.withdrawIdis forwarded unchanged. Clients must not assume that it is always numeric.The
txHashfallback accepts only the ValueChain transaction hash of the withdrawal request. It cannot query by the final external-chain withdrawal transaction hash.If
chaindoes not match the record, the API returns an empty result instead of an error.
Response
Deposit and withdrawal status share the formal record fields below. Deposit status can also include AML results.
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
TransferStatus
aml
false
Deposit status only. Omitted when the AML lookup is skipped or finds no matching orders.
records
DepositWithdrawalRecord[]
true
Matching deposit or withdrawal records.
total
int32
true
Total number of matching records.
DepositAMLResult
When orders match, data.aml contains both orders and total. If the AML lookup fails, it contains only error. The formal deposit records remain available in data.records.
total
integer
On match
Total number of matching AML orders.
error
string
On lookup failure
Error message from the AML lookup.
BridgeDepositOrder
chain
string
true
Source chain identifier, for example BASE_ETH.
txHash
string
true
Original bridge deposit transaction hash on the source chain.
eventIndex
string
true
Event index within the transaction. Copy this string into a refund request, including an empty value.
token
string
true
Token identifier used for refunds, for example BASE_USDC.
coinSymbol
string
true
Asset symbol, for example USDC.
sender
string
true
Original payer’s address.
receiver
string
true
Intended recipient of the deposit.
amount
string
true
Integer amount in token base units.
decimals
uint8
true
Decimal places for amount. For example, "10500000" with 6 decimals means 10.5 tokens.
creditToSpot
bool
true
true when the deposit targets Spot.
amlStatus
string
true
Pending, Approved, Rejected, RefundPending, or Refunded. See AML orders for the action to take.
DepositWithdrawalRecord
account
string
true
Sodex user account address.
amount
string
true
Transfer amount.
chain
string
true
External chain identifier.
coin
string
true
Coin symbol.
decimals
uint8
true
Coin decimals.
failCode
string
true
Failure code. Empty when no failure occurred.
failReason
string
true
Failure reason. Empty when no failure occurred.
n
string
true
Mirror record sequence or cursor value.
receiver
string
true
Receiving address.
reportAmount
string
true
Amount reported by the external transfer system.
sender
string
true
Sending address.
status
string
true
Current transfer status.
statusTime
int64
true
Time when the status was last updated.
stmp
int64
true
Record timestamp.
token
string
true
Token identifier or contract address.
txHash
string
true
Current transaction hash.
originTxHash
string
false
Original transaction hash. Omitted when unavailable.
type
string
true
Record type.
withdrawFee
string
false
Withdrawal fee. Omitted when not applicable.
withdrawId
uint64
false
Withdrawal identifier. Omitted when unavailable.
Response Example
Withdrawal in progress
Base USDC deposit rejected before formal credit
For GET /api/v1/user/deposit/status, code: 0 means the lookup succeeded. Here the original Base transaction has no formal deposit records (data.total: 0) and one rejected AML order (data.aml.total: 1). The original payer can use this order’s txHash, eventIndex, and token to request a refund.
Empty Response Example
No matching record is a successful response:
Last updated