@symmio/trading-core 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/chains/types.d.ts +197 -0
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core/chains/types.js.map +1 -1
- package/dist/core/config/merge-chain-config.d.ts.map +1 -1
- package/dist/core/config/merge-chain-config.js +49 -19
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/gasless/abortable-sleep.d.ts +17 -0
- package/dist/gasless/abortable-sleep.d.ts.map +1 -0
- package/dist/gasless/abortable-sleep.js +21 -0
- package/dist/gasless/abortable-sleep.js.map +1 -0
- package/dist/gasless/assert-gateway-coherence.d.ts +20 -0
- package/dist/gasless/assert-gateway-coherence.d.ts.map +1 -0
- package/dist/gasless/assert-gateway-coherence.js +26 -0
- package/dist/gasless/assert-gateway-coherence.js.map +1 -0
- package/dist/gasless/batch/calls.d.ts +121 -0
- package/dist/gasless/batch/calls.d.ts.map +1 -0
- package/dist/gasless/batch/calls.js +36 -0
- package/dist/gasless/batch/calls.js.map +1 -0
- package/dist/gasless/batch/index.d.ts +2 -0
- package/dist/gasless/batch/index.d.ts.map +1 -0
- package/dist/gasless/batch/resolve-gasless-batch.d.ts +118 -0
- package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/batch/resolve-gasless-batch.js +89 -0
- package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -0
- package/dist/gasless/classify-gasless-failure.d.ts +99 -0
- package/dist/gasless/classify-gasless-failure.d.ts.map +1 -0
- package/dist/gasless/classify-gasless-failure.js +60 -0
- package/dist/gasless/classify-gasless-failure.js.map +1 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts +121 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts.map +1 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +73 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js.map +1 -0
- package/dist/gasless/confirm-gasless-request/index.d.ts +2 -0
- package/dist/gasless/confirm-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/constants.d.ts +24 -0
- package/dist/gasless/constants.d.ts.map +1 -0
- package/dist/gasless/constants.js +6 -0
- package/dist/gasless/constants.js.map +1 -0
- package/dist/gasless/delegation-preflight.d.ts +39 -0
- package/dist/gasless/delegation-preflight.d.ts.map +1 -0
- package/dist/gasless/delegation-preflight.js +33 -0
- package/dist/gasless/delegation-preflight.js.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +73 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js +189 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -0
- package/dist/gasless/eip712.d.ts +79 -0
- package/dist/gasless/eip712.d.ts.map +1 -0
- package/dist/gasless/eip712.js +60 -0
- package/dist/gasless/eip712.js.map +1 -0
- package/dist/gasless/errors.d.ts +132 -0
- package/dist/gasless/errors.d.ts.map +1 -0
- package/dist/gasless/errors.js +110 -0
- package/dist/gasless/errors.js.map +1 -0
- package/dist/gasless/events.d.ts +37 -0
- package/dist/gasless/events.d.ts.map +1 -0
- package/dist/gasless/events.js +34 -0
- package/dist/gasless/events.js.map +1 -0
- package/dist/gasless/fallback.d.ts +58 -0
- package/dist/gasless/fallback.d.ts.map +1 -0
- package/dist/gasless/fallback.js +34 -0
- package/dist/gasless/fallback.js.map +1 -0
- package/dist/gasless/format-gasless-operation.d.ts +37 -0
- package/dist/gasless/format-gasless-operation.d.ts.map +1 -0
- package/dist/gasless/format-gasless-operation.js +33 -0
- package/dist/gasless/format-gasless-operation.js.map +1 -0
- package/dist/gasless/gasless-url.d.ts +82 -0
- package/dist/gasless/gasless-url.d.ts.map +1 -0
- package/dist/gasless/gasless-url.js +70 -0
- package/dist/gasless/gasless-url.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/calls.d.ts +73 -0
- package/dist/gasless/gasless-wallet-execute/calls.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/calls.js +24 -0
- package/dist/gasless/gasless-wallet-execute/calls.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +148 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +120 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/index.d.ts +5 -0
- package/dist/gasless/gasless-wallet-execute/index.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/query.d.ts +18 -0
- package/dist/gasless/gasless-wallet-execute/query.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/query.js +12 -0
- package/dist/gasless/gasless-wallet-execute/query.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/selectors.d.ts +38 -0
- package/dist/gasless/gasless-wallet-execute/selectors.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/selectors.js +15 -0
- package/dist/gasless/gasless-wallet-execute/selectors.js.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts +72 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js +42 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts +3 -0
- package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts +47 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.js +50 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.js.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts +80 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js +61 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/index.d.ts +3 -0
- package/dist/gasless/get-gasless-deposit-policy/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/query.d.ts +51 -0
- package/dist/gasless/get-gasless-deposit-policy/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/query.js +25 -0
- package/dist/gasless/get-gasless-deposit-policy/query.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts +27 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js +22 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts +61 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js +59 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts +79 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js +53 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/index.d.ts +4 -0
- package/dist/gasless/get-gasless-fee-quote/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/query.d.ts +41 -0
- package/dist/gasless/get-gasless-fee-quote/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/query.js +31 -0
- package/dist/gasless/get-gasless-fee-quote/query.js.map +1 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.d.ts +51 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.js +15 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.js.map +1 -0
- package/dist/gasless/get-gasless-request/index.d.ts +4 -0
- package/dist/gasless/get-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/query.d.ts +64 -0
- package/dist/gasless/get-gasless-request/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/query.js +42 -0
- package/dist/gasless/get-gasless-request/query.js.map +1 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.d.ts +26 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.js +62 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts +40 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js +15 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/index.d.ts +4 -0
- package/dist/gasless/get-gasless-request-transactions/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/query.d.ts +75 -0
- package/dist/gasless/get-gasless-request-transactions/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/query.js +37 -0
- package/dist/gasless/get-gasless-request-transactions/query.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts +21 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js +27 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts +48 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js +20 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-address/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/query.d.ts +46 -0
- package/dist/gasless/get-gasless-wallet-address/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-address/query.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts +57 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js +17 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts +51 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts +51 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js +21 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-nonce/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.d.ts +47 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.js.map +1 -0
- package/dist/gasless/get-session-key-selectors.d.ts +83 -0
- package/dist/gasless/get-session-key-selectors.d.ts.map +1 -0
- package/dist/gasless/get-session-key-selectors.js +25 -0
- package/dist/gasless/get-session-key-selectors.js.map +1 -0
- package/dist/gasless/http.d.ts +229 -0
- package/dist/gasless/http.d.ts.map +1 -0
- package/dist/gasless/http.js +165 -0
- package/dist/gasless/http.js.map +1 -0
- package/dist/gasless/index.d.ts +34 -0
- package/dist/gasless/index.d.ts.map +1 -0
- package/dist/gasless/is-newer-gasless-request.d.ts +32 -0
- package/dist/gasless/is-newer-gasless-request.d.ts.map +1 -0
- package/dist/gasless/is-newer-gasless-request.js +21 -0
- package/dist/gasless/is-newer-gasless-request.js.map +1 -0
- package/dist/gasless/nonce-lock.d.ts +180 -0
- package/dist/gasless/nonce-lock.d.ts.map +1 -0
- package/dist/gasless/nonce-lock.js +102 -0
- package/dist/gasless/nonce-lock.js.map +1 -0
- package/dist/gasless/observe-gasless-request.d.ts +65 -0
- package/dist/gasless/observe-gasless-request.d.ts.map +1 -0
- package/dist/gasless/observe-gasless-request.js +56 -0
- package/dist/gasless/observe-gasless-request.js.map +1 -0
- package/dist/gasless/query-poll-delay.d.ts +39 -0
- package/dist/gasless/query-poll-delay.d.ts.map +1 -0
- package/dist/gasless/query-poll-delay.js +14 -0
- package/dist/gasless/query-poll-delay.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/index.d.ts +3 -0
- package/dist/gasless/relay-gasless-batch/index.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/query.d.ts +18 -0
- package/dist/gasless/relay-gasless-batch/query.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/query.js +12 -0
- package/dist/gasless/relay-gasless-batch/query.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +106 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +145 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +36 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +24 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -0
- package/dist/gasless/relay-grant-delegation/index.d.ts +3 -0
- package/dist/gasless/relay-grant-delegation/index.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/query.d.ts +18 -0
- package/dist/gasless/relay-grant-delegation/query.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/query.js +12 -0
- package/dist/gasless/relay-grant-delegation/query.js.map +1 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +69 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +57 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -0
- package/dist/gasless/relay-instant-operations/index.d.ts +3 -0
- package/dist/gasless/relay-instant-operations/index.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/query.d.ts +18 -0
- package/dist/gasless/relay-instant-operations/query.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/query.js +12 -0
- package/dist/gasless/relay-instant-operations/query.js.map +1 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +127 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js +42 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -0
- package/dist/gasless/relayable-writes.d.ts +163 -0
- package/dist/gasless/relayable-writes.d.ts.map +1 -0
- package/dist/gasless/relayable-writes.js +113 -0
- package/dist/gasless/relayable-writes.js.map +1 -0
- package/dist/gasless/resolve-gasless.d.ts +52 -0
- package/dist/gasless/resolve-gasless.d.ts.map +1 -0
- package/dist/gasless/resolve-gasless.js +19 -0
- package/dist/gasless/resolve-gasless.js.map +1 -0
- package/dist/gasless/resolve-wallet-identities.d.ts +30 -0
- package/dist/gasless/resolve-wallet-identities.d.ts.map +1 -0
- package/dist/gasless/resolve-wallet-identities.js +21 -0
- package/dist/gasless/resolve-wallet-identities.js.map +1 -0
- package/dist/gasless/resubmit-gasless-request/index.d.ts +3 -0
- package/dist/gasless/resubmit-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/query.d.ts +19 -0
- package/dist/gasless/resubmit-gasless-request/query.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/query.js +12 -0
- package/dist/gasless/resubmit-gasless-request/query.js.map +1 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +50 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +52 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts +3 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts +18 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.js +12 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +66 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +36 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts +3 -0
- package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts +18 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.js +12 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +106 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +43 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -0
- package/dist/gasless/status-read-limiter.d.ts +44 -0
- package/dist/gasless/status-read-limiter.d.ts.map +1 -0
- package/dist/gasless/status-read-limiter.js +28 -0
- package/dist/gasless/status-read-limiter.js.map +1 -0
- package/dist/gasless/to-gasless-deposit-receipt.d.ts +61 -0
- package/dist/gasless/to-gasless-deposit-receipt.d.ts.map +1 -0
- package/dist/gasless/to-gasless-deposit-receipt.js +36 -0
- package/dist/gasless/to-gasless-deposit-receipt.js.map +1 -0
- package/dist/gasless/to-gasless-submit-receipt.d.ts +60 -0
- package/dist/gasless/to-gasless-submit-receipt.d.ts.map +1 -0
- package/dist/gasless/to-gasless-submit-receipt.js +26 -0
- package/dist/gasless/to-gasless-submit-receipt.js.map +1 -0
- package/dist/gasless/transient-read.d.ts +32 -0
- package/dist/gasless/transient-read.d.ts.map +1 -0
- package/dist/gasless/transient-read.js +28 -0
- package/dist/gasless/transient-read.js.map +1 -0
- package/dist/gasless/types/generated/gasless-deposits.d.ts +170 -0
- package/dist/gasless/types/generated/gasless-deposits.d.ts.map +1 -0
- package/dist/gasless/types/generated/gasless-operations.d.ts +260 -0
- package/dist/gasless/types/generated/gasless-operations.d.ts.map +1 -0
- package/dist/gasless/types.d.ts +493 -0
- package/dist/gasless/types.d.ts.map +1 -0
- package/dist/gasless/types.js +33 -0
- package/dist/gasless/types.js.map +1 -0
- package/dist/gasless/unconfirmed-submit.d.ts +132 -0
- package/dist/gasless/unconfirmed-submit.d.ts.map +1 -0
- package/dist/gasless/unconfirmed-submit.js +49 -0
- package/dist/gasless/unconfirmed-submit.js.map +1 -0
- package/dist/gasless/wait-for-gasless-request/index.d.ts +2 -0
- package/dist/gasless/wait-for-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts +114 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts.map +1 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js +77 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js.map +1 -0
- package/dist/gasless/wallet-id.d.ts +42 -0
- package/dist/gasless/wallet-id.d.ts.map +1 -0
- package/dist/gasless/wallet-id.js +25 -0
- package/dist/gasless/wallet-id.js.map +1 -0
- package/dist/gasless/wire-parse.d.ts +33 -0
- package/dist/gasless/wire-parse.d.ts.map +1 -0
- package/dist/gasless/wire-parse.js +14 -0
- package/dist/gasless/wire-parse.js.map +1 -0
- package/dist/gasless/wire-types.d.ts +73 -0
- package/dist/gasless/wire-types.d.ts.map +1 -0
- package/dist/gasless/write-request-registry.d.ts +56 -0
- package/dist/gasless/write-request-registry.d.ts.map +1 -0
- package/dist/gasless/write-request-registry.js +22 -0
- package/dist/gasless/write-request-registry.js.map +1 -0
- package/dist/index.d.ts +82 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +568 -497
- package/dist/pools/listing-config/to-listing-config.js +2 -2
- package/dist/pools/listing-config/to-listing-config.js.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.js +46 -40
- package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
- package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
- package/dist/pools/markets/to-listing-market.js +2 -1
- package/dist/pools/markets/to-listing-market.js.map +1 -1
- package/dist/pools/types/generated/listing-backend.d.ts +163 -16
- package/dist/pools/types/generated/listing-backend.d.ts.map +1 -1
- package/dist/pools/types/generated/listing-backend.js.map +1 -1
- package/dist/pools/types.d.ts +52 -2
- package/dist/pools/types.d.ts.map +1 -1
- package/dist/pools/types.js +6 -4
- package/dist/pools/types.js.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +3 -2
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
- package/dist/quotes/get-quote-funding/types.d.ts +4 -2
- package/dist/quotes/get-quote-funding/types.d.ts.map +1 -1
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts +68 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js +34 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js.map +1 -0
- package/dist/quotes/get-quote-pending-funding/index.d.ts +4 -0
- package/dist/quotes/get-quote-pending-funding/index.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/query.d.ts +58 -0
- package/dist/quotes/get-quote-pending-funding/query.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/query.js +27 -0
- package/dist/quotes/get-quote-pending-funding/query.js.map +1 -0
- package/dist/quotes/get-quote-pending-funding/types.d.ts +19 -0
- package/dist/quotes/get-quote-pending-funding/types.d.ts.map +1 -0
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +2 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
- package/dist/quotes/grouping/aggregate-group-funding.d.ts +9 -8
- package/dist/quotes/grouping/aggregate-group-funding.d.ts.map +1 -1
- package/dist/quotes/grouping/aggregate-group-funding.js.map +1 -1
- package/dist/quotes/grouping/partition-quotes.d.ts +30 -0
- package/dist/quotes/grouping/partition-quotes.d.ts.map +1 -1
- package/dist/quotes/grouping/partition-quotes.js +9 -6
- package/dist/quotes/grouping/partition-quotes.js.map +1 -1
- package/dist/quotes/index.d.ts +1 -0
- package/dist/quotes/index.d.ts.map +1 -1
- package/dist/quotes/unified-quote.d.ts +6 -6
- package/dist/quotes/unified-quote.js.map +1 -1
- package/dist/shared/errors/redact-url.d.ts +15 -0
- package/dist/shared/errors/redact-url.d.ts.map +1 -0
- package/dist/shared/errors/redact-url.js +9 -0
- package/dist/shared/errors/redact-url.js.map +1 -0
- package/dist/shared/errors/retry-after.d.ts +17 -0
- package/dist/shared/errors/retry-after.d.ts.map +1 -0
- package/dist/shared/errors/retry-after.js +16 -0
- package/dist/shared/errors/retry-after.js.map +1 -0
- package/dist/shared/errors/sanitized-api-error.d.ts +32 -0
- package/dist/shared/errors/sanitized-api-error.d.ts.map +1 -0
- package/dist/shared/errors/sanitized-api-error.js +41 -0
- package/dist/shared/errors/sanitized-api-error.js.map +1 -0
- package/dist/shared/errors/symm-error.d.ts +39 -4
- package/dist/shared/errors/symm-error.d.ts.map +1 -1
- package/dist/shared/errors/symm-error.js +29 -15
- package/dist/shared/errors/symm-error.js.map +1 -1
- package/dist/shared/types/properties.d.ts +53 -5
- package/dist/shared/types/properties.d.ts.map +1 -1
- package/dist/shared/utils/core-units.d.ts +82 -0
- package/dist/shared/utils/core-units.d.ts.map +1 -0
- package/dist/shared/utils/core-units.js +21 -0
- package/dist/shared/utils/core-units.js.map +1 -0
- package/dist/shared/utils/http-header.d.ts +16 -0
- package/dist/shared/utils/http-header.d.ts.map +1 -0
- package/dist/shared/utils/http-header.js +14 -0
- package/dist/shared/utils/http-header.js.map +1 -0
- package/dist/shared/utils/query.js +2 -1
- package/dist/shared/utils/query.js.map +1 -1
- package/dist/solvers/force-close/force-close-auto.d.ts +6 -2
- package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-auto.js +2 -1
- package/dist/solvers/force-close/force-close-auto.js.map +1 -1
- package/dist/solvers/force-close/force-close-position.d.ts +9 -3
- package/dist/solvers/force-close/force-close-position.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-position.js +2 -1
- package/dist/solvers/force-close/force-close-position.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +12 -12
- package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +7 -7
- package/dist/symmio-contracts/abi/index.d.ts +2 -0
- package/dist/symmio-contracts/abi/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts +2323 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js +2706 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts +137 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js +145 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/index.d.ts +2 -0
- package/dist/symmio-contracts/abi/v0.8.6/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +1879 -37
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +2180 -50
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +11 -2
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +33 -17
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +9 -2
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +33 -16
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +8 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +8 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +7 -2
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts +9 -3
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +41 -20
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/types.d.ts +3 -1
- package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/types.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts +60 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js +35 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts +91 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js +19 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js +15 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts +79 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js +32 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts +43 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js +14 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +24 -3
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +48 -22
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts +62 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js +35 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts +12 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js +29 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts +39 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js +27 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-is-delegation-active.js +7 -7
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts +42 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js +30 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js +21 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +2 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +87 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +38 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +2 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts +15 -3
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js +34 -17
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +2 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +2 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts +85 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js +29 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +9 -7
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +24 -22
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js +4 -2
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts +43 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js +15 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts +4 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts +43 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js +25 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts +85 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/index.d.ts +5 -0
- package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +2 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +46 -17
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts +18 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.js +12 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.js.map +1 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts +35 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js +28 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/types.d.ts +6 -6
- package/dist/symmio-contracts/symmio/types.js.map +1 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.d.ts +2 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.d.ts.map +1 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.js +24 -21
- package/dist/symmio-subgraph/executeSubgraphRequest.js.map +1 -1
- package/dist/websocket/gasless/close-code-policy.d.ts +51 -0
- package/dist/websocket/gasless/close-code-policy.d.ts.map +1 -0
- package/dist/websocket/gasless/close-code-policy.js +75 -0
- package/dist/websocket/gasless/close-code-policy.js.map +1 -0
- package/dist/websocket/gasless/gasless-stream-hub.d.ts +61 -0
- package/dist/websocket/gasless/gasless-stream-hub.d.ts.map +1 -0
- package/dist/websocket/gasless/gasless-stream-hub.js +311 -0
- package/dist/websocket/gasless/gasless-stream-hub.js.map +1 -0
- package/dist/websocket/gasless/index.d.ts +7 -0
- package/dist/websocket/gasless/index.d.ts.map +1 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.d.ts +82 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.d.ts.map +1 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.js +136 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.js.map +1 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts +58 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts.map +1 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.js +59 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.js.map +1 -0
- package/dist/websocket/gasless/types.d.ts +48 -0
- package/dist/websocket/gasless/types.d.ts.map +1 -0
- package/dist/websocket/gasless/watch-gasless-request.d.ts +72 -0
- package/dist/websocket/gasless/watch-gasless-request.d.ts.map +1 -0
- package/dist/websocket/gasless/watch-gasless-request.js +35 -0
- package/dist/websocket/gasless/watch-gasless-request.js.map +1 -0
- package/dist/websocket/index.d.ts +1 -0
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/socket/create-reconnecting-socket.d.ts +39 -6
- package/dist/websocket/socket/create-reconnecting-socket.d.ts.map +1 -1
- package/dist/websocket/socket/create-reconnecting-socket.js +92 -53
- package/dist/websocket/socket/create-reconnecting-socket.js.map +1 -1
- package/dist/websocket/socket/socket-status.d.ts +7 -2
- package/dist/websocket/socket/socket-status.d.ts.map +1 -1
- package/dist/websocket/socket/socket-status.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","names":[],"sources":["../../src/gasless/errors.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport { SymmApiError, SymmError } from \"../shared/errors/symm-error\";\n\n/**\n * A decoded on-chain custom error the service extracted from a failed\n * `eth_call` simulation and returned inside `details.contract_revert`.\n */\nexport interface GaslessContractRevert {\n /** 4-byte error selector. */\n selector: string;\n /** Custom-error name, e.g. `\"InvalidWalletOperationTarget\"`. */\n error: string;\n /** Full error signature when the node supplied it. */\n signature?: string;\n /**\n * Decoded argument values — a positional array, or an object keyed by\n * parameter name. The vendor sends whichever its decoder produced, so both\n * shapes reach a consumer and neither can be assumed; narrow with\n * `Array.isArray` before indexing.\n */\n arguments?: readonly unknown[] | Record<string, unknown>;\n /** Decoded arguments keyed by parameter name, when available. */\n decoded?: Record<string, unknown> | string;\n}\n\n/**\n * The batch entry an `OperationFailed(operationIndex, revertData)` revert\n * blames, as the service reported it.\n *\n * The InstantLayer wraps every inner revert of a relayed batch in this error,\n * so the generic simulation message never names the call that actually failed.\n * Decode `revertData` against the failing target's ABI with\n * {@link decodeGaslessOperationFailure} to get the real cause.\n */\nexport interface GaslessFailedOperation {\n /** Zero-based position of the failing operation in the submitted batch. */\n index: number;\n /** The inner revert data, to decode against the target contract's ABI. */\n revertData: Hex;\n}\n\n/**\n * One request-validation failure from a FastAPI `422` response, whose body is\n * `{ \"detail\": [{ \"loc\", \"msg\", \"type\" }] }`. The service rejected the\n * payload's shape before acting on it, so a `422` is a client bug to fix, not a\n * condition a user can resolve.\n */\nexport interface GaslessValidationIssue {\n /** Path to the offending input, e.g. `[\"path\", \"request_id\"]` or `[\"body\", \"signedOps\", 0, \"target\"]`. */\n loc: readonly (string | number)[];\n /** Human-readable reason. */\n msg: string;\n /** Machine-readable failure type, e.g. `\"uuid_parsing\"` or `\"missing\"`. */\n type: string;\n}\n\n/**\n * The vendor's structured error detail, normalized from whichever envelope an\n * HTTP error used: the service's `{ detail: { code, message, details } }`, the\n * gateway's own `{ error }`, or a FastAPI `422` `{ detail: [...] }`.\n */\nexport interface GaslessErrorDetail {\n /** Vendor error code, e.g. `\"SIMULATION_REVERTED\"`, `\"INSUFFICIENT_ALLOWANCE\"`. */\n code: string | null;\n /** Human-readable vendor message. */\n message: string | null;\n /** Safe diagnostic context; `contract_revert` is surfaced separately. */\n details: Record<string, unknown> | null;\n /** Decoded on-chain revert, when the node returned custom-error data. */\n contractRevert: GaslessContractRevert | null;\n /**\n * The gateway's own error string, from its `{ \"error\": \"…\" }` envelope.\n * The gateway answers authentication, routing and rate-limit failures itself\n * before any service sees the request, e.g.\n * `\"Unknown or disabled protocol instance: …\"` or `\"Rate limit exceeded\"`.\n * `null` for errors the service returned.\n */\n gatewayError: string | null;\n /** The request-validation issues of a FastAPI `422` response; `null` for any other error. */\n validationErrors: readonly GaslessValidationIssue[] | null;\n /**\n * The node's plain revert string (`revert_message`), when the simulation\n * produced one. Prefer it, `contractRevert` and {@link GaslessErrorDetail.failedOperation}\n * over the generic `message` when deciding what the user can fix — an\n * `\"OperationalFee: Insufficient balance\"` here names the payer's shortfall,\n * which the simulation message does not.\n */\n revertMessage: string | null;\n /** The service's own decoded view of the revert (`decoded_revert`), in whatever shape it sent. */\n decodedRevert: unknown;\n /** The nested JSON-RPC error (`rpc_error`) the node returned, when the failure came from the chain. */\n rpcError: Record<string, unknown> | null;\n /** The failing batch entry of an `OperationFailed` revert; `null` when the service named none. */\n failedOperation: GaslessFailedOperation | null;\n}\n\n/**\n * Every string the service offered about a revert, joined into one haystack.\n *\n * The same cause reaches the client under different keys depending on how far\n * the service got decoding it — a custom-error name, a full signature, a\n * decoded string, the node's `revert_message`, or only the generic message — so\n * a predicate that reads one of them misses the other four.\n *\n * @param detail - A parsed vendor detail, or `null`.\n * @returns The concatenated revert text, empty when there is none.\n *\n * @internal\n */\nexport function gaslessRevertText(detail: GaslessErrorDetail | null): string {\n if (!detail) return \"\";\n const revert = detail.contractRevert;\n return [\n revert?.error,\n revert?.signature,\n typeof revert?.decoded === \"string\" ? revert.decoded : undefined,\n detail.revertMessage,\n typeof detail.decodedRevert === \"string\" ? detail.decodedRevert : undefined,\n detail.message,\n ]\n .filter((part): part is string => typeof part === \"string\")\n .join(\" | \");\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\n/**\n * Normalize a FastAPI `detail` array into validation issues, keeping only\n * `loc`, `msg` and `type`. The raw `input` and `ctx` echo request content and\n * stay in `responseData`. A malformed entry keeps whatever fields it has, with\n * empty fallbacks.\n */\nfunction toValidationIssues(detail: unknown[]): GaslessValidationIssue[] {\n return detail.flatMap((entry): GaslessValidationIssue[] => {\n if (typeof entry === \"string\") return [{ loc: [], msg: entry, type: \"\" }];\n const record = asRecord(entry);\n if (!record) return [];\n return [\n {\n loc: Array.isArray(record.loc)\n ? record.loc.filter((part): part is string | number => typeof part === \"string\" || typeof part === \"number\")\n : [],\n msg: typeof record.msg === \"string\" ? record.msg : \"\",\n type: typeof record.type === \"string\" ? record.type : \"\",\n },\n ];\n });\n}\n\n/**\n * Read a diagnostic field the vendor may place either directly on `detail` or\n * one level down in `detail.details`, under its snake_case wire name or the\n * camelCase twin a JSON re-serializer may have produced.\n *\n * The release notes the fields (`revert_message`, `decoded_revert`, nested\n * `rpc_error`) without pinning the level they sit at, and the two observed\n * envelopes disagree, so both are searched rather than guessed.\n */\nfunction pickDiagnostic(sources: readonly (Record<string, unknown> | null)[], ...names: readonly string[]): unknown {\n for (const source of sources) {\n if (!source) continue;\n for (const name of names) {\n if (source[name] !== undefined && source[name] !== null) return source[name];\n }\n }\n return undefined;\n}\n\n/** Coerce a wire index (number, bigint or decimal string) to a safe array index. */\nfunction toOperationIndex(value: unknown): number | null {\n if (typeof value === \"number\") return Number.isSafeInteger(value) && value >= 0 ? value : null;\n if (typeof value === \"bigint\") return value >= 0n && value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : null;\n if (typeof value === \"string\" && /^\\d+$/.test(value)) {\n const parsed = Number(value);\n return Number.isSafeInteger(parsed) ? parsed : null;\n }\n return null;\n}\n\n/** Coerce a wire revert-data field to `Hex`; anything else is not decodable. */\nfunction toRevertData(value: unknown): Hex | null {\n return typeof value === \"string\" && /^0x[0-9a-fA-F]*$/.test(value) ? (value as Hex) : null;\n}\n\n/**\n * Locate the failing batch entry of an `OperationFailed(operationIndex,\n * revertData)` revert.\n *\n * Two shapes carry it, and which one arrives depends on how far the service\n * decoded the revert: an explicit `failed_operation` bag beside the other\n * diagnostics, or the decoded `contract_revert` itself, whose arguments are\n * positional in one deployment and keyed by parameter name in another.\n */\nfunction toFailedOperation(\n sources: readonly (Record<string, unknown> | null)[],\n contractRevert: GaslessContractRevert | null,\n): GaslessFailedOperation | null {\n const bag = asRecord(pickDiagnostic(sources, \"failed_operation\", \"failedOperation\"));\n const candidates: (Record<string, unknown> | null)[] = [bag, ...sources];\n for (const candidate of candidates) {\n if (!candidate) continue;\n const index = toOperationIndex(candidate.index ?? candidate.operation_index ?? candidate.operationIndex);\n const revertData = toRevertData(candidate.revert_data ?? candidate.revertData);\n if (index !== null && revertData !== null) return { index, revertData };\n }\n\n if (contractRevert?.error !== \"OperationFailed\") return null;\n const args = contractRevert.arguments;\n if (Array.isArray(args)) {\n const index = toOperationIndex(args[0]);\n const revertData = toRevertData(args[1]);\n return index !== null && revertData !== null ? { index, revertData } : null;\n }\n const keyed = asRecord(args) ?? asRecord(contractRevert.decoded);\n if (!keyed) return null;\n const index = toOperationIndex(keyed.operationIndex ?? keyed.operation_index ?? keyed.index);\n const revertData = toRevertData(keyed.revertData ?? keyed.revert_data);\n return index !== null && revertData !== null ? { index, revertData } : null;\n}\n\n/**\n * Recover the vendor response body from an error that merely *carries* one.\n *\n * Framework layers re-wrap {@link SymmApiError} into their own error type —\n * `@symmio/trading-react`'s `normalizeSymmError` produces a `SymmioRequestError`\n * that extends `Error` while preserving `responseData`. Without this the\n * `instanceof Error` bail below would discard the gateway's decoded revert\n * exactly where a consumer needs it most: through a hook. Matched structurally\n * because `core` cannot import a framework layer's error class.\n */\nfunction unwrapBody(err: unknown): unknown {\n if (typeof err === \"object\" && err !== null && \"responseData\" in err) {\n return (err as { responseData: unknown }).responseData;\n }\n return err;\n}\n\n/**\n * Extract the vendor's error detail from any error a gasless action throws:\n * the service's `{ code, message, details }` (including a decoded\n * `contract_revert`, when present), the gateway's own `{ error }` string, or a\n * FastAPI `422`'s validation issues.\n *\n * Gasless HTTP failures are thrown as `SymmApiError` with the raw response\n * body preserved in `responseData`; this digs the vendor envelope out of it so\n * UIs can branch on the vendor code (`FEE_POLICY_WOULD_REVERT`,\n * `INSUFFICIENT_ALLOWANCE`, `SIMULATION_REVERTED`, …) without re-parsing.\n * Also understands the flat `{ error_code, error_message }` shape stored on\n * polled records.\n *\n * @param err - Anything caught from a gasless action or read from a record.\n * @returns The normalized detail, or `null` when none can be extracted.\n *\n * @example\n * ```ts\n * try {\n * await relayInstantOperations(config, parameters);\n * } catch (err) {\n * const detail = parseGaslessErrorDetail(err);\n * if (detail?.contractRevert) showRevert(detail.contractRevert.error);\n * }\n * ```\n */\nexport function parseGaslessErrorDetail(err: unknown): GaslessErrorDetail | null {\n const body = err instanceof SymmApiError ? err.responseData : err instanceof SymmError ? null : unwrapBody(err);\n /** A plain Error is not a response body — its `message` is not vendor detail. */\n if (body instanceof Error) return null;\n const record = asRecord(body);\n if (!record) return null;\n\n const gatewayError = typeof record.error === \"string\" ? record.error : null;\n const validationIssues = Array.isArray(record.detail) ? toValidationIssues(record.detail) : [];\n const validationErrors = validationIssues.length > 0 ? validationIssues : null;\n\n const detail = asRecord(record.detail) ?? record;\n const code = detail.code ?? detail.error_code;\n const message = detail.message ?? detail.error_message;\n const details = asRecord(detail.details);\n const rawRevert = asRecord(pickDiagnostic([detail, details], \"contract_revert\", \"contractRevert\"));\n\n if (code === undefined && message === undefined && !details && gatewayError === null && validationErrors === null) {\n return null;\n }\n\n const revertArguments = rawRevert?.arguments;\n const contractRevert: GaslessContractRevert | null =\n rawRevert && typeof rawRevert.error === \"string\"\n ? {\n selector: typeof rawRevert.selector === \"string\" ? rawRevert.selector : \"0x\",\n error: rawRevert.error,\n ...(typeof rawRevert.signature === \"string\" ? { signature: rawRevert.signature } : {}),\n ...(Array.isArray(revertArguments) || asRecord(revertArguments)\n ? { arguments: revertArguments as GaslessContractRevert[\"arguments\"] }\n : {}),\n ...(rawRevert.decoded !== undefined\n ? { decoded: rawRevert.decoded as GaslessContractRevert[\"decoded\"] }\n : {}),\n }\n : null;\n\n /** The two levels the vendor places diagnostics at, searched in that order. */\n const sources = [detail, details];\n const revertMessage = pickDiagnostic(sources, \"revert_message\", \"revertMessage\");\n\n return {\n code: typeof code === \"string\" ? code : null,\n message: typeof message === \"string\" ? message : null,\n details,\n contractRevert,\n gatewayError,\n validationErrors,\n revertMessage: typeof revertMessage === \"string\" ? revertMessage : null,\n decodedRevert: pickDiagnostic(sources, \"decoded_revert\", \"decodedRevert\"),\n rpcError: asRecord(pickDiagnostic(sources, \"rpc_error\", \"rpcError\")),\n failedOperation: toFailedOperation(sources, contractRevert),\n };\n}\n"],"mappings":";;AA6GA,SAAgB,EAAkB,GAA2C;CAC3E,IAAI,CAAC,GAAQ,OAAO;CACpB,IAAM,IAAS,EAAO;CACtB,OAAO;EACL,GAAQ;EACR,GAAQ;EACR,OAAO,GAAQ,WAAY,WAAW,EAAO,UAAU,KAAA;EACvD,EAAO;EACP,OAAO,EAAO,iBAAkB,WAAW,EAAO,gBAAgB,KAAA;EAClE,EAAO;CACT,EACG,QAAQ,MAAyB,OAAO,KAAS,QAAQ,EACzD,KAAK,KAAK;AACf;AAEA,SAAS,EAAS,GAAgD;CAChE,OAAyB,OAAO,KAAU,YAAnC,KAA+C,CAAC,MAAM,QAAQ,CAAK,IACrE,IACD;AACN;AAQA,SAAS,EAAmB,GAA6C;CACvE,OAAO,EAAO,SAAS,MAAoC;EACzD,IAAI,OAAO,KAAU,UAAU,OAAO,CAAC;GAAE,KAAK,CAAC;GAAG,KAAK;GAAO,MAAM;EAAG,CAAC;EACxE,IAAM,IAAS,EAAS,CAAK;EAE7B,OADK,IACE,CACL;GACE,KAAK,MAAM,QAAQ,EAAO,GAAG,IACzB,EAAO,IAAI,QAAQ,MAAkC,OAAO,KAAS,YAAY,OAAO,KAAS,QAAQ,IACzG,CAAC;GACL,KAAK,OAAO,EAAO,OAAQ,WAAW,EAAO,MAAM;GACnD,MAAM,OAAO,EAAO,QAAS,WAAW,EAAO,OAAO;EACxD,CACF,IAToB,CAAC;CAUvB,CAAC;AACH;AAWA,SAAS,EAAe,GAAsD,GAAG,GAAmC;CAClH,KAAK,IAAM,KAAU,GACd,OACL;OAAK,IAAM,KAAQ,GACjB,IAAI,EAAO,OAAU,KAAA,KAAa,EAAO,OAAU,MAAM,OAAO,EAAO;CAAA;AAI7E;AAGA,SAAS,EAAiB,GAA+B;CACvD,IAAI,OAAO,KAAU,UAAU,OAAO,OAAO,cAAc,CAAK,KAAK,KAAS,IAAI,IAAQ;CAC1F,IAAI,OAAO,KAAU,UAAU,OAAO,KAAS,MAAM,KAAS,kBAA8B,IAAI,OAAO,CAAK,IAAI;CAChH,IAAI,OAAO,KAAU,YAAY,QAAQ,KAAK,CAAK,GAAG;EACpD,IAAM,IAAS,OAAO,CAAK;EAC3B,OAAO,OAAO,cAAc,CAAM,IAAI,IAAS;CACjD;CACA,OAAO;AACT;AAGA,SAAS,EAAa,GAA4B;CAChD,OAAO,OAAO,KAAU,YAAY,mBAAmB,KAAK,CAAK,IAAK,IAAgB;AACxF;AAWA,SAAS,EACP,GACA,GAC+B;CAE/B,IAAM,IAAiD,CAD3C,EAAS,EAAe,GAAS,oBAAoB,iBAAiB,CAC1B,GAAK,GAAG,CAAO;CACvE,KAAK,IAAM,KAAa,GAAY;EAClC,IAAI,CAAC,GAAW;EAChB,IAAM,IAAQ,EAAiB,EAAU,SAAS,EAAU,mBAAmB,EAAU,cAAc,GACjG,IAAa,EAAa,EAAU,eAAe,EAAU,UAAU;EAC7E,IAAI,MAAU,QAAQ,MAAe,MAAM,OAAO;GAAE;GAAO;EAAW;CACxE;CAEA,IAAI,GAAgB,UAAU,mBAAmB,OAAO;CACxD,IAAM,IAAO,EAAe;CAC5B,IAAI,MAAM,QAAQ,CAAI,GAAG;EACvB,IAAM,IAAQ,EAAiB,EAAK,EAAE,GAChC,IAAa,EAAa,EAAK,EAAE;EACvC,OAAO,MAAU,QAAQ,MAAe,OAAO;GAAE;GAAO;EAAW,IAAI;CACzE;CACA,IAAM,IAAQ,EAAS,CAAI,KAAK,EAAS,EAAe,OAAO;CAC/D,IAAI,CAAC,GAAO,OAAO;CACnB,IAAM,IAAQ,EAAiB,EAAM,kBAAkB,EAAM,mBAAmB,EAAM,KAAK,GACrF,IAAa,EAAa,EAAM,cAAc,EAAM,WAAW;CACrE,OAAO,MAAU,QAAQ,MAAe,OAAO;EAAE;EAAO;CAAW,IAAI;AACzE;AAYA,SAAS,EAAW,GAAuB;CAIzC,OAHI,OAAO,KAAQ,YAAY,KAAgB,kBAAkB,IACvD,EAAkC,eAErC;AACT;AA4BA,SAAgB,EAAwB,GAAyC;CAC/E,IAAM,IAAO,aAAe,IAAe,EAAI,eAAe,aAAe,IAAY,OAAO,EAAW,CAAG;CAE9G,IAAI,aAAgB,OAAO,OAAO;CAClC,IAAM,IAAS,EAAS,CAAI;CAC5B,IAAI,CAAC,GAAQ,OAAO;CAEpB,IAAM,IAAe,OAAO,EAAO,SAAU,WAAW,EAAO,QAAQ,MACjE,IAAmB,MAAM,QAAQ,EAAO,MAAM,IAAI,EAAmB,EAAO,MAAM,IAAI,CAAC,GACvF,IAAmB,EAAiB,SAAS,IAAI,IAAmB,MAEpE,IAAS,EAAS,EAAO,MAAM,KAAK,GACpC,IAAO,EAAO,QAAQ,EAAO,YAC7B,IAAU,EAAO,WAAW,EAAO,eACnC,IAAU,EAAS,EAAO,OAAO,GACjC,IAAY,EAAS,EAAe,CAAC,GAAQ,CAAO,GAAG,mBAAmB,gBAAgB,CAAC;CAEjG,IAAI,MAAS,KAAA,KAAa,MAAY,KAAA,KAAa,CAAC,KAAW,MAAiB,QAAQ,MAAqB,MAC3G,OAAO;CAGT,IAAM,IAAkB,GAAW,WAC7B,IACJ,KAAa,OAAO,EAAU,SAAU,WACpC;EACE,UAAU,OAAO,EAAU,YAAa,WAAW,EAAU,WAAW;EACxE,OAAO,EAAU;EACjB,GAAI,OAAO,EAAU,aAAc,WAAW,EAAE,WAAW,EAAU,UAAU,IAAI,CAAC;EACpF,GAAI,MAAM,QAAQ,CAAe,KAAK,EAAS,CAAe,IAC1D,EAAE,WAAW,EAAsD,IACnE,CAAC;EACL,GAAI,EAAU,YAAY,KAAA,IAEtB,CAAC,IADD,EAAE,SAAS,EAAU,QAA4C;CAEvE,IACA,MAGA,IAAU,CAAC,GAAQ,CAAO,GAC1B,IAAgB,EAAe,GAAS,kBAAkB,eAAe;CAE/E,OAAO;EACL,MAAM,OAAO,KAAS,WAAW,IAAO;EACxC,SAAS,OAAO,KAAY,WAAW,IAAU;EACjD;EACA;EACA;EACA;EACA,eAAe,OAAO,KAAkB,WAAW,IAAgB;EACnE,eAAe,EAAe,GAAS,kBAAkB,eAAe;EACxE,UAAU,EAAS,EAAe,GAAS,aAAa,UAAU,CAAC;EACnE,iBAAiB,EAAkB,GAAS,CAAc;CAC5D;AACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GaslessExecutionConfig } from '../core/chains/types.js';
|
|
2
|
+
import { GaslessRequest } from './types.js';
|
|
3
|
+
/** One event the gasless execution observer can receive. */
|
|
4
|
+
export type GaslessRelayObserverEvent = Parameters<NonNullable<GaslessExecutionConfig["onEvent"]>>[0];
|
|
5
|
+
/**
|
|
6
|
+
* Notify the config's gasless observer, swallowing anything it throws.
|
|
7
|
+
*
|
|
8
|
+
* The observer exists so a consumer can persist a `requestId` the moment a
|
|
9
|
+
* relay is accepted — there is no list-by-wallet endpoint, so an id lost to a
|
|
10
|
+
* reload is unrecoverable. That makes it load-bearing but untrusted: a throwing
|
|
11
|
+
* observer must never take down the write it is observing.
|
|
12
|
+
*
|
|
13
|
+
* @param onEvent - The observer from `gasless.execution.onEvent`, if any.
|
|
14
|
+
* @param event - The event to deliver.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function fireGaslessEvent(onEvent: GaslessExecutionConfig["onEvent"], event: GaslessRelayObserverEvent): void;
|
|
19
|
+
/**
|
|
20
|
+
* Render a request record as the vendor's wire shape, for attaching to a
|
|
21
|
+
* {@link SymmApiError} as `responseData`.
|
|
22
|
+
*
|
|
23
|
+
* A terminal failure is not a transport failure — there is no HTTP error to
|
|
24
|
+
* carry it — so the record travels in the error body instead, and consumers
|
|
25
|
+
* read the real cause off `responseData` rather than parsing a message.
|
|
26
|
+
*
|
|
27
|
+
* Wallet ids are rendered as the decimal strings the service uses on the wire,
|
|
28
|
+
* so the body stays JSON-serializable — a `bigint` would throw in
|
|
29
|
+
* `JSON.stringify` the moment a consumer logged the error.
|
|
30
|
+
*
|
|
31
|
+
* @param record - The terminal request record.
|
|
32
|
+
* @returns The snake_case body shape the service itself would return.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function toGaslessRecordBody(record: GaslessRequest): Record<string, unknown>;
|
|
37
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/gasless/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,WAAW,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtG;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAMnH;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBnF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/gasless/events.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
try {
|
|
4
|
+
e?.(t);
|
|
5
|
+
} catch {}
|
|
6
|
+
}
|
|
7
|
+
function t(e) {
|
|
8
|
+
let t = {
|
|
9
|
+
request_id: e.requestId,
|
|
10
|
+
status: e.status,
|
|
11
|
+
error_code: e.errorCode,
|
|
12
|
+
error_message: e.errorMessage,
|
|
13
|
+
idempotency_key: e.idempotencyKey,
|
|
14
|
+
tx_hash: e.txHash,
|
|
15
|
+
wallet_ids: e.walletIds.map((e) => e.toString()),
|
|
16
|
+
created_at: e.createdAt,
|
|
17
|
+
updated_at: e.updatedAt
|
|
18
|
+
};
|
|
19
|
+
return e.service === "deposits" ? {
|
|
20
|
+
...t,
|
|
21
|
+
wallet_address: e.owner,
|
|
22
|
+
wallet_id: e.walletId.toString(),
|
|
23
|
+
deposit_address: e.depositAddress
|
|
24
|
+
} : {
|
|
25
|
+
...t,
|
|
26
|
+
user_address: e.owner,
|
|
27
|
+
operation_type: e.operationType,
|
|
28
|
+
account_id: e.accountId
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { e as fireGaslessEvent, t as toGaslessRecordBody };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../../src/gasless/events.ts"],"sourcesContent":["import type { GaslessExecutionConfig } from \"../core/chains/types\";\nimport type { GaslessRequest } from \"./types\";\n\n/** One event the gasless execution observer can receive. */\nexport type GaslessRelayObserverEvent = Parameters<NonNullable<GaslessExecutionConfig[\"onEvent\"]>>[0];\n\n/**\n * Notify the config's gasless observer, swallowing anything it throws.\n *\n * The observer exists so a consumer can persist a `requestId` the moment a\n * relay is accepted — there is no list-by-wallet endpoint, so an id lost to a\n * reload is unrecoverable. That makes it load-bearing but untrusted: a throwing\n * observer must never take down the write it is observing.\n *\n * @param onEvent - The observer from `gasless.execution.onEvent`, if any.\n * @param event - The event to deliver.\n *\n * @internal\n */\nexport function fireGaslessEvent(onEvent: GaslessExecutionConfig[\"onEvent\"], event: GaslessRelayObserverEvent): void {\n try {\n onEvent?.(event);\n } catch {\n /** Observer failures must never break the write. */\n }\n}\n\n/**\n * Render a request record as the vendor's wire shape, for attaching to a\n * {@link SymmApiError} as `responseData`.\n *\n * A terminal failure is not a transport failure — there is no HTTP error to\n * carry it — so the record travels in the error body instead, and consumers\n * read the real cause off `responseData` rather than parsing a message.\n *\n * Wallet ids are rendered as the decimal strings the service uses on the wire,\n * so the body stays JSON-serializable — a `bigint` would throw in\n * `JSON.stringify` the moment a consumer logged the error.\n *\n * @param record - The terminal request record.\n * @returns The snake_case body shape the service itself would return.\n *\n * @internal\n */\nexport function toGaslessRecordBody(record: GaslessRequest): Record<string, unknown> {\n const body: Record<string, unknown> = {\n request_id: record.requestId,\n status: record.status,\n error_code: record.errorCode,\n error_message: record.errorMessage,\n idempotency_key: record.idempotencyKey,\n tx_hash: record.txHash,\n wallet_ids: record.walletIds.map((walletId) => walletId.toString()),\n created_at: record.createdAt,\n updated_at: record.updatedAt,\n };\n\n return record.service === \"deposits\"\n ? {\n ...body,\n wallet_address: record.owner,\n wallet_id: record.walletId.toString(),\n deposit_address: record.depositAddress,\n }\n : { ...body, user_address: record.owner, operation_type: record.operationType, account_id: record.accountId };\n}\n"],"mappings":";AAmBA,SAAgB,EAAiB,GAA4C,GAAwC;CACnH,IAAI;EACF,IAAU,CAAK;CACjB,QAAQ,CAER;AACF;AAmBA,SAAgB,EAAoB,GAAiD;CACnF,IAAM,IAAgC;EACpC,YAAY,EAAO;EACnB,QAAQ,EAAO;EACf,YAAY,EAAO;EACnB,eAAe,EAAO;EACtB,iBAAiB,EAAO;EACxB,SAAS,EAAO;EAChB,YAAY,EAAO,UAAU,KAAK,MAAa,EAAS,SAAS,CAAC;EAClE,YAAY,EAAO;EACnB,YAAY,EAAO;CACrB;CAEA,OAAO,EAAO,YAAY,aACtB;EACE,GAAG;EACH,gBAAgB,EAAO;EACvB,WAAW,EAAO,SAAS,SAAS;EACpC,iBAAiB,EAAO;CAC1B,IACA;EAAE,GAAG;EAAM,cAAc,EAAO;EAAO,gBAAgB,EAAO;EAAe,YAAY,EAAO;CAAU;AAChH"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an error is a **definitive fee/quota rejection** — the relay refused
|
|
3
|
+
* the request before any broadcast because the billing account hit its daily
|
|
4
|
+
* quota, lacks allowance, or cannot cover the fee. One of only two situations
|
|
5
|
+
* where a wallet-paid retry of the same intent is safe.
|
|
6
|
+
*
|
|
7
|
+
* Three shapes qualify, all of them pre-broadcast:
|
|
8
|
+
*
|
|
9
|
+
* - a fee code (`FEE_POLICY_WOULD_REVERT` / `INSUFFICIENT_ALLOWANCE`) on any
|
|
10
|
+
* `4xx` — the service answered with a verdict, and a `4xx` is by definition
|
|
11
|
+
* not an acceptance;
|
|
12
|
+
* - a `400 SIMULATION_REVERTED` whose decoded revert is **billing-specific**
|
|
13
|
+
* (`OperationalFee: …`, `DailyFreeOpsLimitExceeded`, `FeeLimitExceeded`) —
|
|
14
|
+
* the operation simulates, only the charge does not;
|
|
15
|
+
* - a stored record that ended `rejected` carrying either of those — the worker
|
|
16
|
+
* refused it before any broadcast.
|
|
17
|
+
*
|
|
18
|
+
* A matching code on an ambiguous transport failure never qualifies, and
|
|
19
|
+
* neither does an unconfirmed submit: the request may still execute.
|
|
20
|
+
*
|
|
21
|
+
* @param err - Anything caught from a gasless submit, or a polled record error.
|
|
22
|
+
* @returns `true` only for a confirmed pre-broadcast fee/quota rejection.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* if (isConfirmedGaslessFeeLimitError(err)) await payFromWallet();
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function isConfirmedGaslessFeeLimitError(err: unknown): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether an error means the gasless relay is **definitively unavailable** —
|
|
32
|
+
* the gateway refused the request itself, before any service saw it, so
|
|
33
|
+
* nothing was accepted and nothing can execute.
|
|
34
|
+
*
|
|
35
|
+
* Exactly two statuses qualify: `429` (rate limited, dropped at the gateway)
|
|
36
|
+
* and a `503` carrying the gateway's own `{ error }` envelope (its
|
|
37
|
+
* configuration is not ready). Both are reported only after the SDK's own
|
|
38
|
+
* same-key retries are exhausted, and only when no attempt of that submit was
|
|
39
|
+
* ambiguous: a refusal of the resend says nothing about the attempt before it,
|
|
40
|
+
* so the SDK reports that submit as `GASLESS_SUBMIT_UNCONFIRMED` instead.
|
|
41
|
+
*
|
|
42
|
+
* **`0`, `502`, `504`, a timeout and a bare `503` never qualify**, however much
|
|
43
|
+
* they look like an outage: the request may have reached the service and been
|
|
44
|
+
* accepted, and a wallet-paid retry would then execute the same intent twice.
|
|
45
|
+
* Those surface as `GASLESS_SUBMIT_UNCONFIRMED` instead — replay them with
|
|
46
|
+
* `resubmitGaslessRequest`. A gateway `404` does not qualify either: it names
|
|
47
|
+
* an unknown or disabled instance, which is a configuration error that a wallet
|
|
48
|
+
* retry papers over.
|
|
49
|
+
*
|
|
50
|
+
* Callers must still pair this with a not-yet-accepted guard: after a `202` the
|
|
51
|
+
* workflow exists server-side, and even a `404` while polling (the
|
|
52
|
+
* accept-vs-record race) must never trigger a wallet-paid retry.
|
|
53
|
+
*
|
|
54
|
+
* @param err - Anything caught from a gasless submit.
|
|
55
|
+
* @returns `true` for a pre-acceptance `429` or gateway `503`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isConfirmedGaslessUnavailableError(err: unknown): boolean;
|
|
58
|
+
//# sourceMappingURL=fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/gasless/fallback.ts"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAqBrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIxE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { gaslessRevertText as e, parseGaslessErrorDetail as t } from "./errors.js";
|
|
2
|
+
import { getGaslessUnconfirmedSubmit as n, readGaslessErrorStatus as r } from "./unconfirmed-submit.js";
|
|
3
|
+
import { classifyGaslessHttpStatus as i } from "./http.js";
|
|
4
|
+
import { GaslessRequestStatus as a } from "./types.js";
|
|
5
|
+
//#region src/gasless/fallback.ts
|
|
6
|
+
var o = new Set(["FEE_POLICY_WOULD_REVERT", "INSUFFICIENT_ALLOWANCE"]), s = [
|
|
7
|
+
"OperationalFee:",
|
|
8
|
+
"DailyFreeOpsLimitExceeded",
|
|
9
|
+
"FeeLimitExceeded"
|
|
10
|
+
];
|
|
11
|
+
function c(t) {
|
|
12
|
+
let n = e(t);
|
|
13
|
+
return s.some((e) => n.includes(e));
|
|
14
|
+
}
|
|
15
|
+
function l(e) {
|
|
16
|
+
let t = typeof e == "object" && e && "responseData" in e ? e.responseData : e;
|
|
17
|
+
return typeof t == "object" && t ? t.status : void 0;
|
|
18
|
+
}
|
|
19
|
+
function u(e) {
|
|
20
|
+
if (n(e) !== null) return !1;
|
|
21
|
+
let i = t(e);
|
|
22
|
+
if (!i) return !1;
|
|
23
|
+
let s = r(e), u = i.code !== null && o.has(i.code);
|
|
24
|
+
return u && s !== void 0 && s >= 400 && s < 500 || i.code === "SIMULATION_REVERTED" && s === 400 && c(i) ? !0 : l(e) === a.REJECTED && (u || c(i));
|
|
25
|
+
}
|
|
26
|
+
function d(e) {
|
|
27
|
+
if (n(e) !== null) return !1;
|
|
28
|
+
let t = i(e);
|
|
29
|
+
return t === "rate-limited" || t === "gateway-not-ready";
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { u as isConfirmedGaslessFeeLimitError, d as isConfirmedGaslessUnavailableError };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.js","names":[],"sources":["../../src/gasless/fallback.ts"],"sourcesContent":["import { gaslessRevertText, parseGaslessErrorDetail, type GaslessErrorDetail } from \"./errors\";\nimport { classifyGaslessHttpStatus } from \"./http\";\nimport { GaslessRequestStatus } from \"./types\";\nimport { getGaslessUnconfirmedSubmit, readGaslessErrorStatus } from \"./unconfirmed-submit\";\n\n/**\n * Vendor codes that mean the gateway's **fee policy** refused the request —\n * daily free quota exhausted, selector blocked, or an insufficient\n * operational-fee allowance.\n */\nconst GASLESS_FEE_LIMIT_CODES = new Set([\"FEE_POLICY_WOULD_REVERT\", \"INSUFFICIENT_ALLOWANCE\"]);\n\n/**\n * Revert fragments that identify a **billing-only** simulation failure: the\n * batch itself simulates, and only the fee charge does not.\n *\n * `OperationalFee:` is the GaslessLayer's require-string prefix (balance and\n * allowance shortfalls), `DailyFreeOpsLimitExceeded` is the free-quota revert,\n * and `FeeLimitExceeded` is the caller's own fee cap. Nothing else in a\n * `SIMULATION_REVERTED` is safe to treat this way: an ordinary revert means the\n * operation would have failed on-chain too, and retrying it through the wallet\n * only burns gas on the same revert.\n */\nconst GASLESS_BILLING_REVERT_FRAGMENTS = [\"OperationalFee:\", \"DailyFreeOpsLimitExceeded\", \"FeeLimitExceeded\"];\n\nfunction isBillingRevert(detail: GaslessErrorDetail): boolean {\n const text = gaslessRevertText(detail);\n return GASLESS_BILLING_REVERT_FRAGMENTS.some((fragment) => text.includes(fragment));\n}\n\n/** The stored workflow status of a record that rides inside an error, if any. */\nfunction recordStatus(err: unknown): unknown {\n const body = typeof err === \"object\" && err !== null && \"responseData\" in err ? err.responseData : err;\n return typeof body === \"object\" && body !== null ? (body as { status?: unknown }).status : undefined;\n}\n\n/**\n * Whether an error is a **definitive fee/quota rejection** — the relay refused\n * the request before any broadcast because the billing account hit its daily\n * quota, lacks allowance, or cannot cover the fee. One of only two situations\n * where a wallet-paid retry of the same intent is safe.\n *\n * Three shapes qualify, all of them pre-broadcast:\n *\n * - a fee code (`FEE_POLICY_WOULD_REVERT` / `INSUFFICIENT_ALLOWANCE`) on any\n * `4xx` — the service answered with a verdict, and a `4xx` is by definition\n * not an acceptance;\n * - a `400 SIMULATION_REVERTED` whose decoded revert is **billing-specific**\n * (`OperationalFee: …`, `DailyFreeOpsLimitExceeded`, `FeeLimitExceeded`) —\n * the operation simulates, only the charge does not;\n * - a stored record that ended `rejected` carrying either of those — the worker\n * refused it before any broadcast.\n *\n * A matching code on an ambiguous transport failure never qualifies, and\n * neither does an unconfirmed submit: the request may still execute.\n *\n * @param err - Anything caught from a gasless submit, or a polled record error.\n * @returns `true` only for a confirmed pre-broadcast fee/quota rejection.\n *\n * @example\n * ```ts\n * if (isConfirmedGaslessFeeLimitError(err)) await payFromWallet();\n * ```\n */\nexport function isConfirmedGaslessFeeLimitError(err: unknown): boolean {\n /** An unconfirmed submit may be executing, whatever the last status said. */\n if (getGaslessUnconfirmedSubmit(err) !== null) return false;\n\n const detail = parseGaslessErrorDetail(err);\n if (!detail) return false;\n const status = readGaslessErrorStatus(err);\n const feeCode = detail.code !== null && GASLESS_FEE_LIMIT_CODES.has(detail.code);\n\n /** Any `4xx` is a verdict the service reached before accepting anything. */\n if (feeCode && status !== undefined && status >= 400 && status < 500) return true;\n if (detail.code === \"SIMULATION_REVERTED\" && status === 400 && isBillingRevert(detail)) return true;\n\n /**\n * A `rejected` terminal surfaced after acceptance: the workflow record rides\n * in `responseData` (manually-constructed SymmApiError) or the value itself\n * is a record. `rejected` means the worker refused it before any broadcast,\n * so a wallet retry cannot double-execute — but only a billing cause makes\n * retrying it from the wallet sensible rather than a second guaranteed revert.\n */\n return recordStatus(err) === GaslessRequestStatus.REJECTED && (feeCode || isBillingRevert(detail));\n}\n\n/**\n * Whether an error means the gasless relay is **definitively unavailable** —\n * the gateway refused the request itself, before any service saw it, so\n * nothing was accepted and nothing can execute.\n *\n * Exactly two statuses qualify: `429` (rate limited, dropped at the gateway)\n * and a `503` carrying the gateway's own `{ error }` envelope (its\n * configuration is not ready). Both are reported only after the SDK's own\n * same-key retries are exhausted, and only when no attempt of that submit was\n * ambiguous: a refusal of the resend says nothing about the attempt before it,\n * so the SDK reports that submit as `GASLESS_SUBMIT_UNCONFIRMED` instead.\n *\n * **`0`, `502`, `504`, a timeout and a bare `503` never qualify**, however much\n * they look like an outage: the request may have reached the service and been\n * accepted, and a wallet-paid retry would then execute the same intent twice.\n * Those surface as `GASLESS_SUBMIT_UNCONFIRMED` instead — replay them with\n * `resubmitGaslessRequest`. A gateway `404` does not qualify either: it names\n * an unknown or disabled instance, which is a configuration error that a wallet\n * retry papers over.\n *\n * Callers must still pair this with a not-yet-accepted guard: after a `202` the\n * workflow exists server-side, and even a `404` while polling (the\n * accept-vs-record race) must never trigger a wallet-paid retry.\n *\n * @param err - Anything caught from a gasless submit.\n * @returns `true` for a pre-acceptance `429` or gateway `503`.\n */\nexport function isConfirmedGaslessUnavailableError(err: unknown): boolean {\n if (getGaslessUnconfirmedSubmit(err) !== null) return false;\n const failure = classifyGaslessHttpStatus(err);\n return failure === \"rate-limited\" || failure === \"gateway-not-ready\";\n}\n"],"mappings":";;;;;AAUA,IAAM,IAA0B,IAAI,IAAI,CAAC,2BAA2B,wBAAwB,CAAC,GAavF,IAAmC;CAAC;CAAmB;CAA6B;AAAkB;AAE5G,SAAS,EAAgB,GAAqC;CAC5D,IAAM,IAAO,EAAkB,CAAM;CACrC,OAAO,EAAiC,MAAM,MAAa,EAAK,SAAS,CAAQ,CAAC;AACpF;AAGA,SAAS,EAAa,GAAuB;CAC3C,IAAM,IAAO,OAAO,KAAQ,YAAY,KAAgB,kBAAkB,IAAM,EAAI,eAAe;CACnG,OAAO,OAAO,KAAS,YAAY,IAAiB,EAA8B,SAAS,KAAA;AAC7F;AA8BA,SAAgB,EAAgC,GAAuB;CAErE,IAAI,EAA4B,CAAG,MAAM,MAAM,OAAO;CAEtD,IAAM,IAAS,EAAwB,CAAG;CAC1C,IAAI,CAAC,GAAQ,OAAO;CACpB,IAAM,IAAS,EAAuB,CAAG,GACnC,IAAU,EAAO,SAAS,QAAQ,EAAwB,IAAI,EAAO,IAAI;CAa/E,OAVI,KAAW,MAAW,KAAA,KAAa,KAAU,OAAO,IAAS,OAC7D,EAAO,SAAS,yBAAyB,MAAW,OAAO,EAAgB,CAAM,IAAU,KASxF,EAAa,CAAG,MAAM,EAAqB,aAAa,KAAW,EAAgB,CAAM;AAClG;AA6BA,SAAgB,EAAmC,GAAuB;CACxE,IAAI,EAA4B,CAAG,MAAM,MAAM,OAAO;CACtD,IAAM,IAAU,EAA0B,CAAG;CAC7C,OAAO,MAAY,kBAAkB,MAAY;AACnD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SignedOperation } from '../solvers/instant-open/shared/types.js';
|
|
2
|
+
import { GaslessWireSignedOperation } from './wire-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Convert a `bigint` field to a JSON **number** for the GaslessQ wire format,
|
|
5
|
+
* refusing values outside the safe-integer range.
|
|
6
|
+
*
|
|
7
|
+
* The service schema types `replayAttackHeader.nonce` and `deadline`,
|
|
8
|
+
* `maxUses`, and the flex-field `offset` and `length` as integers, so the SDK
|
|
9
|
+
* sends numbers. The vendor guide says the API also accepts
|
|
10
|
+
* `replayAttackHeader.nonce` and `deadline` as decimal strings, but a number
|
|
11
|
+
* is valid under both the guide and the schema. Wallet IDs are different:
|
|
12
|
+
* they travel as decimal strings (`toGaslessWalletIdWire`) and never pass
|
|
13
|
+
* through here. Every value the SDK puts in these fields (sequential nonces,
|
|
14
|
+
* unix-second deadlines, `maxUses: 1`, calldata byte offsets) fits comfortably
|
|
15
|
+
* below `2^53`; anything larger is a bug worth failing loudly on rather than
|
|
16
|
+
* silently truncating.
|
|
17
|
+
*
|
|
18
|
+
* @throws {SymmError} `GASLESS_VALUE_UNSAFE` outside `[0, Number.MAX_SAFE_INTEGER]`.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function toGaslessSafeNumber(value: bigint, field: string): number;
|
|
23
|
+
/**
|
|
24
|
+
* Serialize a signed InstantLayer operation into the GaslessQ wire shape.
|
|
25
|
+
*
|
|
26
|
+
* Deliberately **not** the solver-flow `formatSignedOperationPayload` — the
|
|
27
|
+
* two wire contracts are maintained by different services and must be able to
|
|
28
|
+
* drift independently. Semantics match: every `uint256` becomes a guarded
|
|
29
|
+
* JSON number.
|
|
30
|
+
*
|
|
31
|
+
* @param operation - The struct that was EIP-712 signed.
|
|
32
|
+
* @returns The wire-shaped operation for a `relay-instant` body.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatGaslessOperation(operation: SignedOperation): GaslessWireSignedOperation;
|
|
37
|
+
//# sourceMappingURL=format-gasless-operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-gasless-operation.d.ts","sourceRoot":"","sources":["../../src/gasless/format-gasless-operation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAUxE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,eAAe,GAAG,0BAA0B,CAqB7F"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SymmError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
//#region src/gasless/format-gasless-operation.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = Number(t);
|
|
5
|
+
if (!Number.isSafeInteger(r) || r < 0) throw new e("validation", "GASLESS_VALUE_UNSAFE", `Gasless: ${n} (${t}) is outside the JSON safe-integer range the relay accepts.`);
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
return {
|
|
10
|
+
signer: e.signer,
|
|
11
|
+
target: e.target,
|
|
12
|
+
callData: e.callData,
|
|
13
|
+
signerAccount: {
|
|
14
|
+
addr: e.signerAccount.addr,
|
|
15
|
+
isPartyB: e.signerAccount.isPartyB
|
|
16
|
+
},
|
|
17
|
+
flexFields: e.flexFields.map((e) => ({
|
|
18
|
+
offset: t(e.offset, "flexFields.offset"),
|
|
19
|
+
length: t(e.length, "flexFields.length"),
|
|
20
|
+
authorizedFlexFiller: e.authorizedFlexFiller
|
|
21
|
+
})),
|
|
22
|
+
maxUses: t(e.maxUses, "maxUses"),
|
|
23
|
+
replayAttackHeader: {
|
|
24
|
+
nonce: t(e.replayAttackHeader.nonce, "replayAttackHeader.nonce"),
|
|
25
|
+
deadline: t(e.replayAttackHeader.deadline, "replayAttackHeader.deadline"),
|
|
26
|
+
salt: e.replayAttackHeader.salt
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { n as formatGaslessOperation, t as toGaslessSafeNumber };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=format-gasless-operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-gasless-operation.js","names":[],"sources":["../../src/gasless/format-gasless-operation.ts"],"sourcesContent":["import { SymmError } from \"../shared/errors/symm-error\";\nimport type { SignedOperation } from \"../solvers/instant-open/shared/types\";\nimport type { GaslessWireSignedOperation } from \"./wire-types\";\n\n/**\n * Convert a `bigint` field to a JSON **number** for the GaslessQ wire format,\n * refusing values outside the safe-integer range.\n *\n * The service schema types `replayAttackHeader.nonce` and `deadline`,\n * `maxUses`, and the flex-field `offset` and `length` as integers, so the SDK\n * sends numbers. The vendor guide says the API also accepts\n * `replayAttackHeader.nonce` and `deadline` as decimal strings, but a number\n * is valid under both the guide and the schema. Wallet IDs are different:\n * they travel as decimal strings (`toGaslessWalletIdWire`) and never pass\n * through here. Every value the SDK puts in these fields (sequential nonces,\n * unix-second deadlines, `maxUses: 1`, calldata byte offsets) fits comfortably\n * below `2^53`; anything larger is a bug worth failing loudly on rather than\n * silently truncating.\n *\n * @throws {SymmError} `GASLESS_VALUE_UNSAFE` outside `[0, Number.MAX_SAFE_INTEGER]`.\n *\n * @internal\n */\nexport function toGaslessSafeNumber(value: bigint, field: string): number {\n const asNumber = Number(value);\n if (!Number.isSafeInteger(asNumber) || asNumber < 0) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_VALUE_UNSAFE\",\n `Gasless: ${field} (${value}) is outside the JSON safe-integer range the relay accepts.`,\n );\n }\n return asNumber;\n}\n\n/**\n * Serialize a signed InstantLayer operation into the GaslessQ wire shape.\n *\n * Deliberately **not** the solver-flow `formatSignedOperationPayload` — the\n * two wire contracts are maintained by different services and must be able to\n * drift independently. Semantics match: every `uint256` becomes a guarded\n * JSON number.\n *\n * @param operation - The struct that was EIP-712 signed.\n * @returns The wire-shaped operation for a `relay-instant` body.\n *\n * @internal\n */\nexport function formatGaslessOperation(operation: SignedOperation): GaslessWireSignedOperation {\n return {\n signer: operation.signer,\n target: operation.target,\n callData: operation.callData,\n signerAccount: {\n addr: operation.signerAccount.addr,\n isPartyB: operation.signerAccount.isPartyB,\n },\n flexFields: operation.flexFields.map((field) => ({\n offset: toGaslessSafeNumber(field.offset, \"flexFields.offset\"),\n length: toGaslessSafeNumber(field.length, \"flexFields.length\"),\n authorizedFlexFiller: field.authorizedFlexFiller,\n })),\n maxUses: toGaslessSafeNumber(operation.maxUses, \"maxUses\"),\n replayAttackHeader: {\n nonce: toGaslessSafeNumber(operation.replayAttackHeader.nonce, \"replayAttackHeader.nonce\"),\n deadline: toGaslessSafeNumber(operation.replayAttackHeader.deadline, \"replayAttackHeader.deadline\"),\n salt: operation.replayAttackHeader.salt,\n },\n };\n}\n"],"mappings":";;AAuBA,SAAgB,EAAoB,GAAe,GAAuB;CACxE,IAAM,IAAW,OAAO,CAAK;CAC7B,IAAI,CAAC,OAAO,cAAc,CAAQ,KAAK,IAAW,GAChD,MAAM,IAAI,EACR,cACA,wBACA,YAAY,EAAM,IAAI,EAAM,4DAC9B;CAEF,OAAO;AACT;AAeA,SAAgB,EAAuB,GAAwD;CAC7F,OAAO;EACL,QAAQ,EAAU;EAClB,QAAQ,EAAU;EAClB,UAAU,EAAU;EACpB,eAAe;GACb,MAAM,EAAU,cAAc;GAC9B,UAAU,EAAU,cAAc;EACpC;EACA,YAAY,EAAU,WAAW,KAAK,OAAW;GAC/C,QAAQ,EAAoB,EAAM,QAAQ,mBAAmB;GAC7D,QAAQ,EAAoB,EAAM,QAAQ,mBAAmB;GAC7D,sBAAsB,EAAM;EAC9B,EAAE;EACF,SAAS,EAAoB,EAAU,SAAS,SAAS;EACzD,oBAAoB;GAClB,OAAO,EAAoB,EAAU,mBAAmB,OAAO,0BAA0B;GACzF,UAAU,EAAoB,EAAU,mBAAmB,UAAU,6BAA6B;GAClG,MAAM,EAAU,mBAAmB;EACrC;CACF;AACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { SymmioGaslessConfig } from '../core/chains/types.js';
|
|
2
|
+
import { GaslessService } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A chain's `gasless.url`, classified by form, with the protocol instance the
|
|
5
|
+
* SDK expects responses from. Every URL-derived transport (HTTP bases, stream
|
|
6
|
+
* endpoints) starts from this one parse, so the forms cannot drift apart.
|
|
7
|
+
*
|
|
8
|
+
* `url` is the configured value, trimmed of surrounding whitespace and
|
|
9
|
+
* trailing slashes, and otherwise verbatim.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export type GaslessUrl = {
|
|
14
|
+
/** A bare gateway origin (`https://host`); services live under `/v1/instances/{protocolInstance}/{service}`. */
|
|
15
|
+
form: "origin";
|
|
16
|
+
url: string;
|
|
17
|
+
/** The configured `protocolInstance`, which the origin form requires. */
|
|
18
|
+
protocolInstance: string;
|
|
19
|
+
} | {
|
|
20
|
+
/** A gateway instance root (`…/v1/instances/{instance}`); services live under `/{service}`. */
|
|
21
|
+
form: "instance-root";
|
|
22
|
+
url: string;
|
|
23
|
+
/** The instance the path pins. */
|
|
24
|
+
protocolInstance: string;
|
|
25
|
+
} | {
|
|
26
|
+
/** An instance-pinned service base (`…/v1/instances/{instance}/{service}`), usable for that service only. */
|
|
27
|
+
form: "service-base";
|
|
28
|
+
url: string;
|
|
29
|
+
/** The service the path pins. */
|
|
30
|
+
service: GaslessService;
|
|
31
|
+
/** The instance the path pins. */
|
|
32
|
+
protocolInstance: string;
|
|
33
|
+
} | {
|
|
34
|
+
/** Any other path: a proxy (e.g. a server-side BFF) that forwards `/{service}/…` to the gateway. */
|
|
35
|
+
form: "proxy-root";
|
|
36
|
+
url: string;
|
|
37
|
+
/**
|
|
38
|
+
* The configured `protocolInstance`, or `null` when none is configured.
|
|
39
|
+
* A proxy may strip the gateway's instance header, so it is checked only
|
|
40
|
+
* when a response carries one.
|
|
41
|
+
*/
|
|
42
|
+
protocolInstance: string | null;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Parse a chain's gasless `url` into one of the supported forms.
|
|
46
|
+
*
|
|
47
|
+
* - **Origin** (no path): needs `protocolInstance`.
|
|
48
|
+
* - **Instance root** (`…/v1/instances/{instance}`): the path pins the instance.
|
|
49
|
+
* - **Service base** (`…/v1/instances/{instance}/{operations|deposits}`): pins the instance and one service.
|
|
50
|
+
* - **Proxy root** (any other path, absolute or relative): pins nothing itself.
|
|
51
|
+
*
|
|
52
|
+
* The instance-less `…/v1/operations` / `…/v1/deposits` compatibility routes
|
|
53
|
+
* are rejected. They resolve through a gateway default the vendor is retiring,
|
|
54
|
+
* and pin no instance to verify responses against. A query string or fragment
|
|
55
|
+
* is rejected too, because the SDK appends service paths to the URL, and so are
|
|
56
|
+
* credentials in the URL, which would otherwise ride along into logs and errors.
|
|
57
|
+
*
|
|
58
|
+
* Error messages never echo the URL, which may carry credentials.
|
|
59
|
+
*
|
|
60
|
+
* @param chainId - The chain the config belongs to (for error messages).
|
|
61
|
+
* @param gasless - The chain's `url` and optional `protocolInstance`.
|
|
62
|
+
* @returns The classified URL.
|
|
63
|
+
* @throws {SymmError} `GASLESS_URL_INVALID` for an empty, unparseable, non-HTTP(S), query-, fragment- or credential-bearing url.
|
|
64
|
+
* @throws {SymmError} `GASLESS_URL_LEGACY_ROUTE` for an instance-less `/v1/{service}` base.
|
|
65
|
+
* @throws {SymmError} `GASLESS_PROTOCOL_INSTANCE_REQUIRED` for an origin without `protocolInstance`.
|
|
66
|
+
* @throws {SymmError} `GASLESS_PROTOCOL_INSTANCE_CONFLICT` when the path pins a different instance than `protocolInstance`.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export declare function parseGaslessUrl(chainId: number, gasless: Pick<SymmioGaslessConfig, "url" | "protocolInstance">): GaslessUrl;
|
|
71
|
+
/**
|
|
72
|
+
* Check that a URL can serve `service`: a service base pins exactly one.
|
|
73
|
+
*
|
|
74
|
+
* @param chainId - The chain the config belongs to (for error messages).
|
|
75
|
+
* @param url - The parsed gasless url.
|
|
76
|
+
* @param service - The service about to be called.
|
|
77
|
+
* @throws {SymmError} `GASLESS_URL_SERVICE_MISMATCH` when a service base pins the other service.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export declare function assertGaslessUrlServes(chainId: number, url: GaslessUrl, service: GaslessService): void;
|
|
82
|
+
//# sourceMappingURL=gasless-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasless-url.d.ts","sourceRoot":"","sources":["../../src/gasless/gasless-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAClB;IACE,gHAAgH;IAChH,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,+FAA+F;IAC/F,IAAI,EAAE,eAAe,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,6GAA6G;IAC7G,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,OAAO,EAAE,cAAc,CAAC;IACxB,kCAAkC;IAClC,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,oGAAoG;IACpG,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAmDN;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,kBAAkB,CAAC,GAC7D,UAAU,CA8DZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAQtG"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { SymmError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
//#region src/gasless/gasless-url.ts
|
|
3
|
+
var t = /\/v1\/instances\/([^/]+)\/(operations|deposits)$/i, n = /\/v1\/instances\/([^/]+)$/i, r = /\/v1\/(?:operations|deposits)$/i, i = /^[a-z][a-z\d+.-]*:/i;
|
|
4
|
+
function a(t, n) {
|
|
5
|
+
return new e("config", "GASLESS_URL_INVALID", `Gasless: chain ${t} has an invalid gasless url: ${n}.`);
|
|
6
|
+
}
|
|
7
|
+
function o(e, t) {
|
|
8
|
+
try {
|
|
9
|
+
return decodeURIComponent(t);
|
|
10
|
+
} catch {
|
|
11
|
+
throw a(e, "the protocol-instance segment is not valid percent-encoding");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function s(t, n, r) {
|
|
15
|
+
if (r && r !== n) throw new e("config", "GASLESS_PROTOCOL_INSTANCE_CONFLICT", `Gasless: chain ${t} declares protocolInstance "${r}", but its gasless url pins instance "${n}". Remove one of them or make them match. They must name the same deployment.`);
|
|
16
|
+
}
|
|
17
|
+
function c(c, l) {
|
|
18
|
+
let u = l.url.trim().replace(/\/+$/, "");
|
|
19
|
+
if (u === "") throw a(c, "it is empty");
|
|
20
|
+
if (/[?#]/.test(u)) throw a(c, "it carries a query string or fragment, and the SDK appends service paths to it");
|
|
21
|
+
let d = i.test(u) || u.startsWith("//"), f;
|
|
22
|
+
try {
|
|
23
|
+
f = i.test(u) ? new URL(u) : new URL(u, "https://relative.invalid");
|
|
24
|
+
} catch {
|
|
25
|
+
throw a(c, "it cannot be parsed");
|
|
26
|
+
}
|
|
27
|
+
if (f.protocol !== "https:" && f.protocol !== "http:") throw a(c, `it uses the "${f.protocol}" scheme instead of https or http`);
|
|
28
|
+
if (f.username !== "" || f.password !== "") throw a(c, "it carries credentials (user:password@). Pass a partner key as `apiKey` instead");
|
|
29
|
+
let p = f.pathname.replace(/\/+$/, ""), m = l.protocolInstance || void 0, h = t.exec(p);
|
|
30
|
+
if (h) {
|
|
31
|
+
let [, e = "", t = ""] = h, n = o(c, e);
|
|
32
|
+
return s(c, n, m), {
|
|
33
|
+
form: "service-base",
|
|
34
|
+
url: u,
|
|
35
|
+
service: t.toLowerCase() === "operations" ? "operations" : "deposits",
|
|
36
|
+
protocolInstance: n
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
let g = n.exec(p);
|
|
40
|
+
if (g) {
|
|
41
|
+
let [, e = ""] = g, t = o(c, e);
|
|
42
|
+
return s(c, t, m), {
|
|
43
|
+
form: "instance-root",
|
|
44
|
+
url: u,
|
|
45
|
+
protocolInstance: t
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (r.test(p)) throw new e("config", "GASLESS_URL_LEGACY_ROUTE", `Gasless: chain ${c} points its gasless url at an instance-less /v1/operations or /v1/deposits route. Those compatibility routes are being retired and pin no protocol instance. Use the gateway origin with \`protocolInstance\` instead.`);
|
|
49
|
+
if (p === "") {
|
|
50
|
+
if (!d) throw a(c, "a relative url must name a proxy path");
|
|
51
|
+
if (!m) throw new e("config", "GASLESS_PROTOCOL_INSTANCE_REQUIRED", `Gasless: chain ${c} points its gasless url at a gateway origin but declares no \`protocolInstance\`. The instance key selects the deployment and cannot be derived.`);
|
|
52
|
+
return {
|
|
53
|
+
form: "origin",
|
|
54
|
+
url: u,
|
|
55
|
+
protocolInstance: m
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
form: "proxy-root",
|
|
60
|
+
url: u,
|
|
61
|
+
protocolInstance: m ?? null
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function l(t, n, r) {
|
|
65
|
+
if (n.form === "service-base" && n.service !== r) throw new e("config", "GASLESS_URL_SERVICE_MISMATCH", `Gasless: chain ${t} configures a "${n.service}" service base, but the "${r}" service was requested. Point \`gasless.url\` at the gateway origin (or an instance root) so both services can be derived.`);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { l as assertGaslessUrlServes, c as parseGaslessUrl };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=gasless-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasless-url.js","names":[],"sources":["../../src/gasless/gasless-url.ts"],"sourcesContent":["import type { SymmioGaslessConfig } from \"../core/chains/types\";\nimport { SymmError } from \"../shared/errors/symm-error\";\nimport type { GaslessService } from \"./types\";\n\n/**\n * A chain's `gasless.url`, classified by form, with the protocol instance the\n * SDK expects responses from. Every URL-derived transport (HTTP bases, stream\n * endpoints) starts from this one parse, so the forms cannot drift apart.\n *\n * `url` is the configured value, trimmed of surrounding whitespace and\n * trailing slashes, and otherwise verbatim.\n *\n * @internal\n */\nexport type GaslessUrl =\n | {\n /** A bare gateway origin (`https://host`); services live under `/v1/instances/{protocolInstance}/{service}`. */\n form: \"origin\";\n url: string;\n /** The configured `protocolInstance`, which the origin form requires. */\n protocolInstance: string;\n }\n | {\n /** A gateway instance root (`…/v1/instances/{instance}`); services live under `/{service}`. */\n form: \"instance-root\";\n url: string;\n /** The instance the path pins. */\n protocolInstance: string;\n }\n | {\n /** An instance-pinned service base (`…/v1/instances/{instance}/{service}`), usable for that service only. */\n form: \"service-base\";\n url: string;\n /** The service the path pins. */\n service: GaslessService;\n /** The instance the path pins. */\n protocolInstance: string;\n }\n | {\n /** Any other path: a proxy (e.g. a server-side BFF) that forwards `/{service}/…` to the gateway. */\n form: \"proxy-root\";\n url: string;\n /**\n * The configured `protocolInstance`, or `null` when none is configured.\n * A proxy may strip the gateway's instance header, so it is checked only\n * when a response carries one.\n */\n protocolInstance: string | null;\n };\n\n/** `…/v1/instances/{instance}/{service}` — the instance and service a base pins. */\nconst SERVICE_BASE_PATH = /\\/v1\\/instances\\/([^/]+)\\/(operations|deposits)$/i;\n/** `…/v1/instances/{instance}` — the instance a root pins. */\nconst INSTANCE_ROOT_PATH = /\\/v1\\/instances\\/([^/]+)$/i;\n/** `…/v1/operations` / `…/v1/deposits` — the instance-less compatibility routes. */\nconst LEGACY_SERVICE_PATH = /\\/v1\\/(?:operations|deposits)$/i;\n/**\n * A URL that names its own scheme (`https:`, `wss:`, or a mistyped `localhost:`).\n * Anything else, including a protocol-relative `//host`, resolves like a\n * browser would: against the page's origin.\n */\nconst HAS_SCHEME = /^[a-z][a-z\\d+.-]*:/i;\n\nfunction invalidUrl(chainId: number, reason: string): SymmError {\n return new SymmError(\n \"config\",\n \"GASLESS_URL_INVALID\",\n `Gasless: chain ${chainId} has an invalid gasless url: ${reason}.`,\n );\n}\n\n/**\n * Decode the instance segment a gateway path pins.\n *\n * @throws {SymmError} `GASLESS_URL_INVALID` on malformed percent-encoding.\n */\nfunction decodeInstance(chainId: number, segment: string): string {\n try {\n return decodeURIComponent(segment);\n } catch {\n throw invalidUrl(chainId, \"the protocol-instance segment is not valid percent-encoding\");\n }\n}\n\n/**\n * Check a path-pinned instance against the configured `protocolInstance`.\n *\n * @throws {SymmError} `GASLESS_PROTOCOL_INSTANCE_CONFLICT` when both are set and differ.\n */\nfunction assertNoInstanceConflict(chainId: number, pinned: string, configured?: string): void {\n if (configured && configured !== pinned) {\n throw new SymmError(\n \"config\",\n \"GASLESS_PROTOCOL_INSTANCE_CONFLICT\",\n `Gasless: chain ${chainId} declares protocolInstance \"${configured}\", but its gasless url pins instance \"${pinned}\". Remove one of them or make them match. They must name the same deployment.`,\n );\n }\n}\n\n/**\n * Parse a chain's gasless `url` into one of the supported forms.\n *\n * - **Origin** (no path): needs `protocolInstance`.\n * - **Instance root** (`…/v1/instances/{instance}`): the path pins the instance.\n * - **Service base** (`…/v1/instances/{instance}/{operations|deposits}`): pins the instance and one service.\n * - **Proxy root** (any other path, absolute or relative): pins nothing itself.\n *\n * The instance-less `…/v1/operations` / `…/v1/deposits` compatibility routes\n * are rejected. They resolve through a gateway default the vendor is retiring,\n * and pin no instance to verify responses against. A query string or fragment\n * is rejected too, because the SDK appends service paths to the URL, and so are\n * credentials in the URL, which would otherwise ride along into logs and errors.\n *\n * Error messages never echo the URL, which may carry credentials.\n *\n * @param chainId - The chain the config belongs to (for error messages).\n * @param gasless - The chain's `url` and optional `protocolInstance`.\n * @returns The classified URL.\n * @throws {SymmError} `GASLESS_URL_INVALID` for an empty, unparseable, non-HTTP(S), query-, fragment- or credential-bearing url.\n * @throws {SymmError} `GASLESS_URL_LEGACY_ROUTE` for an instance-less `/v1/{service}` base.\n * @throws {SymmError} `GASLESS_PROTOCOL_INSTANCE_REQUIRED` for an origin without `protocolInstance`.\n * @throws {SymmError} `GASLESS_PROTOCOL_INSTANCE_CONFLICT` when the path pins a different instance than `protocolInstance`.\n *\n * @internal\n */\nexport function parseGaslessUrl(\n chainId: number,\n gasless: Pick<SymmioGaslessConfig, \"url\" | \"protocolInstance\">,\n): GaslessUrl {\n const url = gasless.url.trim().replace(/\\/+$/, \"\");\n if (url === \"\") throw invalidUrl(chainId, \"it is empty\");\n if (/[?#]/.test(url)) {\n throw invalidUrl(chainId, \"it carries a query string or fragment, and the SDK appends service paths to it\");\n }\n\n const absolute = HAS_SCHEME.test(url) || url.startsWith(\"//\");\n let parsed: URL;\n try {\n parsed = HAS_SCHEME.test(url) ? new URL(url) : new URL(url, \"https://relative.invalid\");\n } catch {\n throw invalidUrl(chainId, \"it cannot be parsed\");\n }\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") {\n throw invalidUrl(chainId, `it uses the \"${parsed.protocol}\" scheme instead of https or http`);\n }\n if (parsed.username !== \"\" || parsed.password !== \"\") {\n throw invalidUrl(chainId, \"it carries credentials (user:password@). Pass a partner key as `apiKey` instead\");\n }\n\n const path = parsed.pathname.replace(/\\/+$/, \"\");\n const configured = gasless.protocolInstance || undefined;\n\n const serviceBase = SERVICE_BASE_PATH.exec(path);\n if (serviceBase) {\n const [, segment = \"\", serviceName = \"\"] = serviceBase;\n const protocolInstance = decodeInstance(chainId, segment);\n assertNoInstanceConflict(chainId, protocolInstance, configured);\n const service: GaslessService = serviceName.toLowerCase() === \"operations\" ? \"operations\" : \"deposits\";\n return { form: \"service-base\", url, service, protocolInstance };\n }\n\n const instanceRoot = INSTANCE_ROOT_PATH.exec(path);\n if (instanceRoot) {\n const [, segment = \"\"] = instanceRoot;\n const protocolInstance = decodeInstance(chainId, segment);\n assertNoInstanceConflict(chainId, protocolInstance, configured);\n return { form: \"instance-root\", url, protocolInstance };\n }\n\n if (LEGACY_SERVICE_PATH.test(path)) {\n throw new SymmError(\n \"config\",\n \"GASLESS_URL_LEGACY_ROUTE\",\n `Gasless: chain ${chainId} points its gasless url at an instance-less /v1/operations or /v1/deposits route. Those compatibility routes are being retired and pin no protocol instance. Use the gateway origin with \\`protocolInstance\\` instead.`,\n );\n }\n\n if (path === \"\") {\n if (!absolute) throw invalidUrl(chainId, \"a relative url must name a proxy path\");\n if (!configured) {\n throw new SymmError(\n \"config\",\n \"GASLESS_PROTOCOL_INSTANCE_REQUIRED\",\n `Gasless: chain ${chainId} points its gasless url at a gateway origin but declares no \\`protocolInstance\\`. The instance key selects the deployment and cannot be derived.`,\n );\n }\n return { form: \"origin\", url, protocolInstance: configured };\n }\n\n return { form: \"proxy-root\", url, protocolInstance: configured ?? null };\n}\n\n/**\n * Check that a URL can serve `service`: a service base pins exactly one.\n *\n * @param chainId - The chain the config belongs to (for error messages).\n * @param url - The parsed gasless url.\n * @param service - The service about to be called.\n * @throws {SymmError} `GASLESS_URL_SERVICE_MISMATCH` when a service base pins the other service.\n *\n * @internal\n */\nexport function assertGaslessUrlServes(chainId: number, url: GaslessUrl, service: GaslessService): void {\n if (url.form === \"service-base\" && url.service !== service) {\n throw new SymmError(\n \"config\",\n \"GASLESS_URL_SERVICE_MISMATCH\",\n `Gasless: chain ${chainId} configures a \"${url.service}\" service base, but the \"${service}\" service was requested. Point \\`gasless.url\\` at the gateway origin (or an instance root) so both services can be derived.`,\n );\n }\n}\n"],"mappings":";;AAmDA,IAAM,IAAoB,qDAEpB,IAAqB,8BAErB,IAAsB,mCAMtB,IAAa;AAEnB,SAAS,EAAW,GAAiB,GAA2B;CAC9D,OAAO,IAAI,EACT,UACA,uBACA,kBAAkB,EAAQ,+BAA+B,EAAO,EAClE;AACF;AAOA,SAAS,EAAe,GAAiB,GAAyB;CAChE,IAAI;EACF,OAAO,mBAAmB,CAAO;CACnC,QAAQ;EACN,MAAM,EAAW,GAAS,6DAA6D;CACzF;AACF;AAOA,SAAS,EAAyB,GAAiB,GAAgB,GAA2B;CAC5F,IAAI,KAAc,MAAe,GAC/B,MAAM,IAAI,EACR,UACA,sCACA,kBAAkB,EAAQ,8BAA8B,EAAW,wCAAwC,EAAO,8EACpH;AAEJ;AA4BA,SAAgB,EACd,GACA,GACY;CACZ,IAAM,IAAM,EAAQ,IAAI,KAAK,EAAE,QAAQ,QAAQ,EAAE;CACjD,IAAI,MAAQ,IAAI,MAAM,EAAW,GAAS,aAAa;CACvD,IAAI,OAAO,KAAK,CAAG,GACjB,MAAM,EAAW,GAAS,gFAAgF;CAG5G,IAAM,IAAW,EAAW,KAAK,CAAG,KAAK,EAAI,WAAW,IAAI,GACxD;CACJ,IAAI;EACF,IAAS,EAAW,KAAK,CAAG,IAAI,IAAI,IAAI,CAAG,IAAI,IAAI,IAAI,GAAK,0BAA0B;CACxF,QAAQ;EACN,MAAM,EAAW,GAAS,qBAAqB;CACjD;CACA,IAAI,EAAO,aAAa,YAAY,EAAO,aAAa,SACtD,MAAM,EAAW,GAAS,gBAAgB,EAAO,SAAS,kCAAkC;CAE9F,IAAI,EAAO,aAAa,MAAM,EAAO,aAAa,IAChD,MAAM,EAAW,GAAS,iFAAiF;CAG7G,IAAM,IAAO,EAAO,SAAS,QAAQ,QAAQ,EAAE,GACzC,IAAa,EAAQ,oBAAoB,KAAA,GAEzC,IAAc,EAAkB,KAAK,CAAI;CAC/C,IAAI,GAAa;EACf,IAAM,GAAG,IAAU,IAAI,IAAc,MAAM,GACrC,IAAmB,EAAe,GAAS,CAAO;EAGxD,OAFA,EAAyB,GAAS,GAAkB,CAAU,GAEvD;GAAE,MAAM;GAAgB;GAAK,SADJ,EAAY,YAAY,MAAM,eAAe,eAAe;GAC/C;EAAiB;CAChE;CAEA,IAAM,IAAe,EAAmB,KAAK,CAAI;CACjD,IAAI,GAAc;EAChB,IAAM,GAAG,IAAU,MAAM,GACnB,IAAmB,EAAe,GAAS,CAAO;EAExD,OADA,EAAyB,GAAS,GAAkB,CAAU,GACvD;GAAE,MAAM;GAAiB;GAAK;EAAiB;CACxD;CAEA,IAAI,EAAoB,KAAK,CAAI,GAC/B,MAAM,IAAI,EACR,UACA,4BACA,kBAAkB,EAAQ,uNAC5B;CAGF,IAAI,MAAS,IAAI;EACf,IAAI,CAAC,GAAU,MAAM,EAAW,GAAS,uCAAuC;EAChF,IAAI,CAAC,GACH,MAAM,IAAI,EACR,UACA,sCACA,kBAAkB,EAAQ,iJAC5B;EAEF,OAAO;GAAE,MAAM;GAAU;GAAK,kBAAkB;EAAW;CAC7D;CAEA,OAAO;EAAE,MAAM;EAAc;EAAK,kBAAkB,KAAc;CAAK;AACzE;AAYA,SAAgB,EAAuB,GAAiB,GAAiB,GAA+B;CACtG,IAAI,EAAI,SAAS,kBAAkB,EAAI,YAAY,GACjD,MAAM,IAAI,EACR,UACA,gCACA,kBAAkB,EAAQ,iBAAiB,EAAI,QAAQ,2BAA2B,EAAQ,4HAC5F;AAEJ"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Abi, Address, Hex } from 'viem';
|
|
2
|
+
/** One inner call of a gasless-wallet `execute` batch, given as raw calldata. */
|
|
3
|
+
export interface GaslessWalletRawCall {
|
|
4
|
+
/** Contract the wallet calls. */
|
|
5
|
+
target: Address;
|
|
6
|
+
/**
|
|
7
|
+
* Native value forwarded with the call. Defaults to `0n`. The wallet holds no
|
|
8
|
+
* native balance unless someone funded it directly, so a non-zero value
|
|
9
|
+
* reverts the whole batch in practice.
|
|
10
|
+
*/
|
|
11
|
+
value?: bigint;
|
|
12
|
+
/** Calldata for the target. */
|
|
13
|
+
data: Hex;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One inner call expressed against an ABI, which the SDK encodes with viem's
|
|
17
|
+
* `encodeFunctionData` — that throws on an arity or type mismatch, before any
|
|
18
|
+
* signature prompt or network call.
|
|
19
|
+
*
|
|
20
|
+
* `args` is deliberately `readonly unknown[]`: nothing else in this SDK uses
|
|
21
|
+
* viem's contract-function generics, and a mapped-tuple surface would be out of
|
|
22
|
+
* keeping. When you want compile-time-checked arguments, encode with viem
|
|
23
|
+
* yourself and pass the result as a {@link GaslessWalletRawCall} — both forms
|
|
24
|
+
* mix freely in one batch.
|
|
25
|
+
*/
|
|
26
|
+
export interface GaslessWalletContractCall {
|
|
27
|
+
/** Contract the wallet calls. */
|
|
28
|
+
target: Address;
|
|
29
|
+
/** Native value forwarded with the call. Defaults to `0n`. */
|
|
30
|
+
value?: bigint;
|
|
31
|
+
/** ABI containing `functionName`. */
|
|
32
|
+
abi: Abi | readonly unknown[];
|
|
33
|
+
/** Function to call on `target`. */
|
|
34
|
+
functionName: string;
|
|
35
|
+
/** Arguments for `functionName`, in order. Omit for a no-argument function. */
|
|
36
|
+
args?: readonly unknown[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* One inner call of a gasless-wallet `execute` batch — either raw calldata
|
|
40
|
+
* ({@link GaslessWalletRawCall}) or an ABI-level call the SDK encodes
|
|
41
|
+
* ({@link GaslessWalletContractCall}).
|
|
42
|
+
*/
|
|
43
|
+
export type GaslessWalletCall = GaslessWalletRawCall | GaslessWalletContractCall;
|
|
44
|
+
/**
|
|
45
|
+
* The calldata one inner call runs with — raw `data`, or the ABI call encoded.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function gaslessWalletCallData(call: GaslessWalletCall): Hex;
|
|
50
|
+
/**
|
|
51
|
+
* The 4-byte selector the GaslessLayer reads off one inner call when it prices
|
|
52
|
+
* the operation and checks a delegate's authority.
|
|
53
|
+
*
|
|
54
|
+
* Derived from the encoded calldata rather than from `functionName`, so an
|
|
55
|
+
* overloaded ABI resolves to the same selector the wallet will actually run.
|
|
56
|
+
* Calldata shorter than a selector yields `0x00000000` — what the contract's
|
|
57
|
+
* own `_selectorFromMemory` returns for it.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function gaslessWalletCallSelector(call: GaslessWalletCall): Hex;
|
|
62
|
+
/**
|
|
63
|
+
* Normalize either call form to the `(address,uint256,bytes)` tuple the
|
|
64
|
+
* wallet's `execute` takes.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function toWalletCallTuple(call: GaslessWalletCall): {
|
|
69
|
+
target: Address;
|
|
70
|
+
value: bigint;
|
|
71
|
+
data: Hex;
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../../src/gasless/gasless-wallet-execute/calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAEzF,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,GAAG,CAAC;CACX;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,GAAG,EAAE,GAAG,GAAG,SAAS,OAAO,EAAE,CAAC;IAC9B,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,yBAAyB,CAAC;AAEjF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,GAAG,GAAG,CAGlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,GAAG,CAGtE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,CAExG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { encodeFunctionData as e, size as t, slice as n } from "viem";
|
|
2
|
+
//#region src/gasless/gasless-wallet-execute/calls.ts
|
|
3
|
+
function r(t) {
|
|
4
|
+
return "data" in t ? t.data : e({
|
|
5
|
+
abi: t.abi,
|
|
6
|
+
functionName: t.functionName,
|
|
7
|
+
args: t.args
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function i(e) {
|
|
11
|
+
let i = r(e);
|
|
12
|
+
return t(i) < 4 ? "0x00000000" : n(i, 0, 4);
|
|
13
|
+
}
|
|
14
|
+
function a(e) {
|
|
15
|
+
return {
|
|
16
|
+
target: e.target,
|
|
17
|
+
value: e.value ?? 0n,
|
|
18
|
+
data: r(e)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as gaslessWalletCallData, i as gaslessWalletCallSelector, a as toWalletCallTuple };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.js","names":[],"sources":["../../../src/gasless/gasless-wallet-execute/calls.ts"],"sourcesContent":["import { encodeFunctionData, size, slice, type Abi, type Address, type Hex } from \"viem\";\n\n/** One inner call of a gasless-wallet `execute` batch, given as raw calldata. */\nexport interface GaslessWalletRawCall {\n /** Contract the wallet calls. */\n target: Address;\n /**\n * Native value forwarded with the call. Defaults to `0n`. The wallet holds no\n * native balance unless someone funded it directly, so a non-zero value\n * reverts the whole batch in practice.\n */\n value?: bigint;\n /** Calldata for the target. */\n data: Hex;\n}\n\n/**\n * One inner call expressed against an ABI, which the SDK encodes with viem's\n * `encodeFunctionData` — that throws on an arity or type mismatch, before any\n * signature prompt or network call.\n *\n * `args` is deliberately `readonly unknown[]`: nothing else in this SDK uses\n * viem's contract-function generics, and a mapped-tuple surface would be out of\n * keeping. When you want compile-time-checked arguments, encode with viem\n * yourself and pass the result as a {@link GaslessWalletRawCall} — both forms\n * mix freely in one batch.\n */\nexport interface GaslessWalletContractCall {\n /** Contract the wallet calls. */\n target: Address;\n /** Native value forwarded with the call. Defaults to `0n`. */\n value?: bigint;\n /** ABI containing `functionName`. */\n abi: Abi | readonly unknown[];\n /** Function to call on `target`. */\n functionName: string;\n /** Arguments for `functionName`, in order. Omit for a no-argument function. */\n args?: readonly unknown[];\n}\n\n/**\n * One inner call of a gasless-wallet `execute` batch — either raw calldata\n * ({@link GaslessWalletRawCall}) or an ABI-level call the SDK encodes\n * ({@link GaslessWalletContractCall}).\n */\nexport type GaslessWalletCall = GaslessWalletRawCall | GaslessWalletContractCall;\n\n/**\n * The calldata one inner call runs with — raw `data`, or the ABI call encoded.\n *\n * @internal\n */\nexport function gaslessWalletCallData(call: GaslessWalletCall): Hex {\n if (\"data\" in call) return call.data;\n return encodeFunctionData({ abi: call.abi as Abi, functionName: call.functionName, args: call.args });\n}\n\n/**\n * The 4-byte selector the GaslessLayer reads off one inner call when it prices\n * the operation and checks a delegate's authority.\n *\n * Derived from the encoded calldata rather than from `functionName`, so an\n * overloaded ABI resolves to the same selector the wallet will actually run.\n * Calldata shorter than a selector yields `0x00000000` — what the contract's\n * own `_selectorFromMemory` returns for it.\n *\n * @internal\n */\nexport function gaslessWalletCallSelector(call: GaslessWalletCall): Hex {\n const data = gaslessWalletCallData(call);\n return size(data) < 4 ? \"0x00000000\" : slice(data, 0, 4);\n}\n\n/**\n * Normalize either call form to the `(address,uint256,bytes)` tuple the\n * wallet's `execute` takes.\n *\n * @internal\n */\nexport function toWalletCallTuple(call: GaslessWalletCall): { target: Address; value: bigint; data: Hex } {\n return { target: call.target, value: call.value ?? 0n, data: gaslessWalletCallData(call) };\n}\n"],"mappings":";;AAoDA,SAAgB,EAAsB,GAA8B;CAElE,OADI,UAAU,IAAa,EAAK,OACzB,EAAmB;EAAE,KAAK,EAAK;EAAY,cAAc,EAAK;EAAc,MAAM,EAAK;CAAK,CAAC;AACtG;AAaA,SAAgB,EAA0B,GAA8B;CACtE,IAAM,IAAO,EAAsB,CAAI;CACvC,OAAO,EAAK,CAAI,IAAI,IAAI,eAAe,EAAM,GAAM,GAAG,CAAC;AACzD;AAQA,SAAgB,EAAkB,GAAwE;CACxG,OAAO;EAAE,QAAQ,EAAK;EAAQ,OAAO,EAAK,SAAS;EAAI,MAAM,EAAsB,CAAI;CAAE;AAC3F"}
|