@symmio/trading-core 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/chains/types.d.ts +197 -0
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core/chains/types.js.map +1 -1
- package/dist/core/config/merge-chain-config.d.ts.map +1 -1
- package/dist/core/config/merge-chain-config.js +49 -19
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/gasless/abortable-sleep.d.ts +17 -0
- package/dist/gasless/abortable-sleep.d.ts.map +1 -0
- package/dist/gasless/abortable-sleep.js +21 -0
- package/dist/gasless/abortable-sleep.js.map +1 -0
- package/dist/gasless/assert-gateway-coherence.d.ts +20 -0
- package/dist/gasless/assert-gateway-coherence.d.ts.map +1 -0
- package/dist/gasless/assert-gateway-coherence.js +26 -0
- package/dist/gasless/assert-gateway-coherence.js.map +1 -0
- package/dist/gasless/batch/calls.d.ts +121 -0
- package/dist/gasless/batch/calls.d.ts.map +1 -0
- package/dist/gasless/batch/calls.js +36 -0
- package/dist/gasless/batch/calls.js.map +1 -0
- package/dist/gasless/batch/index.d.ts +2 -0
- package/dist/gasless/batch/index.d.ts.map +1 -0
- package/dist/gasless/batch/resolve-gasless-batch.d.ts +118 -0
- package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/batch/resolve-gasless-batch.js +89 -0
- package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -0
- package/dist/gasless/classify-gasless-failure.d.ts +99 -0
- package/dist/gasless/classify-gasless-failure.d.ts.map +1 -0
- package/dist/gasless/classify-gasless-failure.js +60 -0
- package/dist/gasless/classify-gasless-failure.js.map +1 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts +121 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts.map +1 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +73 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js.map +1 -0
- package/dist/gasless/confirm-gasless-request/index.d.ts +2 -0
- package/dist/gasless/confirm-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/constants.d.ts +24 -0
- package/dist/gasless/constants.d.ts.map +1 -0
- package/dist/gasless/constants.js +6 -0
- package/dist/gasless/constants.js.map +1 -0
- package/dist/gasless/delegation-preflight.d.ts +39 -0
- package/dist/gasless/delegation-preflight.d.ts.map +1 -0
- package/dist/gasless/delegation-preflight.js +33 -0
- package/dist/gasless/delegation-preflight.js.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +73 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js +189 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -0
- package/dist/gasless/eip712.d.ts +79 -0
- package/dist/gasless/eip712.d.ts.map +1 -0
- package/dist/gasless/eip712.js +60 -0
- package/dist/gasless/eip712.js.map +1 -0
- package/dist/gasless/errors.d.ts +132 -0
- package/dist/gasless/errors.d.ts.map +1 -0
- package/dist/gasless/errors.js +110 -0
- package/dist/gasless/errors.js.map +1 -0
- package/dist/gasless/events.d.ts +37 -0
- package/dist/gasless/events.d.ts.map +1 -0
- package/dist/gasless/events.js +34 -0
- package/dist/gasless/events.js.map +1 -0
- package/dist/gasless/fallback.d.ts +58 -0
- package/dist/gasless/fallback.d.ts.map +1 -0
- package/dist/gasless/fallback.js +34 -0
- package/dist/gasless/fallback.js.map +1 -0
- package/dist/gasless/format-gasless-operation.d.ts +37 -0
- package/dist/gasless/format-gasless-operation.d.ts.map +1 -0
- package/dist/gasless/format-gasless-operation.js +33 -0
- package/dist/gasless/format-gasless-operation.js.map +1 -0
- package/dist/gasless/gasless-url.d.ts +82 -0
- package/dist/gasless/gasless-url.d.ts.map +1 -0
- package/dist/gasless/gasless-url.js +70 -0
- package/dist/gasless/gasless-url.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/calls.d.ts +73 -0
- package/dist/gasless/gasless-wallet-execute/calls.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/calls.js +24 -0
- package/dist/gasless/gasless-wallet-execute/calls.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +148 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +120 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/index.d.ts +5 -0
- package/dist/gasless/gasless-wallet-execute/index.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/query.d.ts +18 -0
- package/dist/gasless/gasless-wallet-execute/query.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/query.js +12 -0
- package/dist/gasless/gasless-wallet-execute/query.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/selectors.d.ts +38 -0
- package/dist/gasless/gasless-wallet-execute/selectors.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/selectors.js +15 -0
- package/dist/gasless/gasless-wallet-execute/selectors.js.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts +72 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js +42 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts +3 -0
- package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts +47 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.js +50 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.js.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts +80 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js +61 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/index.d.ts +3 -0
- package/dist/gasless/get-gasless-deposit-policy/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/query.d.ts +51 -0
- package/dist/gasless/get-gasless-deposit-policy/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/query.js +25 -0
- package/dist/gasless/get-gasless-deposit-policy/query.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts +27 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js +22 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts +61 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js +59 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts +79 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js +53 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/index.d.ts +4 -0
- package/dist/gasless/get-gasless-fee-quote/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/query.d.ts +41 -0
- package/dist/gasless/get-gasless-fee-quote/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/query.js +31 -0
- package/dist/gasless/get-gasless-fee-quote/query.js.map +1 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.d.ts +51 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.js +15 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.js.map +1 -0
- package/dist/gasless/get-gasless-request/index.d.ts +4 -0
- package/dist/gasless/get-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/query.d.ts +64 -0
- package/dist/gasless/get-gasless-request/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/query.js +42 -0
- package/dist/gasless/get-gasless-request/query.js.map +1 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.d.ts +26 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.js +62 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts +40 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js +15 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/index.d.ts +4 -0
- package/dist/gasless/get-gasless-request-transactions/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/query.d.ts +75 -0
- package/dist/gasless/get-gasless-request-transactions/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/query.js +37 -0
- package/dist/gasless/get-gasless-request-transactions/query.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts +21 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js +27 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts +48 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js +20 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-address/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/query.d.ts +46 -0
- package/dist/gasless/get-gasless-wallet-address/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-address/query.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts +57 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js +17 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts +51 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts +51 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js +21 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-nonce/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.d.ts +47 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.js.map +1 -0
- package/dist/gasless/get-session-key-selectors.d.ts +83 -0
- package/dist/gasless/get-session-key-selectors.d.ts.map +1 -0
- package/dist/gasless/get-session-key-selectors.js +25 -0
- package/dist/gasless/get-session-key-selectors.js.map +1 -0
- package/dist/gasless/http.d.ts +229 -0
- package/dist/gasless/http.d.ts.map +1 -0
- package/dist/gasless/http.js +165 -0
- package/dist/gasless/http.js.map +1 -0
- package/dist/gasless/index.d.ts +34 -0
- package/dist/gasless/index.d.ts.map +1 -0
- package/dist/gasless/is-newer-gasless-request.d.ts +32 -0
- package/dist/gasless/is-newer-gasless-request.d.ts.map +1 -0
- package/dist/gasless/is-newer-gasless-request.js +21 -0
- package/dist/gasless/is-newer-gasless-request.js.map +1 -0
- package/dist/gasless/nonce-lock.d.ts +180 -0
- package/dist/gasless/nonce-lock.d.ts.map +1 -0
- package/dist/gasless/nonce-lock.js +102 -0
- package/dist/gasless/nonce-lock.js.map +1 -0
- package/dist/gasless/observe-gasless-request.d.ts +65 -0
- package/dist/gasless/observe-gasless-request.d.ts.map +1 -0
- package/dist/gasless/observe-gasless-request.js +56 -0
- package/dist/gasless/observe-gasless-request.js.map +1 -0
- package/dist/gasless/query-poll-delay.d.ts +39 -0
- package/dist/gasless/query-poll-delay.d.ts.map +1 -0
- package/dist/gasless/query-poll-delay.js +14 -0
- package/dist/gasless/query-poll-delay.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/index.d.ts +3 -0
- package/dist/gasless/relay-gasless-batch/index.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/query.d.ts +18 -0
- package/dist/gasless/relay-gasless-batch/query.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/query.js +12 -0
- package/dist/gasless/relay-gasless-batch/query.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +106 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +145 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +36 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +24 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -0
- package/dist/gasless/relay-grant-delegation/index.d.ts +3 -0
- package/dist/gasless/relay-grant-delegation/index.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/query.d.ts +18 -0
- package/dist/gasless/relay-grant-delegation/query.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/query.js +12 -0
- package/dist/gasless/relay-grant-delegation/query.js.map +1 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +69 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +57 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -0
- package/dist/gasless/relay-instant-operations/index.d.ts +3 -0
- package/dist/gasless/relay-instant-operations/index.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/query.d.ts +18 -0
- package/dist/gasless/relay-instant-operations/query.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/query.js +12 -0
- package/dist/gasless/relay-instant-operations/query.js.map +1 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +127 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js +42 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -0
- package/dist/gasless/relayable-writes.d.ts +163 -0
- package/dist/gasless/relayable-writes.d.ts.map +1 -0
- package/dist/gasless/relayable-writes.js +113 -0
- package/dist/gasless/relayable-writes.js.map +1 -0
- package/dist/gasless/resolve-gasless.d.ts +52 -0
- package/dist/gasless/resolve-gasless.d.ts.map +1 -0
- package/dist/gasless/resolve-gasless.js +19 -0
- package/dist/gasless/resolve-gasless.js.map +1 -0
- package/dist/gasless/resolve-wallet-identities.d.ts +30 -0
- package/dist/gasless/resolve-wallet-identities.d.ts.map +1 -0
- package/dist/gasless/resolve-wallet-identities.js +21 -0
- package/dist/gasless/resolve-wallet-identities.js.map +1 -0
- package/dist/gasless/resubmit-gasless-request/index.d.ts +3 -0
- package/dist/gasless/resubmit-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/query.d.ts +19 -0
- package/dist/gasless/resubmit-gasless-request/query.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/query.js +12 -0
- package/dist/gasless/resubmit-gasless-request/query.js.map +1 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +50 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +52 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts +3 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts +18 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.js +12 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +66 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +36 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts +3 -0
- package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts +18 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.js +12 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +106 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +43 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -0
- package/dist/gasless/status-read-limiter.d.ts +44 -0
- package/dist/gasless/status-read-limiter.d.ts.map +1 -0
- package/dist/gasless/status-read-limiter.js +28 -0
- package/dist/gasless/status-read-limiter.js.map +1 -0
- package/dist/gasless/to-gasless-deposit-receipt.d.ts +61 -0
- package/dist/gasless/to-gasless-deposit-receipt.d.ts.map +1 -0
- package/dist/gasless/to-gasless-deposit-receipt.js +36 -0
- package/dist/gasless/to-gasless-deposit-receipt.js.map +1 -0
- package/dist/gasless/to-gasless-submit-receipt.d.ts +60 -0
- package/dist/gasless/to-gasless-submit-receipt.d.ts.map +1 -0
- package/dist/gasless/to-gasless-submit-receipt.js +26 -0
- package/dist/gasless/to-gasless-submit-receipt.js.map +1 -0
- package/dist/gasless/transient-read.d.ts +32 -0
- package/dist/gasless/transient-read.d.ts.map +1 -0
- package/dist/gasless/transient-read.js +28 -0
- package/dist/gasless/transient-read.js.map +1 -0
- package/dist/gasless/types/generated/gasless-deposits.d.ts +170 -0
- package/dist/gasless/types/generated/gasless-deposits.d.ts.map +1 -0
- package/dist/gasless/types/generated/gasless-operations.d.ts +260 -0
- package/dist/gasless/types/generated/gasless-operations.d.ts.map +1 -0
- package/dist/gasless/types.d.ts +493 -0
- package/dist/gasless/types.d.ts.map +1 -0
- package/dist/gasless/types.js +33 -0
- package/dist/gasless/types.js.map +1 -0
- package/dist/gasless/unconfirmed-submit.d.ts +132 -0
- package/dist/gasless/unconfirmed-submit.d.ts.map +1 -0
- package/dist/gasless/unconfirmed-submit.js +49 -0
- package/dist/gasless/unconfirmed-submit.js.map +1 -0
- package/dist/gasless/wait-for-gasless-request/index.d.ts +2 -0
- package/dist/gasless/wait-for-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts +114 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts.map +1 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js +77 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js.map +1 -0
- package/dist/gasless/wallet-id.d.ts +42 -0
- package/dist/gasless/wallet-id.d.ts.map +1 -0
- package/dist/gasless/wallet-id.js +25 -0
- package/dist/gasless/wallet-id.js.map +1 -0
- package/dist/gasless/wire-parse.d.ts +33 -0
- package/dist/gasless/wire-parse.d.ts.map +1 -0
- package/dist/gasless/wire-parse.js +14 -0
- package/dist/gasless/wire-parse.js.map +1 -0
- package/dist/gasless/wire-types.d.ts +73 -0
- package/dist/gasless/wire-types.d.ts.map +1 -0
- package/dist/gasless/write-request-registry.d.ts +56 -0
- package/dist/gasless/write-request-registry.d.ts.map +1 -0
- package/dist/gasless/write-request-registry.js +22 -0
- package/dist/gasless/write-request-registry.js.map +1 -0
- package/dist/index.d.ts +82 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +568 -497
- package/dist/pools/listing-config/to-listing-config.js +2 -2
- package/dist/pools/listing-config/to-listing-config.js.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.js +46 -40
- package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
- package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
- package/dist/pools/markets/to-listing-market.js +2 -1
- package/dist/pools/markets/to-listing-market.js.map +1 -1
- package/dist/pools/types/generated/listing-backend.d.ts +163 -16
- package/dist/pools/types/generated/listing-backend.d.ts.map +1 -1
- package/dist/pools/types/generated/listing-backend.js.map +1 -1
- package/dist/pools/types.d.ts +52 -2
- package/dist/pools/types.d.ts.map +1 -1
- package/dist/pools/types.js +6 -4
- package/dist/pools/types.js.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +3 -2
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
- package/dist/quotes/get-quote-funding/types.d.ts +4 -2
- package/dist/quotes/get-quote-funding/types.d.ts.map +1 -1
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts +68 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js +34 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js.map +1 -0
- package/dist/quotes/get-quote-pending-funding/index.d.ts +4 -0
- package/dist/quotes/get-quote-pending-funding/index.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/query.d.ts +58 -0
- package/dist/quotes/get-quote-pending-funding/query.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/query.js +27 -0
- package/dist/quotes/get-quote-pending-funding/query.js.map +1 -0
- package/dist/quotes/get-quote-pending-funding/types.d.ts +19 -0
- package/dist/quotes/get-quote-pending-funding/types.d.ts.map +1 -0
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +2 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
- package/dist/quotes/grouping/aggregate-group-funding.d.ts +9 -8
- package/dist/quotes/grouping/aggregate-group-funding.d.ts.map +1 -1
- package/dist/quotes/grouping/aggregate-group-funding.js.map +1 -1
- package/dist/quotes/grouping/partition-quotes.d.ts +30 -0
- package/dist/quotes/grouping/partition-quotes.d.ts.map +1 -1
- package/dist/quotes/grouping/partition-quotes.js +9 -6
- package/dist/quotes/grouping/partition-quotes.js.map +1 -1
- package/dist/quotes/index.d.ts +1 -0
- package/dist/quotes/index.d.ts.map +1 -1
- package/dist/quotes/unified-quote.d.ts +6 -6
- package/dist/quotes/unified-quote.js.map +1 -1
- package/dist/shared/errors/redact-url.d.ts +15 -0
- package/dist/shared/errors/redact-url.d.ts.map +1 -0
- package/dist/shared/errors/redact-url.js +9 -0
- package/dist/shared/errors/redact-url.js.map +1 -0
- package/dist/shared/errors/retry-after.d.ts +17 -0
- package/dist/shared/errors/retry-after.d.ts.map +1 -0
- package/dist/shared/errors/retry-after.js +16 -0
- package/dist/shared/errors/retry-after.js.map +1 -0
- package/dist/shared/errors/sanitized-api-error.d.ts +32 -0
- package/dist/shared/errors/sanitized-api-error.d.ts.map +1 -0
- package/dist/shared/errors/sanitized-api-error.js +41 -0
- package/dist/shared/errors/sanitized-api-error.js.map +1 -0
- package/dist/shared/errors/symm-error.d.ts +39 -4
- package/dist/shared/errors/symm-error.d.ts.map +1 -1
- package/dist/shared/errors/symm-error.js +29 -15
- package/dist/shared/errors/symm-error.js.map +1 -1
- package/dist/shared/types/properties.d.ts +53 -5
- package/dist/shared/types/properties.d.ts.map +1 -1
- package/dist/shared/utils/core-units.d.ts +82 -0
- package/dist/shared/utils/core-units.d.ts.map +1 -0
- package/dist/shared/utils/core-units.js +21 -0
- package/dist/shared/utils/core-units.js.map +1 -0
- package/dist/shared/utils/http-header.d.ts +16 -0
- package/dist/shared/utils/http-header.d.ts.map +1 -0
- package/dist/shared/utils/http-header.js +14 -0
- package/dist/shared/utils/http-header.js.map +1 -0
- package/dist/shared/utils/query.js +2 -1
- package/dist/shared/utils/query.js.map +1 -1
- package/dist/solvers/force-close/force-close-auto.d.ts +6 -2
- package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-auto.js +2 -1
- package/dist/solvers/force-close/force-close-auto.js.map +1 -1
- package/dist/solvers/force-close/force-close-position.d.ts +9 -3
- package/dist/solvers/force-close/force-close-position.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-position.js +2 -1
- package/dist/solvers/force-close/force-close-position.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +12 -12
- package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +7 -7
- package/dist/symmio-contracts/abi/index.d.ts +2 -0
- package/dist/symmio-contracts/abi/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts +2323 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js +2706 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts +137 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js +145 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/index.d.ts +2 -0
- package/dist/symmio-contracts/abi/v0.8.6/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +1879 -37
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +2180 -50
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +11 -2
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +33 -17
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +9 -2
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +33 -16
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +8 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +8 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +7 -2
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts +9 -3
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +41 -20
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/types.d.ts +3 -1
- package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/types.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts +60 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js +35 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts +91 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js +19 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js +15 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts +79 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js +32 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts +43 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js +14 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +24 -3
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +48 -22
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts +62 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js +35 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts +12 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js +29 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts +39 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js +27 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-is-delegation-active.js +7 -7
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts +42 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js +30 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js +21 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +2 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +87 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +38 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +2 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts +15 -3
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js +34 -17
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +2 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +2 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts +85 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js +29 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +9 -7
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +24 -22
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js +4 -2
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts +43 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js +15 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts +4 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts +43 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js +25 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts +85 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/index.d.ts +5 -0
- package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +2 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +46 -17
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts +18 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.js +12 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.js.map +1 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts +35 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js +28 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/types.d.ts +6 -6
- package/dist/symmio-contracts/symmio/types.js.map +1 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.d.ts +2 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.d.ts.map +1 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.js +24 -21
- package/dist/symmio-subgraph/executeSubgraphRequest.js.map +1 -1
- package/dist/websocket/gasless/close-code-policy.d.ts +51 -0
- package/dist/websocket/gasless/close-code-policy.d.ts.map +1 -0
- package/dist/websocket/gasless/close-code-policy.js +75 -0
- package/dist/websocket/gasless/close-code-policy.js.map +1 -0
- package/dist/websocket/gasless/gasless-stream-hub.d.ts +61 -0
- package/dist/websocket/gasless/gasless-stream-hub.d.ts.map +1 -0
- package/dist/websocket/gasless/gasless-stream-hub.js +311 -0
- package/dist/websocket/gasless/gasless-stream-hub.js.map +1 -0
- package/dist/websocket/gasless/index.d.ts +7 -0
- package/dist/websocket/gasless/index.d.ts.map +1 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.d.ts +82 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.d.ts.map +1 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.js +136 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.js.map +1 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts +58 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts.map +1 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.js +59 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.js.map +1 -0
- package/dist/websocket/gasless/types.d.ts +48 -0
- package/dist/websocket/gasless/types.d.ts.map +1 -0
- package/dist/websocket/gasless/watch-gasless-request.d.ts +72 -0
- package/dist/websocket/gasless/watch-gasless-request.d.ts.map +1 -0
- package/dist/websocket/gasless/watch-gasless-request.js +35 -0
- package/dist/websocket/gasless/watch-gasless-request.js.map +1 -0
- package/dist/websocket/index.d.ts +1 -0
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/socket/create-reconnecting-socket.d.ts +39 -6
- package/dist/websocket/socket/create-reconnecting-socket.d.ts.map +1 -1
- package/dist/websocket/socket/create-reconnecting-socket.js +92 -53
- package/dist/websocket/socket/create-reconnecting-socket.js.map +1 -1
- package/dist/websocket/socket/socket-status.d.ts +7 -2
- package/dist/websocket/socket/socket-status.d.ts.map +1 -1
- package/dist/websocket/socket/socket-status.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resubmit-gasless-request.js","names":[],"sources":["../../../src/gasless/resubmit-gasless-request/resubmit-gasless-request.ts"],"sourcesContent":["import { isAddress, type Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport { getGaslessWalletAddress } from \"../get-gasless-wallet-address/get-gasless-wallet-address\";\nimport { postGaslessSubmit, resolveGaslessHttp } from \"../http\";\nimport { assertGaslessDepositWallet, toGaslessDepositReceipt } from \"../to-gasless-deposit-receipt\";\nimport { toGaslessSubmitReceipt } from \"../to-gasless-submit-receipt\";\nimport type { GaslessDepositSubmitReceipt, GaslessSubmitReceipt } from \"../types\";\nimport type { GaslessUnconfirmedSubmit } from \"../unconfirmed-submit\";\nimport { parseGaslessWalletId } from \"../wallet-id\";\nimport type { GaslessWireDepositAccepted, GaslessWireOperationAccepted } from \"../wire-types\";\n\n/** Parameters for {@link resubmitGaslessRequest}: the recorded submit, unchanged. */\nexport type ResubmitGaslessRequestParameters = GaslessUnconfirmedSubmit;\n\n/** Return type of {@link resubmitGaslessRequest}. */\nexport type ResubmitGaslessRequestReturnType = GaslessSubmitReceipt | GaslessDepositSubmitReceipt;\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_RESUBMIT_BODY_INVALID\",\n \"Gasless: the recorded submit has no JSON object body, so there is nothing to resend. Only a GaslessUnconfirmedSubmit taken from getGaslessUnconfirmedSubmit can be resubmitted.\",\n );\n }\n return value as Record<string, unknown>;\n}\n\n/** Read an address the recorded body must carry, without rebuilding the body. */\nfunction requireAddress(body: Record<string, unknown>, field: string): Address {\n const value = body[field];\n if (typeof value !== \"string\" || !isAddress(value)) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_RESUBMIT_BODY_INVALID\",\n `Gasless: the recorded submit body has no valid \"${field}\" address, so the acceptance could not be attributed to an owner. Resubmit only a GaslessUnconfirmedSubmit taken from getGaslessUnconfirmedSubmit.`,\n );\n }\n return value;\n}\n\n/**\n * Resend an **unconfirmed** gasless submit, byte for byte, under its original\n * idempotency key.\n *\n * This is the vendor's prescribed recovery for a lost response: the same key\n * with the same payload either lands the request or returns the record the\n * service already created, so it can never execute the intent twice. It is the\n * *only* safe response to `GASLESS_SUBMIT_UNCONFIRMED` — re-running the intent\n * through the wallet would double-execute whatever the relayer accepted.\n *\n * The body is sent exactly as recorded, never rebuilt: the signatures inside it\n * cover specific nonces and deadlines, and a regenerated payload would be a\n * different request under a key the service has already bound.\n *\n * A deposit settlement is re-verified the same way the original submit was —\n * the wallet's deterministic address is read before the POST and checked\n * against the acceptance — so a replay can never sweep a wallet you did not\n * fund.\n *\n * @param config - The SDK config.\n * @param submit - The record from `getGaslessUnconfirmedSubmit(err)`, unmodified.\n * @returns The acceptance receipt: an operation receipt for `/gateway/relay-instant`,\n * a deposit receipt for either settlement path.\n * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION` for the recorded chain.\n * @throws {SymmError} `GASLESS_RESUBMIT_BODY_INVALID` when the record is not a submit this SDK produced.\n * @throws {SymmApiError} `GASLESS_SUBMIT_UNCONFIRMED` again when the replay is itself\n * inconclusive — keep the record and try again later.\n *\n * @example\n * ```ts\n * try {\n * await relayInstantOperations(config, parameters);\n * } catch (err) {\n * const pending = getGaslessUnconfirmedSubmit(err);\n * if (!pending) throw err;\n * await store.save(pending);\n * const receipt = await resubmitGaslessRequest(config, pending);\n * await store.clear(pending.idempotencyKey);\n * }\n * ```\n */\nexport async function resubmitGaslessRequest(\n config: Config,\n submit: ResubmitGaslessRequestParameters,\n): Promise<ResubmitGaslessRequestReturnType> {\n const { chainId, path, body, idempotencyKey } = submit;\n const context = resolveGaslessHttp(config, { chainId, service: submit.service });\n const record = asRecord(body);\n\n if (path === \"/gateway/relay-instant\") {\n const owner = requireAddress(record, \"userAddress\");\n const walletIds = Array.isArray(record.walletIds)\n ? record.walletIds.map((walletId, index) => parseGaslessWalletId(walletId, `walletIds[${index}]`))\n : [];\n const raw = await postGaslessSubmit<GaslessWireOperationAccepted>(context, path, body, idempotencyKey);\n return toGaslessSubmitReceipt(raw, {\n owner,\n walletIds,\n idempotencyKey,\n protocolInstance: context.protocolInstance,\n });\n }\n\n const owner = requireAddress(record, \"owner\");\n const walletId =\n record.walletId === undefined || record.walletId === null ? 0n : parseGaslessWalletId(record.walletId);\n\n /** Read before the POST, exactly as the original settlement did: a failed read must not follow a 202. */\n const depositAddress = await getGaslessWalletAddress(config, { chainId, owner, walletId });\n\n const raw = await postGaslessSubmit<GaslessWireDepositAccepted>(context, path, body, idempotencyKey);\n const receipt = toGaslessDepositReceipt(raw, {\n owner,\n walletId,\n idempotencyKey,\n protocolInstance: context.protocolInstance,\n });\n assertGaslessDepositWallet(receipt, { walletId, depositAddress, url: context.baseURL, path });\n return receipt;\n}\n"],"mappings":";;;;;;;;AAkBA,SAAS,EAAS,GAAyC;CACzD,IAAI,OAAO,KAAU,aAAY,KAAkB,MAAM,QAAQ,CAAK,GACpE,MAAM,IAAI,EACR,cACA,iCACA,iLACF;CAEF,OAAO;AACT;AAGA,SAAS,EAAe,GAA+B,GAAwB;CAC7E,IAAM,IAAQ,EAAK;CACnB,IAAI,OAAO,KAAU,YAAY,CAAC,EAAU,CAAK,GAC/C,MAAM,IAAI,EACR,cACA,iCACA,mDAAmD,EAAM,mJAC3D;CAEF,OAAO;AACT;AA2CA,eAAsB,EACpB,GACA,GAC2C;CAC3C,IAAM,EAAE,YAAS,SAAM,SAAM,sBAAmB,GAC1C,IAAU,EAAmB,GAAQ;EAAE;EAAS,SAAS,EAAO;CAAQ,CAAC,GACzE,IAAS,EAAS,CAAI;CAE5B,IAAI,MAAS,0BAA0B;EACrC,IAAM,IAAQ,EAAe,GAAQ,aAAa,GAC5C,IAAY,MAAM,QAAQ,EAAO,SAAS,IAC5C,EAAO,UAAU,KAAK,GAAU,MAAU,EAAqB,GAAU,aAAa,EAAM,EAAE,CAAC,IAC/F,CAAC;EAEL,OAAO,EAAuB,MADZ,EAAgD,GAAS,GAAM,GAAM,CAAc,GAClE;GACjC;GACA;GACA;GACA,kBAAkB,EAAQ;EAC5B,CAAC;CACH;CAEA,IAAM,IAAQ,EAAe,GAAQ,OAAO,GACtC,IACJ,EAAO,aAAa,KAAA,KAAa,EAAO,aAAa,OAAO,KAAK,EAAqB,EAAO,QAAQ,GAGjG,IAAiB,MAAM,EAAwB,GAAQ;EAAE;EAAS;EAAO;CAAS,CAAC,GAGnF,IAAU,EAAwB,MADtB,EAA8C,GAAS,GAAM,GAAM,CAAc,GACtD;EAC3C;EACA;EACA;EACA,kBAAkB,EAAQ;CAC5B,CAAC;CAED,OADA,EAA2B,GAAS;EAAE;EAAU;EAAgB,KAAK,EAAQ;EAAS;CAAK,CAAC,GACrF;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/settle-gasless-deposit-existing-account/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { SettleGaslessDepositExistingAccountParameters, SettleGaslessDepositExistingAccountReturnType } from './settle-gasless-deposit-existing-account.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build TanStack Mutation options for {@link settleGaslessDepositExistingAccount}.
|
|
5
|
+
*
|
|
6
|
+
* @param config - The SDK config.
|
|
7
|
+
* @returns Options to pass to `useMutation`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* useMutation(settleGaslessDepositExistingAccountMutationOptions(config));
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function settleGaslessDepositExistingAccountMutationOptions(config: Config): {
|
|
15
|
+
mutationKey: readonly ["settleGaslessDepositExistingAccount"];
|
|
16
|
+
mutationFn: (variables: SettleGaslessDepositExistingAccountParameters) => Promise<SettleGaslessDepositExistingAccountReturnType>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/gasless/settle-gasless-deposit-existing-account/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,6CAA6C,EAClD,KAAK,6CAA6C,EACnD,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,wBAAgB,kDAAkD,CAAC,MAAM,EAAE,MAAM;;4BAIhE,6CAA6C,KACvD,OAAO,CAAC,6CAA6C,CAAC;EAE5D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { settleGaslessDepositExistingAccount as e } from "./settle-gasless-deposit-existing-account.js";
|
|
2
|
+
//#region src/gasless/settle-gasless-deposit-existing-account/query.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return {
|
|
5
|
+
mutationKey: ["settleGaslessDepositExistingAccount"],
|
|
6
|
+
mutationFn: (n) => e(t, n)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as settleGaslessDepositExistingAccountMutationOptions };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/gasless/settle-gasless-deposit-existing-account/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport {\n settleGaslessDepositExistingAccount,\n type SettleGaslessDepositExistingAccountParameters,\n type SettleGaslessDepositExistingAccountReturnType,\n} from \"./settle-gasless-deposit-existing-account\";\n\n/**\n * Build TanStack Mutation options for {@link settleGaslessDepositExistingAccount}.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(settleGaslessDepositExistingAccountMutationOptions(config));\n * ```\n */\nexport function settleGaslessDepositExistingAccountMutationOptions(config: Config) {\n return {\n mutationKey: [\"settleGaslessDepositExistingAccount\"] as const,\n mutationFn: (\n variables: SettleGaslessDepositExistingAccountParameters,\n ): Promise<SettleGaslessDepositExistingAccountReturnType> => settleGaslessDepositExistingAccount(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAAmD,GAAgB;CACjF,OAAO;EACL,aAAa,CAAC,qCAAqC;EACnD,aACE,MAC2D,EAAoC,GAAQ,CAAS;CACpH;AACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { GaslessDepositSubmitReceipt } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Parameters for {@link settleGaslessDepositExistingAccount}.
|
|
7
|
+
*/
|
|
8
|
+
export type SettleGaslessDepositExistingAccountParameters = Compute<ChainIdParameter & {
|
|
9
|
+
/**
|
|
10
|
+
* Owner of the GaslessWallet whose deposit address is being settled — an
|
|
11
|
+
* owner address, never a GaslessWallet address.
|
|
12
|
+
*/
|
|
13
|
+
owner: Address;
|
|
14
|
+
/**
|
|
15
|
+
* Which of the owner's GaslessWallets to sweep. Defaults to `0n`, the
|
|
16
|
+
* original wallet. Each id has its own deposit address and balance.
|
|
17
|
+
*/
|
|
18
|
+
walletId?: bigint;
|
|
19
|
+
/** The existing wallet-owned sub-account to credit; the gateway verifies ownership. */
|
|
20
|
+
subAccount: Address;
|
|
21
|
+
/**
|
|
22
|
+
* Stable retry key; defaults to a random UUID.
|
|
23
|
+
*
|
|
24
|
+
* **One key per settlement attempt.** Reuse it only to replay a submit
|
|
25
|
+
* whose response was lost — the service then returns the existing record.
|
|
26
|
+
* A **completed** settlement's key must never be reused: mint a fresh one
|
|
27
|
+
* after any terminal status, and after any change to the wallet selection,
|
|
28
|
+
* or the service answers `409 IDEMPOTENCY_KEY_CONFLICT`
|
|
29
|
+
* (`isGaslessIdempotencyConflictError`).
|
|
30
|
+
*/
|
|
31
|
+
idempotencyKey?: string;
|
|
32
|
+
}>;
|
|
33
|
+
/** Return type of {@link settleGaslessDepositExistingAccount}. */
|
|
34
|
+
export type SettleGaslessDepositExistingAccountReturnType = GaslessDepositSubmitReceipt;
|
|
35
|
+
/**
|
|
36
|
+
* Queue the sweep of an owner's deposit address into an **existing**
|
|
37
|
+
* wallet-owned sub-account (a gasless top-up).
|
|
38
|
+
*
|
|
39
|
+
* Same lifecycle as the new-account settlement: the entire observed balance of
|
|
40
|
+
* the selected wallet settles, the flat fee is deducted, and the worker's
|
|
41
|
+
* pre-broadcast re-check can still turn an accepted settlement `rejected`. Poll
|
|
42
|
+
* with `service: "deposits"`. The wallet's deterministic address is read before
|
|
43
|
+
* the submit and checked against the acceptance.
|
|
44
|
+
*
|
|
45
|
+
* @param config - The SDK config.
|
|
46
|
+
* @param parameters - Owner, optional wallet id, target sub-account, retry key.
|
|
47
|
+
* @returns The acceptance receipt; persist `requestId`.
|
|
48
|
+
* @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.
|
|
49
|
+
* @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range.
|
|
50
|
+
* @throws {SymmApiError} `GASLESS_SETTLEMENT_SUBMIT_FAILED` on HTTP failure.
|
|
51
|
+
* @throws {SymmApiError} `GASLESS_SUBMIT_UNCONFIRMED` when the outcome could not be
|
|
52
|
+
* established; `responseData` is the replayable submit, for `resubmitGaslessRequest`.
|
|
53
|
+
* @throws {SymmApiError} `GASLESS_DEPOSIT_WALLET_MISMATCH` when the acceptance names
|
|
54
|
+
* another wallet or deposit address, with the parsed receipt as `responseData`.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const receipt = await settleGaslessDepositExistingAccount(config, {
|
|
59
|
+
* owner,
|
|
60
|
+
* walletId: 1n,
|
|
61
|
+
* subAccount,
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function settleGaslessDepositExistingAccount(config: Config, parameters: SettleGaslessDepositExistingAccountParameters): Promise<SettleGaslessDepositExistingAccountReturnType>;
|
|
66
|
+
//# sourceMappingURL=settle-gasless-deposit-existing-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settle-gasless-deposit-existing-account.d.ts","sourceRoot":"","sources":["../../../src/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAI/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAO5D;;GAEG;AACH,MAAM,MAAM,6CAA6C,GAAG,OAAO,CACjE,gBAAgB,GAAG;IACjB;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CACF,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,6CAA6C,GAAG,2BAA2B,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6CAA6C,GACxD,OAAO,CAAC,6CAA6C,CAAC,CAoCxD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { generateGaslessIdempotencyKey as e, postGaslessSubmit as t, resolveGaslessHttp as n } from "../http.js";
|
|
2
|
+
import { assertGaslessWalletId as r, toGaslessWalletIdWire as i } from "../wallet-id.js";
|
|
3
|
+
import { getGaslessWalletAddress as a } from "../get-gasless-wallet-address/get-gasless-wallet-address.js";
|
|
4
|
+
import { assertGaslessDepositWallet as o, toGaslessDepositReceipt as s } from "../to-gasless-deposit-receipt.js";
|
|
5
|
+
//#region src/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.ts
|
|
6
|
+
var c = "/deposit-settlements/existing-account";
|
|
7
|
+
async function l(l, u) {
|
|
8
|
+
let { chainId: d, owner: f, subAccount: p } = u, m = r(u.walletId ?? 0n), h = n(l, {
|
|
9
|
+
chainId: d,
|
|
10
|
+
service: "deposits"
|
|
11
|
+
}), g = u.idempotencyKey ?? e(), _ = {
|
|
12
|
+
idempotencyKey: g,
|
|
13
|
+
owner: f,
|
|
14
|
+
walletId: i(m),
|
|
15
|
+
subAccount: p
|
|
16
|
+
}, v = await a(l, {
|
|
17
|
+
chainId: d,
|
|
18
|
+
owner: f,
|
|
19
|
+
walletId: m
|
|
20
|
+
}), y = s(await t(h, c, _, g), {
|
|
21
|
+
owner: f,
|
|
22
|
+
walletId: m,
|
|
23
|
+
idempotencyKey: g,
|
|
24
|
+
protocolInstance: h.protocolInstance
|
|
25
|
+
});
|
|
26
|
+
return o(y, {
|
|
27
|
+
walletId: m,
|
|
28
|
+
depositAddress: v,
|
|
29
|
+
url: h.baseURL,
|
|
30
|
+
path: c
|
|
31
|
+
}), y;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { l as settleGaslessDepositExistingAccount };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=settle-gasless-deposit-existing-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settle-gasless-deposit-existing-account.js","names":[],"sources":["../../../src/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { getGaslessWalletAddress } from \"../get-gasless-wallet-address/get-gasless-wallet-address\";\nimport { generateGaslessIdempotencyKey, postGaslessSubmit, resolveGaslessHttp } from \"../http\";\nimport { assertGaslessDepositWallet, toGaslessDepositReceipt } from \"../to-gasless-deposit-receipt\";\nimport type { GaslessDepositSubmitReceipt } from \"../types\";\nimport { assertGaslessWalletId, toGaslessWalletIdWire } from \"../wallet-id\";\nimport type { GaslessWireDepositAccepted, GaslessWireExistingAccountSettlementRequest } from \"../wire-types\";\n\n/** Path the existing-account settlement submits to, under the deposits service base. */\nconst SETTLE_EXISTING_ACCOUNT_PATH = \"/deposit-settlements/existing-account\";\n\n/**\n * Parameters for {@link settleGaslessDepositExistingAccount}.\n */\nexport type SettleGaslessDepositExistingAccountParameters = Compute<\n ChainIdParameter & {\n /**\n * Owner of the GaslessWallet whose deposit address is being settled — an\n * owner address, never a GaslessWallet address.\n */\n owner: Address;\n /**\n * Which of the owner's GaslessWallets to sweep. Defaults to `0n`, the\n * original wallet. Each id has its own deposit address and balance.\n */\n walletId?: bigint;\n /** The existing wallet-owned sub-account to credit; the gateway verifies ownership. */\n subAccount: Address;\n /**\n * Stable retry key; defaults to a random UUID.\n *\n * **One key per settlement attempt.** Reuse it only to replay a submit\n * whose response was lost — the service then returns the existing record.\n * A **completed** settlement's key must never be reused: mint a fresh one\n * after any terminal status, and after any change to the wallet selection,\n * or the service answers `409 IDEMPOTENCY_KEY_CONFLICT`\n * (`isGaslessIdempotencyConflictError`).\n */\n idempotencyKey?: string;\n }\n>;\n\n/** Return type of {@link settleGaslessDepositExistingAccount}. */\nexport type SettleGaslessDepositExistingAccountReturnType = GaslessDepositSubmitReceipt;\n\n/**\n * Queue the sweep of an owner's deposit address into an **existing**\n * wallet-owned sub-account (a gasless top-up).\n *\n * Same lifecycle as the new-account settlement: the entire observed balance of\n * the selected wallet settles, the flat fee is deducted, and the worker's\n * pre-broadcast re-check can still turn an accepted settlement `rejected`. Poll\n * with `service: \"deposits\"`. The wallet's deterministic address is read before\n * the submit and checked against the acceptance.\n *\n * @param config - The SDK config.\n * @param parameters - Owner, optional wallet id, target sub-account, retry key.\n * @returns The acceptance receipt; persist `requestId`.\n * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.\n * @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range.\n * @throws {SymmApiError} `GASLESS_SETTLEMENT_SUBMIT_FAILED` on HTTP failure.\n * @throws {SymmApiError} `GASLESS_SUBMIT_UNCONFIRMED` when the outcome could not be\n * established; `responseData` is the replayable submit, for `resubmitGaslessRequest`.\n * @throws {SymmApiError} `GASLESS_DEPOSIT_WALLET_MISMATCH` when the acceptance names\n * another wallet or deposit address, with the parsed receipt as `responseData`.\n *\n * @example\n * ```ts\n * const receipt = await settleGaslessDepositExistingAccount(config, {\n * owner,\n * walletId: 1n,\n * subAccount,\n * });\n * ```\n */\nexport async function settleGaslessDepositExistingAccount(\n config: Config,\n parameters: SettleGaslessDepositExistingAccountParameters,\n): Promise<SettleGaslessDepositExistingAccountReturnType> {\n const { chainId, owner, subAccount } = parameters;\n const walletId = assertGaslessWalletId(parameters.walletId ?? 0n);\n const context = resolveGaslessHttp(config, { chainId, service: \"deposits\" });\n const idempotencyKey = parameters.idempotencyKey ?? generateGaslessIdempotencyKey();\n\n const body: GaslessWireExistingAccountSettlementRequest = {\n idempotencyKey,\n owner,\n walletId: toGaslessWalletIdWire(walletId),\n subAccount,\n };\n\n /** Read before the submit: the acceptance is verified against it, and a failed read must not follow a 202. */\n const depositAddress = await getGaslessWalletAddress(config, { chainId, owner, walletId });\n\n const raw = await postGaslessSubmit<GaslessWireDepositAccepted>(\n context,\n SETTLE_EXISTING_ACCOUNT_PATH,\n body,\n idempotencyKey,\n );\n\n const receipt = toGaslessDepositReceipt(raw, {\n owner,\n walletId,\n idempotencyKey,\n protocolInstance: context.protocolInstance,\n });\n assertGaslessDepositWallet(receipt, {\n walletId,\n depositAddress,\n url: context.baseURL,\n path: SETTLE_EXISTING_ACCOUNT_PATH,\n });\n return receipt;\n}\n"],"mappings":";;;;;AAWA,IAAM,IAA+B;AAkErC,eAAsB,EACpB,GACA,GACwD;CACxD,IAAM,EAAE,YAAS,UAAO,kBAAe,GACjC,IAAW,EAAsB,EAAW,YAAY,EAAE,GAC1D,IAAU,EAAmB,GAAQ;EAAE;EAAS,SAAS;CAAW,CAAC,GACrE,IAAiB,EAAW,kBAAkB,EAA8B,GAE5E,IAAoD;EACxD;EACA;EACA,UAAU,EAAsB,CAAQ;EACxC;CACF,GAGM,IAAiB,MAAM,EAAwB,GAAQ;EAAE;EAAS;EAAO;CAAS,CAAC,GASnF,IAAU,EAAwB,MAPtB,EAChB,GACA,GACA,GACA,CACF,GAE6C;EAC3C;EACA;EACA;EACA,kBAAkB,EAAQ;CAC5B,CAAC;CAOD,OANA,EAA2B,GAAS;EAClC;EACA;EACA,KAAK,EAAQ;EACb,MAAM;CACR,CAAC,GACM;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/settle-gasless-deposit-new-account/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { SettleGaslessDepositNewAccountParameters, SettleGaslessDepositNewAccountReturnType } from './settle-gasless-deposit-new-account.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build TanStack Mutation options for {@link settleGaslessDepositNewAccount}.
|
|
5
|
+
*
|
|
6
|
+
* @param config - The SDK config.
|
|
7
|
+
* @returns Options to pass to `useMutation`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* useMutation(settleGaslessDepositNewAccountMutationOptions(config));
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function settleGaslessDepositNewAccountMutationOptions(config: Config): {
|
|
15
|
+
mutationKey: readonly ["settleGaslessDepositNewAccount"];
|
|
16
|
+
mutationFn: (variables: SettleGaslessDepositNewAccountParameters) => Promise<SettleGaslessDepositNewAccountReturnType>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/gasless/settle-gasless-deposit-new-account/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,wCAAwC,EAC7C,KAAK,wCAAwC,EAC9C,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,6CAA6C,CAAC,MAAM,EAAE,MAAM;;4BAI3D,wCAAwC,KAClD,OAAO,CAAC,wCAAwC,CAAC;EAEvD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { settleGaslessDepositNewAccount as e } from "./settle-gasless-deposit-new-account.js";
|
|
2
|
+
//#region src/gasless/settle-gasless-deposit-new-account/query.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return {
|
|
5
|
+
mutationKey: ["settleGaslessDepositNewAccount"],
|
|
6
|
+
mutationFn: (n) => e(t, n)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as settleGaslessDepositNewAccountMutationOptions };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/gasless/settle-gasless-deposit-new-account/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport {\n settleGaslessDepositNewAccount,\n type SettleGaslessDepositNewAccountParameters,\n type SettleGaslessDepositNewAccountReturnType,\n} from \"./settle-gasless-deposit-new-account\";\n\n/**\n * Build TanStack Mutation options for {@link settleGaslessDepositNewAccount}.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(settleGaslessDepositNewAccountMutationOptions(config));\n * ```\n */\nexport function settleGaslessDepositNewAccountMutationOptions(config: Config) {\n return {\n mutationKey: [\"settleGaslessDepositNewAccount\"] as const,\n mutationFn: (\n variables: SettleGaslessDepositNewAccountParameters,\n ): Promise<SettleGaslessDepositNewAccountReturnType> => settleGaslessDepositNewAccount(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAA8C,GAAgB;CAC5E,OAAO;EACL,aAAa,CAAC,gCAAgC;EAC9C,aACE,MACsD,EAA+B,GAAQ,CAAS;CAC1G;AACF"}
|
package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { SubAccountIsolationType } from '../../symmio-contracts/account-layer/types.js';
|
|
5
|
+
import { GaslessDepositSubmitReceipt } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creation data for the sub-account a new-account settlement creates.
|
|
8
|
+
*
|
|
9
|
+
* `isolationType` and `singleVAMode` are deliberately **required**: they are
|
|
10
|
+
* product decisions (the lowcap flow uses `MARKET_DIRECTION` with
|
|
11
|
+
* `singleVAMode: true`; majors differ), and the service-side defaults would be
|
|
12
|
+
* silently wrong for either product. There is no `symmioCore` field — the
|
|
13
|
+
* gateway overwrites it with its configured core.
|
|
14
|
+
*/
|
|
15
|
+
export interface GaslessDepositAccountData {
|
|
16
|
+
/** Sub-account name, 1–64 characters. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Sub-account isolation strategy — a product decision, choose explicitly. */
|
|
19
|
+
isolationType: SubAccountIsolationType;
|
|
20
|
+
/** Whether the account runs in single-VA mode — a product decision, choose explicitly. */
|
|
21
|
+
singleVAMode: boolean;
|
|
22
|
+
/** Optional hex metadata (affiliate hooks may expect a specific encoding). Defaults to `0x`. */
|
|
23
|
+
metadata?: Hex;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parameters for {@link settleGaslessDepositNewAccount}.
|
|
27
|
+
*/
|
|
28
|
+
export type SettleGaslessDepositNewAccountParameters = Compute<ChainIdParameter & {
|
|
29
|
+
/**
|
|
30
|
+
* Owner of the GaslessWallet whose deposit address is being settled — an
|
|
31
|
+
* owner address, never a GaslessWallet address. The new sub-account is
|
|
32
|
+
* created for this owner.
|
|
33
|
+
*/
|
|
34
|
+
owner: Address;
|
|
35
|
+
/**
|
|
36
|
+
* Which of the owner's GaslessWallets to sweep. Defaults to `0n`, the
|
|
37
|
+
* original wallet. Each id has its own deposit address and its own balance:
|
|
38
|
+
* settle the id you funded, and read that id's address with
|
|
39
|
+
* `getGaslessWalletAddress` before sending anything to it.
|
|
40
|
+
*/
|
|
41
|
+
walletId?: bigint;
|
|
42
|
+
/** Affiliate passed to `settleDepositToNewAccount`; the zero address disables attribution. */
|
|
43
|
+
affiliate: Address;
|
|
44
|
+
/** Creation data for the new wallet-owned sub-account. */
|
|
45
|
+
accountData: GaslessDepositAccountData;
|
|
46
|
+
/**
|
|
47
|
+
* Stable retry key; defaults to a random UUID.
|
|
48
|
+
*
|
|
49
|
+
* **One key per settlement attempt.** Reuse it only to replay a submit
|
|
50
|
+
* whose response was lost — the service then returns the existing record.
|
|
51
|
+
* A **completed** settlement's key must never be reused: mint a fresh one
|
|
52
|
+
* after any terminal status, and after any change to the wallet selection,
|
|
53
|
+
* or the service answers `409 IDEMPOTENCY_KEY_CONFLICT`
|
|
54
|
+
* (`isGaslessIdempotencyConflictError`).
|
|
55
|
+
*/
|
|
56
|
+
idempotencyKey?: string;
|
|
57
|
+
/** Non-secret client correlation data stored with the request. */
|
|
58
|
+
metadata?: Record<string, unknown>;
|
|
59
|
+
}>;
|
|
60
|
+
/** Return type of {@link settleGaslessDepositNewAccount}. */
|
|
61
|
+
export type SettleGaslessDepositNewAccountReturnType = GaslessDepositSubmitReceipt;
|
|
62
|
+
/**
|
|
63
|
+
* Queue the sweep of an owner's deposit address into a **new** wallet-owned
|
|
64
|
+
* sub-account.
|
|
65
|
+
*
|
|
66
|
+
* The gateway settles the **entire observed collateral balance** at the
|
|
67
|
+
* selected wallet's deposit address, deducts the flat fee, creates the
|
|
68
|
+
* sub-account, and credits the net amount — paying all gas itself. The worker
|
|
69
|
+
* re-checks balance, fee, and minimum before broadcast, so an accepted
|
|
70
|
+
* settlement can still turn `rejected` (funds not yet visible, or moved). Poll
|
|
71
|
+
* with `service: "deposits"`. A `succeeded` settlement is not instantly
|
|
72
|
+
* readable — wait until the sub-account and its balance appear on-chain before
|
|
73
|
+
* flipping the UI.
|
|
74
|
+
*
|
|
75
|
+
* The wallet's deterministic address is read **before** the submit and checked
|
|
76
|
+
* against the acceptance, so a settlement that would sweep a different wallet
|
|
77
|
+
* than the one you funded surfaces as an error instead of moving funds
|
|
78
|
+
* silently. A sweep takes the whole balance of the selected id, so give a
|
|
79
|
+
* deposit flow its own id when it must not share a balance with another flow.
|
|
80
|
+
*
|
|
81
|
+
* @param config - The SDK config.
|
|
82
|
+
* @param parameters - Owner, optional wallet id, affiliate, account creation data, retry key.
|
|
83
|
+
* @returns The acceptance receipt (with the observed/credited estimates); persist `requestId`.
|
|
84
|
+
* @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.
|
|
85
|
+
* @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range.
|
|
86
|
+
* @throws {SymmApiError} `GASLESS_SETTLEMENT_SUBMIT_FAILED` on HTTP failure —
|
|
87
|
+
* `DEPOSIT_BELOW_MINIMUM` in the vendor detail means the address is not
|
|
88
|
+
* funded to the settlement minimum yet.
|
|
89
|
+
* @throws {SymmApiError} `GASLESS_SUBMIT_UNCONFIRMED` when the outcome could not be
|
|
90
|
+
* established; `responseData` is the replayable submit, for `resubmitGaslessRequest`.
|
|
91
|
+
* @throws {SymmApiError} `GASLESS_DEPOSIT_WALLET_MISMATCH` when the acceptance names
|
|
92
|
+
* another wallet or deposit address. The request is already accepted, so the
|
|
93
|
+
* error carries the parsed receipt (with its `requestId`) as `responseData`.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const receipt = await settleGaslessDepositNewAccount(config, {
|
|
98
|
+
* owner,
|
|
99
|
+
* walletId: 1n,
|
|
100
|
+
* affiliate: zeroAddress,
|
|
101
|
+
* accountData: { name: "Main", isolationType: SubAccountIsolationType.MARKET_DIRECTION, singleVAMode: true },
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare function settleGaslessDepositNewAccount(config: Config, parameters: SettleGaslessDepositNewAccountParameters): Promise<SettleGaslessDepositNewAccountReturnType>;
|
|
106
|
+
//# sourceMappingURL=settle-gasless-deposit-new-account.d.ts.map
|
package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settle-gasless-deposit-new-account.d.ts","sourceRoot":"","sources":["../../../src/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAI1F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAO5D;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB;IACxC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,aAAa,EAAE,uBAAuB,CAAC;IACvC,0FAA0F;IAC1F,YAAY,EAAE,OAAO,CAAC;IACtB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAAG,OAAO,CAC5D,gBAAgB,GAAG;IACjB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,SAAS,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,WAAW,EAAE,yBAAyB,CAAC;IACvC;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CACF,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,wCAAwC,GAAG,2BAA2B,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,wCAAwC,GACnD,OAAO,CAAC,wCAAwC,CAAC,CA2CnD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { generateGaslessIdempotencyKey as e, postGaslessSubmit as t, resolveGaslessHttp as n } from "../http.js";
|
|
2
|
+
import { assertGaslessWalletId as r, toGaslessWalletIdWire as i } from "../wallet-id.js";
|
|
3
|
+
import { getGaslessWalletAddress as a } from "../get-gasless-wallet-address/get-gasless-wallet-address.js";
|
|
4
|
+
import { assertGaslessDepositWallet as o, toGaslessDepositReceipt as s } from "../to-gasless-deposit-receipt.js";
|
|
5
|
+
//#region src/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.ts
|
|
6
|
+
var c = "/deposit-settlements/new-account";
|
|
7
|
+
async function l(l, u) {
|
|
8
|
+
let { chainId: d, owner: f, affiliate: p, accountData: m, metadata: h } = u, g = r(u.walletId ?? 0n), _ = n(l, {
|
|
9
|
+
chainId: d,
|
|
10
|
+
service: "deposits"
|
|
11
|
+
}), v = u.idempotencyKey ?? e(), y = {
|
|
12
|
+
idempotencyKey: v,
|
|
13
|
+
owner: f,
|
|
14
|
+
walletId: i(g),
|
|
15
|
+
affiliate: p,
|
|
16
|
+
accountData: {
|
|
17
|
+
name: m.name,
|
|
18
|
+
metadata: m.metadata ?? "0x",
|
|
19
|
+
isolationType: m.isolationType,
|
|
20
|
+
singleVAMode: m.singleVAMode
|
|
21
|
+
},
|
|
22
|
+
...h === void 0 ? {} : { metadata: h }
|
|
23
|
+
}, b = await a(l, {
|
|
24
|
+
chainId: d,
|
|
25
|
+
owner: f,
|
|
26
|
+
walletId: g
|
|
27
|
+
}), x = s(await t(_, c, y, v), {
|
|
28
|
+
owner: f,
|
|
29
|
+
walletId: g,
|
|
30
|
+
idempotencyKey: v,
|
|
31
|
+
protocolInstance: _.protocolInstance
|
|
32
|
+
});
|
|
33
|
+
return o(x, {
|
|
34
|
+
walletId: g,
|
|
35
|
+
depositAddress: b,
|
|
36
|
+
url: _.baseURL,
|
|
37
|
+
path: c
|
|
38
|
+
}), x;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { l as settleGaslessDepositNewAccount };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=settle-gasless-deposit-new-account.js.map
|
package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settle-gasless-deposit-new-account.js","names":[],"sources":["../../../src/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport type { SubAccountIsolationType } from \"../../symmio-contracts/account-layer/types\";\nimport { getGaslessWalletAddress } from \"../get-gasless-wallet-address/get-gasless-wallet-address\";\nimport { generateGaslessIdempotencyKey, postGaslessSubmit, resolveGaslessHttp } from \"../http\";\nimport { assertGaslessDepositWallet, toGaslessDepositReceipt } from \"../to-gasless-deposit-receipt\";\nimport type { GaslessDepositSubmitReceipt } from \"../types\";\nimport { assertGaslessWalletId, toGaslessWalletIdWire } from \"../wallet-id\";\nimport type { GaslessWireDepositAccepted, GaslessWireNewAccountSettlementRequest } from \"../wire-types\";\n\n/** Path the new-account settlement submits to, under the deposits service base. */\nconst SETTLE_NEW_ACCOUNT_PATH = \"/deposit-settlements/new-account\";\n\n/**\n * Creation data for the sub-account a new-account settlement creates.\n *\n * `isolationType` and `singleVAMode` are deliberately **required**: they are\n * product decisions (the lowcap flow uses `MARKET_DIRECTION` with\n * `singleVAMode: true`; majors differ), and the service-side defaults would be\n * silently wrong for either product. There is no `symmioCore` field — the\n * gateway overwrites it with its configured core.\n */\nexport interface GaslessDepositAccountData {\n /** Sub-account name, 1–64 characters. */\n name: string;\n /** Sub-account isolation strategy — a product decision, choose explicitly. */\n isolationType: SubAccountIsolationType;\n /** Whether the account runs in single-VA mode — a product decision, choose explicitly. */\n singleVAMode: boolean;\n /** Optional hex metadata (affiliate hooks may expect a specific encoding). Defaults to `0x`. */\n metadata?: Hex;\n}\n\n/**\n * Parameters for {@link settleGaslessDepositNewAccount}.\n */\nexport type SettleGaslessDepositNewAccountParameters = Compute<\n ChainIdParameter & {\n /**\n * Owner of the GaslessWallet whose deposit address is being settled — an\n * owner address, never a GaslessWallet address. The new sub-account is\n * created for this owner.\n */\n owner: Address;\n /**\n * Which of the owner's GaslessWallets to sweep. Defaults to `0n`, the\n * original wallet. Each id has its own deposit address and its own balance:\n * settle the id you funded, and read that id's address with\n * `getGaslessWalletAddress` before sending anything to it.\n */\n walletId?: bigint;\n /** Affiliate passed to `settleDepositToNewAccount`; the zero address disables attribution. */\n affiliate: Address;\n /** Creation data for the new wallet-owned sub-account. */\n accountData: GaslessDepositAccountData;\n /**\n * Stable retry key; defaults to a random UUID.\n *\n * **One key per settlement attempt.** Reuse it only to replay a submit\n * whose response was lost — the service then returns the existing record.\n * A **completed** settlement's key must never be reused: mint a fresh one\n * after any terminal status, and after any change to the wallet selection,\n * or the service answers `409 IDEMPOTENCY_KEY_CONFLICT`\n * (`isGaslessIdempotencyConflictError`).\n */\n idempotencyKey?: string;\n /** Non-secret client correlation data stored with the request. */\n metadata?: Record<string, unknown>;\n }\n>;\n\n/** Return type of {@link settleGaslessDepositNewAccount}. */\nexport type SettleGaslessDepositNewAccountReturnType = GaslessDepositSubmitReceipt;\n\n/**\n * Queue the sweep of an owner's deposit address into a **new** wallet-owned\n * sub-account.\n *\n * The gateway settles the **entire observed collateral balance** at the\n * selected wallet's deposit address, deducts the flat fee, creates the\n * sub-account, and credits the net amount — paying all gas itself. The worker\n * re-checks balance, fee, and minimum before broadcast, so an accepted\n * settlement can still turn `rejected` (funds not yet visible, or moved). Poll\n * with `service: \"deposits\"`. A `succeeded` settlement is not instantly\n * readable — wait until the sub-account and its balance appear on-chain before\n * flipping the UI.\n *\n * The wallet's deterministic address is read **before** the submit and checked\n * against the acceptance, so a settlement that would sweep a different wallet\n * than the one you funded surfaces as an error instead of moving funds\n * silently. A sweep takes the whole balance of the selected id, so give a\n * deposit flow its own id when it must not share a balance with another flow.\n *\n * @param config - The SDK config.\n * @param parameters - Owner, optional wallet id, affiliate, account creation data, retry key.\n * @returns The acceptance receipt (with the observed/credited estimates); persist `requestId`.\n * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.\n * @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range.\n * @throws {SymmApiError} `GASLESS_SETTLEMENT_SUBMIT_FAILED` on HTTP failure —\n * `DEPOSIT_BELOW_MINIMUM` in the vendor detail means the address is not\n * funded to the settlement minimum yet.\n * @throws {SymmApiError} `GASLESS_SUBMIT_UNCONFIRMED` when the outcome could not be\n * established; `responseData` is the replayable submit, for `resubmitGaslessRequest`.\n * @throws {SymmApiError} `GASLESS_DEPOSIT_WALLET_MISMATCH` when the acceptance names\n * another wallet or deposit address. The request is already accepted, so the\n * error carries the parsed receipt (with its `requestId`) as `responseData`.\n *\n * @example\n * ```ts\n * const receipt = await settleGaslessDepositNewAccount(config, {\n * owner,\n * walletId: 1n,\n * affiliate: zeroAddress,\n * accountData: { name: \"Main\", isolationType: SubAccountIsolationType.MARKET_DIRECTION, singleVAMode: true },\n * });\n * ```\n */\nexport async function settleGaslessDepositNewAccount(\n config: Config,\n parameters: SettleGaslessDepositNewAccountParameters,\n): Promise<SettleGaslessDepositNewAccountReturnType> {\n const { chainId, owner, affiliate, accountData, metadata } = parameters;\n const walletId = assertGaslessWalletId(parameters.walletId ?? 0n);\n const context = resolveGaslessHttp(config, { chainId, service: \"deposits\" });\n const idempotencyKey = parameters.idempotencyKey ?? generateGaslessIdempotencyKey();\n\n const body: GaslessWireNewAccountSettlementRequest = {\n idempotencyKey,\n owner,\n walletId: toGaslessWalletIdWire(walletId),\n affiliate,\n accountData: {\n name: accountData.name,\n metadata: accountData.metadata ?? \"0x\",\n isolationType: accountData.isolationType,\n singleVAMode: accountData.singleVAMode,\n },\n ...(metadata !== undefined ? { metadata } : {}),\n };\n\n /** Read before the submit: the acceptance is verified against it, and a failed read must not follow a 202. */\n const depositAddress = await getGaslessWalletAddress(config, { chainId, owner, walletId });\n\n const raw = await postGaslessSubmit<GaslessWireDepositAccepted>(\n context,\n SETTLE_NEW_ACCOUNT_PATH,\n body,\n idempotencyKey,\n );\n\n const receipt = toGaslessDepositReceipt(raw, {\n owner,\n walletId,\n idempotencyKey,\n protocolInstance: context.protocolInstance,\n });\n assertGaslessDepositWallet(receipt, {\n walletId,\n depositAddress,\n url: context.baseURL,\n path: SETTLE_NEW_ACCOUNT_PATH,\n });\n return receipt;\n}\n"],"mappings":";;;;;AAYA,IAAM,IAA0B;AA0GhC,eAAsB,EACpB,GACA,GACmD;CACnD,IAAM,EAAE,YAAS,UAAO,cAAW,gBAAa,gBAAa,GACvD,IAAW,EAAsB,EAAW,YAAY,EAAE,GAC1D,IAAU,EAAmB,GAAQ;EAAE;EAAS,SAAS;CAAW,CAAC,GACrE,IAAiB,EAAW,kBAAkB,EAA8B,GAE5E,IAA+C;EACnD;EACA;EACA,UAAU,EAAsB,CAAQ;EACxC;EACA,aAAa;GACX,MAAM,EAAY;GAClB,UAAU,EAAY,YAAY;GAClC,eAAe,EAAY;GAC3B,cAAc,EAAY;EAC5B;EACA,GAAI,MAAa,KAAA,IAA2B,CAAC,IAAhB,EAAE,YAAS;CAC1C,GAGM,IAAiB,MAAM,EAAwB,GAAQ;EAAE;EAAS;EAAO;CAAS,CAAC,GASnF,IAAU,EAAwB,MAPtB,EAChB,GACA,GACA,GACA,CACF,GAE6C;EAC3C;EACA;EACA;EACA,kBAAkB,EAAQ;CAC5B,CAAC;CAOD,OANA,EAA2B,GAAS;EAClC;EACA;EACA,KAAK,EAAQ;EACb,MAAM;CACR,CAAC,GACM;AACT"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Config } from '../core/config/index.js';
|
|
2
|
+
import { GaslessHttpContext } from './http.js';
|
|
3
|
+
/**
|
|
4
|
+
* Sustained status GETs per second, per deployment.
|
|
5
|
+
*
|
|
6
|
+
* The anonymous gateway allows 10 requests/s per IP and protocol instance, and
|
|
7
|
+
* status polling is the one gasless call that runs unattended and in parallel —
|
|
8
|
+
* one loop per in-flight workflow, plus every mounted `useGaslessRequest`. This
|
|
9
|
+
* keeps the whole page's polling inside a predictable share of that budget so a
|
|
10
|
+
* submit, a fee quote or a deposit-policy read is never the call that earns the
|
|
11
|
+
* `429`.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare const GASLESS_STATUS_READ_RATE_PER_SECOND = 4;
|
|
16
|
+
/**
|
|
17
|
+
* How many status reads may start back-to-back after an idle period. Matching
|
|
18
|
+
* the rate keeps a freshly opened page responsive — four workflows resolve
|
|
19
|
+
* their first poll immediately — without letting a burst outrun the sustained
|
|
20
|
+
* rate afterwards.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare const GASLESS_STATUS_READ_BURST = 4;
|
|
25
|
+
/**
|
|
26
|
+
* Wait for this deployment's next status-read slot.
|
|
27
|
+
*
|
|
28
|
+
* Paces status GETs at {@link GASLESS_STATUS_READ_RATE_PER_SECOND} per second
|
|
29
|
+
* with a {@link GASLESS_STATUS_READ_BURST} burst, per `(config, origin +
|
|
30
|
+
* protocol instance)`. It only ever delays a read — it never drops one, and a
|
|
31
|
+
* caller that aborts releases nothing, because a slot that was never used stays
|
|
32
|
+
* in the past and is handed to the next caller immediately.
|
|
33
|
+
*
|
|
34
|
+
* @param config - The SDK config the read runs under.
|
|
35
|
+
* @param context - The resolved HTTP context (its origin and instance pick the bucket).
|
|
36
|
+
* @param options - Abort signal for the wait.
|
|
37
|
+
* @throws {SymmError} `GASLESS_WAIT_ABORTED` when `options.signal` aborts while queued.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function acquireGaslessStatusRead(config: Config, context: GaslessHttpContext, options?: {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
//# sourceMappingURL=status-read-limiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-read-limiter.d.ts","sourceRoot":"","sources":["../../src/gasless/status-read-limiter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AA6C3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACrC,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { gaslessAbortedError as e, gaslessSleep as t } from "./abortable-sleep.js";
|
|
2
|
+
var n = 1e3 / 4, r = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function i(e) {
|
|
4
|
+
let t;
|
|
5
|
+
try {
|
|
6
|
+
t = new URL(e.baseURL).origin;
|
|
7
|
+
} catch {
|
|
8
|
+
t = e.baseURL;
|
|
9
|
+
}
|
|
10
|
+
return `${t}|${e.protocolInstance ?? ""}`;
|
|
11
|
+
}
|
|
12
|
+
function a(e, t) {
|
|
13
|
+
let n = r.get(e);
|
|
14
|
+
n || (n = /* @__PURE__ */ new Map(), r.set(e, n));
|
|
15
|
+
let i = n.get(t);
|
|
16
|
+
return i || (i = { nextStartAt: 0 }, n.set(t, i)), i;
|
|
17
|
+
}
|
|
18
|
+
async function o(r, o, s = {}) {
|
|
19
|
+
if (s.signal?.aborted) throw e("the status read");
|
|
20
|
+
let c = a(r, i(o)), l = Date.now(), u = l - 3 * n, d = Math.max(c.nextStartAt, u);
|
|
21
|
+
c.nextStartAt = d + n;
|
|
22
|
+
let f = d - l;
|
|
23
|
+
f <= 0 || await t(f, s.signal, "the status read");
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { o as acquireGaslessStatusRead };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=status-read-limiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-read-limiter.js","names":[],"sources":["../../src/gasless/status-read-limiter.ts"],"sourcesContent":["import type { Config } from \"../core/config\";\nimport { gaslessAbortedError, gaslessSleep } from \"./abortable-sleep\";\nimport type { GaslessHttpContext } from \"./http\";\n\n/**\n * Sustained status GETs per second, per deployment.\n *\n * The anonymous gateway allows 10 requests/s per IP and protocol instance, and\n * status polling is the one gasless call that runs unattended and in parallel —\n * one loop per in-flight workflow, plus every mounted `useGaslessRequest`. This\n * keeps the whole page's polling inside a predictable share of that budget so a\n * submit, a fee quote or a deposit-policy read is never the call that earns the\n * `429`.\n *\n * @internal\n */\nexport const GASLESS_STATUS_READ_RATE_PER_SECOND = 4;\n\n/**\n * How many status reads may start back-to-back after an idle period. Matching\n * the rate keeps a freshly opened page responsive — four workflows resolve\n * their first poll immediately — without letting a burst outrun the sustained\n * rate afterwards.\n *\n * @internal\n */\nexport const GASLESS_STATUS_READ_BURST = 4;\n\n/** Minimum spacing between two sustained reads, in ms. */\nconst MIN_SPACING_MS = 1_000 / GASLESS_STATUS_READ_RATE_PER_SECOND;\n\n/**\n * One deployment's schedule: the earliest time the next read may start. A read\n * reserves its slot by moving the mark forward, so concurrent callers queue in\n * arrival order instead of racing for the same instant.\n */\ninterface ReadSchedule {\n nextStartAt: number;\n}\n\nconst schedules = new WeakMap<Config, Map<string, ReadSchedule>>();\n\n/**\n * The bucket a context shares its budget with: the gateway limits per IP and\n * protocol instance, so both services of one deployment draw from one bucket\n * while a second deployment (a different origin or instance) gets its own.\n */\nfunction scheduleKey(context: GaslessHttpContext): string {\n let origin: string;\n try {\n origin = new URL(context.baseURL).origin;\n } catch {\n origin = context.baseURL;\n }\n return `${origin}|${context.protocolInstance ?? \"\"}`;\n}\n\nfunction getSchedule(config: Config, key: string): ReadSchedule {\n let byDeployment = schedules.get(config);\n if (!byDeployment) {\n byDeployment = new Map();\n schedules.set(config, byDeployment);\n }\n let schedule = byDeployment.get(key);\n if (!schedule) {\n schedule = { nextStartAt: 0 };\n byDeployment.set(key, schedule);\n }\n return schedule;\n}\n\n/**\n * Wait for this deployment's next status-read slot.\n *\n * Paces status GETs at {@link GASLESS_STATUS_READ_RATE_PER_SECOND} per second\n * with a {@link GASLESS_STATUS_READ_BURST} burst, per `(config, origin +\n * protocol instance)`. It only ever delays a read — it never drops one, and a\n * caller that aborts releases nothing, because a slot that was never used stays\n * in the past and is handed to the next caller immediately.\n *\n * @param config - The SDK config the read runs under.\n * @param context - The resolved HTTP context (its origin and instance pick the bucket).\n * @param options - Abort signal for the wait.\n * @throws {SymmError} `GASLESS_WAIT_ABORTED` when `options.signal` aborts while queued.\n *\n * @internal\n */\nexport async function acquireGaslessStatusRead(\n config: Config,\n context: GaslessHttpContext,\n options: { signal?: AbortSignal } = {},\n): Promise<void> {\n if (options.signal?.aborted) throw gaslessAbortedError(\"the status read\");\n\n const schedule = getSchedule(config, scheduleKey(context));\n const now = Date.now();\n /** An idle bucket refills up to the burst, so the mark never rewinds further than that. */\n const earliest = now - (GASLESS_STATUS_READ_BURST - 1) * MIN_SPACING_MS;\n const startAt = Math.max(schedule.nextStartAt, earliest);\n schedule.nextStartAt = startAt + MIN_SPACING_MS;\n\n const delay = startAt - now;\n if (delay <= 0) return;\n await gaslessSleep(delay, options.signal, \"the status read\");\n}\n"],"mappings":";AA6BA,IAAM,IAAiB,MAAA,GAWjB,oBAAY,IAAI,QAA2C;AAOjE,SAAS,EAAY,GAAqC;CACxD,IAAI;CACJ,IAAI;EACF,IAAS,IAAI,IAAI,EAAQ,OAAO,EAAE;CACpC,QAAQ;EACN,IAAS,EAAQ;CACnB;CACA,OAAO,GAAG,EAAO,GAAG,EAAQ,oBAAoB;AAClD;AAEA,SAAS,EAAY,GAAgB,GAA2B;CAC9D,IAAI,IAAe,EAAU,IAAI,CAAM;CACvC,AAAK,MACH,oBAAe,IAAI,IAAI,GACvB,EAAU,IAAI,GAAQ,CAAY;CAEpC,IAAI,IAAW,EAAa,IAAI,CAAG;CAKnC,OAJK,MACH,IAAW,EAAE,aAAa,EAAE,GAC5B,EAAa,IAAI,GAAK,CAAQ,IAEzB;AACT;AAkBA,eAAsB,EACpB,GACA,GACA,IAAoC,CAAC,GACtB;CACf,IAAI,EAAQ,QAAQ,SAAS,MAAM,EAAoB,iBAAiB;CAExE,IAAM,IAAW,EAAY,GAAQ,EAAY,CAAO,CAAC,GACnD,IAAM,KAAK,IAAI,GAEf,IAAW,IAAA,IAAwC,GACnD,IAAU,KAAK,IAAI,EAAS,aAAa,CAAQ;CACvD,EAAS,cAAc,IAAU;CAEjC,IAAM,IAAQ,IAAU;CACpB,KAAS,KACb,MAAM,EAAa,GAAO,EAAQ,QAAQ,iBAAiB;AAC7D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { GaslessDepositSubmitReceipt } from './types.js';
|
|
3
|
+
import { GaslessWireDepositAccepted } from './wire-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the submitter knows about a settlement the acceptance body does not
|
|
6
|
+
* echo, plus the wallet it must have settled.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export interface GaslessDepositSubmitContext {
|
|
11
|
+
/** The `owner` the settlement was submitted for. */
|
|
12
|
+
owner: Address;
|
|
13
|
+
/** The wallet id the settlement was submitted for. */
|
|
14
|
+
walletId: bigint;
|
|
15
|
+
/** The idempotency key the settlement was submitted with. */
|
|
16
|
+
idempotencyKey: string;
|
|
17
|
+
/** The protocol instance the submit was routed to, or `null` for a proxy base that names none. */
|
|
18
|
+
protocolInstance: string | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse a deposit settlement's `202` acceptance into
|
|
22
|
+
* {@link GaslessDepositSubmitReceipt}. Shared by the new-account and
|
|
23
|
+
* existing-account settlement actions.
|
|
24
|
+
*
|
|
25
|
+
* Tolerant in the same way as the operations receipt: only `request_id` is
|
|
26
|
+
* required, an unknown status reads as `queued`, unreported amounts read as
|
|
27
|
+
* `null`, and an omitted `wallet_id` means wallet `0` — the service's own
|
|
28
|
+
* default for a request that names none.
|
|
29
|
+
*
|
|
30
|
+
* @param raw - The acceptance body.
|
|
31
|
+
* @param context - What the submitter knows that the body does not echo.
|
|
32
|
+
* @returns The normalized receipt.
|
|
33
|
+
* @throws {SymmError} `GASLESS_ACCEPTANCE_INVALID` when the body carries no `request_id`.
|
|
34
|
+
* @throws {SymmError} `GASLESS_WALLET_ID_INVALID` when `wallet_id` is present but not a `uint256` decimal.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare function toGaslessDepositReceipt(raw: GaslessWireDepositAccepted, context: GaslessDepositSubmitContext): GaslessDepositSubmitReceipt;
|
|
39
|
+
/**
|
|
40
|
+
* Assert that the accepted settlement is the one that was asked for: the same
|
|
41
|
+
* wallet id, sweeping the same deposit address.
|
|
42
|
+
*
|
|
43
|
+
* The vendor requires this check (doc: "verify the returned ID and address
|
|
44
|
+
* match the wallet funded for this workflow"), because a wrong wallet sweeps a
|
|
45
|
+
* balance the user never meant to move. The request is already accepted when
|
|
46
|
+
* this runs, so the error carries the parsed receipt — the `requestId` must
|
|
47
|
+
* survive the mismatch or the workflow becomes untrackable.
|
|
48
|
+
*
|
|
49
|
+
* @param receipt - The parsed acceptance.
|
|
50
|
+
* @param expected - The wallet the settlement was submitted for, with its derived deposit address.
|
|
51
|
+
* @throws {SymmApiError} `GASLESS_DEPOSIT_WALLET_MISMATCH`, with the receipt as `responseData`.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export declare function assertGaslessDepositWallet(receipt: GaslessDepositSubmitReceipt, expected: {
|
|
56
|
+
walletId: bigint;
|
|
57
|
+
depositAddress: Address;
|
|
58
|
+
url: string;
|
|
59
|
+
path: string;
|
|
60
|
+
}): void;
|
|
61
|
+
//# sourceMappingURL=to-gasless-deposit-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-gasless-deposit-receipt.d.ts","sourceRoot":"","sources":["../../src/gasless/to-gasless-deposit-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAG3D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oDAAoD;IACpD,KAAK,EAAE,OAAO,CAAC;IACf,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,cAAc,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,0BAA0B,EAC/B,OAAO,EAAE,2BAA2B,GACnC,2BAA2B,CAa7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,EACpC,QAAQ,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjF,IAAI,CAeN"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SymmApiError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
import { parseGaslessWalletId as t } from "./wallet-id.js";
|
|
3
|
+
import { toGaslessAcceptanceStatus as n, toGaslessOptionalAmount as r } from "./wire-parse.js";
|
|
4
|
+
import { requireGaslessRequestId as i } from "./to-gasless-submit-receipt.js";
|
|
5
|
+
import { isAddress as a, isAddressEqual as o } from "viem";
|
|
6
|
+
//#region src/gasless/to-gasless-deposit-receipt.ts
|
|
7
|
+
function s(e, a) {
|
|
8
|
+
return {
|
|
9
|
+
requestId: i(e?.request_id),
|
|
10
|
+
status: n(e.status),
|
|
11
|
+
depositAddress: e.deposit_address,
|
|
12
|
+
walletId: e.wallet_id === void 0 || e.wallet_id === null ? 0n : t(e.wallet_id),
|
|
13
|
+
owner: a.owner,
|
|
14
|
+
observedAmount: r(e.observed_amount),
|
|
15
|
+
paidFee: r(e.paid_fee),
|
|
16
|
+
creditedAmount: r(e.credited_amount),
|
|
17
|
+
idempotencyKey: a.idempotencyKey,
|
|
18
|
+
protocolInstance: a.protocolInstance
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function c(t, n) {
|
|
22
|
+
let r = t.walletId === n.walletId, i = a(t.depositAddress) && o(t.depositAddress, n.depositAddress);
|
|
23
|
+
if (!(r && i)) throw new e({
|
|
24
|
+
code: "GASLESS_DEPOSIT_WALLET_MISMATCH",
|
|
25
|
+
message: `Gasless: settlement ${t.requestId} was accepted for wallet ${t.walletId} at ${t.depositAddress}, but it was submitted for wallet ${n.walletId} at ${n.depositAddress}. The request is already accepted — reconcile it by its request id before funding or settling anything else.`,
|
|
26
|
+
status: 202,
|
|
27
|
+
statusText: "Accepted",
|
|
28
|
+
responseData: t,
|
|
29
|
+
url: `${n.url}${n.path}`,
|
|
30
|
+
method: "POST"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { c as assertGaslessDepositWallet, s as toGaslessDepositReceipt };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=to-gasless-deposit-receipt.js.map
|