Wallet adapter
Wallet adapter
Manage the REST v1 wallet adapter configuration used by Mini App balance reads and wallet mutations.
Paths
GET /api/operator/wallet-adapter
PUT /api/operator/wallet-adapter
POST /api/operator/wallet-adapter/test
Required scopes
wallet_adapter:readforGETwallet_adapter:writeforPUTandPOST /test
GET response
The response is masked. Secrets are never returned.
GET has no query parameters or body; only the bearer header and wallet_adapter:read scope are required.
Fields:
balance_adapter_typeauth_mode:env_var,encrypted, ornonebase_urltimeout_msbalance_pathdebit_pathcredit_pathdebit_reversal_pathhas_bearer_tokenhas_signature_secretcurrency_codeupdated_at
PUT body
Typical body:
{
"base_url": "https://wallet.operator.example",
"bearer_token": "operator-wallet-token",
"signature_secret": "optional-signing-secret",
"timeout_ms": 10000,
"balance_path": "/balance",
"debit_path": "/debit",
"credit_path": "/credit",
"debit_reversal_path": "/debit-reversal"
}
A configured secret may be omitted when updating non-secret fields. Sending a new secret replaces the stored encrypted value.
| Field | Type | Requirement | Values/default |
|---|---|---|---|
base_url | string | Required on first setup | May be omitted on later updates to keep the current URL. HTTPS required except localhost/127.0.0.1. |
bearer_token | string | Required on first setup | May be omitted later to keep the encrypted credential. |
signature_secret | string | Optional | Enables request signing. Omit to keep an existing secret; an empty value does not clear it. |
timeout_ms | integer | Optional | Default 10000; clamped to 1000–30000. |
balance_path | string | Optional | Default /balance. A leading / is added when missing. |
debit_path | string | Optional | Default /debit. |
credit_path | string | Optional | Default /credit. |
debit_reversal_path | string | Optional | Default /debit-reversal. |
credit_reversal_path | string | Optional | Accepted by the API, default /credit-reversal; not used by current production trade/redemption flows. |
Current dashboard-managed production paths are balance, debit, credit, and debit reversal. The backend config parser also accepts credit_reversal_path for compatibility with the shared direction enum, but the current trade/redemption processor does not call credit reversal in production flows and the masked GET response does not expose that field.
The current API supports REST v1 only for IDR operators. Unsupported currency returns 400 REST_V1_UNSUPPORTED_CURRENCY.
Test body
Common and mode-specific fields:
| Field | Type | Requirement | Values/default |
|---|---|---|---|
external_user_id | string | Required | Dedicated operator-side test user. |
mode | string | Optional | connection (default) or full_contract. |
amount_minor | positive integer | Required for full_contract | Small real mutation amount in operator currency minor units. |
confirmation | boolean | Required for full_contract | Must be exactly true. |
| Adapter config fields | mixed | Optional | May temporarily override or complete the saved config for this test. The resulting config must contain base_url and a bearer token. |
Connection test:
{
"mode": "connection",
"external_user_id": "operator-user-123",
"base_url": "https://wallet.operator.example",
"bearer_token": "operator-wallet-token"
}
Full contract test:
{
"mode": "full_contract",
"external_user_id": "operator-user-123",
"amount_minor": 1000,
"confirmation": true
}
The full contract test performs real wallet mutations against the configured or submitted adapter config. Use a dedicated test user and a small amount.
The full contract sequence is: balance, debit, debit reversal, credit, second debit, final balance. The final balance must equal the initial balance; a mismatch requires manual review.
All mutation test requests include external_user_id, amount_minor, currency_code, idempotency_key, reason, and metadata. They do not include direction; the path selected for the step is the direction.
If mutation responses include external_user_id, the contract test surfaces it in the step output and fails the step when it does not match the requested test user.
Test response
{
"mode": "connection",
"success": true,
"requires_manual_review": false,
"steps": [
{
"step": "balance",
"method": "GET",
"path": "/balance",
"status": "success",
"latency_ms": 42,
"remote_status": "succeeded",
"external_user_id": "operator-user-123"
}
]
}
Step status can be success, failed, or unknown.
requires_manual_review = true means a mutation or compensation step reached a state that needs operator follow-up before the test user should be reused.
