@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,50 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { gaslessWalletCallData as t } from "../gasless-wallet-execute/calls.js";
|
|
3
|
+
import { gaslessBatchCallData as n, isGaslessBatchWalletExecute as r } from "../batch/calls.js";
|
|
4
|
+
import { getGaslessBatchFeeQuote as i } from "./get-gasless-batch-fee-quote.js";
|
|
5
|
+
//#region src/gasless/get-gasless-batch-fee-quote/query.ts
|
|
6
|
+
function a(e, t) {
|
|
7
|
+
try {
|
|
8
|
+
return t();
|
|
9
|
+
} catch {
|
|
10
|
+
return "functionName" in e ? {
|
|
11
|
+
functionName: e.functionName,
|
|
12
|
+
args: e.args
|
|
13
|
+
} : null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function o(e) {
|
|
17
|
+
return r(e) ? {
|
|
18
|
+
walletId: e.walletId ?? 0n,
|
|
19
|
+
walletCalls: e.walletCalls.map((e) => ({
|
|
20
|
+
target: e.target,
|
|
21
|
+
value: e.value ?? 0n,
|
|
22
|
+
data: a(e, () => t(e))
|
|
23
|
+
}))
|
|
24
|
+
} : { data: a(e, () => n(e)) };
|
|
25
|
+
}
|
|
26
|
+
function s(t = {}) {
|
|
27
|
+
return ["getGaslessBatchFeeQuote", e({
|
|
28
|
+
...t,
|
|
29
|
+
calls: t.calls?.map(o)
|
|
30
|
+
})];
|
|
31
|
+
}
|
|
32
|
+
function c(e, t) {
|
|
33
|
+
return {
|
|
34
|
+
...t.query,
|
|
35
|
+
queryKey: s({
|
|
36
|
+
...t,
|
|
37
|
+
configKey: e.getChainConfigKey(t.chainId)
|
|
38
|
+
}),
|
|
39
|
+
enabled: t.query?.enabled ?? !0,
|
|
40
|
+
queryFn: () => i(e, {
|
|
41
|
+
chainId: t.chainId,
|
|
42
|
+
account: t.account,
|
|
43
|
+
calls: t.calls
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { s as getGaslessBatchFeeQuoteQueryKey, c as getGaslessBatchFeeQuoteQueryOptions };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/gasless/get-gasless-batch-fee-quote/query.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n gaslessBatchCallData,\n isGaslessBatchWalletExecute,\n type GaslessBatchCall,\n type GaslessBatchContractCall,\n type GaslessBatchRawCall,\n} from \"../batch/calls\";\nimport { gaslessWalletCallData, type GaslessWalletCall } from \"../gasless-wallet-execute/calls\";\nimport {\n getGaslessBatchFeeQuote,\n type GetGaslessBatchFeeQuoteParameters,\n type GetGaslessBatchFeeQuoteReturnType,\n} from \"./get-gasless-batch-fee-quote\";\n\n/** Data resolved by the {@link getGaslessBatchFeeQuoteQueryOptions} query. */\nexport type GetGaslessBatchFeeQuoteData = GetGaslessBatchFeeQuoteReturnType;\n\n/**\n * A call's calldata for the query key — or, when an ABI-level call does not\n * encode, its function name and arguments. A key builder runs during render,\n * where a throw would take the component down with it; falling back keeps the\n * key deterministic and leaves the encoding error to the query function, which\n * reports it as the query's error.\n */\nfunction keyedCallData(\n call: GaslessBatchContractCall | GaslessBatchRawCall | GaslessWalletCall,\n encode: () => Hex,\n): unknown {\n try {\n return encode();\n } catch {\n return \"functionName\" in call ? { functionName: call.functionName, args: call.args } : null;\n }\n}\n\n/**\n * The part of a batch call that decides its price, in a hashable form: encoded\n * calldata in place of the ABI (a full contract ABI would otherwise be walked\n * and hashed on every render), and every default made explicit, so equivalent\n * calls share one cache entry.\n */\nfunction toGaslessBatchCallKey(call: GaslessBatchCall): unknown {\n if (isGaslessBatchWalletExecute(call)) {\n return {\n walletId: call.walletId ?? 0n,\n walletCalls: call.walletCalls.map((walletCall) => ({\n target: walletCall.target,\n value: walletCall.value ?? 0n,\n data: keyedCallData(walletCall, () => gaslessWalletCallData(walletCall)),\n })),\n };\n }\n return { data: keyedCallData(call, () => gaslessBatchCallData(call)) };\n}\n\n/**\n * Build the TanStack Query key for {@link getGaslessBatchFeeQuoteQueryOptions}.\n *\n * Each call is keyed by its **encoded calldata**, not its ABI: an\n * `{ abi, functionName, args }` call and the raw `{ data }` it encodes to share\n * one cache entry, and an omitted `walletId` / `value` keys as `0n`.\n *\n * @param options - Partial query parameters.\n * @returns A stable, hashable query key.\n */\nexport function getGaslessBatchFeeQuoteQueryKey(\n options: Compute<ExactPartial<GetGaslessBatchFeeQuoteParameters> & ConfigKeyParameter> = {},\n) {\n return [\n \"getGaslessBatchFeeQuote\",\n filterQueryOptions({ ...options, calls: options.calls?.map(toGaslessBatchCallKey) }),\n ] as const;\n}\n\n/** Query-key type produced by {@link getGaslessBatchFeeQuoteQueryKey}. */\nexport type GetGaslessBatchFeeQuoteQueryKey = ReturnType<typeof getGaslessBatchFeeQuoteQueryKey>;\n\n/**\n * Options accepted by {@link getGaslessBatchFeeQuoteQueryOptions}.\n */\nexport type GetGaslessBatchFeeQuoteOptions = Compute<\n GetGaslessBatchFeeQuoteParameters &\n QueryParameter<GetGaslessBatchFeeQuoteData, Error, GetGaslessBatchFeeQuoteData, GetGaslessBatchFeeQuoteQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getGaslessBatchFeeQuoteQueryOptions}. */\nexport type GetGaslessBatchFeeQuoteQueryOptions = SymmioQueryOptions<\n GetGaslessBatchFeeQuoteData,\n Error,\n GetGaslessBatchFeeQuoteData,\n GetGaslessBatchFeeQuoteQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getGaslessBatchFeeQuote}.\n *\n * The key covers the account, the chain and every call's encoded calldata, so\n * changing an argument re-quotes instead of reusing a stale quote.\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(\n * getGaslessBatchFeeQuoteQueryOptions(config, {\n * account: subAccount,\n * calls: [{ functionName: \"allocate\", args: [amount] }],\n * }),\n * );\n * ```\n */\nexport function getGaslessBatchFeeQuoteQueryOptions(\n config: Config,\n options: GetGaslessBatchFeeQuoteOptions,\n): GetGaslessBatchFeeQuoteQueryOptions {\n return {\n ...options.query,\n queryKey: getGaslessBatchFeeQuoteQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: options.query?.enabled ?? true,\n queryFn: () =>\n getGaslessBatchFeeQuote(config, { chainId: options.chainId, account: options.account, calls: options.calls }),\n };\n}\n"],"mappings":";;;;;AA6BA,SAAS,EACP,GACA,GACS;CACT,IAAI;EACF,OAAO,EAAO;CAChB,QAAQ;EACN,OAAO,kBAAkB,IAAO;GAAE,cAAc,EAAK;GAAc,MAAM,EAAK;EAAK,IAAI;CACzF;AACF;AAQA,SAAS,EAAsB,GAAiC;CAW9D,OAVI,EAA4B,CAAI,IAC3B;EACL,UAAU,EAAK,YAAY;EAC3B,aAAa,EAAK,YAAY,KAAK,OAAgB;GACjD,QAAQ,EAAW;GACnB,OAAO,EAAW,SAAS;GAC3B,MAAM,EAAc,SAAkB,EAAsB,CAAU,CAAC;EACzE,EAAE;CACJ,IAEK,EAAE,MAAM,EAAc,SAAY,EAAqB,CAAI,CAAC,EAAE;AACvE;AAYA,SAAgB,EACd,IAAyF,CAAC,GAC1F;CACA,OAAO,CACL,2BACA,EAAmB;EAAE,GAAG;EAAS,OAAO,EAAQ,OAAO,IAAI,CAAqB;CAAE,CAAC,CACrF;AACF;AAyCA,SAAgB,EACd,GACA,GACqC;CACrC,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAgC;GACxC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,SAAS,EAAQ,OAAO,WAAW;EACnC,eACE,EAAwB,GAAQ;GAAE,SAAS,EAAQ;GAAS,SAAS,EAAQ;GAAS,OAAO,EAAQ;EAAM,CAAC;CAChH;AACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link getGaslessDepositPolicy}.
|
|
6
|
+
*/
|
|
7
|
+
export type GetGaslessDepositPolicyParameters = Compute<ChainIdParameter & {
|
|
8
|
+
/** The owner wallet onboarding through gasless deposit — an owner address, never a GaslessWallet address. */
|
|
9
|
+
owner: Address;
|
|
10
|
+
/**
|
|
11
|
+
* Which of the owner's GaslessWallets receives the deposit. Defaults to
|
|
12
|
+
* `0n`, the original wallet. Each id has its own address and balance, and
|
|
13
|
+
* settling one wallet never sweeps another. Range `0n` through `2^256 - 1`.
|
|
14
|
+
*/
|
|
15
|
+
walletId?: bigint;
|
|
16
|
+
}>;
|
|
17
|
+
/** Return type of {@link getGaslessDepositPolicy}. Every amount is in collateral token units. */
|
|
18
|
+
export interface GetGaslessDepositPolicyReturnType {
|
|
19
|
+
/** The wallet id the policy was read for — `0n` when the parameter was omitted. */
|
|
20
|
+
walletId: bigint;
|
|
21
|
+
/** The deterministic deposit address: the GaslessWallet of `(owner, walletId)`. */
|
|
22
|
+
depositAddress: Address;
|
|
23
|
+
/** The only token the settlement sweeps — send nothing else to the address. */
|
|
24
|
+
collateralTokenAddress: Address;
|
|
25
|
+
/** The collateral token's ERC-20 `decimals()`, the scale of every amount in this policy. */
|
|
26
|
+
collateralDecimals: number;
|
|
27
|
+
/** Flat fee deducted from the observed balance at settlement (collateral token units). */
|
|
28
|
+
depositFee: bigint;
|
|
29
|
+
/** Minimum observed balance the service will settle (collateral token units). */
|
|
30
|
+
minimumDeposit: bigint;
|
|
31
|
+
/**
|
|
32
|
+
* One-time fee the settlement also deducts when it deploys this wallet
|
|
33
|
+
* (collateral token units) — `0n` once the wallet is deployed. See
|
|
34
|
+
* `getGaslessWalletCreationFee`.
|
|
35
|
+
*/
|
|
36
|
+
walletCreationFee: bigint;
|
|
37
|
+
/**
|
|
38
|
+
* The smallest balance that settles: `max(minimumDeposit, depositFee +
|
|
39
|
+
* walletCreationFee + 1n)`. The GaslessLayer rejects a settlement unless the
|
|
40
|
+
* swept balance both reaches `minimumDeposit` and exceeds the deposit fee
|
|
41
|
+
* plus the creation fee. Gate the settlement UI on the observed balance
|
|
42
|
+
* reaching this.
|
|
43
|
+
*/
|
|
44
|
+
settlementMinimum: bigint;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read the gasless **deposit policy** for one of an owner's GaslessWallets —
|
|
48
|
+
* the deterministic deposit address plus the fee and minimum terms — directly
|
|
49
|
+
* from the GaslessLayer.
|
|
50
|
+
*
|
|
51
|
+
* All values are RPC contract reads (the service exposes no read endpoints):
|
|
52
|
+
* `getGaslessWalletAddress(owner, walletId)`, `collateralToken()` and the
|
|
53
|
+
* token's `decimals()`, `depositFee()`, `minimumDeposit()` and
|
|
54
|
+
* `getWalletCreationFee(owner, walletId)`. The deposit address is a pure
|
|
55
|
+
* `CREATE2` view, so it is safe to display before any transaction; collateral
|
|
56
|
+
* sent there can only ever reach a sub-account owned by `owner`. Watch the
|
|
57
|
+
* address's balance with the existing collateral-balance read
|
|
58
|
+
* (`getCollateralBalance`) and enable settlement once it reaches
|
|
59
|
+
* `settlementMinimum`.
|
|
60
|
+
*
|
|
61
|
+
* The settlement sweeps the wallet's **entire** balance, so keep separate
|
|
62
|
+
* wallet ids for funding flows that must not be swept together.
|
|
63
|
+
*
|
|
64
|
+
* @param config - The SDK config.
|
|
65
|
+
* @param parameters - Owner wallet, optional wallet id (default `0n`), optional chain id.
|
|
66
|
+
* @returns The deposit policy.
|
|
67
|
+
* @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range
|
|
68
|
+
* (or a JavaScript `number`), before any RPC call.
|
|
69
|
+
* @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION` /
|
|
70
|
+
* `GASLESS_WALLET_UNAVAILABLE`.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const policy = await getGaslessDepositPolicy(config, { owner });
|
|
75
|
+
* showDepositAddress(policy.depositAddress);
|
|
76
|
+
* const minimum = formatUnits(policy.settlementMinimum, policy.collateralDecimals);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function getGaslessDepositPolicy(config: Config, parameters: GetGaslessDepositPolicyParameters): Promise<GetGaslessDepositPolicyReturnType>;
|
|
80
|
+
//# sourceMappingURL=get-gasless-deposit-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-gasless-deposit-policy.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAqB,MAAM,MAAM,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAO/E;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG,OAAO,CACrD,gBAAgB,GAAG;IACjB,6GAA6G;IAC7G,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,iGAAiG;AACjG,MAAM,WAAW,iCAAiC;IAChD,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,cAAc,EAAE,OAAO,CAAC;IACxB,+EAA+E;IAC/E,sBAAsB,EAAE,OAAO,CAAC;IAChC,4FAA4F;IAC5F,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,iCAAiC,GAC5C,OAAO,CAAC,iCAAiC,CAAC,CA4B5C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { gaslessLayerAbi as e } from "../../symmio-contracts/abi/v0.8.6/gasless-layer.js";
|
|
2
|
+
import { resolveGaslessService as t } from "../resolve-gasless.js";
|
|
3
|
+
import { assertGaslessWalletId as n } from "../wallet-id.js";
|
|
4
|
+
import { getGaslessWalletAddress as r } from "../get-gasless-wallet-address/get-gasless-wallet-address.js";
|
|
5
|
+
import { getGaslessWalletCreationFee as i } from "../get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js";
|
|
6
|
+
import { erc20Abi as a } from "viem";
|
|
7
|
+
//#region src/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.ts
|
|
8
|
+
async function o(t, n) {
|
|
9
|
+
let r = await t.readContract({
|
|
10
|
+
address: n,
|
|
11
|
+
abi: e,
|
|
12
|
+
functionName: "collateralToken"
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
address: r,
|
|
16
|
+
decimals: await t.readContract({
|
|
17
|
+
address: r,
|
|
18
|
+
abi: a,
|
|
19
|
+
functionName: "decimals"
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async function s(a, s) {
|
|
24
|
+
let { chainId: c, owner: l } = s, u = n(s.walletId ?? 0n), d = t(a, { chainId: c }), f = a.getClient({ chainId: c }), [p, m, h, g, _] = await Promise.all([
|
|
25
|
+
r(a, {
|
|
26
|
+
chainId: c,
|
|
27
|
+
owner: l,
|
|
28
|
+
walletId: u
|
|
29
|
+
}),
|
|
30
|
+
o(f, d.gaslessLayerAddress),
|
|
31
|
+
f.readContract({
|
|
32
|
+
address: d.gaslessLayerAddress,
|
|
33
|
+
abi: e,
|
|
34
|
+
functionName: "depositFee"
|
|
35
|
+
}),
|
|
36
|
+
f.readContract({
|
|
37
|
+
address: d.gaslessLayerAddress,
|
|
38
|
+
abi: e,
|
|
39
|
+
functionName: "minimumDeposit"
|
|
40
|
+
}),
|
|
41
|
+
i(a, {
|
|
42
|
+
chainId: c,
|
|
43
|
+
owner: l,
|
|
44
|
+
walletId: u
|
|
45
|
+
})
|
|
46
|
+
]), v = h + _ + 1n, y = g > v ? g : v;
|
|
47
|
+
return {
|
|
48
|
+
walletId: u,
|
|
49
|
+
depositAddress: p,
|
|
50
|
+
collateralTokenAddress: m.address,
|
|
51
|
+
collateralDecimals: m.decimals,
|
|
52
|
+
depositFee: h,
|
|
53
|
+
minimumDeposit: g,
|
|
54
|
+
walletCreationFee: _,
|
|
55
|
+
settlementMinimum: y
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { s as getGaslessDepositPolicy };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=get-gasless-deposit-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-gasless-deposit-policy.js","names":[],"sources":["../../../src/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.ts"],"sourcesContent":["import { erc20Abi, type Address, type PublicClient } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { gaslessLayerAbi } from \"../../symmio-contracts/abi/v0.8.6/gasless-layer\";\nimport { getGaslessWalletAddress } from \"../get-gasless-wallet-address/get-gasless-wallet-address\";\nimport { getGaslessWalletCreationFee } from \"../get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee\";\nimport { resolveGaslessService } from \"../resolve-gasless\";\nimport { assertGaslessWalletId } from \"../wallet-id\";\n\n/**\n * Parameters for {@link getGaslessDepositPolicy}.\n */\nexport type GetGaslessDepositPolicyParameters = Compute<\n ChainIdParameter & {\n /** The owner wallet onboarding through gasless deposit — an owner address, never a GaslessWallet address. */\n owner: Address;\n /**\n * Which of the owner's GaslessWallets receives the deposit. Defaults to\n * `0n`, the original wallet. Each id has its own address and balance, and\n * settling one wallet never sweeps another. Range `0n` through `2^256 - 1`.\n */\n walletId?: bigint;\n }\n>;\n\n/** Return type of {@link getGaslessDepositPolicy}. Every amount is in collateral token units. */\nexport interface GetGaslessDepositPolicyReturnType {\n /** The wallet id the policy was read for — `0n` when the parameter was omitted. */\n walletId: bigint;\n /** The deterministic deposit address: the GaslessWallet of `(owner, walletId)`. */\n depositAddress: Address;\n /** The only token the settlement sweeps — send nothing else to the address. */\n collateralTokenAddress: Address;\n /** The collateral token's ERC-20 `decimals()`, the scale of every amount in this policy. */\n collateralDecimals: number;\n /** Flat fee deducted from the observed balance at settlement (collateral token units). */\n depositFee: bigint;\n /** Minimum observed balance the service will settle (collateral token units). */\n minimumDeposit: bigint;\n /**\n * One-time fee the settlement also deducts when it deploys this wallet\n * (collateral token units) — `0n` once the wallet is deployed. See\n * `getGaslessWalletCreationFee`.\n */\n walletCreationFee: bigint;\n /**\n * The smallest balance that settles: `max(minimumDeposit, depositFee +\n * walletCreationFee + 1n)`. The GaslessLayer rejects a settlement unless the\n * swept balance both reaches `minimumDeposit` and exceeds the deposit fee\n * plus the creation fee. Gate the settlement UI on the observed balance\n * reaching this.\n */\n settlementMinimum: bigint;\n}\n\n/**\n * Read the GaslessLayer's collateral token and that token's ERC-20\n * `decimals()`. The decimals read needs the token address, so it starts as soon\n * as the first read resolves, while the policy's other reads are still running.\n *\n * The scale comes from the token the GaslessLayer itself sweeps, not from the\n * chain config's `collateralDecimals`: every amount in this policy is a\n * GaslessLayer value, so a deployment whose gasless collateral differs from the\n * configured one must still format correctly.\n */\nasync function readCollateralToken(\n client: PublicClient,\n gaslessLayerAddress: Address,\n): Promise<{ address: Address; decimals: number }> {\n const address = await client.readContract({\n address: gaslessLayerAddress,\n abi: gaslessLayerAbi,\n functionName: \"collateralToken\",\n });\n const decimals = await client.readContract({ address, abi: erc20Abi, functionName: \"decimals\" });\n return { address, decimals };\n}\n\n/**\n * Read the gasless **deposit policy** for one of an owner's GaslessWallets —\n * the deterministic deposit address plus the fee and minimum terms — directly\n * from the GaslessLayer.\n *\n * All values are RPC contract reads (the service exposes no read endpoints):\n * `getGaslessWalletAddress(owner, walletId)`, `collateralToken()` and the\n * token's `decimals()`, `depositFee()`, `minimumDeposit()` and\n * `getWalletCreationFee(owner, walletId)`. The deposit address is a pure\n * `CREATE2` view, so it is safe to display before any transaction; collateral\n * sent there can only ever reach a sub-account owned by `owner`. Watch the\n * address's balance with the existing collateral-balance read\n * (`getCollateralBalance`) and enable settlement once it reaches\n * `settlementMinimum`.\n *\n * The settlement sweeps the wallet's **entire** balance, so keep separate\n * wallet ids for funding flows that must not be swept together.\n *\n * @param config - The SDK config.\n * @param parameters - Owner wallet, optional wallet id (default `0n`), optional chain id.\n * @returns The deposit policy.\n * @throws {SymmError} `GASLESS_WALLET_ID_INVALID` for a wallet id outside the `uint256` range\n * (or a JavaScript `number`), before any RPC call.\n * @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION` /\n * `GASLESS_WALLET_UNAVAILABLE`.\n *\n * @example\n * ```ts\n * const policy = await getGaslessDepositPolicy(config, { owner });\n * showDepositAddress(policy.depositAddress);\n * const minimum = formatUnits(policy.settlementMinimum, policy.collateralDecimals);\n * ```\n */\nexport async function getGaslessDepositPolicy(\n config: Config,\n parameters: GetGaslessDepositPolicyParameters,\n): Promise<GetGaslessDepositPolicyReturnType> {\n const { chainId, owner } = parameters;\n const walletId = assertGaslessWalletId(parameters.walletId ?? 0n);\n const gasless = resolveGaslessService(config, { chainId });\n const client = config.getClient({ chainId });\n\n const [depositAddress, collateral, depositFee, minimumDeposit, walletCreationFee] = await Promise.all([\n getGaslessWalletAddress(config, { chainId, owner, walletId }),\n readCollateralToken(client, gasless.gaslessLayerAddress),\n client.readContract({ address: gasless.gaslessLayerAddress, abi: gaslessLayerAbi, functionName: \"depositFee\" }),\n client.readContract({ address: gasless.gaslessLayerAddress, abi: gaslessLayerAbi, functionName: \"minimumDeposit\" }),\n getGaslessWalletCreationFee(config, { chainId, owner, walletId }),\n ]);\n\n /** The swept balance must reach the minimum AND exceed every fee the settlement deducts. */\n const aboveFees = depositFee + walletCreationFee + 1n;\n const settlementMinimum = minimumDeposit > aboveFees ? minimumDeposit : aboveFees;\n\n return {\n walletId,\n depositAddress,\n collateralTokenAddress: collateral.address,\n collateralDecimals: collateral.decimals,\n depositFee,\n minimumDeposit,\n walletCreationFee,\n settlementMinimum,\n };\n}\n"],"mappings":";;;;;;;AAiEA,eAAe,EACb,GACA,GACiD;CACjD,IAAM,IAAU,MAAM,EAAO,aAAa;EACxC,SAAS;EACT,KAAK;EACL,cAAc;CAChB,CAAC;CAED,OAAO;EAAE;EAAS,UAAA,MADK,EAAO,aAAa;GAAE;GAAS,KAAK;GAAU,cAAc;EAAW,CAAC;CACpE;AAC7B;AAmCA,eAAsB,EACpB,GACA,GAC4C;CAC5C,IAAM,EAAE,YAAS,aAAU,GACrB,IAAW,EAAsB,EAAW,YAAY,EAAE,GAC1D,IAAU,EAAsB,GAAQ,EAAE,WAAQ,CAAC,GACnD,IAAS,EAAO,UAAU,EAAE,WAAQ,CAAC,GAErC,CAAC,GAAgB,GAAY,GAAY,GAAgB,KAAqB,MAAM,QAAQ,IAAI;EACpG,EAAwB,GAAQ;GAAE;GAAS;GAAO;EAAS,CAAC;EAC5D,EAAoB,GAAQ,EAAQ,mBAAmB;EACvD,EAAO,aAAa;GAAE,SAAS,EAAQ;GAAqB,KAAK;GAAiB,cAAc;EAAa,CAAC;EAC9G,EAAO,aAAa;GAAE,SAAS,EAAQ;GAAqB,KAAK;GAAiB,cAAc;EAAiB,CAAC;EAClH,EAA4B,GAAQ;GAAE;GAAS;GAAO;EAAS,CAAC;CAClE,CAAC,GAGK,IAAY,IAAa,IAAoB,IAC7C,IAAoB,IAAiB,IAAY,IAAiB;CAExE,OAAO;EACL;EACA;EACA,wBAAwB,EAAW;EACnC,oBAAoB,EAAW;EAC/B;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-deposit-policy/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter, ExactPartial } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetGaslessDepositPolicyParameters, GetGaslessDepositPolicyReturnType } from './get-gasless-deposit-policy.js';
|
|
5
|
+
/** Data resolved by the {@link getGaslessDepositPolicyQueryOptions} query. */
|
|
6
|
+
export type GetGaslessDepositPolicyData = GetGaslessDepositPolicyReturnType;
|
|
7
|
+
/**
|
|
8
|
+
* Build the TanStack Query key for {@link getGaslessDepositPolicyQueryOptions}.
|
|
9
|
+
*
|
|
10
|
+
* An omitted `walletId` keys as `0n`, so `{ owner }` and `{ owner, walletId: 0n }`
|
|
11
|
+
* share one cache entry — they read the same wallet's policy. `predicateMatch`
|
|
12
|
+
* compares only the fields its partial sets, so
|
|
13
|
+
* `predicateMatch(getGaslessDepositPolicyQueryKey, { owner })` still matches every
|
|
14
|
+
* wallet id of the owner.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Partial query parameters.
|
|
17
|
+
* @returns A stable, hashable query key.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* getGaslessDepositPolicyQueryKey({ owner });
|
|
22
|
+
* // → ["getGaslessDepositPolicy", { owner, walletId: "0" }]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getGaslessDepositPolicyQueryKey(options?: Compute<ExactPartial<GetGaslessDepositPolicyParameters> & ConfigKeyParameter>): readonly ["getGaslessDepositPolicy", Record<string, unknown>];
|
|
26
|
+
/** Query-key type produced by {@link getGaslessDepositPolicyQueryKey}. */
|
|
27
|
+
export type GetGaslessDepositPolicyQueryKey = ReturnType<typeof getGaslessDepositPolicyQueryKey>;
|
|
28
|
+
/**
|
|
29
|
+
* Options accepted by {@link getGaslessDepositPolicyQueryOptions}.
|
|
30
|
+
*/
|
|
31
|
+
export type GetGaslessDepositPolicyOptions = Compute<GetGaslessDepositPolicyParameters & QueryParameter<GetGaslessDepositPolicyData, Error, GetGaslessDepositPolicyData, GetGaslessDepositPolicyQueryKey>>;
|
|
32
|
+
/** TanStack Query options returned by {@link getGaslessDepositPolicyQueryOptions}. */
|
|
33
|
+
export type GetGaslessDepositPolicyQueryOptions = SymmioQueryOptions<GetGaslessDepositPolicyData, Error, GetGaslessDepositPolicyData, GetGaslessDepositPolicyQueryKey>;
|
|
34
|
+
/**
|
|
35
|
+
* Build TanStack Query options for {@link getGaslessDepositPolicy}.
|
|
36
|
+
*
|
|
37
|
+
* The policy carries the wallet's creation fee, which drops to `0n` once any
|
|
38
|
+
* action deploys the wallet, so invalidate this query after a settlement or
|
|
39
|
+
* wallet operation — the React relay hooks do.
|
|
40
|
+
*
|
|
41
|
+
* @param config - The SDK config.
|
|
42
|
+
* @param options - Query parameters and TanStack overrides.
|
|
43
|
+
* @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* useQuery(getGaslessDepositPolicyQueryOptions(config, { owner, walletId: 1n }));
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function getGaslessDepositPolicyQueryOptions(config: Config, options: GetGaslessDepositPolicyOptions): GetGaslessDepositPolicyQueryOptions;
|
|
51
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-deposit-policy/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACvC,MAAM,8BAA8B,CAAC;AAEtC,8EAA8E;AAC9E,MAAM,MAAM,2BAA2B,GAAG,iCAAiC,CAAC;AAE5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,GAAE,OAAO,CAAC,YAAY,CAAC,iCAAiC,CAAC,GAAG,kBAAkB,CAAM,iEAG5F;AAED,0EAA0E;AAC1E,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAEjG;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAClD,iCAAiC,GAC/B,cAAc,CAAC,2BAA2B,EAAE,KAAK,EAAE,2BAA2B,EAAE,+BAA+B,CAAC,CACnH,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,mCAAmC,GAAG,kBAAkB,CAClE,2BAA2B,EAC3B,KAAK,EACL,2BAA2B,EAC3B,+BAA+B,CAChC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,8BAA8B,GACtC,mCAAmC,CAYrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { getGaslessDepositPolicy as t } from "./get-gasless-deposit-policy.js";
|
|
3
|
+
//#region src/gasless/get-gasless-deposit-policy/query.ts
|
|
4
|
+
function n(t = {}) {
|
|
5
|
+
return ["getGaslessDepositPolicy", e({
|
|
6
|
+
...t,
|
|
7
|
+
walletId: t.walletId ?? 0n
|
|
8
|
+
})];
|
|
9
|
+
}
|
|
10
|
+
function r(e, r) {
|
|
11
|
+
let { query: i, ...a } = r;
|
|
12
|
+
return {
|
|
13
|
+
...i,
|
|
14
|
+
queryKey: n({
|
|
15
|
+
...a,
|
|
16
|
+
configKey: e.getChainConfigKey(a.chainId)
|
|
17
|
+
}),
|
|
18
|
+
enabled: i?.enabled ?? !0,
|
|
19
|
+
queryFn: () => t(e, a)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as getGaslessDepositPolicyQueryKey, r as getGaslessDepositPolicyQueryOptions };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/gasless/get-gasless-deposit-policy/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n getGaslessDepositPolicy,\n type GetGaslessDepositPolicyParameters,\n type GetGaslessDepositPolicyReturnType,\n} from \"./get-gasless-deposit-policy\";\n\n/** Data resolved by the {@link getGaslessDepositPolicyQueryOptions} query. */\nexport type GetGaslessDepositPolicyData = GetGaslessDepositPolicyReturnType;\n\n/**\n * Build the TanStack Query key for {@link getGaslessDepositPolicyQueryOptions}.\n *\n * An omitted `walletId` keys as `0n`, so `{ owner }` and `{ owner, walletId: 0n }`\n * share one cache entry — they read the same wallet's policy. `predicateMatch`\n * compares only the fields its partial sets, so\n * `predicateMatch(getGaslessDepositPolicyQueryKey, { owner })` still matches every\n * wallet id of the owner.\n *\n * @param options - Partial query parameters.\n * @returns A stable, hashable query key.\n *\n * @example\n * ```ts\n * getGaslessDepositPolicyQueryKey({ owner });\n * // → [\"getGaslessDepositPolicy\", { owner, walletId: \"0\" }]\n * ```\n */\nexport function getGaslessDepositPolicyQueryKey(\n options: Compute<ExactPartial<GetGaslessDepositPolicyParameters> & ConfigKeyParameter> = {},\n) {\n return [\"getGaslessDepositPolicy\", filterQueryOptions({ ...options, walletId: options.walletId ?? 0n })] as const;\n}\n\n/** Query-key type produced by {@link getGaslessDepositPolicyQueryKey}. */\nexport type GetGaslessDepositPolicyQueryKey = ReturnType<typeof getGaslessDepositPolicyQueryKey>;\n\n/**\n * Options accepted by {@link getGaslessDepositPolicyQueryOptions}.\n */\nexport type GetGaslessDepositPolicyOptions = Compute<\n GetGaslessDepositPolicyParameters &\n QueryParameter<GetGaslessDepositPolicyData, Error, GetGaslessDepositPolicyData, GetGaslessDepositPolicyQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getGaslessDepositPolicyQueryOptions}. */\nexport type GetGaslessDepositPolicyQueryOptions = SymmioQueryOptions<\n GetGaslessDepositPolicyData,\n Error,\n GetGaslessDepositPolicyData,\n GetGaslessDepositPolicyQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getGaslessDepositPolicy}.\n *\n * The policy carries the wallet's creation fee, which drops to `0n` once any\n * action deploys the wallet, so invalidate this query after a settlement or\n * wallet operation — the React relay hooks do.\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(getGaslessDepositPolicyQueryOptions(config, { owner, walletId: 1n }));\n * ```\n */\nexport function getGaslessDepositPolicyQueryOptions(\n config: Config,\n options: GetGaslessDepositPolicyOptions,\n): GetGaslessDepositPolicyQueryOptions {\n /** Every parameter reaches the action: a hand-listed subset would silently drop a new one, such as `walletId`. */\n const { query, ...parameters } = options;\n return {\n ...query,\n queryKey: getGaslessDepositPolicyQueryKey({\n ...parameters,\n configKey: config.getChainConfigKey(parameters.chainId),\n }),\n enabled: query?.enabled ?? true,\n queryFn: () => getGaslessDepositPolicy(config, parameters),\n };\n}\n"],"mappings":";;;AA+BA,SAAgB,EACd,IAAyF,CAAC,GAC1F;CACA,OAAO,CAAC,2BAA2B,EAAmB;EAAE,GAAG;EAAS,UAAU,EAAQ,YAAY;CAAG,CAAC,CAAC;AACzG;AAqCA,SAAgB,EACd,GACA,GACqC;CAErC,IAAM,EAAE,UAAO,GAAG,MAAe;CACjC,OAAO;EACL,GAAG;EACH,UAAU,EAAgC;GACxC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAW,OAAO;EACxD,CAAC;EACD,SAAS,GAAO,WAAW;EAC3B,eAAe,EAAwB,GAAQ,CAAU;CAC3D;AACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { SignedOperation } from '../../solvers/instant-open/shared/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Stand-in for an operation signature: 65 zero bytes, the length of a real
|
|
5
|
+
* ECDSA signature. `previewFeeQuote` decodes the signatures array but never
|
|
6
|
+
* verifies it, so a quote needs no signature prompt.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GASLESS_FEE_QUOTE_PLACEHOLDER_SIGNATURE: Hex;
|
|
9
|
+
/** Input of {@link encodeRelayBatchCallData}. */
|
|
10
|
+
export interface EncodeRelayBatchCallDataParameters {
|
|
11
|
+
/** The operations, in relay order. */
|
|
12
|
+
operations: readonly SignedOperation[];
|
|
13
|
+
/** One wallet id per operation, aligned with `operations`. */
|
|
14
|
+
walletIds: readonly bigint[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Encode the `relayInstantBatch(signedOps, signatures, fills, flexFillerSignatures, walletIds)`
|
|
18
|
+
* calldata a fee quote previews — the same call the relayer submits, with
|
|
19
|
+
* placeholder signatures and no flex fills, neither of which affects the price.
|
|
20
|
+
*
|
|
21
|
+
* @param parameters - Operations and their aligned wallet ids.
|
|
22
|
+
* @returns ABI-encoded GaslessLayer calldata.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function encodeRelayBatchCallData(parameters: EncodeRelayBatchCallDataParameters): Hex;
|
|
27
|
+
//# sourceMappingURL=encode-relay-batch-call-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-relay-batch-call-data.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG/E;;;;GAIG;AACH,eAAO,MAAM,uCAAuC,EAAE,GAA6B,CAAC;AAEpF,iDAAiD;AACjD,MAAM,WAAW,kCAAkC;IACjD,sCAAsC;IACtC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IACvC,8DAA8D;IAC9D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,kCAAkC,GAAG,GAAG,CAa5F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { gaslessLayerAbi as e } from "../../symmio-contracts/abi/v0.8.6/gasless-layer.js";
|
|
2
|
+
import { encodeFunctionData as t, pad as n } from "viem";
|
|
3
|
+
//#region src/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.ts
|
|
4
|
+
var r = n("0x", { size: 65 });
|
|
5
|
+
function i(n) {
|
|
6
|
+
let { operations: i, walletIds: a } = n;
|
|
7
|
+
return t({
|
|
8
|
+
abi: e,
|
|
9
|
+
functionName: "relayInstantBatch",
|
|
10
|
+
args: [
|
|
11
|
+
i,
|
|
12
|
+
i.map(() => r),
|
|
13
|
+
i.map(() => []),
|
|
14
|
+
i.map(() => []),
|
|
15
|
+
a
|
|
16
|
+
]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as encodeRelayBatchCallData };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=encode-relay-batch-call-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-relay-batch-call-data.js","names":[],"sources":["../../../src/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.ts"],"sourcesContent":["import { encodeFunctionData, pad, type Hex } from \"viem\";\nimport type { SignedOperation } from \"../../solvers/instant-open/shared/types\";\nimport { gaslessLayerAbi } from \"../../symmio-contracts/abi/v0.8.6/gasless-layer\";\n\n/**\n * Stand-in for an operation signature: 65 zero bytes, the length of a real\n * ECDSA signature. `previewFeeQuote` decodes the signatures array but never\n * verifies it, so a quote needs no signature prompt.\n */\nexport const GASLESS_FEE_QUOTE_PLACEHOLDER_SIGNATURE: Hex = pad(\"0x\", { size: 65 });\n\n/** Input of {@link encodeRelayBatchCallData}. */\nexport interface EncodeRelayBatchCallDataParameters {\n /** The operations, in relay order. */\n operations: readonly SignedOperation[];\n /** One wallet id per operation, aligned with `operations`. */\n walletIds: readonly bigint[];\n}\n\n/**\n * Encode the `relayInstantBatch(signedOps, signatures, fills, flexFillerSignatures, walletIds)`\n * calldata a fee quote previews — the same call the relayer submits, with\n * placeholder signatures and no flex fills, neither of which affects the price.\n *\n * @param parameters - Operations and their aligned wallet ids.\n * @returns ABI-encoded GaslessLayer calldata.\n *\n * @internal\n */\nexport function encodeRelayBatchCallData(parameters: EncodeRelayBatchCallDataParameters): Hex {\n const { operations, walletIds } = parameters;\n return encodeFunctionData({\n abi: gaslessLayerAbi,\n functionName: \"relayInstantBatch\",\n args: [\n operations,\n operations.map(() => GASLESS_FEE_QUOTE_PLACEHOLDER_SIGNATURE),\n operations.map(() => []),\n operations.map(() => []),\n walletIds,\n ],\n });\n}\n"],"mappings":";;;AASA,IAAa,IAA+C,EAAI,MAAM,EAAE,MAAM,GAAG,CAAC;AAoBlF,SAAgB,EAAyB,GAAqD;CAC5F,IAAM,EAAE,eAAY,iBAAc;CAClC,OAAO,EAAmB;EACxB,KAAK;EACL,cAAc;EACd,MAAM;GACJ;GACA,EAAW,UAAU,CAAuC;GAC5D,EAAW,UAAU,CAAC,CAAC;GACvB,EAAW,UAAU,CAAC,CAAC;GACvB;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Address, PublicClient } from 'viem';
|
|
2
|
+
/** Input of {@link resolveGaslessFeeQuoteError}. @internal */
|
|
3
|
+
export interface ResolveGaslessFeeQuoteErrorParameters {
|
|
4
|
+
/** The public client the failed quote was read with. */
|
|
5
|
+
client: PublicClient;
|
|
6
|
+
/** The quoted GaslessLayer. */
|
|
7
|
+
gaslessLayerAddress: Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Map a failed `previewFeeQuote` read onto the SDK's typed errors.
|
|
11
|
+
*
|
|
12
|
+
* - A `DailyFreeOpsLimitExceeded` revert → `GASLESS_FREE_QUOTA_EXHAUSTED`.
|
|
13
|
+
* - Any other revert that carries data → `GASLESS_FEE_QUOTE_REVERTED`: the
|
|
14
|
+
* contract refused the batch itself (a mismatched wallet target, an empty or
|
|
15
|
+
* misaligned batch), so re-signing the same input cannot help.
|
|
16
|
+
* - A call that returned nothing → `GASLESS_LAYER_INTERFACE_UNSUPPORTED`: no
|
|
17
|
+
* code at the configured address answers `previewFeeQuote`.
|
|
18
|
+
* - A revert with **empty** data is ambiguous. A GaslessLayer proxy that
|
|
19
|
+
* predates the multi-wallet interface answers every `previewFeeQuote` this
|
|
20
|
+
* way, but the multi-wallet GaslessLayer does too when it cannot ABI-decode
|
|
21
|
+
* the batch (malformed wallet `execute` calldata, for example). One more read
|
|
22
|
+
* quotes empty calldata to tell them apart (see
|
|
23
|
+
* `implementsPreviewFeeQuote`): revert data there means the interface exists
|
|
24
|
+
* and the batch is at fault → `GASLESS_FEE_QUOTE_REVERTED`; empty data or no
|
|
25
|
+
* data again → `GASLESS_LAYER_INTERFACE_UNSUPPORTED`. When that check is
|
|
26
|
+
* inconclusive, `err` is returned unchanged.
|
|
27
|
+
* - Anything else (transport, rate limit, node error without revert data) is
|
|
28
|
+
* returned unchanged — it says nothing about the batch.
|
|
29
|
+
*
|
|
30
|
+
* @param err - The error `readContract` threw.
|
|
31
|
+
* @param parameters - The client for the empty-revert check, and the quoted GaslessLayer.
|
|
32
|
+
* @returns The typed error to throw, or `err` itself.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveGaslessFeeQuoteError(err: unknown, parameters: ResolveGaslessFeeQuoteErrorParameters): Promise<unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Whether an error means the billing account's **daily free-operations quota is
|
|
39
|
+
* exhausted** and the GaslessLayer refuses paid operations until the UTC reset.
|
|
40
|
+
*
|
|
41
|
+
* Matches the `GASLESS_FREE_QUOTA_EXHAUSTED` error {@link getGaslessFeeQuote}
|
|
42
|
+
* throws (also after a framework layer re-wraps it, e.g. React's
|
|
43
|
+
* `SymmioRequestError`), and a raw viem revert carrying `DailyFreeOpsLimitExceeded`
|
|
44
|
+
* from a direct GaslessLayer call. For the relay service's own HTTP rejections,
|
|
45
|
+
* use `isConfirmedGaslessFeeLimitError`.
|
|
46
|
+
*
|
|
47
|
+
* @param err - Anything caught from a fee quote or a GaslessLayer call.
|
|
48
|
+
* @returns `true` when the free quota blocks the batch.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* try {
|
|
53
|
+
* await getGaslessFeeQuote(config, { operations });
|
|
54
|
+
* } catch (err) {
|
|
55
|
+
* if (isGaslessFreeQuotaExhaustedError(err)) showQuotaResetNotice();
|
|
56
|
+
* else throw err;
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function isGaslessFreeQuotaExhaustedError(err: unknown): boolean;
|
|
61
|
+
//# sourceMappingURL=fee-quote-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fee-quote-errors.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-fee-quote/fee-quote-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,OAAO,EAGZ,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AA6Ed,8DAA8D;AAC9D,MAAM,WAAW,qCAAqC;IACpD,wDAAwD;IACxD,MAAM,EAAE,YAAY,CAAC;IACrB,+BAA+B;IAC/B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,qCAAqC,GAChD,OAAO,CAAC,OAAO,CAAC,CAuClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAItE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { BaseError as n, ContractFunctionRevertedError as r, ContractFunctionZeroDataError as i } from "viem";
|
|
4
|
+
//#region src/gasless/get-gasless-fee-quote/fee-quote-errors.ts
|
|
5
|
+
var a = "DailyFreeOpsLimitExceeded", o = "GASLESS_FREE_QUOTA_EXHAUSTED";
|
|
6
|
+
function s(e) {
|
|
7
|
+
return typeof e == "bigint" ? e.toString() : String(e);
|
|
8
|
+
}
|
|
9
|
+
function c(e) {
|
|
10
|
+
if (!(e instanceof n)) return { type: "inconclusive" };
|
|
11
|
+
if (e.walk((e) => e instanceof i)) return { type: "no-data" };
|
|
12
|
+
let t = e.walk((e) => e instanceof r);
|
|
13
|
+
return !(t instanceof r) || t.raw === void 0 ? { type: "inconclusive" } : {
|
|
14
|
+
type: "revert",
|
|
15
|
+
revert: t,
|
|
16
|
+
data: t.raw
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async function l(t, n) {
|
|
20
|
+
try {
|
|
21
|
+
await t.readContract({
|
|
22
|
+
address: n,
|
|
23
|
+
abi: e,
|
|
24
|
+
functionName: "previewFeeQuote",
|
|
25
|
+
args: ["0x", 0n]
|
|
26
|
+
});
|
|
27
|
+
} catch (e) {
|
|
28
|
+
let t = c(e);
|
|
29
|
+
if (t.type === "no-data") return !1;
|
|
30
|
+
if (t.type === "revert") return t.data !== "0x";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function u(e, n) {
|
|
34
|
+
return new t("config", "GASLESS_LAYER_INTERFACE_UNSUPPORTED", `Gasless: the GaslessLayer at ${n} does not implement previewFeeQuote — it predates the multi-wallet interface this SDK targets, or is not a GaslessLayer. Point gaslessLayerAddress at an upgraded deployment.`, { cause: e });
|
|
35
|
+
}
|
|
36
|
+
async function d(e, n) {
|
|
37
|
+
let { client: r, gaslessLayerAddress: i } = n, d = c(e);
|
|
38
|
+
if (d.type === "inconclusive") return e;
|
|
39
|
+
if (d.type === "no-data") return u(e, i);
|
|
40
|
+
if (d.data === "0x") {
|
|
41
|
+
let n = await l(r, i);
|
|
42
|
+
return n === void 0 ? e : n ? new t("validation", "GASLESS_FEE_QUOTE_REVERTED", `Gasless: the GaslessLayer fee quote reverted with empty revert data. The GaslessLayer at ${i} implements previewFeeQuote, so it could not process this batch — typically calldata it cannot ABI-decode, such as malformed wallet execute arguments. The relay would revert the same way.`, { cause: e }) : u(e, i);
|
|
43
|
+
}
|
|
44
|
+
let { revert: f } = d, p = f.data?.errorName;
|
|
45
|
+
if (p === a) {
|
|
46
|
+
let [n, r] = f.data?.args ?? [];
|
|
47
|
+
return new t("api", o, `Gasless: billing account ${s(n)} has used its daily free-operations quota (${s(r)}), and this GaslessLayer refuses paid operations once it is spent. Retry after the UTC reset or use the wallet path.`, { cause: e });
|
|
48
|
+
}
|
|
49
|
+
return new t("validation", "GASLESS_FEE_QUOTE_REVERTED", `Gasless: the GaslessLayer fee quote reverted with ${p ? `${p}(${(f.data?.args ?? []).map(s).join(", ")})` : `unknown error ${f.signature ?? d.data.slice(0, 10)}`}. The batch itself is invalid — the relay would revert the same way.`, { cause: e });
|
|
50
|
+
}
|
|
51
|
+
function f(e) {
|
|
52
|
+
if (typeof e == "object" && e && "code" in e && e.code === o) return !0;
|
|
53
|
+
let t = c(e);
|
|
54
|
+
return t.type === "revert" && t.revert.data?.errorName === a;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { f as isGaslessFreeQuotaExhaustedError, d as resolveGaslessFeeQuoteError };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=fee-quote-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fee-quote-errors.js","names":[],"sources":["../../../src/gasless/get-gasless-fee-quote/fee-quote-errors.ts"],"sourcesContent":["import {\n BaseError,\n ContractFunctionRevertedError,\n ContractFunctionZeroDataError,\n type Address,\n type ContractErrorName,\n type Hex,\n type PublicClient,\n} from \"viem\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport { gaslessLayerAbi } from \"../../symmio-contracts/abi/v0.8.6/gasless-layer\";\n\n/** The custom error the GaslessLayer reverts with once a billing account's daily free quota is spent. */\nconst FREE_QUOTA_EXHAUSTED_ERROR = \"DailyFreeOpsLimitExceeded\" satisfies ContractErrorName<typeof gaslessLayerAbi>;\n\n/** Error code of a quote refused because the daily free-operations quota is exhausted. */\nconst FREE_QUOTA_EXHAUSTED_CODE = \"GASLESS_FREE_QUOTA_EXHAUSTED\";\n\n/** What reached the client when a contract read failed. */\ntype ReadFailure =\n | { type: \"no-data\" }\n | { type: \"revert\"; revert: ContractFunctionRevertedError; data: Hex }\n | { type: \"inconclusive\" };\n\nfunction formatRevertArgument(value: unknown): string {\n return typeof value === \"bigint\" ? value.toString() : String(value);\n}\n\n/**\n * Classify a failed contract read by what reached the client.\n *\n * - `no-data`: the call returned nothing, so no code answers the function (an\n * address without code, for example).\n * - `revert`: the call reverted; `data` is the revert data, `\"0x\"` when empty.\n * - `inconclusive`: no revert data arrived at all (a transport failure, a rate\n * limit, a node error), which says nothing about the contract.\n */\nfunction classifyReadFailure(err: unknown): ReadFailure {\n if (!(err instanceof BaseError)) return { type: \"inconclusive\" };\n if (err.walk((cause) => cause instanceof ContractFunctionZeroDataError)) return { type: \"no-data\" };\n const revert = err.walk((cause) => cause instanceof ContractFunctionRevertedError);\n if (!(revert instanceof ContractFunctionRevertedError) || revert.raw === undefined) return { type: \"inconclusive\" };\n return { type: \"revert\", revert, data: revert.raw };\n}\n\n/**\n * Whether the GaslessLayer at `gaslessLayerAddress` implements `previewFeeQuote`,\n * decided by quoting empty calldata. The multi-wallet GaslessLayer checks the\n * selector before anything else and rejects it with revert data\n * (`UnsupportedFeeQuoteCall(0x00000000)`). A proxy whose implementation predates\n * the function reverts with empty data again, and an address without code\n * returns nothing.\n *\n * @returns `true` or `false` on that evidence, or `undefined` when the check is\n * inconclusive: it failed for transport reasons, or it answered calldata every\n * GaslessLayer rejects.\n */\nasync function implementsPreviewFeeQuote(\n client: PublicClient,\n gaslessLayerAddress: Address,\n): Promise<boolean | undefined> {\n try {\n await client.readContract({\n address: gaslessLayerAddress,\n abi: gaslessLayerAbi,\n functionName: \"previewFeeQuote\",\n args: [\"0x\", 0n],\n });\n } catch (err) {\n const failure = classifyReadFailure(err);\n if (failure.type === \"no-data\") return false;\n if (failure.type === \"revert\") return failure.data !== \"0x\";\n }\n return undefined;\n}\n\nfunction interfaceUnsupportedError(err: unknown, gaslessLayerAddress: Address): SymmError {\n return new SymmError(\n \"config\",\n \"GASLESS_LAYER_INTERFACE_UNSUPPORTED\",\n `Gasless: the GaslessLayer at ${gaslessLayerAddress} does not implement previewFeeQuote — it predates the multi-wallet interface this SDK targets, or is not a GaslessLayer. Point gaslessLayerAddress at an upgraded deployment.`,\n { cause: err },\n );\n}\n\n/** Input of {@link resolveGaslessFeeQuoteError}. @internal */\nexport interface ResolveGaslessFeeQuoteErrorParameters {\n /** The public client the failed quote was read with. */\n client: PublicClient;\n /** The quoted GaslessLayer. */\n gaslessLayerAddress: Address;\n}\n\n/**\n * Map a failed `previewFeeQuote` read onto the SDK's typed errors.\n *\n * - A `DailyFreeOpsLimitExceeded` revert → `GASLESS_FREE_QUOTA_EXHAUSTED`.\n * - Any other revert that carries data → `GASLESS_FEE_QUOTE_REVERTED`: the\n * contract refused the batch itself (a mismatched wallet target, an empty or\n * misaligned batch), so re-signing the same input cannot help.\n * - A call that returned nothing → `GASLESS_LAYER_INTERFACE_UNSUPPORTED`: no\n * code at the configured address answers `previewFeeQuote`.\n * - A revert with **empty** data is ambiguous. A GaslessLayer proxy that\n * predates the multi-wallet interface answers every `previewFeeQuote` this\n * way, but the multi-wallet GaslessLayer does too when it cannot ABI-decode\n * the batch (malformed wallet `execute` calldata, for example). One more read\n * quotes empty calldata to tell them apart (see\n * `implementsPreviewFeeQuote`): revert data there means the interface exists\n * and the batch is at fault → `GASLESS_FEE_QUOTE_REVERTED`; empty data or no\n * data again → `GASLESS_LAYER_INTERFACE_UNSUPPORTED`. When that check is\n * inconclusive, `err` is returned unchanged.\n * - Anything else (transport, rate limit, node error without revert data) is\n * returned unchanged — it says nothing about the batch.\n *\n * @param err - The error `readContract` threw.\n * @param parameters - The client for the empty-revert check, and the quoted GaslessLayer.\n * @returns The typed error to throw, or `err` itself.\n *\n * @internal\n */\nexport async function resolveGaslessFeeQuoteError(\n err: unknown,\n parameters: ResolveGaslessFeeQuoteErrorParameters,\n): Promise<unknown> {\n const { client, gaslessLayerAddress } = parameters;\n const failure = classifyReadFailure(err);\n if (failure.type === \"inconclusive\") return err;\n if (failure.type === \"no-data\") return interfaceUnsupportedError(err, gaslessLayerAddress);\n\n if (failure.data === \"0x\") {\n const implemented = await implementsPreviewFeeQuote(client, gaslessLayerAddress);\n if (implemented === undefined) return err;\n if (!implemented) return interfaceUnsupportedError(err, gaslessLayerAddress);\n return new SymmError(\n \"validation\",\n \"GASLESS_FEE_QUOTE_REVERTED\",\n `Gasless: the GaslessLayer fee quote reverted with empty revert data. The GaslessLayer at ${gaslessLayerAddress} implements previewFeeQuote, so it could not process this batch — typically calldata it cannot ABI-decode, such as malformed wallet execute arguments. The relay would revert the same way.`,\n { cause: err },\n );\n }\n\n const { revert } = failure;\n const errorName = revert.data?.errorName;\n if (errorName === FREE_QUOTA_EXHAUSTED_ERROR) {\n const [account, limit] = revert.data?.args ?? [];\n return new SymmError(\n \"api\",\n FREE_QUOTA_EXHAUSTED_CODE,\n `Gasless: billing account ${formatRevertArgument(account)} has used its daily free-operations quota (${formatRevertArgument(limit)}), and this GaslessLayer refuses paid operations once it is spent. Retry after the UTC reset or use the wallet path.`,\n { cause: err },\n );\n }\n\n const described = errorName\n ? `${errorName}(${(revert.data?.args ?? []).map(formatRevertArgument).join(\", \")})`\n : `unknown error ${revert.signature ?? failure.data.slice(0, 10)}`;\n return new SymmError(\n \"validation\",\n \"GASLESS_FEE_QUOTE_REVERTED\",\n `Gasless: the GaslessLayer fee quote reverted with ${described}. The batch itself is invalid — the relay would revert the same way.`,\n { cause: err },\n );\n}\n\n/**\n * Whether an error means the billing account's **daily free-operations quota is\n * exhausted** and the GaslessLayer refuses paid operations until the UTC reset.\n *\n * Matches the `GASLESS_FREE_QUOTA_EXHAUSTED` error {@link getGaslessFeeQuote}\n * throws (also after a framework layer re-wraps it, e.g. React's\n * `SymmioRequestError`), and a raw viem revert carrying `DailyFreeOpsLimitExceeded`\n * from a direct GaslessLayer call. For the relay service's own HTTP rejections,\n * use `isConfirmedGaslessFeeLimitError`.\n *\n * @param err - Anything caught from a fee quote or a GaslessLayer call.\n * @returns `true` when the free quota blocks the batch.\n *\n * @example\n * ```ts\n * try {\n * await getGaslessFeeQuote(config, { operations });\n * } catch (err) {\n * if (isGaslessFreeQuotaExhaustedError(err)) showQuotaResetNotice();\n * else throw err;\n * }\n * ```\n */\nexport function isGaslessFreeQuotaExhaustedError(err: unknown): boolean {\n if (typeof err === \"object\" && err !== null && \"code\" in err && err.code === FREE_QUOTA_EXHAUSTED_CODE) return true;\n const failure = classifyReadFailure(err);\n return failure.type === \"revert\" && failure.revert.data?.errorName === FREE_QUOTA_EXHAUSTED_ERROR;\n}\n"],"mappings":";;;;AAaA,IAAM,IAA6B,6BAG7B,IAA4B;AAQlC,SAAS,EAAqB,GAAwB;CACpD,OAAO,OAAO,KAAU,WAAW,EAAM,SAAS,IAAI,OAAO,CAAK;AACpE;AAWA,SAAS,EAAoB,GAA2B;CACtD,IAAI,EAAE,aAAe,IAAY,OAAO,EAAE,MAAM,eAAe;CAC/D,IAAI,EAAI,MAAM,MAAU,aAAiB,CAA6B,GAAG,OAAO,EAAE,MAAM,UAAU;CAClG,IAAM,IAAS,EAAI,MAAM,MAAU,aAAiB,CAA6B;CAEjF,OADI,EAAE,aAAkB,MAAkC,EAAO,QAAQ,KAAA,IAAkB,EAAE,MAAM,eAAe,IAC3G;EAAE,MAAM;EAAU;EAAQ,MAAM,EAAO;CAAI;AACpD;AAcA,eAAe,EACb,GACA,GAC8B;CAC9B,IAAI;EACF,MAAM,EAAO,aAAa;GACxB,SAAS;GACT,KAAK;GACL,cAAc;GACd,MAAM,CAAC,MAAM,EAAE;EACjB,CAAC;CACH,SAAS,GAAK;EACZ,IAAM,IAAU,EAAoB,CAAG;EACvC,IAAI,EAAQ,SAAS,WAAW,OAAO;EACvC,IAAI,EAAQ,SAAS,UAAU,OAAO,EAAQ,SAAS;CACzD;AAEF;AAEA,SAAS,EAA0B,GAAc,GAAyC;CACxF,OAAO,IAAI,EACT,UACA,uCACA,gCAAgC,EAAoB,gLACpD,EAAE,OAAO,EAAI,CACf;AACF;AAqCA,eAAsB,EACpB,GACA,GACkB;CAClB,IAAM,EAAE,WAAQ,2BAAwB,GAClC,IAAU,EAAoB,CAAG;CACvC,IAAI,EAAQ,SAAS,gBAAgB,OAAO;CAC5C,IAAI,EAAQ,SAAS,WAAW,OAAO,EAA0B,GAAK,CAAmB;CAEzF,IAAI,EAAQ,SAAS,MAAM;EACzB,IAAM,IAAc,MAAM,EAA0B,GAAQ,CAAmB;EAG/E,OAFI,MAAgB,KAAA,IAAkB,IACjC,IACE,IAAI,EACT,cACA,8BACA,4FAA4F,EAAoB,8LAChH,EAAE,OAAO,EAAI,CACf,IANyB,EAA0B,GAAK,CAAmB;CAO7E;CAEA,IAAM,EAAE,cAAW,GACb,IAAY,EAAO,MAAM;CAC/B,IAAI,MAAc,GAA4B;EAC5C,IAAM,CAAC,GAAS,KAAS,EAAO,MAAM,QAAQ,CAAC;EAC/C,OAAO,IAAI,EACT,OACA,GACA,4BAA4B,EAAqB,CAAO,EAAE,6CAA6C,EAAqB,CAAK,EAAE,uHACnI,EAAE,OAAO,EAAI,CACf;CACF;CAKA,OAAO,IAAI,EACT,cACA,8BACA,qDANgB,IACd,GAAG,EAAU,IAAI,EAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,CAAoB,EAAE,KAAK,IAAI,EAAE,KAC/E,iBAAiB,EAAO,aAAa,EAAQ,KAAK,MAAM,GAAG,EAAE,IAIA,uEAC/D,EAAE,OAAO,EAAI,CACf;AACF;AAyBA,SAAgB,EAAiC,GAAuB;CACtE,IAAI,OAAO,KAAQ,YAAY,KAAgB,UAAU,KAAO,EAAI,SAAS,GAA2B,OAAO;CAC/G,IAAM,IAAU,EAAoB,CAAG;CACvC,OAAO,EAAQ,SAAS,YAAY,EAAQ,OAAO,MAAM,cAAc;AACzE"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
3
|
+
import { SignedOperation } from '../../solvers/instant-open/shared/types.js';
|
|
4
|
+
import { GaslessFeeQuote } from '../types.js';
|
|
5
|
+
/** One operation of a batch to quote, with the GaslessWallet it runs against. */
|
|
6
|
+
export interface GaslessFeeQuoteOperation {
|
|
7
|
+
/**
|
|
8
|
+
* The exact operation about to be relayed — final calldata, signer account
|
|
9
|
+
* and replay header. No signature is needed: the quote never verifies one.
|
|
10
|
+
*/
|
|
11
|
+
operation: SignedOperation;
|
|
12
|
+
/**
|
|
13
|
+
* The GaslessWallet id the operation is relayed with. Omit (or pass `0n`) for
|
|
14
|
+
* ordinary InstantLayer operations, delegation grants, and wallet-zero
|
|
15
|
+
* operations; pass the wallet's id for an operation that executes from a
|
|
16
|
+
* positive-id wallet. Range `0n` through `2^256 - 1`.
|
|
17
|
+
*/
|
|
18
|
+
walletId?: bigint;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parameters for {@link getGaslessFeeQuote}.
|
|
22
|
+
*/
|
|
23
|
+
export type GetGaslessFeeQuoteParameters = Compute<ChainIdParameter & {
|
|
24
|
+
/**
|
|
25
|
+
* The full batch, in relay order. Quote the whole batch rather than one
|
|
26
|
+
* operation at a time: free-quota slots and first-use wallet creation fees
|
|
27
|
+
* are allocated across the batch.
|
|
28
|
+
*/
|
|
29
|
+
operations: readonly GaslessFeeQuoteOperation[];
|
|
30
|
+
}>;
|
|
31
|
+
/** Return type of {@link getGaslessFeeQuote}. */
|
|
32
|
+
export type GetGaslessFeeQuoteReturnType = GaslessFeeQuote;
|
|
33
|
+
/**
|
|
34
|
+
* Quote what the GaslessLayer would charge to relay a batch — **before** asking
|
|
35
|
+
* the user to sign anything.
|
|
36
|
+
*
|
|
37
|
+
* Encodes the batch as the `relayInstantBatch` call the relayer submits (with
|
|
38
|
+
* placeholder signatures) and reads `previewFeeQuote(callData, 0)`. The quote
|
|
39
|
+
* applies selector fees, payer multipliers, the daily free quota, and the
|
|
40
|
+
* one-time creation fee of every undeployed GaslessWallet the batch executes
|
|
41
|
+
* from — any wallet id, wallet `0` included — and prices a wallet operation by
|
|
42
|
+
* its inner call selectors. Every amount is 18-decimal.
|
|
43
|
+
*
|
|
44
|
+
* It is a preview, not a guarantee: `exact` is always `false`, the charge and its
|
|
45
|
+
* payer can change before execution, and the relayer's own simulation is
|
|
46
|
+
* authoritative. The quote does not check that the payer can afford it.
|
|
47
|
+
*
|
|
48
|
+
* Requires a multi-wallet GaslessLayer; a deployment that predates it throws
|
|
49
|
+
* `GASLESS_LAYER_INTERFACE_UNSUPPORTED`. When the quote reverts with empty data,
|
|
50
|
+
* one more read (quoting empty calldata) tells such a deployment apart from a
|
|
51
|
+
* batch the GaslessLayer cannot decode.
|
|
52
|
+
*
|
|
53
|
+
* @param config - The SDK config.
|
|
54
|
+
* @param parameters - The batch to quote and an optional chain id.
|
|
55
|
+
* @returns The fee quote.
|
|
56
|
+
* @throws {SymmError} `GASLESS_EMPTY_BATCH` for an empty batch, or `GASLESS_WALLET_ID_INVALID`
|
|
57
|
+
* for a wallet id outside the `uint256` range — both before any RPC call.
|
|
58
|
+
* @throws {SymmError} `GASLESS_NOT_CONFIGURED` / `GASLESS_UNSUPPORTED_CONTRACTS_VERSION`.
|
|
59
|
+
* @throws {SymmError} `GASLESS_FREE_QUOTA_EXHAUSTED` when a billing account's daily free
|
|
60
|
+
* quota is spent and the GaslessLayer refuses paid operations (see
|
|
61
|
+
* {@link isGaslessFreeQuotaExhaustedError}).
|
|
62
|
+
* @throws {SymmError} `GASLESS_FEE_QUOTE_REVERTED` when the contract rejects the batch
|
|
63
|
+
* (e.g. a wallet operation whose target is not the wallet of its id) or cannot
|
|
64
|
+
* decode it (malformed wallet `execute` calldata, which reverts with empty data).
|
|
65
|
+
* @throws {SymmError} `GASLESS_LAYER_INTERFACE_UNSUPPORTED` when the configured address
|
|
66
|
+
* has no `previewFeeQuote`.
|
|
67
|
+
* @throws Viem transport errors, unchanged — and the original viem revert, unchanged,
|
|
68
|
+
* when an empty-data revert cannot be classified because the follow-up read failed.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const quote = await getGaslessFeeQuote(config, {
|
|
73
|
+
* operations: [{ operation }, { operation: walletOperation, walletId: 2n }],
|
|
74
|
+
* });
|
|
75
|
+
* const fee = quote.totalFee18; // 18-decimal
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function getGaslessFeeQuote(config: Config, parameters: GetGaslessFeeQuoteParameters): Promise<GetGaslessFeeQuoteReturnType>;
|
|
79
|
+
//# sourceMappingURL=get-gasless-fee-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-gasless-fee-quote.d.ts","sourceRoot":"","sources":["../../../src/gasless/get-gasless-fee-quote/get-gasless-fee-quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,UAAU,CAAC;AAKlE,iFAAiF;AACjF,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,EAAE,eAAe,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAChD,gBAAgB,GAAG;IACjB;;;;OAIG;IACH,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACjD,CACF,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,4BAA4B,GACvC,OAAO,CAAC,4BAA4B,CAAC,CAiDvC"}
|