@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,51 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link getGaslessWalletNonce}.
|
|
6
|
+
*/
|
|
7
|
+
export type GetGaslessWalletNonceParameters = Compute<ChainIdParameter & {
|
|
8
|
+
/** The owner wallet the gasless wallet belongs to — an owner address, never a GaslessWallet address. */
|
|
9
|
+
owner: Address;
|
|
10
|
+
/**
|
|
11
|
+
* Which of the owner's GaslessWallets the operation executes from. Defaults
|
|
12
|
+
* to `0n`, the original wallet, which keeps its pre-upgrade nonce stream.
|
|
13
|
+
* Range `0n` through `2^256 - 1`.
|
|
14
|
+
*/
|
|
15
|
+
walletId?: bigint;
|
|
16
|
+
/**
|
|
17
|
+
* The signer account the nonce is keyed under — the operation's
|
|
18
|
+
* `signerAccount.addr` (the owner itself for an owner-signed call, or a
|
|
19
|
+
* sub-account for a session-key signer).
|
|
20
|
+
*/
|
|
21
|
+
account: Address;
|
|
22
|
+
}>;
|
|
23
|
+
/** Return type of {@link getGaslessWalletNonce}. */
|
|
24
|
+
export type GetGaslessWalletNonceReturnType = bigint;
|
|
25
|
+
/**
|
|
26
|
+
* Read the GaslessLayer's **wallet-operation** replay nonce —
|
|
27
|
+
* `walletOperationNonces(owner, walletId, signerAccount)`, the last nonce the
|
|
28
|
+
* selected wallet consumed for that signer account.
|
|
29
|
+
*
|
|
30
|
+
* A separate counter from the InstantLayer's operation nonces — the two are
|
|
31
|
+
* not interchangeable. Wallet-execute operations sign with `nonce + 1`, read
|
|
32
|
+
* immediately before signing. Every `(walletId, signerAccount)` pair is its own
|
|
33
|
+
* stream: wallet `0` keeps the original per-signer-account counter, and each
|
|
34
|
+
* positive id counts separately for its own wallet address, so nonces from one
|
|
35
|
+
* id never apply to another.
|
|
36
|
+
*
|
|
37
|
+
* @param config - The SDK config.
|
|
38
|
+
* @param parameters - Owner wallet, optional wallet id (default `0n`), signer account, optional chain id.
|
|
39
|
+
* @returns The current wallet-operation nonce. Sign with `nonce + 1n`.
|
|
40
|
+
* @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range
|
|
41
|
+
* (or a JavaScript `number`), before any RPC call.
|
|
42
|
+
* @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const current = await getGaslessWalletNonce(config, { owner, walletId: 2n, account: subAccount });
|
|
47
|
+
* const nextNonce = current + 1n;
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function getGaslessWalletNonce(config: Config, parameters: GetGaslessWalletNonceParameters): Promise<GetGaslessWalletNonceReturnType>;
|
|
51
|
+
//# sourceMappingURL=get-gasless-wallet-nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-gasless-wallet-nonce.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.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;AAK/E;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,CACnD,gBAAgB,GAAG;IACjB,wGAAwG;IACxG,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,+BAA+B,GAC1C,OAAO,CAAC,+BAA+B,CAAC,CAY1C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { gaslessLayerAbi as e } from "../../symmio-contracts/abi/v0.8.6/gasless-layer.js";
|
|
2
|
+
import { resolveGaslessService as t } from "../resolve-gasless.js";
|
|
3
|
+
import { assertGaslessWalletId as n } from "../wallet-id.js";
|
|
4
|
+
//#region src/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.ts
|
|
5
|
+
async function r(r, i) {
|
|
6
|
+
let { chainId: a, owner: o, account: s } = i, c = n(i.walletId ?? 0n), l = t(r, { chainId: a });
|
|
7
|
+
return r.getClient({ chainId: a }).readContract({
|
|
8
|
+
address: l.gaslessLayerAddress,
|
|
9
|
+
abi: e,
|
|
10
|
+
functionName: "walletOperationNonces",
|
|
11
|
+
args: [
|
|
12
|
+
o,
|
|
13
|
+
c,
|
|
14
|
+
s
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { r as getGaslessWalletNonce };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=get-gasless-wallet-nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-gasless-wallet-nonce.js","names":[],"sources":["../../../src/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { gaslessLayerAbi } from \"../../symmio-contracts/abi/v0.8.6/gasless-layer\";\nimport { resolveGaslessService } from \"../resolve-gasless\";\nimport { assertGaslessWalletId } from \"../wallet-id\";\n\n/**\n * Parameters for {@link getGaslessWalletNonce}.\n */\nexport type GetGaslessWalletNonceParameters = Compute<\n ChainIdParameter & {\n /** The owner wallet the gasless wallet belongs to — an owner address, never a GaslessWallet address. */\n owner: Address;\n /**\n * Which of the owner's GaslessWallets the operation executes from. Defaults\n * to `0n`, the original wallet, which keeps its pre-upgrade nonce stream.\n * Range `0n` through `2^256 - 1`.\n */\n walletId?: bigint;\n /**\n * The signer account the nonce is keyed under — the operation's\n * `signerAccount.addr` (the owner itself for an owner-signed call, or a\n * sub-account for a session-key signer).\n */\n account: Address;\n }\n>;\n\n/** Return type of {@link getGaslessWalletNonce}. */\nexport type GetGaslessWalletNonceReturnType = bigint;\n\n/**\n * Read the GaslessLayer's **wallet-operation** replay nonce —\n * `walletOperationNonces(owner, walletId, signerAccount)`, the last nonce the\n * selected wallet consumed for that signer account.\n *\n * A separate counter from the InstantLayer's operation nonces — the two are\n * not interchangeable. Wallet-execute operations sign with `nonce + 1`, read\n * immediately before signing. Every `(walletId, signerAccount)` pair is its own\n * stream: wallet `0` keeps the original per-signer-account counter, and each\n * positive id counts separately for its own wallet address, so nonces from one\n * id never apply to another.\n *\n * @param config - The SDK config.\n * @param parameters - Owner wallet, optional wallet id (default `0n`), signer account, optional chain id.\n * @returns The current wallet-operation nonce. Sign with `nonce + 1n`.\n * @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range\n * (or a JavaScript `number`), before any RPC call.\n * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.\n *\n * @example\n * ```ts\n * const current = await getGaslessWalletNonce(config, { owner, walletId: 2n, account: subAccount });\n * const nextNonce = current + 1n;\n * ```\n */\nexport async function getGaslessWalletNonce(\n config: Config,\n parameters: GetGaslessWalletNonceParameters,\n): Promise<GetGaslessWalletNonceReturnType> {\n const { chainId, owner, account } = parameters;\n const walletId = assertGaslessWalletId(parameters.walletId ?? 0n);\n const gasless = resolveGaslessService(config, { chainId });\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: gasless.gaslessLayerAddress,\n abi: gaslessLayerAbi,\n functionName: \"walletOperationNonces\",\n args: [owner, walletId, account],\n });\n}\n"],"mappings":";;;;AAyDA,eAAsB,EACpB,GACA,GAC0C;CAC1C,IAAM,EAAE,YAAS,UAAO,eAAY,GAC9B,IAAW,EAAsB,EAAW,YAAY,EAAE,GAC1D,IAAU,EAAsB,GAAQ,EAAE,WAAQ,CAAC;CAGzD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAQ;EACjB,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAO;GAAU;EAAO;CACjC,CAAC;AACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-wallet-nonce/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter, ExactPartial } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetGaslessWalletNonceParameters, GetGaslessWalletNonceReturnType } from './get-gasless-wallet-nonce.js';
|
|
5
|
+
/** Data resolved by the {@link getGaslessWalletNonceQueryOptions} query. */
|
|
6
|
+
export type GetGaslessWalletNonceData = GetGaslessWalletNonceReturnType;
|
|
7
|
+
/**
|
|
8
|
+
* Build the TanStack Query key for {@link getGaslessWalletNonceQueryOptions}.
|
|
9
|
+
*
|
|
10
|
+
* An omitted `walletId` keys as `0n`, so `{ owner, account }` and
|
|
11
|
+
* `{ owner, walletId: 0n, account }` share one cache entry — they read the same
|
|
12
|
+
* nonce stream. `predicateMatch` compares only the fields its partial sets, so
|
|
13
|
+
* `predicateMatch(getGaslessWalletNonceQueryKey, { account })` still matches the
|
|
14
|
+
* account's nonce on every wallet.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Partial query parameters.
|
|
17
|
+
* @returns A stable, hashable query key.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* getGaslessWalletNonceQueryKey({ owner, account });
|
|
22
|
+
* // → ["getGaslessWalletNonce", { owner, account, walletId: "0" }]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getGaslessWalletNonceQueryKey(options?: Compute<ExactPartial<GetGaslessWalletNonceParameters> & ConfigKeyParameter>): readonly ["getGaslessWalletNonce", Record<string, unknown>];
|
|
26
|
+
/** Query-key type produced by {@link getGaslessWalletNonceQueryKey}. */
|
|
27
|
+
export type GetGaslessWalletNonceQueryKey = ReturnType<typeof getGaslessWalletNonceQueryKey>;
|
|
28
|
+
/**
|
|
29
|
+
* Options accepted by {@link getGaslessWalletNonceQueryOptions}.
|
|
30
|
+
*/
|
|
31
|
+
export type GetGaslessWalletNonceOptions = Compute<GetGaslessWalletNonceParameters & QueryParameter<GetGaslessWalletNonceData, Error, GetGaslessWalletNonceData, GetGaslessWalletNonceQueryKey>>;
|
|
32
|
+
/** TanStack Query options returned by {@link getGaslessWalletNonceQueryOptions}. */
|
|
33
|
+
export type GetGaslessWalletNonceQueryOptions = SymmioQueryOptions<GetGaslessWalletNonceData, Error, GetGaslessWalletNonceData, GetGaslessWalletNonceQueryKey>;
|
|
34
|
+
/**
|
|
35
|
+
* Build TanStack Query options for {@link getGaslessWalletNonce}.
|
|
36
|
+
*
|
|
37
|
+
* @param config - The SDK config.
|
|
38
|
+
* @param options - Query parameters and TanStack overrides.
|
|
39
|
+
* @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* useQuery(getGaslessWalletNonceQueryOptions(config, { owner, walletId: 1n, account: subAccount }));
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function getGaslessWalletNonceQueryOptions(config: Config, options: GetGaslessWalletNonceOptions): GetGaslessWalletNonceQueryOptions;
|
|
47
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-wallet-nonce/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,4BAA4B,CAAC;AAEpC,4EAA4E;AAC5E,MAAM,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AAExE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,OAAO,CAAC,YAAY,CAAC,+BAA+B,CAAC,GAAG,kBAAkB,CAAM,+DAG1F;AAED,wEAAwE;AACxE,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE7F;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAChD,+BAA+B,GAC7B,cAAc,CAAC,yBAAyB,EAAE,KAAK,EAAE,yBAAyB,EAAE,6BAA6B,CAAC,CAC7G,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,iCAAiC,GAAG,kBAAkB,CAChE,yBAAyB,EACzB,KAAK,EACL,yBAAyB,EACzB,6BAA6B,CAC9B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,4BAA4B,GACpC,iCAAiC,CASnC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { getGaslessWalletNonce as t } from "./get-gasless-wallet-nonce.js";
|
|
3
|
+
//#region src/gasless/get-gasless-wallet-nonce/query.ts
|
|
4
|
+
function n(t = {}) {
|
|
5
|
+
return ["getGaslessWalletNonce", e({
|
|
6
|
+
...t,
|
|
7
|
+
walletId: t.walletId ?? 0n
|
|
8
|
+
})];
|
|
9
|
+
}
|
|
10
|
+
function r(e, r) {
|
|
11
|
+
let { query: i, ...a } = r;
|
|
12
|
+
return {
|
|
13
|
+
...i,
|
|
14
|
+
queryKey: n({
|
|
15
|
+
...a,
|
|
16
|
+
configKey: e.getChainConfigKey(a.chainId)
|
|
17
|
+
}),
|
|
18
|
+
enabled: i?.enabled ?? !0,
|
|
19
|
+
queryFn: () => t(e, a)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as getGaslessWalletNonceQueryKey, r as getGaslessWalletNonceQueryOptions };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/gasless/get-gasless-wallet-nonce/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n getGaslessWalletNonce,\n type GetGaslessWalletNonceParameters,\n type GetGaslessWalletNonceReturnType,\n} from \"./get-gasless-wallet-nonce\";\n\n/** Data resolved by the {@link getGaslessWalletNonceQueryOptions} query. */\nexport type GetGaslessWalletNonceData = GetGaslessWalletNonceReturnType;\n\n/**\n * Build the TanStack Query key for {@link getGaslessWalletNonceQueryOptions}.\n *\n * An omitted `walletId` keys as `0n`, so `{ owner, account }` and\n * `{ owner, walletId: 0n, account }` share one cache entry — they read the same\n * nonce stream. `predicateMatch` compares only the fields its partial sets, so\n * `predicateMatch(getGaslessWalletNonceQueryKey, { account })` still matches the\n * account's nonce on every wallet.\n *\n * @param options - Partial query parameters.\n * @returns A stable, hashable query key.\n *\n * @example\n * ```ts\n * getGaslessWalletNonceQueryKey({ owner, account });\n * // → [\"getGaslessWalletNonce\", { owner, account, walletId: \"0\" }]\n * ```\n */\nexport function getGaslessWalletNonceQueryKey(\n options: Compute<ExactPartial<GetGaslessWalletNonceParameters> & ConfigKeyParameter> = {},\n) {\n return [\"getGaslessWalletNonce\", filterQueryOptions({ ...options, walletId: options.walletId ?? 0n })] as const;\n}\n\n/** Query-key type produced by {@link getGaslessWalletNonceQueryKey}. */\nexport type GetGaslessWalletNonceQueryKey = ReturnType<typeof getGaslessWalletNonceQueryKey>;\n\n/**\n * Options accepted by {@link getGaslessWalletNonceQueryOptions}.\n */\nexport type GetGaslessWalletNonceOptions = Compute<\n GetGaslessWalletNonceParameters &\n QueryParameter<GetGaslessWalletNonceData, Error, GetGaslessWalletNonceData, GetGaslessWalletNonceQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getGaslessWalletNonceQueryOptions}. */\nexport type GetGaslessWalletNonceQueryOptions = SymmioQueryOptions<\n GetGaslessWalletNonceData,\n Error,\n GetGaslessWalletNonceData,\n GetGaslessWalletNonceQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getGaslessWalletNonce}.\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(getGaslessWalletNonceQueryOptions(config, { owner, walletId: 1n, account: subAccount }));\n * ```\n */\nexport function getGaslessWalletNonceQueryOptions(\n config: Config,\n options: GetGaslessWalletNonceOptions,\n): GetGaslessWalletNonceQueryOptions {\n /** Every parameter reaches the action: a hand-listed subset would silently drop a new one, such as `walletId`. */\n const { query, ...parameters } = options;\n return {\n ...query,\n queryKey: getGaslessWalletNonceQueryKey({ ...parameters, configKey: config.getChainConfigKey(parameters.chainId) }),\n enabled: query?.enabled ?? true,\n queryFn: () => getGaslessWalletNonce(config, parameters),\n };\n}\n"],"mappings":";;;AA+BA,SAAgB,EACd,IAAuF,CAAC,GACxF;CACA,OAAO,CAAC,yBAAyB,EAAmB;EAAE,GAAG;EAAS,UAAU,EAAQ,YAAY;CAAG,CAAC,CAAC;AACvG;AAiCA,SAAgB,EACd,GACA,GACmC;CAEnC,IAAM,EAAE,UAAO,GAAG,MAAe;CACjC,OAAO;EACL,GAAG;EACH,UAAU,EAA8B;GAAE,GAAG;GAAY,WAAW,EAAO,kBAAkB,EAAW,OAAO;EAAE,CAAC;EAClH,SAAS,GAAO,WAAW;EAC3B,eAAe,EAAsB,GAAQ,CAAU;CACzD;AACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { Config } from '../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../shared/types/properties.js';
|
|
4
|
+
/**
|
|
5
|
+
* Which authority to include in a session key's delegation grant.
|
|
6
|
+
*
|
|
7
|
+
* Each flag is a separate decision, so an app grants exactly the authority its
|
|
8
|
+
* key needs and nothing more.
|
|
9
|
+
*/
|
|
10
|
+
export interface SessionKeySelectorScope {
|
|
11
|
+
/**
|
|
12
|
+
* Include the instant trade lifecycle — open, close and margin top-up —
|
|
13
|
+
* resolved for the chain's contracts generation. Defaults to `true`.
|
|
14
|
+
*/
|
|
15
|
+
trade?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Include gasless account management (`GASLESS_SESSION_KEY_SELECTORS`):
|
|
18
|
+
* allocation, margin, cancellations, force-cancels, the operational-fee
|
|
19
|
+
* approval, renaming, and settling or cancelling an already-initiated
|
|
20
|
+
* withdrawal. Defaults to `true`.
|
|
21
|
+
*/
|
|
22
|
+
account?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Include `initiateWithdraw` (`GASLESS_SESSION_KEY_WITHDRAW_SELECTORS`).
|
|
25
|
+
* Defaults to **`false`**: its parts carry a caller-supplied `receiver`, so a
|
|
26
|
+
* key holding it can send the sub-account's collateral to an address of its
|
|
27
|
+
* own choosing. Opt in only for a key that must run withdrawals unattended.
|
|
28
|
+
*/
|
|
29
|
+
withdraw?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parameters for {@link getSessionKeySelectors}: the target chain plus the
|
|
33
|
+
* authority scope to grant.
|
|
34
|
+
*/
|
|
35
|
+
export type GetSessionKeySelectorsParameters = Compute<ChainIdParameter & SessionKeySelectorScope>;
|
|
36
|
+
/**
|
|
37
|
+
* Build the selector set to grant a session key — **this is the function to
|
|
38
|
+
* call**. {@link GASLESS_SESSION_KEY_SELECTORS} and
|
|
39
|
+
* {@link GASLESS_SESSION_KEY_WITHDRAW_SELECTORS} are its low-level pieces, and
|
|
40
|
+
* the trade lifecycle is a third piece that is chain-dependent; this resolves
|
|
41
|
+
* all three for one chain and hands back a single array for `grantDelegation`.
|
|
42
|
+
*
|
|
43
|
+
* The default scope — trade **and** account management, **without**
|
|
44
|
+
* `initiateWithdraw` — is the onboarding grant: one signature buys a key
|
|
45
|
+
* promptless, gas-free authority over the whole trading lifecycle and the
|
|
46
|
+
* account's own bookkeeping, while the one write that names a destination for
|
|
47
|
+
* collateral stays behind an explicit `withdraw: true`.
|
|
48
|
+
*
|
|
49
|
+
* The returned order is stable and meaningful — account selectors, then the
|
|
50
|
+
* withdraw selector, then the trade selectors — so two grants diff readably in a
|
|
51
|
+
* UI. Values are lowercase and de-duplicated.
|
|
52
|
+
*
|
|
53
|
+
* @param config - The SDK config.
|
|
54
|
+
* @param parameters - Optional `chainId` (defaults to the config's
|
|
55
|
+
* `defaultChainId`) and scope flags.
|
|
56
|
+
* @returns The de-duplicated, lowercase selector set for the requested scope.
|
|
57
|
+
* @throws {SymmError} `UNSUPPORTED_CHAIN` when the chain is not configured.
|
|
58
|
+
* @throws {SymmError} `SESSION_KEY_SELECTORS_UNSUPPORTED_CHAIN` when the `account`
|
|
59
|
+
* or `withdraw` scope is requested on a chain whose `contractsVersion` is not
|
|
60
|
+
* `"0.8.6"`. Those selectors come from the v0.8.6 ABIs and include
|
|
61
|
+
* `approveOperationalFeeWithMultiplier`, which does not exist on a v0.8.5
|
|
62
|
+
* diamond. A trade-only request (`{ account: false }`) works on both
|
|
63
|
+
* generations.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* await grantDelegation(config, {
|
|
68
|
+
* account: { addr: subAccount, isPartyB: false },
|
|
69
|
+
* delegatedSigner: sessionKey,
|
|
70
|
+
* selectors: getSessionKeySelectors(config, { chainId }),
|
|
71
|
+
* expiryTimestamp,
|
|
72
|
+
* gasless: true,
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* // A key that also withdraws unattended — it can move the collateral out.
|
|
79
|
+
* const selectors = getSessionKeySelectors(config, { chainId, withdraw: true });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function getSessionKeySelectors(config: Config, parameters?: GetSessionKeySelectorsParameters): readonly Hex[];
|
|
83
|
+
//# sourceMappingURL=get-session-key-selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-session-key-selectors.d.ts","sourceRoot":"","sources":["../../src/gasless/get-session-key-selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAI5E;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,gBAAgB,GAAG,uBAAuB,CAAC,CAAC;AAqBnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,gCAAqC,GAChD,SAAS,GAAG,EAAE,CAqBhB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SymmError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
import { GASLESS_SESSION_KEY_SELECTORS as t, GASLESS_SESSION_KEY_WITHDRAW_SELECTORS as n } from "./relayable-writes.js";
|
|
3
|
+
import { getInstantTradeRequiredSelectors as r } from "../solvers/instant-open/shared/selectors.js";
|
|
4
|
+
//#region src/gasless/get-session-key-selectors.ts
|
|
5
|
+
function i(e) {
|
|
6
|
+
let t = /* @__PURE__ */ new Set(), n = [];
|
|
7
|
+
for (let r of e) {
|
|
8
|
+
let e = r.toLowerCase();
|
|
9
|
+
t.has(e) || (t.add(e), n.push(e));
|
|
10
|
+
}
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
function a(a, o = {}) {
|
|
14
|
+
let { chainId: s, trade: c = !0, account: l = !0, withdraw: u = !1 } = o, d = [];
|
|
15
|
+
if (l || u) {
|
|
16
|
+
let r = a.getChainConfig(s);
|
|
17
|
+
if (r.contractsVersion !== "0.8.6") throw new e("config", "SESSION_KEY_SELECTORS_UNSUPPORTED_CHAIN", `Session keys: chain ${r.chainId} runs contracts ${r.contractsVersion}, but the account-management selectors exist only on perps-core ("0.8.6") deployments. Request \`{ account: false, withdraw: false }\` for a trade-only key.`);
|
|
18
|
+
l && d.push(...t), u && d.push(...n);
|
|
19
|
+
}
|
|
20
|
+
return c && d.push(...r(a, { chainId: s })), i(d);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as getSessionKeySelectors };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=get-session-key-selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-session-key-selectors.js","names":[],"sources":["../../src/gasless/get-session-key-selectors.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport type { Config } from \"../core/config\";\nimport { SymmError } from \"../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../shared/types/properties\";\nimport { getInstantTradeRequiredSelectors } from \"../solvers/instant-open/shared/selectors\";\nimport { GASLESS_SESSION_KEY_SELECTORS, GASLESS_SESSION_KEY_WITHDRAW_SELECTORS } from \"./relayable-writes\";\n\n/**\n * Which authority to include in a session key's delegation grant.\n *\n * Each flag is a separate decision, so an app grants exactly the authority its\n * key needs and nothing more.\n */\nexport interface SessionKeySelectorScope {\n /**\n * Include the instant trade lifecycle — open, close and margin top-up —\n * resolved for the chain's contracts generation. Defaults to `true`.\n */\n trade?: boolean;\n /**\n * Include gasless account management (`GASLESS_SESSION_KEY_SELECTORS`):\n * allocation, margin, cancellations, force-cancels, the operational-fee\n * approval, renaming, and settling or cancelling an already-initiated\n * withdrawal. Defaults to `true`.\n */\n account?: boolean;\n /**\n * Include `initiateWithdraw` (`GASLESS_SESSION_KEY_WITHDRAW_SELECTORS`).\n * Defaults to **`false`**: its parts carry a caller-supplied `receiver`, so a\n * key holding it can send the sub-account's collateral to an address of its\n * own choosing. Opt in only for a key that must run withdrawals unattended.\n */\n withdraw?: boolean;\n}\n\n/**\n * Parameters for {@link getSessionKeySelectors}: the target chain plus the\n * authority scope to grant.\n */\nexport type GetSessionKeySelectorsParameters = Compute<ChainIdParameter & SessionKeySelectorScope>;\n\n/**\n * Normalize to lowercase and drop repeats while preserving first-seen order.\n *\n * The scopes overlap by design (a selector may appear in more than one source\n * set), and `grantDelegation` rejects a duplicate-bearing selector array, so the\n * union has to be de-duplicated before it reaches the contract.\n */\nfunction dedupeSelectors(selectors: readonly Hex[]): readonly Hex[] {\n const seen = new Set<Hex>();\n const unique: Hex[] = [];\n for (const selector of selectors) {\n const normalized = selector.toLowerCase() as Hex;\n if (seen.has(normalized)) continue;\n seen.add(normalized);\n unique.push(normalized);\n }\n return unique;\n}\n\n/**\n * Build the selector set to grant a session key — **this is the function to\n * call**. {@link GASLESS_SESSION_KEY_SELECTORS} and\n * {@link GASLESS_SESSION_KEY_WITHDRAW_SELECTORS} are its low-level pieces, and\n * the trade lifecycle is a third piece that is chain-dependent; this resolves\n * all three for one chain and hands back a single array for `grantDelegation`.\n *\n * The default scope — trade **and** account management, **without**\n * `initiateWithdraw` — is the onboarding grant: one signature buys a key\n * promptless, gas-free authority over the whole trading lifecycle and the\n * account's own bookkeeping, while the one write that names a destination for\n * collateral stays behind an explicit `withdraw: true`.\n *\n * The returned order is stable and meaningful — account selectors, then the\n * withdraw selector, then the trade selectors — so two grants diff readably in a\n * UI. Values are lowercase and de-duplicated.\n *\n * @param config - The SDK config.\n * @param parameters - Optional `chainId` (defaults to the config's\n * `defaultChainId`) and scope flags.\n * @returns The de-duplicated, lowercase selector set for the requested scope.\n * @throws {SymmError} `UNSUPPORTED_CHAIN` when the chain is not configured.\n * @throws {SymmError} `SESSION_KEY_SELECTORS_UNSUPPORTED_CHAIN` when the `account`\n * or `withdraw` scope is requested on a chain whose `contractsVersion` is not\n * `\"0.8.6\"`. Those selectors come from the v0.8.6 ABIs and include\n * `approveOperationalFeeWithMultiplier`, which does not exist on a v0.8.5\n * diamond. A trade-only request (`{ account: false }`) works on both\n * generations.\n *\n * @example\n * ```ts\n * await grantDelegation(config, {\n * account: { addr: subAccount, isPartyB: false },\n * delegatedSigner: sessionKey,\n * selectors: getSessionKeySelectors(config, { chainId }),\n * expiryTimestamp,\n * gasless: true,\n * });\n * ```\n *\n * @example\n * ```ts\n * // A key that also withdraws unattended — it can move the collateral out.\n * const selectors = getSessionKeySelectors(config, { chainId, withdraw: true });\n * ```\n */\nexport function getSessionKeySelectors(\n config: Config,\n parameters: GetSessionKeySelectorsParameters = {},\n): readonly Hex[] {\n const { chainId, trade = true, account = true, withdraw = false } = parameters;\n\n const selectors: Hex[] = [];\n\n if (account || withdraw) {\n const chain = config.getChainConfig(chainId);\n if (chain.contractsVersion !== \"0.8.6\") {\n throw new SymmError(\n \"config\",\n \"SESSION_KEY_SELECTORS_UNSUPPORTED_CHAIN\",\n `Session keys: chain ${chain.chainId} runs contracts ${chain.contractsVersion}, but the account-management selectors exist only on perps-core (\"0.8.6\") deployments. Request \\`{ account: false, withdraw: false }\\` for a trade-only key.`,\n );\n }\n if (account) selectors.push(...GASLESS_SESSION_KEY_SELECTORS);\n if (withdraw) selectors.push(...GASLESS_SESSION_KEY_WITHDRAW_SELECTORS);\n }\n\n if (trade) selectors.push(...getInstantTradeRequiredSelectors(config, { chainId }));\n\n return dedupeSelectors(selectors);\n}\n"],"mappings":";;;;AAgDA,SAAS,EAAgB,GAA2C;CAClE,IAAM,oBAAO,IAAI,IAAS,GACpB,IAAgB,CAAC;CACvB,KAAK,IAAM,KAAY,GAAW;EAChC,IAAM,IAAa,EAAS,YAAY;EACpC,EAAK,IAAI,CAAU,MACvB,EAAK,IAAI,CAAU,GACnB,EAAO,KAAK,CAAU;CACxB;CACA,OAAO;AACT;AAgDA,SAAgB,EACd,GACA,IAA+C,CAAC,GAChC;CAChB,IAAM,EAAE,YAAS,WAAQ,IAAM,aAAU,IAAM,cAAW,OAAU,GAE9D,IAAmB,CAAC;CAE1B,IAAI,KAAW,GAAU;EACvB,IAAM,IAAQ,EAAO,eAAe,CAAO;EAC3C,IAAI,EAAM,qBAAqB,SAC7B,MAAM,IAAI,EACR,UACA,2CACA,uBAAuB,EAAM,QAAQ,kBAAkB,EAAM,iBAAiB,6JAChF;EAGF,AADI,KAAS,EAAU,KAAK,GAAG,CAA6B,GACxD,KAAU,EAAU,KAAK,GAAG,CAAsC;CACxE;CAIA,OAFI,KAAO,EAAU,KAAK,GAAG,EAAiC,GAAQ,EAAE,WAAQ,CAAC,CAAC,GAE3E,EAAgB,CAAS;AAClC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { SymmioGaslessConfig } from '../core/chains/types.js';
|
|
3
|
+
import { Config } from '../core/config/index.js';
|
|
4
|
+
import { GaslessService } from './types.js';
|
|
5
|
+
import { GaslessSubmitPath } from './unconfirmed-submit.js';
|
|
6
|
+
/** Default HTTP timeout for a gasless submit (`execution.submitTimeoutMs`). @internal */
|
|
7
|
+
export declare const GASLESS_SUBMIT_TIMEOUT_MS = 30000;
|
|
8
|
+
/**
|
|
9
|
+
* How many times a submit the gateway itself refused (`429`, or a `503`
|
|
10
|
+
* carrying its `{ error }` envelope) is retried under the same idempotency key.
|
|
11
|
+
* Both mean the request never reached the service, so a retry cannot duplicate
|
|
12
|
+
* anything — the bound exists to keep a submit from outliving its caller.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const GASLESS_SUBMIT_THROTTLE_RETRIES = 2;
|
|
17
|
+
/** The response header the gateway stamps with the protocol instance that answered. @internal */
|
|
18
|
+
export declare const GASLESS_PROTOCOL_INSTANCE_HEADER = "x-gaslessq-protocol-instance";
|
|
19
|
+
/**
|
|
20
|
+
* A resolved gasless HTTP context for one `(chain, service)` pair: the final
|
|
21
|
+
* per-service base URL, the request headers, and the protocol instance the
|
|
22
|
+
* responses must come from.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export interface GaslessHttpContext {
|
|
27
|
+
/** Final service base, e.g. `…/v1/instances/<protocol-instance>/operations`. */
|
|
28
|
+
baseURL: string;
|
|
29
|
+
/** Request headers: `Accept`, plus `Authorization: Bearer …` only when an `apiKey` is configured. */
|
|
30
|
+
headers: Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* The protocol instance responses are asserted against, or `null` when the
|
|
33
|
+
* config names none (a proxy root without `protocolInstance`).
|
|
34
|
+
*/
|
|
35
|
+
protocolInstance: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Whether a response must carry the instance header. `true` for the gateway
|
|
38
|
+
* URL forms, where the gateway itself stamps every routed response; `false`
|
|
39
|
+
* for a proxy root, which may not forward the header, so only a header that
|
|
40
|
+
* is present is checked.
|
|
41
|
+
*/
|
|
42
|
+
requireInstanceHeader: boolean;
|
|
43
|
+
/** HTTP timeout applied to submits (POSTs), in ms. */
|
|
44
|
+
submitTimeoutMs: number;
|
|
45
|
+
/** The chain the context was resolved for (for error messages and events). */
|
|
46
|
+
chainId: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Derive the per-service base URL from a chain's gasless config.
|
|
50
|
+
*
|
|
51
|
+
* The `url` forms are parsed by `parseGaslessUrl`:
|
|
52
|
+
* - a gateway **origin** — the SDK appends
|
|
53
|
+
* `/v1/instances/{protocolInstance}/{service}`;
|
|
54
|
+
* - an **instance root** — the SDK appends `/{service}`;
|
|
55
|
+
* - an instance-pinned **service base** — used as-is, and it must match the
|
|
56
|
+
* requested service;
|
|
57
|
+
* - a **proxy root** — the SDK appends `/{service}`.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveGaslessHttp(config: Config, parameters: {
|
|
62
|
+
chainId?: number;
|
|
63
|
+
service: GaslessService;
|
|
64
|
+
}): GaslessHttpContext;
|
|
65
|
+
/**
|
|
66
|
+
* Build a {@link GaslessHttpContext} from an already-resolved gasless block.
|
|
67
|
+
*
|
|
68
|
+
* Anonymous access is the default: the `Authorization` header is omitted
|
|
69
|
+
* entirely unless a non-blank `apiKey` is configured.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildGaslessHttpContext(chainId: number, gasless: SymmioGaslessConfig, service: GaslessService): GaslessHttpContext;
|
|
74
|
+
/**
|
|
75
|
+
* Assert that a successful response came from the expected protocol instance.
|
|
76
|
+
* The gateway stamps `X-GasLessQ-Protocol-Instance` on every response it
|
|
77
|
+
* routes. A mismatch means a different deployment answered (a
|
|
78
|
+
* staging/production cross-wire), and the response must not be trusted.
|
|
79
|
+
*
|
|
80
|
+
* Gateway URL forms fail closed on a missing header too. A proxy root only
|
|
81
|
+
* fails on a header that is present and wrong, since a proxy may not forward
|
|
82
|
+
* it.
|
|
83
|
+
*
|
|
84
|
+
* @internal
|
|
85
|
+
* @throws {SymmError} `GASLESS_INSTANCE_MISMATCH`
|
|
86
|
+
*/
|
|
87
|
+
export declare function assertGaslessInstance(context: GaslessHttpContext, response: AxiosResponse): void;
|
|
88
|
+
/**
|
|
89
|
+
* Whether an error is a `GASLESS_INSTANCE_MISMATCH` on a response the gateway
|
|
90
|
+
* **accepted** (a `2xx`) — the submit created a workflow somewhere, on a
|
|
91
|
+
* deployment this config does not address.
|
|
92
|
+
*
|
|
93
|
+
* Nothing about it can be trusted except that it happened, so it is never
|
|
94
|
+
* grounds for a wallet-paid retry, and any signature it consumed must be
|
|
95
|
+
* treated as spent.
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export declare function isGaslessAcceptedInstanceMismatchError(err: unknown): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Perform a gasless GET and normalize failures into the house error shape.
|
|
102
|
+
*
|
|
103
|
+
* @param context - The resolved HTTP context for the call's service.
|
|
104
|
+
* @param path - The path under the service base.
|
|
105
|
+
* @param code - The SDK error code a failure is reported under.
|
|
106
|
+
* @param options - `signal` cancels the request in flight — pass TanStack's
|
|
107
|
+
* query signal, or the caller's own, so a poll nobody is waiting for stops
|
|
108
|
+
* spending the deployment's shared request budget.
|
|
109
|
+
*
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
export declare function gaslessGet<data>(context: GaslessHttpContext, path: string, code: string, options?: {
|
|
113
|
+
signal?: AbortSignal;
|
|
114
|
+
}): Promise<data>;
|
|
115
|
+
/**
|
|
116
|
+
* How long to wait before resending a submit, whether the gateway refused it or
|
|
117
|
+
* its outcome is unknown.
|
|
118
|
+
*
|
|
119
|
+
* `Retry-After` is honored when the gateway sent one and the browser was
|
|
120
|
+
* allowed to read it, but never trusted as a floor of zero: a cross-origin page
|
|
121
|
+
* usually sees `null`, and hammering a throttled gateway is what earned the
|
|
122
|
+
* `429`. So the wait is at least a jittered second, and the jitter keeps a
|
|
123
|
+
* page's concurrent workflows from retrying in lockstep.
|
|
124
|
+
*
|
|
125
|
+
* @param retryAfterMs - The server's requested delay, or `null` when unknown.
|
|
126
|
+
* @param random - Injectable `Math.random`, for deterministic tests.
|
|
127
|
+
* @returns The delay in ms.
|
|
128
|
+
*
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
export declare function gaslessSubmitRetryDelay(retryAfterMs: number | null, random?: () => number): number;
|
|
132
|
+
/**
|
|
133
|
+
* POST one gasless **submit** — the only gasless call that can leave a side
|
|
134
|
+
* effect behind when its response is lost — and decide, for every outcome,
|
|
135
|
+
* whether the service can have accepted it.
|
|
136
|
+
*
|
|
137
|
+
* Three dispositions, all under the caller's single idempotency key (the vendor
|
|
138
|
+
* returns the existing record for a byte-identical resend, so reusing the key
|
|
139
|
+
* can never double-execute; a *changed* payload needs a fresh one):
|
|
140
|
+
*
|
|
141
|
+
* - **Refused by the gateway** (`429`, or a `503` carrying its `{ error }`
|
|
142
|
+
* envelope): the request never reached the service. Resent up to
|
|
143
|
+
* {@link GASLESS_SUBMIT_THROTTLE_RETRIES} times after
|
|
144
|
+
* {@link gaslessSubmitRetryDelay}, while the wait still fits inside
|
|
145
|
+
* `execution.submitTimeoutMs`. Exhausted, the gateway's own error is thrown —
|
|
146
|
+
* the one submit failure that is provably *not* accepted, and so the only one
|
|
147
|
+
* a wallet-paid retry may follow.
|
|
148
|
+
* - **Ambiguous** (no response, a timeout, or a `5xx` without the gateway
|
|
149
|
+
* envelope): the service may or may not have accepted it. Resent **once**,
|
|
150
|
+
* after a {@link gaslessSubmitRetryDelay} backoff, then thrown as
|
|
151
|
+
* `GASLESS_SUBMIT_UNCONFIRMED` carrying the exact bytes that were sent, so the
|
|
152
|
+
* caller can persist them and replay them later with `resubmitGaslessRequest`.
|
|
153
|
+
* Never a rejection, and never grounds for a wallet retry. The backoff is the
|
|
154
|
+
* vendor's: a resend that races the first attempt's insert can be answered with
|
|
155
|
+
* a `5xx` instead of the record that insert created.
|
|
156
|
+
* - **Answered** (any other status, or a `2xx`): thrown as-is, or returned. A
|
|
157
|
+
* `2xx` without a `request_id` is unconfirmed too — the workflow exists and
|
|
158
|
+
* nothing identifies it. A `2xx` from the wrong protocol instance throws
|
|
159
|
+
* `GASLESS_INSTANCE_MISMATCH` with the parsed body kept in `responseData`,
|
|
160
|
+
* because the `request_id` in it is the only handle on a request that was
|
|
161
|
+
* accepted somewhere.
|
|
162
|
+
*
|
|
163
|
+
* An ambiguous attempt decides every failure after it. A gateway refusal of the
|
|
164
|
+
* resend, or a service verdict on it, describes only the resend — the first
|
|
165
|
+
* attempt may already be executing — so it is thrown as
|
|
166
|
+
* `GASLESS_SUBMIT_UNCONFIRMED` with that failure as its `cause`. Thrown as-is,
|
|
167
|
+
* a `429` would read as provably not accepted, and a wallet-paid retry would
|
|
168
|
+
* execute the intent twice.
|
|
169
|
+
*
|
|
170
|
+
* @param context - The resolved HTTP context for the submit's service.
|
|
171
|
+
* @param path - The submit route (see {@link GASLESS_SUBMIT_ROUTES}).
|
|
172
|
+
* @param body - The exact JSON body to send.
|
|
173
|
+
* @param idempotencyKey - The key inside `body`, recorded on an unconfirmed submit.
|
|
174
|
+
* @returns The acceptance body.
|
|
175
|
+
*
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
export declare function postGaslessSubmit<data extends {
|
|
179
|
+
request_id?: string | null;
|
|
180
|
+
}>(context: GaslessHttpContext, path: GaslessSubmitPath, body: unknown, idempotencyKey: string): Promise<data>;
|
|
181
|
+
/**
|
|
182
|
+
* The canonical 3-branch error normalization every gasless HTTP call shares.
|
|
183
|
+
*
|
|
184
|
+
* An axios failure becomes a `SymmApiError` whose `cause` is a sanitized
|
|
185
|
+
* snapshot (see `toSanitizedApiError`), never the axios error itself. That
|
|
186
|
+
* error's request config holds the `Authorization` header and the signed body,
|
|
187
|
+
* so the `apiKey` cannot leak through a logged or serialized error.
|
|
188
|
+
* `responseData` stays the raw response body.
|
|
189
|
+
*
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
export declare function toGaslessError(err: unknown, context: GaslessHttpContext, code: string): Error;
|
|
193
|
+
/**
|
|
194
|
+
* How a failed gasless HTTP call was disposed of, from the status and, where
|
|
195
|
+
* the gateway overloads a status, from the body: the gateway's own
|
|
196
|
+
* `{ "error": "…" }` envelope versus a service `{ "detail": … }` body.
|
|
197
|
+
*
|
|
198
|
+
* - `"rate-limited"` — `429`: dropped at the gateway, never forwarded.
|
|
199
|
+
* - `"gateway-not-ready"` — `503` with the gateway envelope: its configuration is not ready.
|
|
200
|
+
* - `"unauthorized"` / `"forbidden"` — `401` / `403`: credentials rejected, or not allowed for this instance or service.
|
|
201
|
+
* - `"unknown-instance"` — `404` with the gateway envelope: no such instance or service route.
|
|
202
|
+
* - `"selector-conflict"` — `400` with the gateway envelope: the URL and the instance selector disagree.
|
|
203
|
+
* - `"client-schema"` — `422`: the service rejected the payload shape (a client bug).
|
|
204
|
+
* - `"ambiguous"` — no response (network failure or timeout), `408`, or any other `5xx`: the request may or may not have reached the service.
|
|
205
|
+
* - `"service"` — any other status: the service answered with its own verdict (`detail.code`).
|
|
206
|
+
*
|
|
207
|
+
* @internal
|
|
208
|
+
*/
|
|
209
|
+
export type GaslessHttpFailureClass = "rate-limited" | "gateway-not-ready" | "unauthorized" | "forbidden" | "unknown-instance" | "selector-conflict" | "client-schema" | "ambiguous" | "service";
|
|
210
|
+
/**
|
|
211
|
+
* Classify a failed gasless HTTP call — see {@link GaslessHttpFailureClass}.
|
|
212
|
+
*
|
|
213
|
+
* The status is read structurally, so an error a framework layer re-wrapped
|
|
214
|
+
* (`@symmio/trading-react`'s `SymmioRequestError`, which copies `status` and
|
|
215
|
+
* `responseData`) classifies exactly like the `SymmApiError` underneath it.
|
|
216
|
+
*
|
|
217
|
+
* @param err - Anything caught from a gasless HTTP call.
|
|
218
|
+
* @returns The class, or `null` when `err` carries no HTTP status.
|
|
219
|
+
*
|
|
220
|
+
* @internal
|
|
221
|
+
*/
|
|
222
|
+
export declare function classifyGaslessHttpStatus(err: unknown): GaslessHttpFailureClass | null;
|
|
223
|
+
/**
|
|
224
|
+
* Generate a random idempotency key for one gasless submit. Reuse the same key
|
|
225
|
+
* only when retrying the byte-identical request; any change to the payload
|
|
226
|
+
* needs a fresh key.
|
|
227
|
+
*/
|
|
228
|
+
export declare function generateGaslessIdempotencyKey(): string;
|
|
229
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/gasless/http.ts"],"names":[],"mappings":"AAAA,OAAc,EAAgB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAO7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAIL,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAC;AAE9B,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD,iGAAiG;AACjG,eAAO,MAAM,gCAAgC,iCAAiC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;OAKG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sDAAsD;IACtD,eAAe,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,GACxD,kBAAkB,CAIpB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,cAAc,GACtB,kBAAkB,CAuBpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAIhG;AAmBD;;;;;;;;;;GAUG;AACH,wBAAgB,sCAAsC,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAG5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,IAAI,EACnC,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACrC,OAAO,CAAC,IAAI,CAAC,CAYf;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,GAAE,MAAM,MAAoB,GAAG,MAAM,CAE/G;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,SAAS;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACjF,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,OAAO,EACb,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA4Df;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAM7F;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,uBAAuB,GAC/B,cAAc,GACd,mBAAmB,GACnB,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,mBAAmB,GACnB,eAAe,GACf,WAAW,GACX,SAAS,CAAC;AAEd;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAyBtF;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD"}
|