@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,20 @@
|
|
|
1
|
+
import { SymmioGaslessConfig } from '../core/chains/types.js';
|
|
2
|
+
import { Config } from '../core/config/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Check, once per config and chain, that the configured GaslessLayer verifies
|
|
5
|
+
* operations against the same InstantLayer the chain config signs for.
|
|
6
|
+
*
|
|
7
|
+
* InstantLayer signatures are bound to the chain's `instantLayerAddress`
|
|
8
|
+
* (the EIP-712 `verifyingContract`), while the relay is verified by whichever
|
|
9
|
+
* InstantLayer the GaslessLayer points at. When the two differ, every relayed
|
|
10
|
+
* signature is rejected — after the user has already been prompted for it.
|
|
11
|
+
*
|
|
12
|
+
* @param config - The SDK config.
|
|
13
|
+
* @param chainId - The chain the relay targets.
|
|
14
|
+
* @param gasless - The chain's resolved gasless block.
|
|
15
|
+
* @throws {SymmError} `GASLESS_CONFIG_INCOHERENT` when the two InstantLayer addresses differ.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function assertGaslessGatewayCoherence(config: Config, chainId: number, gasless: SymmioGaslessConfig): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=assert-gateway-coherence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-gateway-coherence.d.ts","sourceRoot":"","sources":["../../src/gasless/assert-gateway-coherence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAO7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAuCf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { gaslessLayerAbi as e } from "../symmio-contracts/abi/v0.8.6/gasless-layer.js";
|
|
2
|
+
import { SymmError as t } from "../shared/errors/symm-error.js";
|
|
3
|
+
import { isAddressEqual as n } from "viem";
|
|
4
|
+
//#region src/gasless/assert-gateway-coherence.ts
|
|
5
|
+
var r = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function i(i, a, o) {
|
|
7
|
+
let s = r.get(i);
|
|
8
|
+
s || (s = /* @__PURE__ */ new Map(), r.set(i, s));
|
|
9
|
+
let c = s.get(a);
|
|
10
|
+
if (c) return c;
|
|
11
|
+
let l = (async () => {
|
|
12
|
+
let { addresses: r } = i.getChainConfig(a), s = await i.getClient({ chainId: a }).readContract({
|
|
13
|
+
address: o.gaslessLayerAddress,
|
|
14
|
+
abi: e,
|
|
15
|
+
functionName: "instantLayer"
|
|
16
|
+
});
|
|
17
|
+
if (!n(s, r.instantLayerAddress)) throw new t("config", "GASLESS_CONFIG_INCOHERENT", `Gasless: the configured GaslessLayer (${o.gaslessLayerAddress}) verifies operations against InstantLayer ${s}, but chain ${a} is configured with instantLayerAddress ${r.instantLayerAddress}. Relayed signatures would be rejected — align the two addresses (createConfig override) before using gasless execution.`);
|
|
18
|
+
})();
|
|
19
|
+
return s.set(a, l), l.catch(() => {
|
|
20
|
+
s.get(a) === l && s.delete(a);
|
|
21
|
+
}), l;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as assertGaslessGatewayCoherence };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=assert-gateway-coherence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-gateway-coherence.js","names":[],"sources":["../../src/gasless/assert-gateway-coherence.ts"],"sourcesContent":["import { isAddressEqual } from \"viem\";\nimport type { SymmioGaslessConfig } from \"../core/chains/types\";\nimport type { Config } from \"../core/config\";\nimport { SymmError } from \"../shared/errors/symm-error\";\nimport { gaslessLayerAbi } from \"../symmio-contracts/abi/v0.8.6/gasless-layer\";\n\n/** One coherence probe per (config, chainId) — the gateway address is a config constant. */\nconst coherenceChecks = new WeakMap<Config, Map<number, Promise<void>>>();\n\n/**\n * Check, once per config and chain, that the configured GaslessLayer verifies\n * operations against the same InstantLayer the chain config signs for.\n *\n * InstantLayer signatures are bound to the chain's `instantLayerAddress`\n * (the EIP-712 `verifyingContract`), while the relay is verified by whichever\n * InstantLayer the GaslessLayer points at. When the two differ, every relayed\n * signature is rejected — after the user has already been prompted for it.\n *\n * @param config - The SDK config.\n * @param chainId - The chain the relay targets.\n * @param gasless - The chain's resolved gasless block.\n * @throws {SymmError} `GASLESS_CONFIG_INCOHERENT` when the two InstantLayer addresses differ.\n *\n * @internal\n */\nexport function assertGaslessGatewayCoherence(\n config: Config,\n chainId: number,\n gasless: SymmioGaslessConfig,\n): Promise<void> {\n let byChain = coherenceChecks.get(config);\n if (!byChain) {\n byChain = new Map();\n coherenceChecks.set(config, byChain);\n }\n const cached = byChain.get(chainId);\n if (cached) return cached;\n\n const probe = (async () => {\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n const gatewayInstantLayer = await client.readContract({\n address: gasless.gaslessLayerAddress,\n abi: gaslessLayerAbi,\n functionName: \"instantLayer\",\n });\n if (!isAddressEqual(gatewayInstantLayer, addresses.instantLayerAddress)) {\n throw new SymmError(\n \"config\",\n \"GASLESS_CONFIG_INCOHERENT\",\n `Gasless: the configured GaslessLayer (${gasless.gaslessLayerAddress}) verifies operations against InstantLayer ${gatewayInstantLayer}, but chain ${chainId} is configured with instantLayerAddress ${addresses.instantLayerAddress}. Relayed signatures would be rejected — align the two addresses (createConfig override) before using gasless execution.`,\n );\n }\n })();\n /**\n * Cache the real probe, not a swallowed copy. A pre-swallowed promise would\n * resolve for every caller that arrived while the first probe was still in\n * flight, so a concurrent write would sail past the guard on a misconfigured\n * chain and sign against an InstantLayer the gateway does not verify.\n *\n * The entry is dropped on rejection so a transient RPC failure cannot poison\n * the config — the next write probes again.\n */\n byChain.set(chainId, probe);\n probe.catch(() => {\n if (byChain.get(chainId) === probe) byChain.delete(chainId);\n });\n return probe;\n}\n"],"mappings":";;;;AAOA,IAAM,oBAAkB,IAAI,QAA4C;AAkBxE,SAAgB,EACd,GACA,GACA,GACe;CACf,IAAI,IAAU,EAAgB,IAAI,CAAM;CACxC,AAAK,MACH,oBAAU,IAAI,IAAI,GAClB,EAAgB,IAAI,GAAQ,CAAO;CAErC,IAAM,IAAS,EAAQ,IAAI,CAAO;CAClC,IAAI,GAAQ,OAAO;CAEnB,IAAM,KAAS,YAAY;EACzB,IAAM,EAAE,iBAAc,EAAO,eAAe,CAAO,GAE7C,IAAsB,MADb,EAAO,UAAU,EAAE,WAAQ,CACR,EAAO,aAAa;GACpD,SAAS,EAAQ;GACjB,KAAK;GACL,cAAc;EAChB,CAAC;EACD,IAAI,CAAC,EAAe,GAAqB,EAAU,mBAAmB,GACpE,MAAM,IAAI,EACR,UACA,6BACA,yCAAyC,EAAQ,oBAAoB,6CAA6C,EAAoB,cAAc,EAAQ,0CAA0C,EAAU,oBAAoB,yHACtO;CAEJ,GAAG;CAcH,OAJA,EAAQ,IAAI,GAAS,CAAK,GAC1B,EAAM,YAAY;EAChB,AAAI,EAAQ,IAAI,CAAO,MAAM,KAAO,EAAQ,OAAO,CAAO;CAC5D,CAAC,GACM;AACT"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Abi, Hex } from 'viem';
|
|
2
|
+
import { GaslessWalletCall } from '../gasless-wallet-execute/calls.js';
|
|
3
|
+
/**
|
|
4
|
+
* A relayable write named by its function, which the SDK encodes with viem's
|
|
5
|
+
* `encodeFunctionData` — that throws on an arity or type mismatch, before any
|
|
6
|
+
* signature prompt or network call.
|
|
7
|
+
*
|
|
8
|
+
* The target contract is **not** given: the SDK resolves it from the encoded
|
|
9
|
+
* selector (the core diamond, the AccountLayer or the InstantLayer). The `abi`
|
|
10
|
+
* is optional too — every relayable write is a known SYMMIO function, so
|
|
11
|
+
* `{ functionName: "allocate", args: [amount] }` is enough. Pass an `abi` (the
|
|
12
|
+
* SDK's own `symmioAbi`, `accountLayerAbi` or `instantLayerAbi`) when you
|
|
13
|
+
* already hold it; the selector must still be a relayable write.
|
|
14
|
+
*
|
|
15
|
+
* `args` is deliberately `readonly unknown[]`, as for `GaslessWalletContractCall`.
|
|
16
|
+
* When you want compile-time-checked arguments, encode with viem yourself and
|
|
17
|
+
* pass the result as a {@link GaslessBatchRawCall}.
|
|
18
|
+
*/
|
|
19
|
+
export interface GaslessBatchContractCall {
|
|
20
|
+
/** ABI containing `functionName`. Omit it to use the SDK's own ABI for the relayable write of that name. */
|
|
21
|
+
abi?: Abi | readonly unknown[];
|
|
22
|
+
/** The relayable write to run — `"allocate"`, `"initiateWithdraw"`, `"grantDelegation"`, … */
|
|
23
|
+
functionName: string;
|
|
24
|
+
/** Arguments for `functionName`, in order. Omit for a no-argument function. */
|
|
25
|
+
args?: readonly unknown[];
|
|
26
|
+
}
|
|
27
|
+
/** A relayable write given as raw calldata; its selector decides the target contract. */
|
|
28
|
+
export interface GaslessBatchRawCall {
|
|
29
|
+
/** Calldata of a relayable write. */
|
|
30
|
+
data: Hex;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A GaslessWallet `execute` entry: several calls the owner's deterministic
|
|
34
|
+
* wallet makes, authorized by **one** gateway-domain signature.
|
|
35
|
+
*
|
|
36
|
+
* The calls run **as the wallet contract**, not as the SYMMIO account — use it to
|
|
37
|
+
* move the wallet's own tokens (an ERC-20 `approve` followed by a bridge call,
|
|
38
|
+
* say), exactly as with `gaslessWalletExecute`.
|
|
39
|
+
*/
|
|
40
|
+
export interface GaslessBatchWalletExecute {
|
|
41
|
+
/** The calls the wallet makes, in order. Each is raw `data` or an `{ abi, functionName, args }` triple. */
|
|
42
|
+
walletCalls: readonly GaslessWalletCall[];
|
|
43
|
+
/**
|
|
44
|
+
* Which of the owner's GaslessWallets makes them. Defaults to `0n`, the
|
|
45
|
+
* original wallet. Each id is an independent wallet with its own address,
|
|
46
|
+
* balance and nonce stream.
|
|
47
|
+
*/
|
|
48
|
+
walletId?: bigint;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* One entry of a gasless batch: a relayable write — an ABI-level call
|
|
52
|
+
* ({@link GaslessBatchContractCall}) or raw calldata ({@link GaslessBatchRawCall}) —
|
|
53
|
+
* or a GaslessWallet `execute` ({@link GaslessBatchWalletExecute}). The forms mix
|
|
54
|
+
* freely in one batch.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* import type { GaslessBatchCall } from "@symmio/trading-core";
|
|
59
|
+
* import { erc20Abi } from "viem";
|
|
60
|
+
*
|
|
61
|
+
* const calls: GaslessBatchCall[] = [
|
|
62
|
+
* { functionName: "allocate", args: [amount] },
|
|
63
|
+
* { walletId: 1n, walletCalls: [{ target: usdc, abi: erc20Abi, functionName: "transfer", args: [to, value] }] },
|
|
64
|
+
* ];
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export type GaslessBatchCall = GaslessBatchContractCall | GaslessBatchRawCall | GaslessBatchWalletExecute;
|
|
68
|
+
/**
|
|
69
|
+
* Whether a batch entry is a GaslessWallet `execute`.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export declare function isGaslessBatchWalletExecute(call: GaslessBatchCall): call is GaslessBatchWalletExecute;
|
|
74
|
+
/**
|
|
75
|
+
* The calldata a relayable-write entry runs with — raw `data`, or the named
|
|
76
|
+
* call encoded against its own `abi` or, when it has none, the SDK's ABI for
|
|
77
|
+
* the relayable write of that name.
|
|
78
|
+
*
|
|
79
|
+
* @throws {SymmError} `GASLESS_NOT_RELAYABLE` when a call without an `abi` names no relayable write.
|
|
80
|
+
* @throws Viem's encoding error when the arguments do not encode.
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export declare function gaslessBatchCallData(call: GaslessBatchContractCall | GaslessBatchRawCall): Hex;
|
|
85
|
+
/**
|
|
86
|
+
* The 4-byte selector of a calldata blob, lowercased. Calldata shorter than a
|
|
87
|
+
* selector yields `0x00000000`, which no relayable write uses.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export declare function gaslessCallDataSelector(callData: Hex): Hex;
|
|
92
|
+
/**
|
|
93
|
+
* The selectors a gasless batch runs — the delegation set a session key must
|
|
94
|
+
* hold to relay it on the batch's account: each relayable write's selector, and
|
|
95
|
+
* for every GaslessWallet entry the wallet-execution sentinel plus each inner
|
|
96
|
+
* call's selector. Lowercased and de-duplicated in first-seen order, because
|
|
97
|
+
* `grantDelegation` rejects a duplicate-bearing array.
|
|
98
|
+
*
|
|
99
|
+
* Selectors come from the **encoded** calldata, so an overloaded ABI resolves to
|
|
100
|
+
* the function that will actually run.
|
|
101
|
+
*
|
|
102
|
+
* A batch that contains `grantDelegation` must be owner-signed whatever this
|
|
103
|
+
* returns: the InstantLayer rejects a delegate-signed grant, so no delegation
|
|
104
|
+
* makes it relayable by a session key.
|
|
105
|
+
*
|
|
106
|
+
* @param calls - The batch, in any order.
|
|
107
|
+
* @returns The selector set, as `bytes4` hex.
|
|
108
|
+
* @throws Viem's encoding error when an ABI-level call does not encode.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* await grantDelegation(config, {
|
|
113
|
+
* account: { addr: subAccount, isPartyB: false },
|
|
114
|
+
* delegatedSigner: sessionKey,
|
|
115
|
+
* selectors: getGaslessBatchSelectors(calls),
|
|
116
|
+
* expiryTimestamp,
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function getGaslessBatchSelectors(calls: readonly GaslessBatchCall[]): readonly Hex[];
|
|
121
|
+
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../../src/gasless/batch/calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,GAAG,EAAoB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,wBAAwB;IACvC,4GAA4G;IAC5G,GAAG,CAAC,EAAE,GAAG,GAAG,SAAS,OAAO,EAAE,CAAC;IAC/B,8FAA8F;IAC9F,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC3B;AAED,yFAAyF;AACzF,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,IAAI,EAAE,GAAG,CAAC;CACX;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,2GAA2G;IAC3G,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,GAAG,mBAAmB,GAAG,yBAAyB,CAAC;AAE1G;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,IAAI,yBAAyB,CAErG;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,GAAG,mBAAmB,GAAG,GAAG,CAI9F;AAcD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,CAE1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,GAAG,EAAE,CAmB3F"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SymmError as e } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { GASLESS_RELAYABLE_FUNCTIONS as t } from "../relayable-writes.js";
|
|
3
|
+
import { getGaslessWalletExecuteSelectors as n } from "../gasless-wallet-execute/selectors.js";
|
|
4
|
+
import { encodeFunctionData as r, size as i, slice as a } from "viem";
|
|
5
|
+
//#region src/gasless/batch/calls.ts
|
|
6
|
+
function o(e) {
|
|
7
|
+
return "walletCalls" in e;
|
|
8
|
+
}
|
|
9
|
+
function s(e) {
|
|
10
|
+
return "data" in e ? e.data : r({
|
|
11
|
+
abi: e.abi ?? [c(e.functionName)],
|
|
12
|
+
functionName: e.functionName,
|
|
13
|
+
args: e.args
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function c(n) {
|
|
17
|
+
let r = t.get(n);
|
|
18
|
+
if (!r) throw new e("validation", "GASLESS_NOT_RELAYABLE", `Gasless: no relayable write is named "${n}". A batch carries the writes in GASLESS_RELAYABLE_SELECTORS; run any other call from the GaslessWallet as a \`walletCalls\` entry.`);
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
function l(e) {
|
|
22
|
+
return (i(e) < 4 ? "0x00000000" : a(e, 0, 4)).toLowerCase();
|
|
23
|
+
}
|
|
24
|
+
function u(e) {
|
|
25
|
+
let t = /* @__PURE__ */ new Set(), r = [], i = (e) => {
|
|
26
|
+
let n = e.toLowerCase();
|
|
27
|
+
t.has(n) || (t.add(n), r.push(n));
|
|
28
|
+
};
|
|
29
|
+
for (let t of e) if (o(t)) for (let e of n(t.walletCalls)) i(e);
|
|
30
|
+
else i(l(s(t)));
|
|
31
|
+
return r;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { s as gaslessBatchCallData, l as gaslessCallDataSelector, u as getGaslessBatchSelectors, o as isGaslessBatchWalletExecute };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.js","names":[],"sources":["../../../src/gasless/batch/calls.ts"],"sourcesContent":["import { encodeFunctionData, size, slice, type Abi, type AbiFunction, type Hex } from \"viem\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { GaslessWalletCall } from \"../gasless-wallet-execute/calls\";\nimport { getGaslessWalletExecuteSelectors } from \"../gasless-wallet-execute/selectors\";\nimport { GASLESS_RELAYABLE_FUNCTIONS } from \"../relayable-writes\";\n\n/**\n * A relayable write named by its function, 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 * The target contract is **not** given: the SDK resolves it from the encoded\n * selector (the core diamond, the AccountLayer or the InstantLayer). The `abi`\n * is optional too — every relayable write is a known SYMMIO function, so\n * `{ functionName: \"allocate\", args: [amount] }` is enough. Pass an `abi` (the\n * SDK's own `symmioAbi`, `accountLayerAbi` or `instantLayerAbi`) when you\n * already hold it; the selector must still be a relayable write.\n *\n * `args` is deliberately `readonly unknown[]`, as for `GaslessWalletContractCall`.\n * When you want compile-time-checked arguments, encode with viem yourself and\n * pass the result as a {@link GaslessBatchRawCall}.\n */\nexport interface GaslessBatchContractCall {\n /** ABI containing `functionName`. Omit it to use the SDK's own ABI for the relayable write of that name. */\n abi?: Abi | readonly unknown[];\n /** The relayable write to run — `\"allocate\"`, `\"initiateWithdraw\"`, `\"grantDelegation\"`, … */\n functionName: string;\n /** Arguments for `functionName`, in order. Omit for a no-argument function. */\n args?: readonly unknown[];\n}\n\n/** A relayable write given as raw calldata; its selector decides the target contract. */\nexport interface GaslessBatchRawCall {\n /** Calldata of a relayable write. */\n data: Hex;\n}\n\n/**\n * A GaslessWallet `execute` entry: several calls the owner's deterministic\n * wallet makes, authorized by **one** gateway-domain signature.\n *\n * The calls run **as the wallet contract**, not as the SYMMIO account — use it to\n * move the wallet's own tokens (an ERC-20 `approve` followed by a bridge call,\n * say), exactly as with `gaslessWalletExecute`.\n */\nexport interface GaslessBatchWalletExecute {\n /** The calls the wallet makes, in order. Each is raw `data` or an `{ abi, functionName, args }` triple. */\n walletCalls: readonly GaslessWalletCall[];\n /**\n * Which of the owner's GaslessWallets makes them. Defaults to `0n`, the\n * original wallet. Each id is an independent wallet with its own address,\n * balance and nonce stream.\n */\n walletId?: bigint;\n}\n\n/**\n * One entry of a gasless batch: a relayable write — an ABI-level call\n * ({@link GaslessBatchContractCall}) or raw calldata ({@link GaslessBatchRawCall}) —\n * or a GaslessWallet `execute` ({@link GaslessBatchWalletExecute}). The forms mix\n * freely in one batch.\n *\n * @example\n * ```ts\n * import type { GaslessBatchCall } from \"@symmio/trading-core\";\n * import { erc20Abi } from \"viem\";\n *\n * const calls: GaslessBatchCall[] = [\n * { functionName: \"allocate\", args: [amount] },\n * { walletId: 1n, walletCalls: [{ target: usdc, abi: erc20Abi, functionName: \"transfer\", args: [to, value] }] },\n * ];\n * ```\n */\nexport type GaslessBatchCall = GaslessBatchContractCall | GaslessBatchRawCall | GaslessBatchWalletExecute;\n\n/**\n * Whether a batch entry is a GaslessWallet `execute`.\n *\n * @internal\n */\nexport function isGaslessBatchWalletExecute(call: GaslessBatchCall): call is GaslessBatchWalletExecute {\n return \"walletCalls\" in call;\n}\n\n/**\n * The calldata a relayable-write entry runs with — raw `data`, or the named\n * call encoded against its own `abi` or, when it has none, the SDK's ABI for\n * the relayable write of that name.\n *\n * @throws {SymmError} `GASLESS_NOT_RELAYABLE` when a call without an `abi` names no relayable write.\n * @throws Viem's encoding error when the arguments do not encode.\n *\n * @internal\n */\nexport function gaslessBatchCallData(call: GaslessBatchContractCall | GaslessBatchRawCall): Hex {\n if (\"data\" in call) return call.data;\n const abi = call.abi ?? [relayableFunction(call.functionName)];\n return encodeFunctionData({ abi: abi as Abi, functionName: call.functionName, args: call.args });\n}\n\nfunction relayableFunction(functionName: string): AbiFunction {\n const item = GASLESS_RELAYABLE_FUNCTIONS.get(functionName);\n if (!item) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_NOT_RELAYABLE\",\n `Gasless: no relayable write is named \"${functionName}\". A batch carries the writes in GASLESS_RELAYABLE_SELECTORS; run any other call from the GaslessWallet as a \\`walletCalls\\` entry.`,\n );\n }\n return item;\n}\n\n/**\n * The 4-byte selector of a calldata blob, lowercased. Calldata shorter than a\n * selector yields `0x00000000`, which no relayable write uses.\n *\n * @internal\n */\nexport function gaslessCallDataSelector(callData: Hex): Hex {\n return (size(callData) < 4 ? \"0x00000000\" : slice(callData, 0, 4)).toLowerCase() as Hex;\n}\n\n/**\n * The selectors a gasless batch runs — the delegation set a session key must\n * hold to relay it on the batch's account: each relayable write's selector, and\n * for every GaslessWallet entry the wallet-execution sentinel plus each inner\n * call's selector. Lowercased and de-duplicated in first-seen order, because\n * `grantDelegation` rejects a duplicate-bearing array.\n *\n * Selectors come from the **encoded** calldata, so an overloaded ABI resolves to\n * the function that will actually run.\n *\n * A batch that contains `grantDelegation` must be owner-signed whatever this\n * returns: the InstantLayer rejects a delegate-signed grant, so no delegation\n * makes it relayable by a session key.\n *\n * @param calls - The batch, in any order.\n * @returns The selector set, as `bytes4` hex.\n * @throws Viem's encoding error when an ABI-level call does not encode.\n *\n * @example\n * ```ts\n * await grantDelegation(config, {\n * account: { addr: subAccount, isPartyB: false },\n * delegatedSigner: sessionKey,\n * selectors: getGaslessBatchSelectors(calls),\n * expiryTimestamp,\n * });\n * ```\n */\nexport function getGaslessBatchSelectors(calls: readonly GaslessBatchCall[]): readonly Hex[] {\n const seen = new Set<Hex>();\n const unique: Hex[] = [];\n const add = (selector: Hex) => {\n const normalized = selector.toLowerCase() as Hex;\n if (seen.has(normalized)) return;\n seen.add(normalized);\n unique.push(normalized);\n };\n\n for (const call of calls) {\n if (isGaslessBatchWalletExecute(call)) {\n for (const selector of getGaslessWalletExecuteSelectors(call.walletCalls)) add(selector);\n } else {\n add(gaslessCallDataSelector(gaslessBatchCallData(call)));\n }\n }\n\n return unique;\n}\n"],"mappings":";;;;;AAgFA,SAAgB,EAA4B,GAA2D;CACrG,OAAO,iBAAiB;AAC1B;AAYA,SAAgB,EAAqB,GAA2D;CAG9F,OAFI,UAAU,IAAa,EAAK,OAEzB,EAAmB;EAAO,KADrB,EAAK,OAAO,CAAC,EAAkB,EAAK,YAAY,CAAC;EAChB,cAAc,EAAK;EAAc,MAAM,EAAK;CAAK,CAAC;AACjG;AAEA,SAAS,EAAkB,GAAmC;CAC5D,IAAM,IAAO,EAA4B,IAAI,CAAY;CACzD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,cACA,yBACA,yCAAyC,EAAa,oIACxD;CAEF,OAAO;AACT;AAQA,SAAgB,EAAwB,GAAoB;CAC1D,QAAQ,EAAK,CAAQ,IAAI,IAAI,eAAe,EAAM,GAAU,GAAG,CAAC,GAAG,YAAY;AACjF;AA8BA,SAAgB,EAAyB,GAAoD;CAC3F,IAAM,oBAAO,IAAI,IAAS,GACpB,IAAgB,CAAC,GACjB,KAAO,MAAkB;EAC7B,IAAM,IAAa,EAAS,YAAY;EACpC,EAAK,IAAI,CAAU,MACvB,EAAK,IAAI,CAAU,GACnB,EAAO,KAAK,CAAU;CACxB;CAEA,KAAK,IAAM,KAAQ,GACjB,IAAI,EAA4B,CAAI,GAClC,KAAK,IAAM,KAAY,EAAiC,EAAK,WAAW,GAAG,EAAI,CAAQ;MAEvF,EAAI,EAAwB,EAAqB,CAAI,CAAC,CAAC;CAI3D,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/batch/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { SymmioContractAddresses } from '../../core/chains/types.js';
|
|
3
|
+
import { Config } from '../../core/config/index.js';
|
|
4
|
+
import { SignedOperation } from '../../solvers/instant-open/shared/types.js';
|
|
5
|
+
import { GaslessWalletCall } from '../gasless-wallet-execute/calls.js';
|
|
6
|
+
import { GaslessBatchCall } from './calls.js';
|
|
7
|
+
/** A relayable write, resolved to the contract the InstantLayer calls. @internal */
|
|
8
|
+
export interface ResolvedGaslessInstantEntry {
|
|
9
|
+
type: "instant";
|
|
10
|
+
/** Contract the InstantLayer calls with `callData`. */
|
|
11
|
+
target: Address;
|
|
12
|
+
/** The write's calldata. */
|
|
13
|
+
callData: Hex;
|
|
14
|
+
/** The write's selector, lowercased. */
|
|
15
|
+
selector: Hex;
|
|
16
|
+
/** The write's stable workflow label (`"allocate"`, `"initiateWithdraw"`, …). */
|
|
17
|
+
operationType: string;
|
|
18
|
+
}
|
|
19
|
+
/** A GaslessWallet `execute` entry, encoded. @internal */
|
|
20
|
+
export interface ResolvedGaslessWalletEntry {
|
|
21
|
+
type: "wallet";
|
|
22
|
+
/** The wallet id the entry executes from. */
|
|
23
|
+
walletId: bigint;
|
|
24
|
+
/** `GaslessWallet.execute(calls)` calldata. */
|
|
25
|
+
callData: Hex;
|
|
26
|
+
/** The inner calls, for the delegation pre-flight. */
|
|
27
|
+
walletCalls: readonly GaslessWalletCall[];
|
|
28
|
+
}
|
|
29
|
+
/** One batch entry, resolved and encoded, in relay order. @internal */
|
|
30
|
+
export type ResolvedGaslessBatchEntry = ResolvedGaslessInstantEntry | ResolvedGaslessWalletEntry;
|
|
31
|
+
/**
|
|
32
|
+
* Encode every batch entry and resolve each relayable write to its contract.
|
|
33
|
+
*
|
|
34
|
+
* Runs before any network call or signature prompt, so a malformed call, an
|
|
35
|
+
* invalid wallet id or a write the relayer cannot carry fails up front.
|
|
36
|
+
*
|
|
37
|
+
* @param addresses - The chain's contract addresses.
|
|
38
|
+
* @param calls - The batch, in relay order.
|
|
39
|
+
* @returns The resolved entries, in the same order.
|
|
40
|
+
* @throws {SymmError} `GASLESS_EMPTY_BATCH` for an empty batch.
|
|
41
|
+
* @throws {SymmError} `GASLESS_NOT_RELAYABLE` for a call whose selector is not a relayable write.
|
|
42
|
+
* @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range.
|
|
43
|
+
* @throws Viem's encoding error when an ABI-level call does not encode.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveGaslessBatchEntries(addresses: SymmioContractAddresses, calls: readonly GaslessBatchCall[]): ResolvedGaslessBatchEntry[];
|
|
48
|
+
/**
|
|
49
|
+
* The label a batch relays under by default: its entries' labels joined with
|
|
50
|
+
* `+` (`"approveOperationalFee+allocate"`), or `"gaslessBatch"` when that exceeds
|
|
51
|
+
* the service's 128 characters.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export declare function defaultGaslessBatchOperationType(entries: readonly ResolvedGaslessBatchEntry[]): string;
|
|
56
|
+
/**
|
|
57
|
+
* The distinct wallet ids a batch's GaslessWallet entries execute from, in first-seen order.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function distinctGaslessBatchWalletIds(entries: readonly ResolvedGaslessBatchEntry[]): bigint[];
|
|
62
|
+
/**
|
|
63
|
+
* Read the address of each wallet a batch executes from — the signed `target`
|
|
64
|
+
* of its GaslessWallet entries.
|
|
65
|
+
*
|
|
66
|
+
* @param config - The SDK config.
|
|
67
|
+
* @param parameters - The chain, the wallets' owner, and the distinct wallet ids.
|
|
68
|
+
* @returns Each id's wallet address.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
export declare function readGaslessBatchWalletTargets(config: Config, parameters: {
|
|
73
|
+
chainId: number;
|
|
74
|
+
owner: Address;
|
|
75
|
+
walletIds: readonly bigint[];
|
|
76
|
+
}): Promise<Map<bigint, Address>>;
|
|
77
|
+
/** Everything a batch's operations are built from, besides its entries. @internal */
|
|
78
|
+
export interface GaslessBatchBuildContext {
|
|
79
|
+
/** The EIP-712 signer written into every operation. */
|
|
80
|
+
signer: Address;
|
|
81
|
+
/** The batch's account — every operation's `signerAccount.addr`. */
|
|
82
|
+
account: Address;
|
|
83
|
+
/** The signature deadline shared by every operation (unix seconds). */
|
|
84
|
+
deadline: bigint;
|
|
85
|
+
/** The InstantLayer nonce the account has consumed; the first relayable write signs `+ 1n`. */
|
|
86
|
+
instantNonce: bigint;
|
|
87
|
+
/** Each wallet id's address — the signed `target` of its entries. */
|
|
88
|
+
walletTargets: ReadonlyMap<bigint, Address>;
|
|
89
|
+
/** Each wallet id's consumed wallet-operation nonce; the first entry on it signs `+ 1n`. Omitted ids start at `0n`. */
|
|
90
|
+
walletNonces: ReadonlyMap<bigint, bigint>;
|
|
91
|
+
/** The replay salt of each operation, called once per operation in order. */
|
|
92
|
+
salt: () => Hex;
|
|
93
|
+
}
|
|
94
|
+
/** A batch's operations, ready to sign. @internal */
|
|
95
|
+
export interface GaslessBatchOperations {
|
|
96
|
+
/** One operation per entry, in relay order. */
|
|
97
|
+
operations: SignedOperation[];
|
|
98
|
+
/** One wallet id per operation — `0n` for every relayable write. */
|
|
99
|
+
walletIds: bigint[];
|
|
100
|
+
/** The highest InstantLayer nonce the batch signs, or `null` when it has no relayable write. */
|
|
101
|
+
lastInstantNonce: bigint | null;
|
|
102
|
+
/** The highest wallet-operation nonce the batch signs on each wallet id. */
|
|
103
|
+
lastWalletNonces: Map<bigint, bigint>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Build a batch's operations with sequential nonces on each stream: the
|
|
107
|
+
* relayable writes count up the account's InstantLayer stream, and each wallet
|
|
108
|
+
* id's entries count up that wallet's own stream.
|
|
109
|
+
*
|
|
110
|
+
* Every operation is the full InstantLayer `SignedOperation` shape — a wallet
|
|
111
|
+
* entry too, with no flex fields and `maxUses` 1, which is how the relay's ABI
|
|
112
|
+
* and wire format carry it. Only its **signature** covers the five-field
|
|
113
|
+
* gateway struct.
|
|
114
|
+
*
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
export declare function buildGaslessBatchOperations(entries: readonly ResolvedGaslessBatchEntry[], context: GaslessBatchBuildContext): GaslessBatchOperations;
|
|
118
|
+
//# sourceMappingURL=resolve-gasless-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-gasless-batch.d.ts","sourceRoot":"","sources":["../../../src/gasless/batch/resolve-gasless-batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAK5F,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAC;AAQjB,oFAAoF;AACpF,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,SAAS,CAAC;IAChB,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,GAAG,CAAC;IACd,wCAAwC;IACxC,QAAQ,EAAE,GAAG,CAAC;IACd,iFAAiF;IACjF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,0DAA0D;AAC1D,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,QAAQ,CAAC;IACf,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,QAAQ,EAAE,GAAG,CAAC;IACd,sDAAsD;IACtD,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC3C;AAED,uEAAuE;AACvE,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,GAAG,0BAA0B,CAAC;AAajG;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,uBAAuB,EAClC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GACjC,yBAAyB,EAAE,CAqC7B;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,SAAS,yBAAyB,EAAE,GAAG,MAAM,CAKtG;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,SAAS,yBAAyB,EAAE,GAAG,MAAM,EAAE,CAErG;AAED;;;;;;;;;GASG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC5E,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAM/B;AAED,qFAAqF;AACrF,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,YAAY,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,uHAAuH;IACvH,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,CAAC;CACjB;AAED,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,oEAAoE;IACpE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gGAAgG;IAChG,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,4EAA4E;IAC5E,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,yBAAyB,EAAE,EAC7C,OAAO,EAAE,wBAAwB,GAChC,sBAAsB,CAuCxB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { gaslessWalletAbi as e } from "../../symmio-contracts/abi/v0.8.6/gasless-wallet.js";
|
|
2
|
+
import { SymmError as t } from "../../shared/errors/symm-error.js";
|
|
3
|
+
import { buildSignedOperation as n } from "../../solvers/instant-open/shared/operations.js";
|
|
4
|
+
import { assertGaslessWalletId as r } from "../wallet-id.js";
|
|
5
|
+
import { GASLESS_RELAYABLE_WRITES as i } from "../relayable-writes.js";
|
|
6
|
+
import { toWalletCallTuple as a } from "../gasless-wallet-execute/calls.js";
|
|
7
|
+
import { gaslessBatchCallData as o, gaslessCallDataSelector as s, isGaslessBatchWalletExecute as c } from "./calls.js";
|
|
8
|
+
import { getGaslessWalletAddress as l } from "../get-gasless-wallet-address/get-gasless-wallet-address.js";
|
|
9
|
+
import { GASLESS_WALLET_EXECUTE_OPERATION_TYPE as u } from "../gasless-wallet-execute/gasless-wallet-execute.js";
|
|
10
|
+
import { encodeFunctionData as d } from "viem";
|
|
11
|
+
//#region src/gasless/batch/resolve-gasless-batch.ts
|
|
12
|
+
var f = "gaslessBatch", p = 128;
|
|
13
|
+
function m(e, t) {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case "symmio": return e.symmioAddress;
|
|
16
|
+
case "accountLayer": return e.accountLayerAddress;
|
|
17
|
+
case "instantLayer": return e.instantLayerAddress;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function h(n, l) {
|
|
21
|
+
if (l.length === 0) throw new t("validation", "GASLESS_EMPTY_BATCH", "Gasless: a batch needs at least one call.");
|
|
22
|
+
return l.map((l, u) => {
|
|
23
|
+
if (c(l)) return {
|
|
24
|
+
type: "wallet",
|
|
25
|
+
walletId: r(l.walletId ?? 0n, `calls[${u}].walletId`),
|
|
26
|
+
callData: d({
|
|
27
|
+
abi: e,
|
|
28
|
+
functionName: "execute",
|
|
29
|
+
args: [l.walletCalls.map(a)]
|
|
30
|
+
}),
|
|
31
|
+
walletCalls: l.walletCalls
|
|
32
|
+
};
|
|
33
|
+
let f = o(l), p = s(f), h = i.get(p);
|
|
34
|
+
if (!h) throw new t("validation", "GASLESS_NOT_RELAYABLE", `Gasless: calls[${u}] (selector ${p}) is not a relayable write. A batch carries the writes in GASLESS_RELAYABLE_SELECTORS; run any other call from the GaslessWallet as a \`walletCalls\` entry.`);
|
|
35
|
+
return {
|
|
36
|
+
type: "instant",
|
|
37
|
+
target: m(n, h.target),
|
|
38
|
+
callData: f,
|
|
39
|
+
selector: p,
|
|
40
|
+
operationType: h.operationType
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function g(e) {
|
|
45
|
+
let t = e.map((e) => e.type === "wallet" ? u : e.operationType).join("+");
|
|
46
|
+
return t.length <= p ? t : f;
|
|
47
|
+
}
|
|
48
|
+
function _(e) {
|
|
49
|
+
return [...new Set(e.flatMap((e) => e.type === "wallet" ? [e.walletId] : []))];
|
|
50
|
+
}
|
|
51
|
+
async function v(e, t) {
|
|
52
|
+
let { chainId: n, owner: r, walletIds: i } = t, a = await Promise.all(i.map((t) => l(e, {
|
|
53
|
+
chainId: n,
|
|
54
|
+
owner: r,
|
|
55
|
+
walletId: t
|
|
56
|
+
})));
|
|
57
|
+
return new Map(i.map((e, t) => [e, a[t]]));
|
|
58
|
+
}
|
|
59
|
+
function y(e, t) {
|
|
60
|
+
let r = [], i = [], a = null, o = /* @__PURE__ */ new Map();
|
|
61
|
+
for (let s of e) {
|
|
62
|
+
let e, c;
|
|
63
|
+
if (s.type === "instant") e = s.target, c = (a ?? t.instantNonce) + 1n, a = c, i.push(0n);
|
|
64
|
+
else {
|
|
65
|
+
let n = t.walletTargets.get(s.walletId);
|
|
66
|
+
if (n === void 0) throw Error(`gasless batch: no wallet address was resolved for wallet id ${s.walletId}.`);
|
|
67
|
+
e = n, c = (o.get(s.walletId) ?? t.walletNonces.get(s.walletId) ?? 0n) + 1n, o.set(s.walletId, c), i.push(s.walletId);
|
|
68
|
+
}
|
|
69
|
+
r.push(n({
|
|
70
|
+
signer: t.signer,
|
|
71
|
+
target: e,
|
|
72
|
+
callData: s.callData,
|
|
73
|
+
signerAccount: t.account,
|
|
74
|
+
deadline: t.deadline,
|
|
75
|
+
nonce: c,
|
|
76
|
+
salt: t.salt()
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
operations: r,
|
|
81
|
+
walletIds: i,
|
|
82
|
+
lastInstantNonce: a,
|
|
83
|
+
lastWalletNonces: o
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { y as buildGaslessBatchOperations, g as defaultGaslessBatchOperationType, _ as distinctGaslessBatchWalletIds, v as readGaslessBatchWalletTargets, h as resolveGaslessBatchEntries };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=resolve-gasless-batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-gasless-batch.js","names":[],"sources":["../../../src/gasless/batch/resolve-gasless-batch.ts"],"sourcesContent":["import { encodeFunctionData, type Address, type Hex } from \"viem\";\nimport type { SymmioContractAddresses } from \"../../core/chains/types\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport { buildSignedOperation } from \"../../solvers/instant-open/shared/operations\";\nimport type { SignedOperation } from \"../../solvers/instant-open/shared/types\";\nimport { gaslessWalletAbi } from \"../../symmio-contracts/abi/v0.8.6/gasless-wallet\";\nimport { toWalletCallTuple, type GaslessWalletCall } from \"../gasless-wallet-execute/calls\";\nimport { GASLESS_WALLET_EXECUTE_OPERATION_TYPE } from \"../gasless-wallet-execute/gasless-wallet-execute\";\nimport { getGaslessWalletAddress } from \"../get-gasless-wallet-address/get-gasless-wallet-address\";\nimport { GASLESS_RELAYABLE_WRITES, type GaslessRelayableTarget } from \"../relayable-writes\";\nimport { assertGaslessWalletId } from \"../wallet-id\";\nimport {\n gaslessBatchCallData,\n gaslessCallDataSelector,\n isGaslessBatchWalletExecute,\n type GaslessBatchCall,\n} from \"./calls\";\n\n/** The label a batch relays under when its entries' own labels do not fit the service's 128 characters. */\nconst GASLESS_BATCH_OPERATION_TYPE = \"gaslessBatch\";\n\n/** The service's limit on an `operationType` label. */\nconst GASLESS_OPERATION_TYPE_MAX_LENGTH = 128;\n\n/** A relayable write, resolved to the contract the InstantLayer calls. @internal */\nexport interface ResolvedGaslessInstantEntry {\n type: \"instant\";\n /** Contract the InstantLayer calls with `callData`. */\n target: Address;\n /** The write's calldata. */\n callData: Hex;\n /** The write's selector, lowercased. */\n selector: Hex;\n /** The write's stable workflow label (`\"allocate\"`, `\"initiateWithdraw\"`, …). */\n operationType: string;\n}\n\n/** A GaslessWallet `execute` entry, encoded. @internal */\nexport interface ResolvedGaslessWalletEntry {\n type: \"wallet\";\n /** The wallet id the entry executes from. */\n walletId: bigint;\n /** `GaslessWallet.execute(calls)` calldata. */\n callData: Hex;\n /** The inner calls, for the delegation pre-flight. */\n walletCalls: readonly GaslessWalletCall[];\n}\n\n/** One batch entry, resolved and encoded, in relay order. @internal */\nexport type ResolvedGaslessBatchEntry = ResolvedGaslessInstantEntry | ResolvedGaslessWalletEntry;\n\nfunction relayableTargetAddress(addresses: SymmioContractAddresses, target: GaslessRelayableTarget): Address {\n switch (target) {\n case \"symmio\":\n return addresses.symmioAddress;\n case \"accountLayer\":\n return addresses.accountLayerAddress;\n case \"instantLayer\":\n return addresses.instantLayerAddress;\n }\n}\n\n/**\n * Encode every batch entry and resolve each relayable write to its contract.\n *\n * Runs before any network call or signature prompt, so a malformed call, an\n * invalid wallet id or a write the relayer cannot carry fails up front.\n *\n * @param addresses - The chain's contract addresses.\n * @param calls - The batch, in relay order.\n * @returns The resolved entries, in the same order.\n * @throws {SymmError} `GASLESS_EMPTY_BATCH` for an empty batch.\n * @throws {SymmError} `GASLESS_NOT_RELAYABLE` for a call whose selector is not a relayable write.\n * @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range.\n * @throws Viem's encoding error when an ABI-level call does not encode.\n *\n * @internal\n */\nexport function resolveGaslessBatchEntries(\n addresses: SymmioContractAddresses,\n calls: readonly GaslessBatchCall[],\n): ResolvedGaslessBatchEntry[] {\n if (calls.length === 0) {\n throw new SymmError(\"validation\", \"GASLESS_EMPTY_BATCH\", \"Gasless: a batch needs at least one call.\");\n }\n\n return calls.map((call, index): ResolvedGaslessBatchEntry => {\n if (isGaslessBatchWalletExecute(call)) {\n return {\n type: \"wallet\",\n walletId: assertGaslessWalletId(call.walletId ?? 0n, `calls[${index}].walletId`),\n callData: encodeFunctionData({\n abi: gaslessWalletAbi,\n functionName: \"execute\",\n args: [call.walletCalls.map(toWalletCallTuple)],\n }),\n walletCalls: call.walletCalls,\n };\n }\n\n const callData = gaslessBatchCallData(call);\n const selector = gaslessCallDataSelector(callData);\n const write = GASLESS_RELAYABLE_WRITES.get(selector);\n if (!write) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_NOT_RELAYABLE\",\n `Gasless: calls[${index}] (selector ${selector}) is not a relayable write. A batch carries the writes in GASLESS_RELAYABLE_SELECTORS; run any other call from the GaslessWallet as a \\`walletCalls\\` entry.`,\n );\n }\n return {\n type: \"instant\",\n target: relayableTargetAddress(addresses, write.target),\n callData,\n selector,\n operationType: write.operationType,\n };\n });\n}\n\n/**\n * The label a batch relays under by default: its entries' labels joined with\n * `+` (`\"approveOperationalFee+allocate\"`), or `\"gaslessBatch\"` when that exceeds\n * the service's 128 characters.\n *\n * @internal\n */\nexport function defaultGaslessBatchOperationType(entries: readonly ResolvedGaslessBatchEntry[]): string {\n const label = entries\n .map((entry) => (entry.type === \"wallet\" ? GASLESS_WALLET_EXECUTE_OPERATION_TYPE : entry.operationType))\n .join(\"+\");\n return label.length <= GASLESS_OPERATION_TYPE_MAX_LENGTH ? label : GASLESS_BATCH_OPERATION_TYPE;\n}\n\n/**\n * The distinct wallet ids a batch's GaslessWallet entries execute from, in first-seen order.\n *\n * @internal\n */\nexport function distinctGaslessBatchWalletIds(entries: readonly ResolvedGaslessBatchEntry[]): bigint[] {\n return [...new Set(entries.flatMap((entry) => (entry.type === \"wallet\" ? [entry.walletId] : [])))];\n}\n\n/**\n * Read the address of each wallet a batch executes from — the signed `target`\n * of its GaslessWallet entries.\n *\n * @param config - The SDK config.\n * @param parameters - The chain, the wallets' owner, and the distinct wallet ids.\n * @returns Each id's wallet address.\n *\n * @internal\n */\nexport async function readGaslessBatchWalletTargets(\n config: Config,\n parameters: { chainId: number; owner: Address; walletIds: readonly bigint[] },\n): Promise<Map<bigint, Address>> {\n const { chainId, owner, walletIds } = parameters;\n const addresses = await Promise.all(\n walletIds.map((walletId) => getGaslessWalletAddress(config, { chainId, owner, walletId })),\n );\n return new Map(walletIds.map((walletId, index) => [walletId, addresses[index]!]));\n}\n\n/** Everything a batch's operations are built from, besides its entries. @internal */\nexport interface GaslessBatchBuildContext {\n /** The EIP-712 signer written into every operation. */\n signer: Address;\n /** The batch's account — every operation's `signerAccount.addr`. */\n account: Address;\n /** The signature deadline shared by every operation (unix seconds). */\n deadline: bigint;\n /** The InstantLayer nonce the account has consumed; the first relayable write signs `+ 1n`. */\n instantNonce: bigint;\n /** Each wallet id's address — the signed `target` of its entries. */\n walletTargets: ReadonlyMap<bigint, Address>;\n /** Each wallet id's consumed wallet-operation nonce; the first entry on it signs `+ 1n`. Omitted ids start at `0n`. */\n walletNonces: ReadonlyMap<bigint, bigint>;\n /** The replay salt of each operation, called once per operation in order. */\n salt: () => Hex;\n}\n\n/** A batch's operations, ready to sign. @internal */\nexport interface GaslessBatchOperations {\n /** One operation per entry, in relay order. */\n operations: SignedOperation[];\n /** One wallet id per operation — `0n` for every relayable write. */\n walletIds: bigint[];\n /** The highest InstantLayer nonce the batch signs, or `null` when it has no relayable write. */\n lastInstantNonce: bigint | null;\n /** The highest wallet-operation nonce the batch signs on each wallet id. */\n lastWalletNonces: Map<bigint, bigint>;\n}\n\n/**\n * Build a batch's operations with sequential nonces on each stream: the\n * relayable writes count up the account's InstantLayer stream, and each wallet\n * id's entries count up that wallet's own stream.\n *\n * Every operation is the full InstantLayer `SignedOperation` shape — a wallet\n * entry too, with no flex fields and `maxUses` 1, which is how the relay's ABI\n * and wire format carry it. Only its **signature** covers the five-field\n * gateway struct.\n *\n * @internal\n */\nexport function buildGaslessBatchOperations(\n entries: readonly ResolvedGaslessBatchEntry[],\n context: GaslessBatchBuildContext,\n): GaslessBatchOperations {\n const operations: SignedOperation[] = [];\n const walletIds: bigint[] = [];\n let lastInstantNonce: bigint | null = null;\n const lastWalletNonces = new Map<bigint, bigint>();\n\n for (const entry of entries) {\n let target: Address;\n let nonce: bigint;\n if (entry.type === \"instant\") {\n target = entry.target;\n nonce = (lastInstantNonce ?? context.instantNonce) + 1n;\n lastInstantNonce = nonce;\n walletIds.push(0n);\n } else {\n const walletTarget = context.walletTargets.get(entry.walletId);\n if (walletTarget === undefined) {\n throw new Error(`gasless batch: no wallet address was resolved for wallet id ${entry.walletId}.`);\n }\n target = walletTarget;\n nonce = (lastWalletNonces.get(entry.walletId) ?? context.walletNonces.get(entry.walletId) ?? 0n) + 1n;\n lastWalletNonces.set(entry.walletId, nonce);\n walletIds.push(entry.walletId);\n }\n\n operations.push(\n buildSignedOperation({\n signer: context.signer,\n target,\n callData: entry.callData,\n signerAccount: context.account,\n deadline: context.deadline,\n nonce,\n salt: context.salt(),\n }),\n );\n }\n\n return { operations, walletIds, lastInstantNonce, lastWalletNonces };\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAM,IAA+B,gBAG/B,IAAoC;AA6B1C,SAAS,EAAuB,GAAoC,GAAyC;CAC3G,QAAQ,GAAR;EACE,KAAK,UACH,OAAO,EAAU;EACnB,KAAK,gBACH,OAAO,EAAU;EACnB,KAAK,gBACH,OAAO,EAAU;CACrB;AACF;AAkBA,SAAgB,EACd,GACA,GAC6B;CAC7B,IAAI,EAAM,WAAW,GACnB,MAAM,IAAI,EAAU,cAAc,uBAAuB,2CAA2C;CAGtG,OAAO,EAAM,KAAK,GAAM,MAAqC;EAC3D,IAAI,EAA4B,CAAI,GAClC,OAAO;GACL,MAAM;GACN,UAAU,EAAsB,EAAK,YAAY,IAAI,SAAS,EAAM,WAAW;GAC/E,UAAU,EAAmB;IAC3B,KAAK;IACL,cAAc;IACd,MAAM,CAAC,EAAK,YAAY,IAAI,CAAiB,CAAC;GAChD,CAAC;GACD,aAAa,EAAK;EACpB;EAGF,IAAM,IAAW,EAAqB,CAAI,GACpC,IAAW,EAAwB,CAAQ,GAC3C,IAAQ,EAAyB,IAAI,CAAQ;EACnD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,cACA,yBACA,kBAAkB,EAAM,cAAc,EAAS,6JACjD;EAEF,OAAO;GACL,MAAM;GACN,QAAQ,EAAuB,GAAW,EAAM,MAAM;GACtD;GACA;GACA,eAAe,EAAM;EACvB;CACF,CAAC;AACH;AASA,SAAgB,EAAiC,GAAuD;CACtG,IAAM,IAAQ,EACX,KAAK,MAAW,EAAM,SAAS,WAAW,IAAwC,EAAM,aAAc,EACtG,KAAK,GAAG;CACX,OAAO,EAAM,UAAU,IAAoC,IAAQ;AACrE;AAOA,SAAgB,EAA8B,GAAyD;CACrG,OAAO,CAAC,GAAG,IAAI,IAAI,EAAQ,SAAS,MAAW,EAAM,SAAS,WAAW,CAAC,EAAM,QAAQ,IAAI,CAAC,CAAE,CAAC,CAAC;AACnG;AAYA,eAAsB,EACpB,GACA,GAC+B;CAC/B,IAAM,EAAE,YAAS,UAAO,iBAAc,GAChC,IAAY,MAAM,QAAQ,IAC9B,EAAU,KAAK,MAAa,EAAwB,GAAQ;EAAE;EAAS;EAAO;CAAS,CAAC,CAAC,CAC3F;CACA,OAAO,IAAI,IAAI,EAAU,KAAK,GAAU,MAAU,CAAC,GAAU,EAAU,EAAO,CAAC,CAAC;AAClF;AA4CA,SAAgB,EACd,GACA,GACwB;CACxB,IAAM,IAAgC,CAAC,GACjC,IAAsB,CAAC,GACzB,IAAkC,MAChC,oBAAmB,IAAI,IAAoB;CAEjD,KAAK,IAAM,KAAS,GAAS;EAC3B,IAAI,GACA;EACJ,IAAI,EAAM,SAAS,WAIjB,AAHA,IAAS,EAAM,QACf,KAAS,KAAoB,EAAQ,gBAAgB,IACrD,IAAmB,GACnB,EAAU,KAAK,EAAE;OACZ;GACL,IAAM,IAAe,EAAQ,cAAc,IAAI,EAAM,QAAQ;GAC7D,IAAI,MAAiB,KAAA,GACnB,MAAU,MAAM,+DAA+D,EAAM,SAAS,EAAE;GAKlG,AAHA,IAAS,GACT,KAAS,EAAiB,IAAI,EAAM,QAAQ,KAAK,EAAQ,aAAa,IAAI,EAAM,QAAQ,KAAK,MAAM,IACnG,EAAiB,IAAI,EAAM,UAAU,CAAK,GAC1C,EAAU,KAAK,EAAM,QAAQ;EAC/B;EAEA,EAAW,KACT,EAAqB;GACnB,QAAQ,EAAQ;GAChB;GACA,UAAU,EAAM;GAChB,eAAe,EAAQ;GACvB,UAAU,EAAQ;GAClB;GACA,MAAM,EAAQ,KAAK;EACrB,CAAC,CACH;CACF;CAEA,OAAO;EAAE;EAAY;EAAW;EAAkB;CAAiB;AACrE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Abi, DecodeErrorResultReturnType, Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Why a gasless action failed, in terms of what a UI can do about it.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately coarser than the vendor's codes and finer than the HTTP status:
|
|
6
|
+
* `INSUFFICIENT_ALLOWANCE` and an `OperationalFee: Allowance exceeded` revert
|
|
7
|
+
* are the same problem with two wire shapes, while a `404` for an unknown
|
|
8
|
+
* instance and a `404` for an unknown request id are not the same problem at
|
|
9
|
+
* all.
|
|
10
|
+
*
|
|
11
|
+
* - `"payer-balance"` — the billing account cannot cover the fee. Top up its
|
|
12
|
+
* SYMMIO collateral; raising the allowance alone does nothing.
|
|
13
|
+
* - `"fee-allowance"` — the payer's operational-fee allowance is too low.
|
|
14
|
+
* Approve more with `approveOperationalFee`, then re-read.
|
|
15
|
+
* - `"free-quota"` — the daily free-operations quota is spent and the
|
|
16
|
+
* deployment refuses paid ones. Wait for the UTC reset or use the wallet.
|
|
17
|
+
* - `"fee-limit"` — the fee policy refused the request for any other reason.
|
|
18
|
+
* - `"failed-operation"` — one entry of the batch reverted; decode it with
|
|
19
|
+
* {@link decodeGaslessOperationFailure} to name the real cause.
|
|
20
|
+
* - `"nonce-or-deadline"` — the signature is stale. Refresh the nonce and
|
|
21
|
+
* deadline and ask for a new one; never resend the old payload.
|
|
22
|
+
* - `"deposit-below-minimum"` — the deposit address holds less than the
|
|
23
|
+
* settlement minimum, or the funds are not visible yet.
|
|
24
|
+
* - `"deposit-not-above-fees"` — the balance clears the minimum but not the
|
|
25
|
+
* deposit and wallet-creation fees.
|
|
26
|
+
* - `"idempotency-conflict"` — the key belongs to another workflow; mint a new one.
|
|
27
|
+
* - `"client-schema"` — a `422`: the payload's shape is wrong. A client bug.
|
|
28
|
+
* - `"rate-limited"` / `"unauthorized"` / `"forbidden"` / `"unknown-instance"` /
|
|
29
|
+
* `"gateway-unavailable"` — the gateway answered, before any service saw it.
|
|
30
|
+
* - `"submit-unconfirmed"` — the outcome is unknown and the request may be
|
|
31
|
+
* executing. Replay it with `resubmitGaslessRequest`; never re-run the intent.
|
|
32
|
+
* - `"simulation-reverted"` — the service simulated the batch and it reverted
|
|
33
|
+
* for a reason none of the above explains. Rebuild and re-sign.
|
|
34
|
+
* - `"unknown"` — nothing classified it.
|
|
35
|
+
*/
|
|
36
|
+
export type GaslessFailureReason = "payer-balance" | "fee-allowance" | "free-quota" | "fee-limit" | "failed-operation" | "nonce-or-deadline" | "deposit-below-minimum" | "deposit-not-above-fees" | "idempotency-conflict" | "client-schema" | "rate-limited" | "unauthorized" | "forbidden" | "unknown-instance" | "gateway-unavailable" | "submit-unconfirmed" | "simulation-reverted" | "unknown";
|
|
37
|
+
/**
|
|
38
|
+
* Classify any gasless failure into the one reason a UI should act on.
|
|
39
|
+
*
|
|
40
|
+
* The order is deliberate: what the request *did* (unconfirmed, conflicting)
|
|
41
|
+
* outranks what the service *said*, which outranks what the gateway answered —
|
|
42
|
+
* a `400 SIMULATION_REVERTED` whose revert names an allowance shortfall is an
|
|
43
|
+
* allowance problem, not a "bad request".
|
|
44
|
+
*
|
|
45
|
+
* Works on the error a framework layer re-wrapped too, so a React hook's
|
|
46
|
+
* `SymmioRequestError` classifies exactly like the `SymmApiError` under it.
|
|
47
|
+
*
|
|
48
|
+
* @param err - Anything caught from a gasless action, or a polled record error.
|
|
49
|
+
* @returns The reason, or `"unknown"` when nothing identifies it.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* switch (classifyGaslessFailure(err)) {
|
|
54
|
+
* case "fee-allowance":
|
|
55
|
+
* return showApproveOperationalFee();
|
|
56
|
+
* case "submit-unconfirmed":
|
|
57
|
+
* return showReconcilePending(getGaslessUnconfirmedSubmit(err));
|
|
58
|
+
* default:
|
|
59
|
+
* return showDiagnostics(parseGaslessErrorDetail(err));
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function classifyGaslessFailure(err: unknown): GaslessFailureReason;
|
|
64
|
+
/**
|
|
65
|
+
* The failing batch entry of an `OperationFailed` revert, with its inner revert
|
|
66
|
+
* decoded against the ABI you supplied.
|
|
67
|
+
*/
|
|
68
|
+
export interface GaslessDecodedOperationFailure {
|
|
69
|
+
/** Zero-based position of the failing operation in the submitted batch. */
|
|
70
|
+
index: number;
|
|
71
|
+
/** The inner revert data, exactly as the service reported it. */
|
|
72
|
+
revertData: Hex;
|
|
73
|
+
/** The decoded error, or `null` when the ABI does not describe it. */
|
|
74
|
+
decoded: DecodeErrorResultReturnType | null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Identify the batch entry that reverted, and decode its inner revert.
|
|
78
|
+
*
|
|
79
|
+
* A relayed batch is atomic, so the InstantLayer reports an inner failure as
|
|
80
|
+
* `OperationFailed(operationIndex, revertData)` — which names a position, not a
|
|
81
|
+
* cause. Decoding `revertData` against the ABI of the contract that operation
|
|
82
|
+
* targeted turns it back into the error the user can act on
|
|
83
|
+
* (`InvalidNameLength`, `InsufficientBalance`, …).
|
|
84
|
+
*
|
|
85
|
+
* @param err - Anything caught from a gasless submit.
|
|
86
|
+
* @param abi - ABI of the contract the failing operation targeted.
|
|
87
|
+
* @returns The index, the raw revert data and the decoded error, or `null` when
|
|
88
|
+
* the failure was not an `OperationFailed`.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const failure = decodeGaslessOperationFailure(err, accountLayerAbi);
|
|
93
|
+
* if (failure) {
|
|
94
|
+
* console.error(`operation ${failure.index} reverted:`, failure.decoded?.errorName ?? failure.revertData);
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function decodeGaslessOperationFailure(err: unknown, abi: Abi): GaslessDecodedOperationFailure | null;
|
|
99
|
+
//# sourceMappingURL=classify-gasless-failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-gasless-failure.d.ts","sourceRoot":"","sources":["../../src/gasless/classify-gasless-failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,GAAG,EAAE,KAAK,2BAA2B,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAM/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,oBAAoB,GAC5B,eAAe,GACf,eAAe,GACf,YAAY,GACZ,WAAW,GACX,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,wBAAwB,GACxB,sBAAsB,GACtB,eAAe,GACf,cAAc,GACd,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,qBAAqB,GACrB,oBAAoB,GACpB,qBAAqB,GACrB,SAAS,CAAC;AAyEd;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAkBzE;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,UAAU,EAAE,GAAG,CAAC;IAChB,sEAAsE;IACtE,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,8BAA8B,GAAG,IAAI,CAY3G"}
|