chain.withdraw.v1.AutoWithdrawService
GetAutoWithdrawRule
Read the account's latest rule version. An API key needs READ_AUTO_WITHDRAW in its policy and reads only its own account. Both refusals answer PERMISSION_DENIED: a key whose policy lacks the action gets "api key policy does not allow READ_AUTO_WITHDRAW", and a key that names an account other than its own, such as a root-account key naming a subaccount, gets "api key target scope mismatch".
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/chain.withdraw.v1.AutoWithdrawService/GetAutoWithdrawRule' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"subaccountId": "6789012345678"
}'Responses
{
"rule": {
"createdAt": "2025-01-01T00:00:00Z",
"destinations": [
{
"assetId": 100,
"destinationAddress": "0x3333333333333333333333333333333333333333",
"destinationChainId": "1",
"maxAmountE18": {
"hi": "1",
"lo": "1"
},
"minAmountE18": {
"hi": "1",
"lo": "1"
}
}
],
"enabled": false,
"minUsdValueE18": {
"hi": "1",
"lo": "1"
},
"pause": {
"assetId": 100,
"pausedAt": "2025-01-01T00:00:00Z",
"reason": "value"
},
"schedule": {
"anchorDate": "value",
"cadence": "DAILY",
"dayOfMonth": 31,
"minuteOfDay": 1439,
"minuteOfHour": 59,
"weekday": "MONDAY"
},
"subaccountId": "6789012345678",
"version": 1
}
}chain.withdraw.v1.GetAutoWithdrawRuleRequestchain.withdraw.v1.GetAutoWithdrawRuleResponsePublic subaccount ID; omit for the root account.
Public subaccount ID the rule belongs to; zero for the root account.
Rule version, starting at 1.
Whether the rule runs. A disabled version has no destinations.
How often the rule runs.
Run day of a weekly or biweekly rule.
Minute after 00:00 UTC the run starts, 0 to 1439, for every cadence but HOURLY; must be 0 for an hourly rule.
Minute past every hour an HOURLY rule is checked, 0 to 59.
Run day of a MONTHLY rule, 1 to 31; see MONTHLY for shorter months.
A UTC date (YYYY-MM-DD) in a week a BIWEEKLY rule runs; weeks start on Monday. Responses return the Monday that starts that week.
Ledger asset paid. At most one destination per asset.
External destination chain identifier.
Destination address on destination_chain_id. It must be on the account's external withdraw whitelist when the rule is written and whenever a run pays it. Responses carry its canonical form.
Most significant 64 bits.
Least significant 64 bits.
Most significant 64 bits.
Least significant 64 bits.
When this version was created.
Asset whose payout paused the rule.
Machine-readable reason: destination_not_whitelisted when the destination left the account's external withdraw whitelist, destination_invalid when it is no longer a valid destination, or authority_revoked when the person who set the rule may no longer change it or withdraw from the account.
When the rule was paused.
Most significant 64 bits.
Least significant 64 bits.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| account-shard-unavailable | 503 | unavailable | Account Shard Unavailable | The account shard cannot currently accept fund movement. |
| amount-below-minimum | 400 | invalid_argument | Amount Below Minimum | The withdraw amount is below the configured minimum including fees. |
| amount-exceeds-route-precision | 400 | invalid_argument | Amount Exceeds Route Precision | The withdraw amount has more decimal places than the destination network's token supports. |
| amount-exceeds-supply | 400 | invalid_argument | Amount Exceeds Supply | The withdraw amount exceeds the available zipped-asset supply. |
| api-key-binding-invalid | 403 | permission_denied | API Key Binding Invalid | API-key authorization binding verification failed. |
| api-key-binding-public-key-mismatch | 403 | permission_denied | API Key Binding Public Key Mismatch | The API-key authorization binding does not match the configured public key. |
| api-key-binding-scope-mismatch | 403 | permission_denied | API Key Binding Scope Mismatch | The API-key authorization binding does not cover the requested scope. |
| api-key-not-found | 403 | permission_denied | API Key Not Found | The API key could not be resolved. |
| auth-authentication-required | 401 | unauthenticated | Authentication Required | Authentication is required. |
| auth-session-kind-not-allowed | 403 | permission_denied | Interactive Session Required | This operation accepts only an interactive session; API keys are refused. |
| capital-view-unavailable | 503 | unavailable | Capital View Unavailable | The authoritative capital view is not ready. |
| chain-metadata-unavailable | 503 | unavailable | Chain Metadata Unavailable | Required chain or contract metadata is unavailable. |
| conflict | 409 | aborted | Conflict | The request conflicts with existing state. |
| destination-validation-unavailable | 503 | unavailable | Destination Validation Unavailable | Destination validation is temporarily unavailable. |
| external-destination-not-whitelisted | 403 | permission_denied | External Destination Not Whitelisted | The external destination is not whitelisted. |
| failed-precondition | 400 | failed_precondition | Failed Precondition | A required withdraw precondition was not satisfied. |
| fee-unavailable | 503 | unavailable | Fee Unavailable | Required network fee data is unavailable. |
| funds-lock-conflict | 409 | aborted | Funds Lock Conflict | The funds lock conflicts with an existing or finalized reservation. |
| idempotency-conflict | 409 | already_exists | Idempotency Conflict | The idempotency key was reused with different request data. |
| insufficient-funds | 400 | failed_precondition | Insufficient Funds | The source account does not have enough available Trading balance. |
| internal-error | 500 | internal | Internal Error | The withdraw failed because of an unexpected server error. |
| internal-recipient-not-whitelisted | 403 | permission_denied | Internal Recipient Not Whitelisted | The internal funding recipient is not whitelisted. |
| invalid-action | 400 | invalid_argument | Invalid Withdraw Action | The withdraw action is invalid for this endpoint. |
| invalid-amount | 400 | invalid_argument | Invalid Amount | The withdraw amount is invalid. |
| invalid-auto-withdraw-schedule | 400 | invalid_argument | Invalid Auto-Withdraw Schedule | The auto-withdraw schedule is invalid for its cadence. |
| invalid-destination-address | 400 | invalid_argument | Invalid Destination Address | The destination address is invalid. |
| invalid-destination-chain | 400 | invalid_argument | Invalid Destination Chain | The destination chain is invalid. |
| invalid-request | 400 | invalid_argument | Invalid Request | The request payload or one of its fields is invalid. |
| invalid-subaccount-id | 400 | invalid_argument | Invalid Subaccount | The selected subaccount identifier is invalid. |
| not-found | 404 | not_found | Not Found | The requested resource was not found. |
| permission-denied | 403 | permission_denied | Permission Denied | The caller is not permitted to perform this withdraw operation. |
| rate-limit-exceeded | 429 | resource_exhausted | Rate Limit Exceeded | The withdraw admission rate limit was exceeded. |
| service-unavailable | 503 | unavailable | Service Unavailable | A required service is temporarily unavailable. |
| signature-required | 400 | invalid_argument | Signature Required | A payload signature is required. |
| signature-scheme-unsupported | 400 | invalid_argument | Signature Scheme Unsupported | The signature scheme is unsupported. |
| signer-wallet-invalid | 400 | invalid_argument | Invalid Signer Wallet | The signer wallet is invalid. |
| source-smart-account-unavailable | 400 | failed_precondition | Source Smart Account Unavailable | The source smart-account address is unavailable. |
| step-up-unavailable | 503 | unavailable | Step-Up Unavailable | Fresh step-up verification is temporarily unavailable. |
| subaccount-not-found | 404 | not_found | Subaccount Not Found | The selected subaccount does not exist. |
| supply-unavailable | 503 | unavailable | Supply Unavailable | Required zipped-asset supply data is unavailable. |
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication is required. |
| unsupported-asset | 400 | invalid_argument | Unsupported Asset | The requested asset or withdraw route is not supported. |
| unsupported-ledger | 400 | invalid_argument | Unsupported Ledger | The requested ledger is not supported for withdrawals. |
| wallet-binding-invalid | 403 | permission_denied | Wallet Binding Invalid | Wallet authorization binding verification failed. |
| wallet-binding-scope-mismatch | 403 | permission_denied | Wallet Binding Scope Mismatch | The wallet authorization binding does not cover the requested scope. |
| wallet-binding-signer-mismatch | 403 | permission_denied | Wallet Binding Signer Mismatch | The wallet authorization binding does not match the signer. |