@symmio/trading-core 4.3.0 → 4.5.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/candles/adapters/tradingview/map-resolution.d.ts.map +1 -1
- package/dist/candles/adapters/tradingview/map-resolution.js +2 -0
- package/dist/candles/adapters/tradingview/map-resolution.js.map +1 -1
- package/dist/candles/adapters/tradingview/to-tradingview-datafeed.d.ts.map +1 -1
- package/dist/candles/adapters/tradingview/to-tradingview-datafeed.js +6 -4
- package/dist/candles/adapters/tradingview/to-tradingview-datafeed.js.map +1 -1
- package/dist/candles/history-query.d.ts +67 -0
- package/dist/candles/history-query.d.ts.map +1 -0
- package/dist/candles/history-query.js +80 -0
- package/dist/candles/history-query.js.map +1 -0
- package/dist/candles/index.d.ts +3 -0
- package/dist/candles/index.d.ts.map +1 -1
- package/dist/candles/merge-candle-pages.d.ts +5 -0
- package/dist/candles/merge-candle-pages.d.ts.map +1 -0
- package/dist/candles/merge-candle-pages.js +13 -0
- package/dist/candles/merge-candle-pages.js.map +1 -0
- package/dist/candles/query.d.ts +5 -1
- package/dist/candles/query.d.ts.map +1 -1
- package/dist/candles/query.js +3 -2
- package/dist/candles/query.js.map +1 -1
- package/dist/candles/refresh-candle-history.d.ts +31 -0
- package/dist/candles/refresh-candle-history.d.ts.map +1 -0
- package/dist/candles/refresh-candle-history.js +91 -0
- package/dist/candles/refresh-candle-history.js.map +1 -0
- package/dist/candles/resolution.d.ts +3 -3
- package/dist/candles/resolution.d.ts.map +1 -1
- package/dist/candles/resolution.js +1 -0
- package/dist/candles/resolution.js.map +1 -1
- package/dist/candles/sources/binance/create-binance-candle-source.d.ts.map +1 -1
- package/dist/candles/sources/binance/create-binance-candle-source.js +3 -1
- package/dist/candles/sources/binance/create-binance-candle-source.js.map +1 -1
- package/dist/candles/sources/lowcap/create-lowcap-candle-source.d.ts +35 -0
- package/dist/candles/sources/lowcap/create-lowcap-candle-source.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/create-lowcap-candle-source.js +104 -0
- package/dist/candles/sources/lowcap/create-lowcap-candle-source.js.map +1 -0
- package/dist/candles/sources/lowcap/create-lowcap-symbol-loader.d.ts +4 -0
- package/dist/candles/sources/lowcap/create-lowcap-symbol-loader.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/create-lowcap-symbol-loader.js +40 -0
- package/dist/candles/sources/lowcap/create-lowcap-symbol-loader.js.map +1 -0
- package/dist/candles/sources/lowcap/get-lowcap-candles.d.ts +12 -0
- package/dist/candles/sources/lowcap/get-lowcap-candles.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/get-lowcap-candles.js +48 -0
- package/dist/candles/sources/lowcap/get-lowcap-candles.js.map +1 -0
- package/dist/candles/sources/lowcap/index.d.ts +2 -0
- package/dist/candles/sources/lowcap/index.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/lowcap-candle-time.d.ts +9 -0
- package/dist/candles/sources/lowcap/lowcap-candle-time.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/lowcap-candle-time.js +24 -0
- package/dist/candles/sources/lowcap/lowcap-candle-time.js.map +1 -0
- package/dist/candles/sources/lowcap/map-resolution.d.ts +16 -0
- package/dist/candles/sources/lowcap/map-resolution.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/map-resolution.js +26 -0
- package/dist/candles/sources/lowcap/map-resolution.js.map +1 -0
- package/dist/candles/sources/lowcap/resolve-lowcap-symbol.d.ts +12 -0
- package/dist/candles/sources/lowcap/resolve-lowcap-symbol.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/resolve-lowcap-symbol.js +8 -0
- package/dist/candles/sources/lowcap/resolve-lowcap-symbol.js.map +1 -0
- package/dist/candles/sources/lowcap/watch-lowcap-candles.d.ts +19 -0
- package/dist/candles/sources/lowcap/watch-lowcap-candles.d.ts.map +1 -0
- package/dist/candles/sources/lowcap/watch-lowcap-candles.js +104 -0
- package/dist/candles/sources/lowcap/watch-lowcap-candles.js.map +1 -0
- package/dist/candles/types.d.ts +32 -16
- package/dist/candles/types.d.ts.map +1 -1
- package/dist/core/chains/registry.d.ts.map +1 -1
- package/dist/core/chains/registry.js +4 -5
- package/dist/core/chains/registry.js.map +1 -1
- package/dist/core/chains/types.d.ts +36 -1
- 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.js +6 -3
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/gasless/batch/calls.d.ts +21 -7
- package/dist/gasless/batch/calls.d.ts.map +1 -1
- package/dist/gasless/batch/calls.js +17 -16
- package/dist/gasless/batch/calls.js.map +1 -1
- package/dist/gasless/batch/resolve-gasless-batch.d.ts +10 -1
- package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -1
- package/dist/gasless/batch/resolve-gasless-batch.js +17 -15
- package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -1
- package/dist/gasless/classify-gasless-failure.d.ts +3 -1
- package/dist/gasless/classify-gasless-failure.d.ts.map +1 -1
- package/dist/gasless/classify-gasless-failure.js +10 -10
- package/dist/gasless/classify-gasless-failure.js.map +1 -1
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +5 -5
- package/dist/gasless/constants.d.ts +21 -0
- package/dist/gasless/constants.d.ts.map +1 -1
- package/dist/gasless/constants.js +2 -2
- package/dist/gasless/constants.js.map +1 -1
- package/dist/gasless/delegation-preflight.js +10 -10
- package/dist/gasless/deployment-key.d.ts +39 -0
- package/dist/gasless/deployment-key.d.ts.map +1 -0
- package/dist/gasless/deployment-key.js +22 -0
- package/dist/gasless/deployment-key.js.map +1 -0
- package/dist/gasless/dispatch/attempt-start.d.ts +31 -0
- package/dist/gasless/dispatch/attempt-start.d.ts.map +1 -0
- package/dist/gasless/dispatch/attempt-start.js +14 -0
- package/dist/gasless/dispatch/attempt-start.js.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +4 -43
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -1
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js +24 -182
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -1
- package/dist/gasless/dispatch/resolve-gasless-write.d.ts +40 -0
- package/dist/gasless/dispatch/resolve-gasless-write.d.ts.map +1 -0
- package/dist/gasless/dispatch/resolve-gasless-write.js +48 -0
- package/dist/gasless/dispatch/resolve-gasless-write.js.map +1 -0
- package/dist/gasless/dispatch/submit-gasless-write.d.ts +11 -0
- package/dist/gasless/dispatch/submit-gasless-write.d.ts.map +1 -0
- package/dist/gasless/dispatch/submit-gasless-write.js +180 -0
- package/dist/gasless/dispatch/submit-gasless-write.js.map +1 -0
- package/dist/gasless/dispatch/types.d.ts +42 -0
- package/dist/gasless/dispatch/types.d.ts.map +1 -0
- package/dist/gasless/effective-instant-selectors.d.ts +11 -0
- package/dist/gasless/effective-instant-selectors.d.ts.map +1 -0
- package/dist/gasless/effective-instant-selectors.js +25 -0
- package/dist/gasless/effective-instant-selectors.js.map +1 -0
- package/dist/gasless/fallback.d.ts +43 -0
- package/dist/gasless/fallback.d.ts.map +1 -1
- package/dist/gasless/fallback.js +27 -17
- package/dist/gasless/fallback.js.map +1 -1
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +13 -5
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -1
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +88 -81
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -1
- package/dist/gasless/get-gasless-batch-funding/batch-fee-approvals.d.ts +20 -0
- package/dist/gasless/get-gasless-batch-funding/batch-fee-approvals.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/batch-fee-approvals.js +29 -0
- package/dist/gasless/get-gasless-batch-funding/batch-fee-approvals.js.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/get-gasless-batch-funding.d.ts +43 -0
- package/dist/gasless/get-gasless-batch-funding/get-gasless-batch-funding.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/get-gasless-batch-funding.js +96 -0
- package/dist/gasless/get-gasless-batch-funding/get-gasless-batch-funding.js.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/index.d.ts +4 -0
- package/dist/gasless/get-gasless-batch-funding/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/query.d.ts +31 -0
- package/dist/gasless/get-gasless-batch-funding/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/query.js +22 -0
- package/dist/gasless/get-gasless-batch-funding/query.js.map +1 -0
- package/dist/gasless/get-gasless-batch-funding/types.d.ts +80 -0
- package/dist/gasless/get-gasless-batch-funding/types.d.ts.map +1 -0
- package/dist/gasless/get-gasless-margin-funding/get-gasless-margin-funding.d.ts +33 -0
- package/dist/gasless/get-gasless-margin-funding/get-gasless-margin-funding.d.ts.map +1 -0
- package/dist/gasless/get-gasless-margin-funding/get-gasless-margin-funding.js +31 -0
- package/dist/gasless/get-gasless-margin-funding/get-gasless-margin-funding.js.map +1 -0
- package/dist/gasless/get-gasless-margin-funding/index.d.ts +4 -0
- package/dist/gasless/get-gasless-margin-funding/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-margin-funding/query.d.ts +31 -0
- package/dist/gasless/get-gasless-margin-funding/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-margin-funding/query.js +22 -0
- package/dist/gasless/get-gasless-margin-funding/query.js.map +1 -0
- package/dist/gasless/get-gasless-margin-funding/types.d.ts +27 -0
- package/dist/gasless/get-gasless-margin-funding/types.d.ts.map +1 -0
- package/dist/gasless/get-session-key-selectors.d.ts +18 -4
- package/dist/gasless/get-session-key-selectors.d.ts.map +1 -1
- package/dist/gasless/get-session-key-selectors.js +20 -12
- package/dist/gasless/get-session-key-selectors.js.map +1 -1
- package/dist/gasless/http.d.ts +7 -7
- package/dist/gasless/http.d.ts.map +1 -1
- package/dist/gasless/http.js +70 -72
- package/dist/gasless/http.js.map +1 -1
- package/dist/gasless/idempotency-key.d.ts +33 -0
- package/dist/gasless/idempotency-key.d.ts.map +1 -0
- package/dist/gasless/idempotency-key.js +15 -0
- package/dist/gasless/idempotency-key.js.map +1 -0
- package/dist/gasless/index.d.ts +4 -0
- package/dist/gasless/index.d.ts.map +1 -1
- package/dist/gasless/nonce-lock.d.ts +55 -17
- package/dist/gasless/nonce-lock.d.ts.map +1 -1
- package/dist/gasless/nonce-lock.js +53 -26
- package/dist/gasless/nonce-lock.js.map +1 -1
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.d.ts +30 -0
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.js +67 -0
- package/dist/gasless/relay-gasless-batch/preflight-batch-delegations.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +30 -9
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -1
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +99 -102
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -1
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.d.ts +18 -0
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.js +17 -0
- package/dist/gasless/relay-gasless-batch/resolve-batch-signers.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +8 -5
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -1
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +22 -16
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -1
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +13 -7
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -1
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +46 -36
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -1
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +14 -15
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -1
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js +12 -11
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -1
- package/dist/gasless/relayable-writes.d.ts.map +1 -1
- package/dist/gasless/relayable-writes.js +28 -0
- package/dist/gasless/relayable-writes.js.map +1 -1
- package/dist/gasless/request-headers.d.ts +7 -0
- package/dist/gasless/request-headers.d.ts.map +1 -0
- package/dist/gasless/request-headers.js +34 -0
- package/dist/gasless/request-headers.js.map +1 -0
- package/dist/gasless/resolve-wallet-identities.js +4 -4
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +11 -4
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -1
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +2 -2
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -1
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +10 -14
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -1
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +3 -2
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -1
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +15 -15
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -1
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +13 -12
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -1
- package/dist/gasless/unconfirmed-submit.d.ts +12 -8
- package/dist/gasless/unconfirmed-submit.d.ts.map +1 -1
- package/dist/gasless/unconfirmed-submit.js +1 -1
- package/dist/gasless/unconfirmed-submit.js.map +1 -1
- package/dist/index.d.ts +27 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +680 -615
- package/dist/pools/listing-config/to-listing-config.d.ts +10 -3
- package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -1
- package/dist/pools/listing-config/to-listing-config.js +5 -1
- package/dist/pools/listing-config/to-listing-config.js.map +1 -1
- package/dist/pools/types/generated/listing-backend.d.ts +266 -1
- 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 +7 -0
- package/dist/pools/types.d.ts.map +1 -1
- package/dist/pools/types.js.map +1 -1
- package/dist/price-service/enigma/ohlcv/fetch-enigma-ohlcv.d.ts +39 -0
- package/dist/price-service/enigma/ohlcv/fetch-enigma-ohlcv.d.ts.map +1 -0
- package/dist/price-service/enigma/ohlcv/fetch-enigma-ohlcv.js +43 -0
- package/dist/price-service/enigma/ohlcv/fetch-enigma-ohlcv.js.map +1 -0
- package/dist/price-service/enigma/ohlcv/generated/enigma-price-service-ohlcv.d.ts +67 -0
- package/dist/price-service/enigma/ohlcv/generated/enigma-price-service-ohlcv.d.ts.map +1 -0
- package/dist/price-service/enigma/ohlcv/generated/enigma-price-service-ohlcv.js +15 -0
- package/dist/price-service/enigma/ohlcv/generated/enigma-price-service-ohlcv.js.map +1 -0
- package/dist/price-service/enigma/ohlcv/parse-enigma-ohlcv.d.ts +21 -0
- package/dist/price-service/enigma/ohlcv/parse-enigma-ohlcv.d.ts.map +1 -0
- package/dist/price-service/enigma/ohlcv/parse-enigma-ohlcv.js +36 -0
- package/dist/price-service/enigma/ohlcv/parse-enigma-ohlcv.js.map +1 -0
- package/dist/price-service/enigma/symbols-info/get-enigma-price-service-symbols-info.d.ts +2 -0
- package/dist/price-service/enigma/symbols-info/get-enigma-price-service-symbols-info.d.ts.map +1 -1
- package/dist/price-service/enigma/symbols-info/get-enigma-price-service-symbols-info.js +12 -8
- package/dist/price-service/enigma/symbols-info/get-enigma-price-service-symbols-info.js.map +1 -1
- package/dist/shared/errors/symm-error.js +3 -3
- package/dist/shared/types/properties.d.ts +45 -8
- package/dist/shared/types/properties.d.ts.map +1 -1
- package/dist/solvers/capabilities.d.ts.map +1 -1
- package/dist/solvers/capabilities.js +4 -2
- package/dist/solvers/capabilities.js.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.js +6 -6
- package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-auto.js +70 -69
- package/dist/solvers/force-close/force-close-auto.js.map +1 -1
- package/dist/solvers/get-error-message/get-error-message.js +4 -4
- package/dist/solvers/get-party-a-upnl/get-party-a-upnl.js +4 -4
- package/dist/solvers/get-solver-balance-info/get-solver-balance-info.js +4 -4
- package/dist/solvers/get-solver-info/get-solver-info.d.ts +5 -2
- package/dist/solvers/get-solver-info/get-solver-info.d.ts.map +1 -1
- package/dist/solvers/get-solver-info/get-solver-info.js +14 -12
- package/dist/solvers/get-solver-info/get-solver-info.js.map +1 -1
- package/dist/solvers/get-solver-info/parse-timelock-info.d.ts +5 -0
- package/dist/solvers/get-solver-info/parse-timelock-info.d.ts.map +1 -0
- package/dist/solvers/get-solver-info/parse-timelock-info.js +27 -0
- package/dist/solvers/get-solver-info/parse-timelock-info.js.map +1 -0
- package/dist/solvers/get-solver-open-interest/get-solver-open-interest.js +4 -4
- package/dist/solvers/get-solver-price-range/get-solver-price-range.js +4 -4
- package/dist/solvers/get-solver-readiness/get-solver-readiness.js +4 -4
- package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.js +17 -17
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts +8 -7
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +43 -39
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts +16 -0
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.d.ts.map +1 -0
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js +92 -0
- package/dist/solvers/instant-open/instant-open/adapters/enigma-margin-timelock.js.map +1 -0
- package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +1 -1
- package/dist/solvers/instant-open/instant-open/index.d.ts +2 -0
- package/dist/solvers/instant-open/instant-open/index.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/instant-open.d.ts +22 -6
- package/dist/solvers/instant-open/instant-open/instant-open.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/instant-open.js +35 -27
- package/dist/solvers/instant-open/instant-open/instant-open.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts +12 -0
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.d.ts.map +1 -0
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js +49 -0
- package/dist/solvers/instant-open/instant-open/prepared/submit-prepared-instant-open.js.map +1 -0
- package/dist/solvers/instant-open/instant-open/prepared/types.d.ts +20 -0
- package/dist/solvers/instant-open/instant-open/prepared/types.d.ts.map +1 -0
- package/dist/solvers/instant-open/instant-open/types.d.ts +5 -4
- package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/hedger-api.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/hedger-api.js +38 -26
- package/dist/solvers/instant-open/shared/hedger-api.js.map +1 -1
- package/dist/solvers/markets/adapters/enigma-markets.js +34 -34
- package/dist/solvers/notional-cap/get-notional-cap-page.js +4 -4
- package/dist/solvers/revenue/get-solver-revenue.js +10 -10
- package/dist/solvers/revenue-records/get-revenue-records.js +11 -11
- package/dist/solvers/symbols/get-symbols.js +13 -13
- package/dist/solvers/trade-volume/get-trade-volume.js +10 -10
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +46 -0
- 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 +53 -0
- 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 +3 -0
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +41 -27
- 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 +23 -9
- 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 +15 -36
- 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 +3 -0
- 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 +40 -26
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +1 -1
- 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 +18 -37
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts +46 -0
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js +20 -0
- package/dist/symmio-contracts/account-layer/actions/get-active-virtual-account-by-key.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts +31 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js +15 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-count-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts +54 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js +26 -0
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +50 -32
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js +10 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/cancel-timelock-op.js.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js +13 -0
- package/dist/symmio-contracts/account-layer/cancel-timelock-op/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js +10 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/clear-timelocks.js.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.js +13 -0
- package/dist/symmio-contracts/account-layer/clear-timelocks/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js +9 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/execute-timelock-op.js.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js +13 -0
- package/dist/symmio-contracts/account-layer/execute-timelock-op/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js +16 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/get-min-timelock-delay.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/get-min-timelock-delay/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js +22 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/get-selector-timelock.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts +22 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js +21 -0
- package/dist/symmio-contracts/account-layer/get-selector-timelock/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js +22 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/get-timelock-schedule.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts +13 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js +17 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/get-timelock-schedule-grace-period.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-grace-period/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js +67 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/get-timelock-schedule-state.js.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts +21 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js +21 -0
- package/dist/symmio-contracts/account-layer/get-timelock-schedule-state/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts +15 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js +17 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/hash-timelock-approval.js.map +1 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/hash-timelock-approval/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.d.ts +47 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.js +30 -0
- package/dist/symmio-contracts/account-layer/hook-metadata.js.map +1 -0
- package/dist/symmio-contracts/account-layer/index.d.ts +21 -0
- package/dist/symmio-contracts/account-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts +14 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js +17 -0
- package/dist/symmio-contracts/account-layer/is-timelock-approval-used/is-timelock-approval-used.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-account-balance-info.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-account-balance-of.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts +43 -0
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js +31 -0
- package/dist/symmio-contracts/account-layer/query/get-active-virtual-account-by-key.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-sub-account-virtual-nonce.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-sub-accounts-count-of-user.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts-addresses.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-addresses-of-sub-account.js +6 -6
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts +39 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js +29 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-count-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts +39 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js +31 -0
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-of-sub-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/query/predict-next-virtual-account.js +6 -6
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts +2 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts +19 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js +10 -0
- package/dist/symmio-contracts/account-layer/resolve-timelock-root-account/resolve-timelock-root-account.js.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js +13 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts +12 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js +10 -0
- package/dist/symmio-contracts/account-layer/schedule-timelock-op/schedule-timelock-op.js.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts +3 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/index.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts +9 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.js +13 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/query.js.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts +13 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js +18 -0
- package/dist/symmio-contracts/account-layer/setup-timelocks/setup-timelocks.js.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.d.ts +4 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.js +9 -0
- package/dist/symmio-contracts/account-layer/timelock-selector.js.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-test.d.ts +7 -0
- package/dist/symmio-contracts/account-layer/timelock-test.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/timelock-types.d.ts +66 -0
- package/dist/symmio-contracts/account-layer/timelock-types.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/types.d.ts +32 -2
- 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/account-layer/write-timelock.d.ts +10 -0
- package/dist/symmio-contracts/account-layer/write-timelock.d.ts.map +1 -0
- package/dist/symmio-contracts/account-layer/write-timelock.js +51 -0
- package/dist/symmio-contracts/account-layer/write-timelock.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +4 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +42 -38
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts +75 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js +46 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts +32 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js +18 -0
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts +33 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.js +18 -0
- package/dist/symmio-contracts/instant-layer/grant-delegations-input.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts +4 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts +19 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegations.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +22 -16
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts +74 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js +36 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +32 -29
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +3 -0
- 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 +37 -28
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +3 -0
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +30 -20
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +5 -0
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +31 -18
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +4 -0
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +30 -25
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +4 -0
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js +12 -8
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts +48 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js +33 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/execute-account-calls.js.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts +23 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.js +12 -0
- package/dist/symmio-contracts/symmio/execute-account-calls/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts +22 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js +14 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/get-deallocate-debounce-time.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts +34 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js +21 -0
- package/dist/symmio-contracts/symmio/get-deallocate-debounce-time/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts +34 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js +35 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/get-pending-withdraw-requests-batch.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts +15 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js +20 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/limit-concurrency.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts +22 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js +30 -0
- package/dist/symmio-contracts/symmio/get-pending-withdraw-requests-batch/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts +30 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js +15 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/get-withdraw-cooldown-of.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts +38 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js +24 -0
- package/dist/symmio-contracts/symmio/get-withdraw-cooldown-of/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/index.d.ts +6 -0
- package/dist/symmio-contracts/symmio/index.d.ts.map +1 -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 +35 -34
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts +18 -0
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js +14 -0
- package/dist/symmio-contracts/symmio/internal/resolve-default-operational-fee-charger.js.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts +18 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js +12 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-subgraph/executeSubgraphRequest.js +3 -3
- package/dist/timelock/approval.d.ts +142 -0
- package/dist/timelock/approval.d.ts.map +1 -0
- package/dist/timelock/approval.js +176 -0
- package/dist/timelock/approval.js.map +1 -0
- package/dist/timelock/attempt-outcome.d.ts +37 -0
- package/dist/timelock/attempt-outcome.d.ts.map +1 -0
- package/dist/timelock/attempt-outcome.js +70 -0
- package/dist/timelock/attempt-outcome.js.map +1 -0
- package/dist/timelock/confirm-write.d.ts +5 -0
- package/dist/timelock/confirm-write.d.ts.map +1 -0
- package/dist/timelock/confirm-write.js +18 -0
- package/dist/timelock/confirm-write.js.map +1 -0
- package/dist/timelock/early-withdraw/early-withdraw.d.ts +60 -0
- package/dist/timelock/early-withdraw/early-withdraw.d.ts.map +1 -0
- package/dist/timelock/early-withdraw/early-withdraw.js +94 -0
- package/dist/timelock/early-withdraw/early-withdraw.js.map +1 -0
- package/dist/timelock/early-withdraw/index.d.ts +2 -0
- package/dist/timelock/early-withdraw/index.d.ts.map +1 -0
- package/dist/timelock/errors.d.ts +23 -0
- package/dist/timelock/errors.d.ts.map +1 -0
- package/dist/timelock/errors.js +29 -0
- package/dist/timelock/errors.js.map +1 -0
- package/dist/timelock/execute-protected-batch.d.ts +31 -0
- package/dist/timelock/execute-protected-batch.d.ts.map +1 -0
- package/dist/timelock/execute-protected-batch.js +148 -0
- package/dist/timelock/execute-protected-batch.js.map +1 -0
- package/dist/timelock/execute-protected-call.d.ts +68 -0
- package/dist/timelock/execute-protected-call.d.ts.map +1 -0
- package/dist/timelock/execute-protected-call.js +146 -0
- package/dist/timelock/execute-protected-call.js.map +1 -0
- package/dist/timelock/execute-protected-function.d.ts +51 -0
- package/dist/timelock/execute-protected-function.d.ts.map +1 -0
- package/dist/timelock/execute-protected-function.js +37 -0
- package/dist/timelock/execute-protected-function.js.map +1 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts +38 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.d.ts.map +1 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.js +49 -0
- package/dist/timelock/get-timelock-policy/get-timelock-policy.js.map +1 -0
- package/dist/timelock/get-timelock-policy/index.d.ts +3 -0
- package/dist/timelock/get-timelock-policy/index.d.ts.map +1 -0
- package/dist/timelock/get-timelock-policy/query.d.ts +13 -0
- package/dist/timelock/get-timelock-policy/query.d.ts.map +1 -0
- package/dist/timelock/get-timelock-policy/query.js +21 -0
- package/dist/timelock/get-timelock-policy/query.js.map +1 -0
- package/dist/timelock/index.d.ts +14 -0
- package/dist/timelock/index.d.ts.map +1 -0
- package/dist/timelock/normalize-timelock-revert.d.ts +3 -0
- package/dist/timelock/normalize-timelock-revert.d.ts.map +1 -0
- package/dist/timelock/normalize-timelock-revert.js +11 -0
- package/dist/timelock/normalize-timelock-revert.js.map +1 -0
- package/dist/timelock/policy-change.d.ts +72 -0
- package/dist/timelock/policy-change.d.ts.map +1 -0
- package/dist/timelock/policy-change.js +63 -0
- package/dist/timelock/policy-change.js.map +1 -0
- package/dist/timelock/policy.d.ts +19 -0
- package/dist/timelock/policy.d.ts.map +1 -0
- package/dist/timelock/policy.js +59 -0
- package/dist/timelock/policy.js.map +1 -0
- package/dist/timelock/protected-call-preflight.d.ts +10 -0
- package/dist/timelock/protected-call-preflight.d.ts.map +1 -0
- package/dist/timelock/protected-call-preflight.js +17 -0
- package/dist/timelock/protected-call-preflight.js.map +1 -0
- package/dist/timelock/root-account.d.ts +14 -0
- package/dist/timelock/root-account.d.ts.map +1 -0
- package/dist/timelock/root-account.js +9 -0
- package/dist/timelock/root-account.js.map +1 -0
- package/dist/timelock/scheduled-call-match.d.ts +4 -0
- package/dist/timelock/scheduled-call-match.d.ts.map +1 -0
- package/dist/timelock/scheduled-call-match.js +43 -0
- package/dist/timelock/scheduled-call-match.js.map +1 -0
- package/dist/timelock/setup-timelock-policy/index.d.ts +2 -0
- package/dist/timelock/setup-timelock-policy/index.d.ts.map +1 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts +46 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.d.ts.map +1 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js +58 -0
- package/dist/timelock/setup-timelock-policy/setup-timelock-policy.js.map +1 -0
- package/dist/timelock/support.d.ts +4 -0
- package/dist/timelock/support.d.ts.map +1 -0
- package/dist/timelock/support.js +9 -0
- package/dist/timelock/support.js.map +1 -0
- package/dist/transactions/execute-contract-write.d.ts +9 -0
- package/dist/transactions/execute-contract-write.d.ts.map +1 -0
- package/dist/transactions/execute-contract-write.js +35 -0
- package/dist/transactions/execute-contract-write.js.map +1 -0
- package/dist/transactions/execute-write.d.ts +32 -0
- package/dist/transactions/execute-write.d.ts.map +1 -0
- package/dist/transactions/execute-write.js +23 -0
- package/dist/transactions/execute-write.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { GaslessWriteOptions, GaslessWriteParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { GaslessBillingAccount, GaslessDispatchCall, ResolvedGaslessWrite } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Normalize a write's `gasless` parameter and validate its caller-owned key.
|
|
6
|
+
* Every path that could reach the wallet runs this first, so a bad key never
|
|
7
|
+
* slips through on a write that turns out not to relay.
|
|
8
|
+
*
|
|
9
|
+
* @param raw - The write's `gasless` parameter, verbatim.
|
|
10
|
+
* @returns The options bag, and whether it carries a caller-owned key.
|
|
11
|
+
* @throws {SymmError} `GASLESS_IDEMPOTENCY_KEY_INVALID` for a blank or over-long key, or a key combined with
|
|
12
|
+
* `enabled: false` or `fallback: "wallet"`.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveGaslessWriteOptions(raw: GaslessWriteParameter["gasless"]): {
|
|
17
|
+
options: GaslessWriteOptions;
|
|
18
|
+
keyed: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Resolve execution policy and billing identity without resolving or prompting a wallet. Null selects wallet execution.
|
|
22
|
+
*
|
|
23
|
+
* A caller-owned `gasless.idempotencyKey` makes the write strictly gasless: it
|
|
24
|
+
* never resolves to `null` and its fallback is always `"error"`, whatever the
|
|
25
|
+
* chain's `execution` defaults say. A retry under that key must never reach the
|
|
26
|
+
* wallet while an earlier attempt may still run.
|
|
27
|
+
*
|
|
28
|
+
* A `billingAccount` of `null` marks an action with no relay path. It follows
|
|
29
|
+
* the rule for calldata the relay cannot carry: a keyed write, or an explicit
|
|
30
|
+
* `enabled: true` without a wallet fallback, throws `GASLESS_NOT_RELAYABLE`;
|
|
31
|
+
* anything else resolves to `null` and takes the wallet.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveGaslessWrite(config: Config, parameters: GaslessWriteParameter & {
|
|
36
|
+
chainId?: number;
|
|
37
|
+
calls: readonly GaslessDispatchCall[];
|
|
38
|
+
billingAccount: GaslessBillingAccount | null;
|
|
39
|
+
}): Promise<ResolvedGaslessWrite | null>;
|
|
40
|
+
//# sourceMappingURL=resolve-gasless-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-gasless-write.d.ts","sourceRoot":"","sources":["../../../src/gasless/dispatch/resolve-gasless-write.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAKhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEhG;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,qBAAqB,CAAC,SAAS,CAAC,GAAG;IACjF,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,CAcA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC9C,GACA,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA4DtC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SymmError as e } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { getVirtualAccount as t } from "../../symmio-contracts/account-layer/actions/get-virtual-account.js";
|
|
3
|
+
import { resolveGaslessIdempotencyKey as n } from "../idempotency-key.js";
|
|
4
|
+
import { GASLESS_RELAYABLE_WRITES as r } from "../relayable-writes.js";
|
|
5
|
+
import { resolveGaslessService as i, supportsGaslessService as a } from "../resolve-gasless.js";
|
|
6
|
+
//#region src/gasless/dispatch/resolve-gasless-write.ts
|
|
7
|
+
function o(t) {
|
|
8
|
+
let r = typeof t == "boolean" ? { enabled: t } : t ?? {}, i = r.idempotencyKey !== void 0;
|
|
9
|
+
if (i && (n(r.idempotencyKey), r.enabled === !1 || r.fallback === "wallet")) throw new e("validation", "GASLESS_IDEMPOTENCY_KEY_INVALID", "Gasless: an idempotency key makes a write strictly gasless, so it cannot be combined with `enabled: false` or `fallback: \"wallet\"`. Drop the key to send the write through the wallet.");
|
|
10
|
+
return {
|
|
11
|
+
options: r,
|
|
12
|
+
keyed: i
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
async function s(n, s) {
|
|
16
|
+
let { options: c, keyed: l } = o(s.gasless), u = n.getChainConfig(s.chainId).chainId, d = l || a(n, { chainId: u }) ? i(n, { chainId: u }) : void 0, f = d?.execution ?? {};
|
|
17
|
+
if (!(l || (c.enabled ?? f.mode === "gasless"))) return null;
|
|
18
|
+
if (!d) return i(n, { chainId: u }), null;
|
|
19
|
+
let p = l ? "error" : c.fallback ?? f.fallback ?? "error", m = s.calls.map((e) => r.get(e.callData.slice(0, 10).toLowerCase())), h = s.billingAccount;
|
|
20
|
+
if (h === null || m.some((e) => e === void 0)) {
|
|
21
|
+
if (!l && (c.enabled !== !0 || p === "wallet")) return null;
|
|
22
|
+
throw new e("validation", "GASLESS_NOT_RELAYABLE", h === null ? "Gasless: this write has no gasless relay path. Drop `gasless` to send it through the wallet." : "Gasless: this write's calldata is not relayable through the gasless service.");
|
|
23
|
+
}
|
|
24
|
+
let g = c.account;
|
|
25
|
+
if (!g && h.kind === "subaccount" && (g = h.account), !g && (h.kind === "virtual-account" || h.kind === "account-or-virtual-account")) {
|
|
26
|
+
let r = await t(n, {
|
|
27
|
+
chainId: u,
|
|
28
|
+
account: h.account
|
|
29
|
+
});
|
|
30
|
+
if (!r.isExists && h.kind === "virtual-account") throw new e("validation", "GASLESS_ACCOUNT_UNRESOLVED", `Gasless: ${h.account} is not a known virtual account — pass \`gasless.account\` with the paying sub-account.`);
|
|
31
|
+
g = r.isExists ? r.parentAccount : h.account;
|
|
32
|
+
}
|
|
33
|
+
if (!g) throw new e("validation", "GASLESS_ACCOUNT_UNRESOLVED", "Gasless: no sub-account to relay under — pass `gasless.account`.");
|
|
34
|
+
return {
|
|
35
|
+
chainId: u,
|
|
36
|
+
gasless: d,
|
|
37
|
+
options: c,
|
|
38
|
+
execution: f,
|
|
39
|
+
fallback: p,
|
|
40
|
+
account: g,
|
|
41
|
+
operationType: m[0]?.operationType ?? "gaslessWrite",
|
|
42
|
+
calls: s.calls
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { s as resolveGaslessWrite, o as resolveGaslessWriteOptions };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=resolve-gasless-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-gasless-write.js","names":[],"sources":["../../../src/gasless/dispatch/resolve-gasless-write.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { GaslessWriteOptions, GaslessWriteParameter } from \"../../shared/types/properties\";\nimport { getVirtualAccount } from \"../../symmio-contracts/account-layer/actions/get-virtual-account\";\nimport { resolveGaslessIdempotencyKey } from \"../idempotency-key\";\nimport { GASLESS_RELAYABLE_WRITES } from \"../relayable-writes\";\nimport { resolveGaslessService, supportsGaslessService } from \"../resolve-gasless\";\nimport type { GaslessBillingAccount, GaslessDispatchCall, ResolvedGaslessWrite } from \"./types\";\n\n/**\n * Normalize a write's `gasless` parameter and validate its caller-owned key.\n * Every path that could reach the wallet runs this first, so a bad key never\n * slips through on a write that turns out not to relay.\n *\n * @param raw - The write's `gasless` parameter, verbatim.\n * @returns The options bag, and whether it carries a caller-owned key.\n * @throws {SymmError} `GASLESS_IDEMPOTENCY_KEY_INVALID` for a blank or over-long key, or a key combined with\n * `enabled: false` or `fallback: \"wallet\"`.\n *\n * @internal\n */\nexport function resolveGaslessWriteOptions(raw: GaslessWriteParameter[\"gasless\"]): {\n options: GaslessWriteOptions;\n keyed: boolean;\n} {\n const options = typeof raw === \"boolean\" ? { enabled: raw } : (raw ?? {});\n const keyed = options.idempotencyKey !== undefined;\n if (keyed) {\n resolveGaslessIdempotencyKey(options.idempotencyKey);\n if (options.enabled === false || options.fallback === \"wallet\") {\n throw new SymmError(\n \"validation\",\n \"GASLESS_IDEMPOTENCY_KEY_INVALID\",\n 'Gasless: an idempotency key makes a write strictly gasless, so it cannot be combined with `enabled: false` or `fallback: \"wallet\"`. Drop the key to send the write through the wallet.',\n );\n }\n }\n return { options, keyed };\n}\n\n/**\n * Resolve execution policy and billing identity without resolving or prompting a wallet. Null selects wallet execution.\n *\n * A caller-owned `gasless.idempotencyKey` makes the write strictly gasless: it\n * never resolves to `null` and its fallback is always `\"error\"`, whatever the\n * chain's `execution` defaults say. A retry under that key must never reach the\n * wallet while an earlier attempt may still run.\n *\n * A `billingAccount` of `null` marks an action with no relay path. It follows\n * the rule for calldata the relay cannot carry: a keyed write, or an explicit\n * `enabled: true` without a wallet fallback, throws `GASLESS_NOT_RELAYABLE`;\n * anything else resolves to `null` and takes the wallet.\n *\n * @internal\n */\nexport async function resolveGaslessWrite(\n config: Config,\n parameters: GaslessWriteParameter & {\n chainId?: number;\n calls: readonly GaslessDispatchCall[];\n billingAccount: GaslessBillingAccount | null;\n },\n): Promise<ResolvedGaslessWrite | null> {\n const { options, keyed } = resolveGaslessWriteOptions(parameters.gasless);\n const chainId = config.getChainConfig(parameters.chainId).chainId;\n /** A keyed write reports the precise configuration/version error instead of falling to the wallet. */\n const supported = keyed || supportsGaslessService(config, { chainId });\n const gasless = supported ? resolveGaslessService(config, { chainId }) : undefined;\n const execution = gasless?.execution ?? {};\n const enabled = keyed || (options.enabled ?? execution.mode === \"gasless\");\n if (!enabled) return null;\n if (!gasless) {\n // An explicit opt-in must report the precise configuration/version error.\n resolveGaslessService(config, { chainId });\n return null;\n }\n const fallback = keyed ? \"error\" : (options.fallback ?? execution.fallback ?? \"error\");\n const writes = parameters.calls.map((call) =>\n GASLESS_RELAYABLE_WRITES.get(call.callData.slice(0, 10).toLowerCase() as Hex),\n );\n const source = parameters.billingAccount;\n if (source === null || writes.some((write) => write === undefined)) {\n if (!keyed && (options.enabled !== true || fallback === \"wallet\")) return null;\n throw new SymmError(\n \"validation\",\n \"GASLESS_NOT_RELAYABLE\",\n source === null\n ? \"Gasless: this write has no gasless relay path. Drop `gasless` to send it through the wallet.\"\n : \"Gasless: this write's calldata is not relayable through the gasless service.\",\n );\n }\n\n let account = options.account;\n if (!account && source.kind === \"subaccount\") account = source.account;\n if (!account && (source.kind === \"virtual-account\" || source.kind === \"account-or-virtual-account\")) {\n const detail = await getVirtualAccount(config, { chainId, account: source.account });\n if (!detail.isExists && source.kind === \"virtual-account\") {\n throw new SymmError(\n \"validation\",\n \"GASLESS_ACCOUNT_UNRESOLVED\",\n `Gasless: ${source.account} is not a known virtual account — pass \\`gasless.account\\` with the paying sub-account.`,\n );\n }\n account = detail.isExists ? detail.parentAccount : source.account;\n }\n if (!account) {\n throw new SymmError(\n \"validation\",\n \"GASLESS_ACCOUNT_UNRESOLVED\",\n \"Gasless: no sub-account to relay under — pass `gasless.account`.\",\n );\n }\n return {\n chainId,\n gasless,\n options,\n execution,\n fallback,\n account,\n operationType: writes[0]?.operationType ?? \"gaslessWrite\",\n calls: parameters.calls,\n };\n}\n"],"mappings":";;;;;;AAsBA,SAAgB,EAA2B,GAGzC;CACA,IAAM,IAAU,OAAO,KAAQ,YAAY,EAAE,SAAS,EAAI,IAAK,KAAO,CAAC,GACjE,IAAQ,EAAQ,mBAAmB,KAAA;CACzC,IAAI,MACF,EAA6B,EAAQ,cAAc,GAC/C,EAAQ,YAAY,MAAS,EAAQ,aAAa,WACpD,MAAM,IAAI,EACR,cACA,mCACA,0LACF;CAGJ,OAAO;EAAE;EAAS;CAAM;AAC1B;AAiBA,eAAsB,EACpB,GACA,GAKsC;CACtC,IAAM,EAAE,YAAS,aAAU,EAA2B,EAAW,OAAO,GAClE,IAAU,EAAO,eAAe,EAAW,OAAO,EAAE,SAGpD,IADY,KAAS,EAAuB,GAAQ,EAAE,WAAQ,CAAC,IACzC,EAAsB,GAAQ,EAAE,WAAQ,CAAC,IAAI,KAAA,GACnE,IAAY,GAAS,aAAa,CAAC;CAEzC,IAAI,EADY,MAAU,EAAQ,WAAW,EAAU,SAAS,aAClD,OAAO;CACrB,IAAI,CAAC,GAGH,OADA,EAAsB,GAAQ,EAAE,WAAQ,CAAC,GAClC;CAET,IAAM,IAAW,IAAQ,UAAW,EAAQ,YAAY,EAAU,YAAY,SACxE,IAAS,EAAW,MAAM,KAAK,MACnC,EAAyB,IAAI,EAAK,SAAS,MAAM,GAAG,EAAE,EAAE,YAAY,CAAQ,CAC9E,GACM,IAAS,EAAW;CAC1B,IAAI,MAAW,QAAQ,EAAO,MAAM,MAAU,MAAU,KAAA,CAAS,GAAG;EAClE,IAAI,CAAC,MAAU,EAAQ,YAAY,MAAQ,MAAa,WAAW,OAAO;EAC1E,MAAM,IAAI,EACR,cACA,yBACA,MAAW,OACP,iGACA,8EACN;CACF;CAEA,IAAI,IAAU,EAAQ;CAEtB,IADI,CAAC,KAAW,EAAO,SAAS,iBAAc,IAAU,EAAO,UAC3D,CAAC,MAAY,EAAO,SAAS,qBAAqB,EAAO,SAAS,+BAA+B;EACnG,IAAM,IAAS,MAAM,EAAkB,GAAQ;GAAE;GAAS,SAAS,EAAO;EAAQ,CAAC;EACnF,IAAI,CAAC,EAAO,YAAY,EAAO,SAAS,mBACtC,MAAM,IAAI,EACR,cACA,8BACA,YAAY,EAAO,QAAQ,wFAC7B;EAEF,IAAU,EAAO,WAAW,EAAO,gBAAgB,EAAO;CAC5D;CACA,IAAI,CAAC,GACH,MAAM,IAAI,EACR,cACA,8BACA,kEACF;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA,eAAe,EAAO,IAAI,iBAAiB;EAC3C,OAAO,EAAW;CACpB;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { GaslessWriteResult, ResolvedGaslessWrite } from './types.js';
|
|
4
|
+
/** Sign and submit one resolved relay attempt. Refusals carry acceptance state; this function never submits a wallet transaction. @internal */
|
|
5
|
+
export declare function submitGaslessWrite(config: Config, write: ResolvedGaslessWrite, attempt: {
|
|
6
|
+
/** The signer to resolve, as the write's `from`. */
|
|
7
|
+
from?: Address;
|
|
8
|
+
/** When the user's action started (ms since epoch), from `getGaslessAttemptStart` or the seam's first line. */
|
|
9
|
+
startedAtMs: number;
|
|
10
|
+
}): Promise<GaslessWriteResult>;
|
|
11
|
+
//# sourceMappingURL=submit-gasless-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-gasless-write.d.ts","sourceRoot":"","sources":["../../../src/gasless/dispatch/submit-gasless-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA4BhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAYxE,+IAA+I;AAC/I,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE;IACP,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+GAA+G;IAC/G,WAAW,EAAE,MAAM,CAAC;CACrB,GACA,OAAO,CAAC,kBAAkB,CAAC,CA6M7B"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { getInstantLayerEip712Domain as n, signSignedOperation as r } from "../../solvers/instant-open/shared/eip712.js";
|
|
3
|
+
import { buildSignedOperation as i } from "../../solvers/instant-open/shared/operations.js";
|
|
4
|
+
import { resolveGaslessIdempotencyKey as a } from "../idempotency-key.js";
|
|
5
|
+
import { getInstantLayerNonce as o } from "../../symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js";
|
|
6
|
+
import { assertGaslessGatewayCoherence as s } from "../assert-gateway-coherence.js";
|
|
7
|
+
import { GASLESS_SIGNATURE_LIFETIME_SECONDS as c } from "../constants.js";
|
|
8
|
+
import { findUndelegatedGaslessSelectors as l, getCachedGaslessAccountOwner as u } from "../delegation-preflight.js";
|
|
9
|
+
import { getEffectiveInstantSelectors as d } from "../effective-instant-selectors.js";
|
|
10
|
+
import { fireGaslessEvent as f, toGaslessRecordBody as p } from "../events.js";
|
|
11
|
+
import { isGaslessFreeQuotaExhaustedError as m } from "../get-gasless-fee-quote/fee-quote-errors.js";
|
|
12
|
+
import { getGaslessUnconfirmedSubmit as h, isGaslessIdempotencyConflictError as g } from "../unconfirmed-submit.js";
|
|
13
|
+
import { isGaslessAcceptedInstanceMismatchError as _ } from "../http.js";
|
|
14
|
+
import { GaslessRequestStatus as v } from "../types.js";
|
|
15
|
+
import { isConfirmedGaslessFeeLimitError as y, isConfirmedGaslessUnavailableError as b } from "../fallback.js";
|
|
16
|
+
import { getGaslessFeeQuote as x } from "../get-gasless-fee-quote/get-gasless-fee-quote.js";
|
|
17
|
+
import { waitForGaslessRequest as S } from "../wait-for-gasless-request/wait-for-gasless-request.js";
|
|
18
|
+
import { blocksGaslessNonceStream as C, gaslessInstantNonceStreamKey as w, getGaslessPendingAcceptance as T, readGaslessStreamNonce as E, submitOnGaslessNonceStream as D, withGaslessNonceLock as O } from "../nonce-lock.js";
|
|
19
|
+
import { relayInstantOperations as k } from "../relay-instant-operations/relay-instant-operations.js";
|
|
20
|
+
import { registerGaslessWriteRequest as A } from "../write-request-registry.js";
|
|
21
|
+
//#region src/gasless/dispatch/submit-gasless-write.ts
|
|
22
|
+
var j = 60;
|
|
23
|
+
async function M(e, p, v) {
|
|
24
|
+
let { chainId: S, gasless: A, options: M, execution: P, account: F, operationType: I, calls: L } = p, { from: R, startedAtMs: z } = v, B = BigInt(Math.floor(z / 1e3) + c), V = M.idempotencyKey !== void 0, H = a(M.idempotencyKey), U = w(S, F);
|
|
25
|
+
if (V) {
|
|
26
|
+
let t = T(e, [U], H);
|
|
27
|
+
if (t) return N(e, p, t.requestId);
|
|
28
|
+
}
|
|
29
|
+
await s(e, S, A);
|
|
30
|
+
let W = await e.getWalletClient({
|
|
31
|
+
chainId: S,
|
|
32
|
+
from: R
|
|
33
|
+
});
|
|
34
|
+
if (P.preflightDelegation ?? !0) {
|
|
35
|
+
let n = await l(e, {
|
|
36
|
+
chainId: S,
|
|
37
|
+
signer: W.account.address,
|
|
38
|
+
signerAccount: F,
|
|
39
|
+
selectors: L.flatMap((e) => d(e.callData))
|
|
40
|
+
});
|
|
41
|
+
if (n.length > 0) return {
|
|
42
|
+
kind: "refused",
|
|
43
|
+
accepted: !1,
|
|
44
|
+
error: new t("validation", "GASLESS_SIGNER_NOT_DELEGATED", `Gasless: signer ${W.account.address} holds no active InstantLayer delegation from sub-account ${F} for selector(s) ${n.join(", ")}. Grant them to the session key (the selector set is built by getSessionKeySelectors) or sign this write with the sub-account's owner.`)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
let G = n(e, { chainId: S }), K = await O(e, U, async () => {
|
|
48
|
+
let n = await E(e, U, () => o(e, {
|
|
49
|
+
chainId: S,
|
|
50
|
+
account: F
|
|
51
|
+
}), V ? H : void 0), a = L.map((e, t) => i({
|
|
52
|
+
signer: W.account.address,
|
|
53
|
+
target: e.target,
|
|
54
|
+
callData: e.callData,
|
|
55
|
+
signerAccount: F,
|
|
56
|
+
deadline: B,
|
|
57
|
+
nonce: n + BigInt(t + 1)
|
|
58
|
+
}));
|
|
59
|
+
if (P.preflightFee ?? !0) try {
|
|
60
|
+
await x(e, {
|
|
61
|
+
chainId: S,
|
|
62
|
+
operations: a.map((e) => ({ operation: e }))
|
|
63
|
+
});
|
|
64
|
+
} catch (e) {
|
|
65
|
+
if (m(e)) return {
|
|
66
|
+
kind: "refused",
|
|
67
|
+
error: e,
|
|
68
|
+
accepted: !1
|
|
69
|
+
};
|
|
70
|
+
if (e instanceof t) throw e;
|
|
71
|
+
}
|
|
72
|
+
let s = Number(B) - Math.floor(Date.now() / 1e3);
|
|
73
|
+
if (s < j) return {
|
|
74
|
+
kind: "refused",
|
|
75
|
+
accepted: !1,
|
|
76
|
+
error: new t("validation", "GASLESS_SIGNATURE_WINDOW_EXPIRED", `Gasless: this write started at ${new Date(z).toISOString()} and its signature would expire in ${Math.max(s, 0)}s, too soon to sign and land it. Nothing was signed or sent; call the write again to start a new attempt.`)
|
|
77
|
+
};
|
|
78
|
+
let c = [];
|
|
79
|
+
for (let e of a) c.push(await r(e, G, W));
|
|
80
|
+
let l = await u(e, S, F).catch(() => null) ?? W.account.address;
|
|
81
|
+
try {
|
|
82
|
+
return {
|
|
83
|
+
receipt: await D(e, U, {
|
|
84
|
+
signedNonce: n + BigInt(a.length),
|
|
85
|
+
service: "operations",
|
|
86
|
+
chainId: S,
|
|
87
|
+
deadline: B,
|
|
88
|
+
idempotencyKey: H,
|
|
89
|
+
callerOwnedKey: V
|
|
90
|
+
}, () => k(e, {
|
|
91
|
+
chainId: S,
|
|
92
|
+
operationType: I,
|
|
93
|
+
userAddress: l,
|
|
94
|
+
accountId: F,
|
|
95
|
+
operations: a.map((e, t) => ({
|
|
96
|
+
operation: e,
|
|
97
|
+
signature: c[t]
|
|
98
|
+
})),
|
|
99
|
+
idempotencyKey: H
|
|
100
|
+
}), C),
|
|
101
|
+
owner: l
|
|
102
|
+
};
|
|
103
|
+
} catch (e) {
|
|
104
|
+
if (!(h(e) !== null || g(e) || _(e)) && (y(e) || b(e))) return {
|
|
105
|
+
kind: "refused",
|
|
106
|
+
error: e,
|
|
107
|
+
accepted: !1
|
|
108
|
+
};
|
|
109
|
+
throw e;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
if ("kind" in K) return K;
|
|
113
|
+
let { receipt: q, owner: J } = K;
|
|
114
|
+
return f(P.onEvent, {
|
|
115
|
+
type: "accepted",
|
|
116
|
+
requestId: q.requestId,
|
|
117
|
+
service: "operations",
|
|
118
|
+
chainId: S,
|
|
119
|
+
protocolInstance: A.protocolInstance ?? null,
|
|
120
|
+
operationType: I,
|
|
121
|
+
idempotencyKey: q.idempotencyKey,
|
|
122
|
+
owner: J,
|
|
123
|
+
walletIds: q.walletIds
|
|
124
|
+
}), N(e, p, q.requestId);
|
|
125
|
+
}
|
|
126
|
+
async function N(t, n, r) {
|
|
127
|
+
let { chainId: i, gasless: a, options: o, execution: s } = n, c = s.onEvent, l = await S(t, {
|
|
128
|
+
chainId: i,
|
|
129
|
+
requestId: r,
|
|
130
|
+
until: "broadcast",
|
|
131
|
+
timeoutMs: o.broadcastTimeoutMs ?? s.broadcastTimeoutMs,
|
|
132
|
+
queuedPollMs: s.queuedPollMs,
|
|
133
|
+
submittedPollMs: s.submittedPollMs,
|
|
134
|
+
signal: o.signal,
|
|
135
|
+
onUpdate: (e) => {
|
|
136
|
+
e.txHash && f(c, {
|
|
137
|
+
type: "broadcast",
|
|
138
|
+
requestId: e.requestId,
|
|
139
|
+
txHash: e.txHash,
|
|
140
|
+
chainId: i
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
if (l.txHash !== null) return A(t, {
|
|
145
|
+
requestId: l.requestId,
|
|
146
|
+
service: "operations",
|
|
147
|
+
chainId: i,
|
|
148
|
+
protocolInstance: a.protocolInstance ?? null,
|
|
149
|
+
broadcastHash: l.txHash
|
|
150
|
+
}), {
|
|
151
|
+
kind: "broadcast",
|
|
152
|
+
hash: l.txHash
|
|
153
|
+
};
|
|
154
|
+
f(c, {
|
|
155
|
+
type: "terminal",
|
|
156
|
+
requestId: l.requestId,
|
|
157
|
+
status: l.status,
|
|
158
|
+
txHash: l.txHash,
|
|
159
|
+
chainId: i
|
|
160
|
+
});
|
|
161
|
+
let u = new e({
|
|
162
|
+
code: l.status === v.REJECTED ? "GASLESS_RELAY_REJECTED" : "GASLESS_RELAY_FAILED",
|
|
163
|
+
message: `Gasless: request ${l.requestId} ended ${l.status} before any broadcast${l.errorMessage ? ` — ${l.errorMessage}` : ""}.`,
|
|
164
|
+
status: 200,
|
|
165
|
+
statusText: "OK",
|
|
166
|
+
responseData: p(l),
|
|
167
|
+
url: a.url,
|
|
168
|
+
method: "GET"
|
|
169
|
+
});
|
|
170
|
+
if (y(u)) return {
|
|
171
|
+
kind: "refused",
|
|
172
|
+
error: u,
|
|
173
|
+
accepted: !0
|
|
174
|
+
};
|
|
175
|
+
throw u;
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
export { M as submitGaslessWrite };
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=submit-gasless-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-gasless-write.js","names":[],"sources":["../../../src/gasless/dispatch/submit-gasless-write.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport { getInstantLayerEip712Domain, signSignedOperation } from \"../../solvers/instant-open/shared/eip712\";\nimport { buildSignedOperation } from \"../../solvers/instant-open/shared/operations\";\nimport { getInstantLayerNonce } from \"../../symmio-contracts/instant-layer/actions/get-instant-layer-nonce\";\nimport { assertGaslessGatewayCoherence } from \"../assert-gateway-coherence\";\nimport { GASLESS_SIGNATURE_LIFETIME_SECONDS } from \"../constants\";\nimport { findUndelegatedGaslessSelectors, getCachedGaslessAccountOwner } from \"../delegation-preflight\";\nimport { getEffectiveInstantSelectors } from \"../effective-instant-selectors\";\nimport { fireGaslessEvent, toGaslessRecordBody } from \"../events\";\nimport { isConfirmedGaslessFeeLimitError, isConfirmedGaslessUnavailableError } from \"../fallback\";\nimport { isGaslessFreeQuotaExhaustedError } from \"../get-gasless-fee-quote/fee-quote-errors\";\nimport { getGaslessFeeQuote } from \"../get-gasless-fee-quote/get-gasless-fee-quote\";\nimport { isGaslessAcceptedInstanceMismatchError } from \"../http\";\nimport { resolveGaslessIdempotencyKey } from \"../idempotency-key\";\nimport {\n blocksGaslessNonceStream,\n gaslessInstantNonceStreamKey,\n getGaslessPendingAcceptance,\n readGaslessStreamNonce,\n submitOnGaslessNonceStream,\n withGaslessNonceLock,\n} from \"../nonce-lock\";\nimport { relayInstantOperations } from \"../relay-instant-operations/relay-instant-operations\";\nimport { GaslessRequestStatus, type GaslessSubmitReceipt } from \"../types\";\nimport { getGaslessUnconfirmedSubmit, isGaslessIdempotencyConflictError } from \"../unconfirmed-submit\";\nimport { waitForGaslessRequest } from \"../wait-for-gasless-request/wait-for-gasless-request\";\nimport { registerGaslessWriteRequest } from \"../write-request-registry\";\nimport type { GaslessWriteResult, ResolvedGaslessWrite } from \"./types\";\n\ntype GaslessDispatchSubmit =\n | { receipt: GaslessSubmitReceipt; owner: Address }\n | Extract<GaslessWriteResult, { kind: \"refused\" }>;\n\n/**\n * The least signature lifetime worth asking the user to sign for: room for the\n * prompt and for the relayer to land it. Below this the attempt stops unsigned.\n */\nconst GASLESS_MIN_SIGNING_WINDOW_SECONDS = 60;\n\n/** Sign and submit one resolved relay attempt. Refusals carry acceptance state; this function never submits a wallet transaction. @internal */\nexport async function submitGaslessWrite(\n config: Config,\n write: ResolvedGaslessWrite,\n attempt: {\n /** The signer to resolve, as the write's `from`. */\n from?: Address;\n /** When the user's action started (ms since epoch), from `getGaslessAttemptStart` or the seam's first line. */\n startedAtMs: number;\n },\n): Promise<GaslessWriteResult> {\n const { chainId, gasless, options, execution, account: resolvedSignerAccount, operationType, calls } = write;\n const { from, startedAtMs } = attempt;\n\n /**\n * Counted from when the user's action started, before any read, lock wait or\n * prompt: an attempt started at `T` can never execute after\n * `T + GASLESS_SIGNATURE_LIFETIME_SECONDS`, which is what lets a caller\n * reconcile an unresolved action on a known date.\n */\n const deadline = BigInt(Math.floor(startedAtMs / 1000) + GASLESS_SIGNATURE_LIFETIME_SECONDS);\n\n /**\n * One key per user action. A caller-owned key is reused on every attempt of\n * that action, so the service accepts the action at most once; without one,\n * the SDK generates a key that describes this attempt alone.\n */\n const callerOwnedKey = options.idempotencyKey !== undefined;\n const idempotencyKey = resolveGaslessIdempotencyKey(options.idempotencyKey);\n const streamKey = gaslessInstantNonceStreamKey(chainId, resolvedSignerAccount);\n\n /** This config already saw an attempt under the same key accepted: follow that request instead of signing again. */\n if (callerOwnedKey) {\n const earlier = getGaslessPendingAcceptance(config, [streamKey], idempotencyKey);\n if (earlier) return followGaslessWrite(config, write, earlier.requestId);\n }\n\n await assertGaslessGatewayCoherence(config, chainId, gasless);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n /**\n * Delegation pre-flight, before any signature prompt. Without it a session key\n * that was never granted a selector still signs, the relayer still accepts,\n * and the InstantLayer reverts on-chain — the user pays a prompt for a write\n * that could never land.\n */\n if (execution.preflightDelegation ?? true) {\n const missing = await findUndelegatedGaslessSelectors(config, {\n chainId,\n signer: walletClient.account.address,\n signerAccount: resolvedSignerAccount,\n selectors: calls.flatMap((call) => getEffectiveInstantSelectors(call.callData)),\n });\n if (missing.length > 0) {\n return {\n kind: \"refused\",\n accepted: false,\n error: new SymmError(\n \"validation\",\n \"GASLESS_SIGNER_NOT_DELEGATED\",\n `Gasless: signer ${walletClient.account.address} holds no active InstantLayer delegation from sub-account ${resolvedSignerAccount} for selector(s) ${missing.join(\", \")}. Grant them to the session key (the selector set is built by getSessionKeySelectors) or sign this write with the sub-account's owner.`,\n ),\n };\n }\n }\n\n const domain = getInstantLayerEip712Domain(config, { chainId });\n\n /**\n * The lock spans read-sign-submit only. Holding it across the broadcast wait\n * would stall every later write behind one slow relay; instead the signed\n * nonce is recorded on the stream and the next caller waits for it lazily.\n */\n const submitted = await withGaslessNonceLock(config, streamKey, async (): Promise<GaslessDispatchSubmit> => {\n /**\n * Fresh sequential nonces, read inside the lock, immediately before signing.\n * A retry under the same caller-owned key does not wait for its own earlier\n * submit: the service accepts the key at most once.\n */\n const currentNonce = await readGaslessStreamNonce(\n config,\n streamKey,\n () => getInstantLayerNonce(config, { chainId, account: resolvedSignerAccount }),\n callerOwnedKey ? idempotencyKey : undefined,\n );\n\n const operations = calls.map((call, index) =>\n buildSignedOperation({\n signer: walletClient.account.address,\n target: call.target,\n callData: call.callData,\n signerAccount: resolvedSignerAccount,\n deadline,\n nonce: currentNonce + BigInt(index + 1),\n }),\n );\n\n /**\n * Fee pre-flight before any signature prompt. Ordinary InstantLayer\n * operations always relay with wallet id 0.\n */\n if (execution.preflightFee ?? true) {\n try {\n await getGaslessFeeQuote(config, { chainId, operations: operations.map((operation) => ({ operation })) });\n } catch (err) {\n /** A definitive pre-acceptance rejection — nothing was signed, so a wallet retry is safe. */\n if (isGaslessFreeQuotaExhaustedError(err)) {\n return { kind: \"refused\", error: err, accepted: false };\n }\n /** A reverted quote or an unsupported GaslessLayer: the relay would fail the same way. */\n if (err instanceof SymmError) throw err;\n /**\n * Anything else is inconclusive: a transport or RPC failure of the quote\n * read itself, or an empty-data revert whose classifying read failed. The\n * relayer simulates the full transaction before accepting it, so signing\n * proceeds.\n */\n }\n }\n\n /**\n * The reads before this point count against the lifetime. When they used\n * nearly all of it (a stalled tab, a slow RPC), the signature could not land\n * after the prompt, so stop with nothing signed.\n */\n const remainingSeconds = Number(deadline) - Math.floor(Date.now() / 1000);\n if (remainingSeconds < GASLESS_MIN_SIGNING_WINDOW_SECONDS) {\n return {\n kind: \"refused\",\n accepted: false,\n error: new SymmError(\n \"validation\",\n \"GASLESS_SIGNATURE_WINDOW_EXPIRED\",\n `Gasless: this write started at ${new Date(startedAtMs).toISOString()} and its signature would expire in ${Math.max(remainingSeconds, 0)}s, too soon to sign and land it. Nothing was signed or sent; call the write again to start a new attempt.`,\n ),\n };\n }\n\n /** EIP-712 prompts — a user rejection propagates unwrapped, with no fallback. */\n const signatures: Hex[] = [];\n for (const operation of operations) {\n signatures.push(await signSignedOperation(operation, domain, walletClient));\n }\n\n /**\n * `userAddress` is the service's tracking identity, and the vendor asks for\n * a workflow to be persisted under its owner. The billing sub-account's\n * owner is that identity — the signer may be a session key that owns\n * nothing. An unreadable owner falls back to the signer rather than failing\n * a write over a tracking label.\n */\n const owner =\n (await getCachedGaslessAccountOwner(config, chainId, resolvedSignerAccount).catch(() => null)) ??\n walletClient.account.address;\n\n try {\n const receipt = await submitOnGaslessNonceStream(\n config,\n streamKey,\n {\n signedNonce: currentNonce + BigInt(operations.length),\n service: \"operations\",\n chainId,\n deadline,\n idempotencyKey,\n callerOwnedKey,\n },\n () =>\n relayInstantOperations(config, {\n chainId,\n operationType,\n userAddress: owner,\n accountId: resolvedSignerAccount,\n operations: operations.map((operation, index) => ({ operation, signature: signatures[index]! })),\n idempotencyKey,\n }),\n blocksGaslessNonceStream,\n );\n return { receipt, owner };\n } catch (err) {\n /**\n * The two fallback predicates already exclude everything ambiguous, but\n * the rule this guard encodes is the one that must never be re-derived\n * wrong: an unconfirmed submit, an idempotency conflict and a `2xx` from\n * the wrong instance all describe a request that may be executing right\n * now. Paying for the same intent from the wallet would double-execute\n * it, so they end the write here whatever `fallback` says.\n */\n const mayBeExecuting =\n getGaslessUnconfirmedSubmit(err) !== null ||\n isGaslessIdempotencyConflictError(err) ||\n isGaslessAcceptedInstanceMismatchError(err);\n const canFallBack =\n !mayBeExecuting && (isConfirmedGaslessFeeLimitError(err) || isConfirmedGaslessUnavailableError(err));\n if (canFallBack) return { kind: \"refused\", error: err, accepted: false };\n throw err;\n }\n });\n\n if (\"kind\" in submitted) return submitted;\n const { receipt, owner } = submitted;\n\n fireGaslessEvent(execution.onEvent, {\n type: \"accepted\",\n requestId: receipt.requestId,\n service: \"operations\",\n chainId,\n protocolInstance: gasless.protocolInstance ?? null,\n operationType,\n idempotencyKey: receipt.idempotencyKey,\n owner,\n walletIds: receipt.walletIds,\n });\n\n return followGaslessWrite(config, write, receipt.requestId);\n}\n\n/**\n * Follow an accepted request to its first broadcast and return that hash.\n *\n * The hash is registered so a receipt wait can follow the request rather than\n * a hash the relayer may replace. A request that ends without any broadcast\n * throws its terminal error, except a confirmed fee or quota rejection, which\n * is returned as an accepted refusal.\n */\nasync function followGaslessWrite(\n config: Config,\n write: ResolvedGaslessWrite,\n requestId: string,\n): Promise<GaslessWriteResult> {\n const { chainId, gasless, options, execution } = write;\n const events = execution.onEvent;\n\n const record = await waitForGaslessRequest(config, {\n chainId,\n requestId,\n until: \"broadcast\",\n timeoutMs: options.broadcastTimeoutMs ?? execution.broadcastTimeoutMs,\n queuedPollMs: execution.queuedPollMs,\n submittedPollMs: execution.submittedPollMs,\n signal: options.signal,\n onUpdate: (update) => {\n if (update.txHash)\n fireGaslessEvent(events, { type: \"broadcast\", requestId: update.requestId, txHash: update.txHash, chainId });\n },\n });\n\n if (record.txHash !== null) {\n /**\n * The hash the write is about to return is only the *first* broadcast — the\n * relayer replaces it on a gas bump or a stuck nonce. Registering it here is\n * what lets the caller's receipt wait follow the request instead of a hash\n * that may never mine (`getGaslessWriteRequest`).\n */\n registerGaslessWriteRequest(config, {\n requestId: record.requestId,\n service: \"operations\",\n chainId,\n protocolInstance: gasless.protocolInstance ?? null,\n broadcastHash: record.txHash,\n });\n return { kind: \"broadcast\", hash: record.txHash };\n }\n\n /** Terminal without a broadcast: rejected or failed before any transaction. */\n fireGaslessEvent(events, {\n type: \"terminal\",\n requestId: record.requestId,\n status: record.status,\n txHash: record.txHash,\n chainId,\n });\n\n const terminalError = new SymmApiError({\n code: record.status === GaslessRequestStatus.REJECTED ? \"GASLESS_RELAY_REJECTED\" : \"GASLESS_RELAY_FAILED\",\n message: `Gasless: request ${record.requestId} ended ${record.status} before any broadcast${record.errorMessage ? ` — ${record.errorMessage}` : \"\"}.`,\n status: 200,\n statusText: \"OK\",\n responseData: toGaslessRecordBody(record),\n url: gasless.url,\n method: \"GET\",\n });\n\n /** A confirmed fee/quota rejection never broadcast — the one post-202 wallet fallback. */\n if (isConfirmedGaslessFeeLimitError(terminalError)) return { kind: \"refused\", error: terminalError, accepted: true };\n throw terminalError;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAqC;AAG3C,eAAsB,EACpB,GACA,GACA,GAM6B;CAC7B,IAAM,EAAE,YAAS,YAAS,YAAS,cAAW,SAAS,GAAuB,kBAAe,aAAU,GACjG,EAAE,SAAM,mBAAgB,GAQxB,IAAW,OAAO,KAAK,MAAM,IAAc,GAAI,IAAI,CAAkC,GAOrF,IAAiB,EAAQ,mBAAmB,KAAA,GAC5C,IAAiB,EAA6B,EAAQ,cAAc,GACpE,IAAY,EAA6B,GAAS,CAAqB;CAG7E,IAAI,GAAgB;EAClB,IAAM,IAAU,EAA4B,GAAQ,CAAC,CAAS,GAAG,CAAc;EAC/E,IAAI,GAAS,OAAO,EAAmB,GAAQ,GAAO,EAAQ,SAAS;CACzE;CAEA,MAAM,EAA8B,GAAQ,GAAS,CAAO;CAC5D,IAAM,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAQnE,IAAI,EAAU,uBAAuB,IAAM;EACzC,IAAM,IAAU,MAAM,EAAgC,GAAQ;GAC5D;GACA,QAAQ,EAAa,QAAQ;GAC7B,eAAe;GACf,WAAW,EAAM,SAAS,MAAS,EAA6B,EAAK,QAAQ,CAAC;EAChF,CAAC;EACD,IAAI,EAAQ,SAAS,GACnB,OAAO;GACL,MAAM;GACN,UAAU;GACV,OAAO,IAAI,EACT,cACA,gCACA,mBAAmB,EAAa,QAAQ,QAAQ,4DAA4D,EAAsB,mBAAmB,EAAQ,KAAK,IAAI,EAAE,uIAC1K;EACF;CAEJ;CAEA,IAAM,IAAS,EAA4B,GAAQ,EAAE,WAAQ,CAAC,GAOxD,IAAY,MAAM,EAAqB,GAAQ,GAAW,YAA4C;EAM1G,IAAM,IAAe,MAAM,EACzB,GACA,SACM,EAAqB,GAAQ;GAAE;GAAS,SAAS;EAAsB,CAAC,GAC9E,IAAiB,IAAiB,KAAA,CACpC,GAEM,IAAa,EAAM,KAAK,GAAM,MAClC,EAAqB;GACnB,QAAQ,EAAa,QAAQ;GAC7B,QAAQ,EAAK;GACb,UAAU,EAAK;GACf,eAAe;GACf;GACA,OAAO,IAAe,OAAO,IAAQ,CAAC;EACxC,CAAC,CACH;EAMA,IAAI,EAAU,gBAAgB,IAC5B,IAAI;GACF,MAAM,EAAmB,GAAQ;IAAE;IAAS,YAAY,EAAW,KAAK,OAAe,EAAE,aAAU,EAAE;GAAE,CAAC;EAC1G,SAAS,GAAK;GAEZ,IAAI,EAAiC,CAAG,GACtC,OAAO;IAAE,MAAM;IAAW,OAAO;IAAK,UAAU;GAAM;GAGxD,IAAI,aAAe,GAAW,MAAM;EAOtC;EAQF,IAAM,IAAmB,OAAO,CAAQ,IAAI,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;EACxE,IAAI,IAAmB,GACrB,OAAO;GACL,MAAM;GACN,UAAU;GACV,OAAO,IAAI,EACT,cACA,oCACA,kCAAkC,IAAI,KAAK,CAAW,EAAE,YAAY,EAAE,qCAAqC,KAAK,IAAI,GAAkB,CAAC,EAAE,0GAC3I;EACF;EAIF,IAAM,IAAoB,CAAC;EAC3B,KAAK,IAAM,KAAa,GACtB,EAAW,KAAK,MAAM,EAAoB,GAAW,GAAQ,CAAY,CAAC;EAU5E,IAAM,IACH,MAAM,EAA6B,GAAQ,GAAS,CAAqB,EAAE,YAAY,IAAI,KAC5F,EAAa,QAAQ;EAEvB,IAAI;GAuBF,OAAO;IAAE,SAAA,MAtBa,EACpB,GACA,GACA;KACE,aAAa,IAAe,OAAO,EAAW,MAAM;KACpD,SAAS;KACT;KACA;KACA;KACA;IACF,SAEE,EAAuB,GAAQ;KAC7B;KACA;KACA,aAAa;KACb,WAAW;KACX,YAAY,EAAW,KAAK,GAAW,OAAW;MAAE;MAAW,WAAW,EAAW;KAAQ,EAAE;KAC/F;IACF,CAAC,GACH,CACF;IACkB;GAAM;EAC1B,SAAS,GAAK;GAeZ,IADE,EAJA,EAA4B,CAAG,MAAM,QACrC,EAAkC,CAAG,KACrC,EAAuC,CAAG,OAEtB,EAAgC,CAAG,KAAK,EAAmC,CAAG,IACnF,OAAO;IAAE,MAAM;IAAW,OAAO;IAAK,UAAU;GAAM;GACvE,MAAM;EACR;CACF,CAAC;CAED,IAAI,UAAU,GAAW,OAAO;CAChC,IAAM,EAAE,YAAS,aAAU;CAc3B,OAZA,EAAiB,EAAU,SAAS;EAClC,MAAM;EACN,WAAW,EAAQ;EACnB,SAAS;EACT;EACA,kBAAkB,EAAQ,oBAAoB;EAC9C;EACA,gBAAgB,EAAQ;EACxB;EACA,WAAW,EAAQ;CACrB,CAAC,GAEM,EAAmB,GAAQ,GAAO,EAAQ,SAAS;AAC5D;AAUA,eAAe,EACb,GACA,GACA,GAC6B;CAC7B,IAAM,EAAE,YAAS,YAAS,YAAS,iBAAc,GAC3C,IAAS,EAAU,SAEnB,IAAS,MAAM,EAAsB,GAAQ;EACjD;EACA;EACA,OAAO;EACP,WAAW,EAAQ,sBAAsB,EAAU;EACnD,cAAc,EAAU;EACxB,iBAAiB,EAAU;EAC3B,QAAQ,EAAQ;EAChB,WAAW,MAAW;GACpB,AAAI,EAAO,UACT,EAAiB,GAAQ;IAAE,MAAM;IAAa,WAAW,EAAO;IAAW,QAAQ,EAAO;IAAQ;GAAQ,CAAC;EAC/G;CACF,CAAC;CAED,IAAI,EAAO,WAAW,MAcpB,OAPA,EAA4B,GAAQ;EAClC,WAAW,EAAO;EAClB,SAAS;EACT;EACA,kBAAkB,EAAQ,oBAAoB;EAC9C,eAAe,EAAO;CACxB,CAAC,GACM;EAAE,MAAM;EAAa,MAAM,EAAO;CAAO;CAIlD,EAAiB,GAAQ;EACvB,MAAM;EACN,WAAW,EAAO;EAClB,QAAQ,EAAO;EACf,QAAQ,EAAO;EACf;CACF,CAAC;CAED,IAAM,IAAgB,IAAI,EAAa;EACrC,MAAM,EAAO,WAAW,EAAqB,WAAW,2BAA2B;EACnF,SAAS,oBAAoB,EAAO,UAAU,SAAS,EAAO,OAAO,uBAAuB,EAAO,eAAe,MAAM,EAAO,iBAAiB,GAAG;EACnJ,QAAQ;EACR,YAAY;EACZ,cAAc,EAAoB,CAAM;EACxC,KAAK,EAAQ;EACb,QAAQ;CACV,CAAC;CAGD,IAAI,EAAgC,CAAa,GAAG,OAAO;EAAE,MAAM;EAAW,OAAO;EAAe,UAAU;CAAK;CACnH,MAAM;AACR"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Address, Hash, Hex } from 'viem';
|
|
2
|
+
import { GaslessExecutionConfig, SymmioGaslessConfig } from '../../core/chains/types.js';
|
|
3
|
+
import { GaslessWriteOptions } from '../../shared/types/properties.js';
|
|
4
|
+
/** One ordered call carried by an InstantLayer write. @internal */
|
|
5
|
+
export interface GaslessDispatchCall {
|
|
6
|
+
target: Address;
|
|
7
|
+
callData: Hex;
|
|
8
|
+
}
|
|
9
|
+
/** The action's billing-account source; an explicit gasless.account always wins. @internal */
|
|
10
|
+
export type GaslessBillingAccount = {
|
|
11
|
+
kind: "explicit";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "subaccount";
|
|
14
|
+
account: Address;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "virtual-account";
|
|
17
|
+
account: Address;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "account-or-virtual-account";
|
|
20
|
+
account: Address;
|
|
21
|
+
};
|
|
22
|
+
/** Relay settings and identity resolved once before selecting a signer. @internal */
|
|
23
|
+
export interface ResolvedGaslessWrite {
|
|
24
|
+
chainId: number;
|
|
25
|
+
gasless: SymmioGaslessConfig;
|
|
26
|
+
options: GaslessWriteOptions;
|
|
27
|
+
execution: GaslessExecutionConfig;
|
|
28
|
+
fallback: "error" | "wallet";
|
|
29
|
+
account: Address;
|
|
30
|
+
operationType: string;
|
|
31
|
+
calls: readonly GaslessDispatchCall[];
|
|
32
|
+
}
|
|
33
|
+
/** Only proven refusals are returned; ambiguous submissions and other failures throw. @internal */
|
|
34
|
+
export type GaslessWriteResult = {
|
|
35
|
+
kind: "broadcast";
|
|
36
|
+
hash: Hash;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "refused";
|
|
39
|
+
error: unknown;
|
|
40
|
+
accepted: boolean;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/gasless/dispatch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC;CACf;AAED,8FAA8F;AAC9F,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,4BAA4B,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7D,qFAAqF;AACrF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,EAAE,sBAAsB,CAAC;IAClC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACvC;AAED,mGAAmG;AACnG,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the InstantLayer delegation authority exercised by one AccountLayer call.
|
|
4
|
+
* `executeTimelockOp` is transparent for delegation: the permission belongs to
|
|
5
|
+
* its immediate inner AccountLayer entry point (`_call` for Core operations),
|
|
6
|
+
* not to the outer wrapper or the raw Core selector.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function getEffectiveInstantSelectors(callData: Hex): readonly Hex[];
|
|
11
|
+
//# sourceMappingURL=effective-instant-selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effective-instant-selectors.d.ts","sourceRoot":"","sources":["../../src/gasless/effective-instant-selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAOlF;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,GAAG,GAAG,SAAS,GAAG,EAAE,CAgB1E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { accountLayerAbi as e } from "../symmio-contracts/abi/v0.8.6/account-layer.js";
|
|
2
|
+
import { decodeFunctionData as t, sliceHex as n, toFunctionSelector as r } from "viem";
|
|
3
|
+
//#region src/gasless/effective-instant-selectors.ts
|
|
4
|
+
var i = r(e.find((e) => e.type === "function" && e.name === "executeTimelockOp")).toLowerCase();
|
|
5
|
+
function a(r) {
|
|
6
|
+
let a = r;
|
|
7
|
+
for (;;) {
|
|
8
|
+
let r = n(a, 0, 4).toLowerCase();
|
|
9
|
+
if (r !== i) return [r];
|
|
10
|
+
try {
|
|
11
|
+
let n = t({
|
|
12
|
+
abi: e,
|
|
13
|
+
data: a
|
|
14
|
+
});
|
|
15
|
+
if (n.functionName !== "executeTimelockOp") return [r];
|
|
16
|
+
a = n.args[1];
|
|
17
|
+
} catch {
|
|
18
|
+
return [r];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as getEffectiveInstantSelectors };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=effective-instant-selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effective-instant-selectors.js","names":[],"sources":["../../src/gasless/effective-instant-selectors.ts"],"sourcesContent":["import { decodeFunctionData, sliceHex, toFunctionSelector, type Hex } from \"viem\";\nimport { accountLayerAbi } from \"../symmio-contracts/abi/v0.8.6/account-layer\";\n\nconst EXECUTE_TIMELOCK_SELECTOR = toFunctionSelector(\n accountLayerAbi.find((item) => item.type === \"function\" && item.name === \"executeTimelockOp\")!,\n).toLowerCase() as Hex;\n\n/**\n * Resolve the InstantLayer delegation authority exercised by one AccountLayer call.\n * `executeTimelockOp` is transparent for delegation: the permission belongs to\n * its immediate inner AccountLayer entry point (`_call` for Core operations),\n * not to the outer wrapper or the raw Core selector.\n *\n * @internal\n */\nexport function getEffectiveInstantSelectors(callData: Hex): readonly Hex[] {\n let current = callData;\n for (;;) {\n const selector = sliceHex(current, 0, 4).toLowerCase() as Hex;\n if (selector !== EXECUTE_TIMELOCK_SELECTOR) return [selector];\n try {\n const decoded = decodeFunctionData({ abi: accountLayerAbi, data: current });\n if (decoded.functionName !== \"executeTimelockOp\") return [selector];\n current = decoded.args[1];\n } catch {\n // Malformed calldata will be rejected later by normal encoding/simulation.\n // Keeping the current selector avoids granting authority inferred from\n // bytes that could not be decoded canonically.\n return [selector];\n }\n }\n}\n"],"mappings":";;;AAGA,IAAM,IAA4B,EAChC,EAAgB,MAAM,MAAS,EAAK,SAAS,cAAc,EAAK,SAAS,mBAAmB,CAC9F,EAAE,YAAY;AAUd,SAAgB,EAA6B,GAA+B;CAC1E,IAAI,IAAU;CACd,SAAS;EACP,IAAM,IAAW,EAAS,GAAS,GAAG,CAAC,EAAE,YAAY;EACrD,IAAI,MAAa,GAA2B,OAAO,CAAC,CAAQ;EAC5D,IAAI;GACF,IAAM,IAAU,EAAmB;IAAE,KAAK;IAAiB,MAAM;GAAQ,CAAC;GAC1E,IAAI,EAAQ,iBAAiB,qBAAqB,OAAO,CAAC,CAAQ;GAClE,IAAU,EAAQ,KAAK;EACzB,QAAQ;GAIN,OAAO,CAAC,CAAQ;EAClB;CACF;AACF"}
|
|
@@ -55,4 +55,47 @@ export declare function isConfirmedGaslessFeeLimitError(err: unknown): boolean;
|
|
|
55
55
|
* @returns `true` for a pre-acceptance `429` or gateway `503`.
|
|
56
56
|
*/
|
|
57
57
|
export declare function isConfirmedGaslessUnavailableError(err: unknown): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the service refused this submit before it could execute: the daily
|
|
60
|
+
* free quota, the fee policy or allowance, or a confirmed outage before
|
|
61
|
+
* acceptance. It is the same rule the SDK applies before its own automatic
|
|
62
|
+
* wallet fallback, so a caller that decides the wallet path itself (a write
|
|
63
|
+
* with `gasless.idempotencyKey` never falls back on its own) applies the same
|
|
64
|
+
* rule.
|
|
65
|
+
*
|
|
66
|
+
* It describes this submit only. If you retried a key, a refusal does not prove
|
|
67
|
+
* that an earlier attempt under that key was refused, so never send a retried
|
|
68
|
+
* action through the wallet on this answer.
|
|
69
|
+
*
|
|
70
|
+
* @param error - Anything a gasless write or relay threw, including a React-wrapped error.
|
|
71
|
+
* @returns `true` when this submit did not and will not execute.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* if (isFirstAttempt && isConfirmedGaslessRefusalError(error)) {
|
|
76
|
+
* await createSubAccounts(config, { ...inputs, gasless: false });
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function isConfirmedGaslessRefusalError(error: unknown): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether a gasless request was accepted and then ended without any on-chain
|
|
83
|
+
* effect: `rejected` (refused by the service's worker before broadcast) or
|
|
84
|
+
* `reverted` (mined and reverted, with every operation and fee rolled back).
|
|
85
|
+
* The service does not try it again, so the action under its key did not
|
|
86
|
+
* happen.
|
|
87
|
+
*
|
|
88
|
+
* A `failed` request is deliberately excluded: the service lost track of it,
|
|
89
|
+
* and its transaction may still mine. Treat it as unresolved.
|
|
90
|
+
*
|
|
91
|
+
* @param error - Anything a gasless write, relay or confirmation threw, including a React-wrapped error.
|
|
92
|
+
* @returns `true` when the error's code is `GASLESS_RELAY_REJECTED` or `GASLESS_RELAY_REVERTED`
|
|
93
|
+
* and the request record it carries, when present, has the matching status.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* if (isGaslessRequestRejectedOrRevertedError(error)) await pendingActions.remove(key);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare function isGaslessRequestRejectedOrRevertedError(error: unknown): boolean;
|
|
58
101
|
//# sourceMappingURL=fallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/gasless/fallback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/gasless/fallback.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAqBrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIxE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMtE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uCAAuC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAW/E"}
|
package/dist/gasless/fallback.js
CHANGED
|
@@ -1,34 +1,44 @@
|
|
|
1
1
|
import { gaslessRevertText as e, parseGaslessErrorDetail as t } from "./errors.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { isGaslessFreeQuotaExhaustedError as n } from "./get-gasless-fee-quote/fee-quote-errors.js";
|
|
3
|
+
import { getGaslessUnconfirmedSubmit as r, readGaslessErrorCode as i, readGaslessErrorStatus as a } from "./unconfirmed-submit.js";
|
|
4
|
+
import { classifyGaslessHttpStatus as o } from "./http.js";
|
|
5
|
+
import { GaslessRequestStatus as s } from "./types.js";
|
|
5
6
|
//#region src/gasless/fallback.ts
|
|
6
|
-
var
|
|
7
|
+
var c = new Set(["FEE_POLICY_WOULD_REVERT", "INSUFFICIENT_ALLOWANCE"]), l = [
|
|
7
8
|
"OperationalFee:",
|
|
8
9
|
"DailyFreeOpsLimitExceeded",
|
|
9
10
|
"FeeLimitExceeded"
|
|
10
11
|
];
|
|
11
|
-
function
|
|
12
|
+
function u(t) {
|
|
12
13
|
let n = e(t);
|
|
13
|
-
return
|
|
14
|
+
return l.some((e) => n.includes(e));
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function d(e) {
|
|
16
17
|
let t = typeof e == "object" && e && "responseData" in e ? e.responseData : e;
|
|
17
18
|
return typeof t == "object" && t ? t.status : void 0;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
let
|
|
22
|
-
if (!
|
|
23
|
-
let
|
|
24
|
-
return
|
|
20
|
+
function f(e) {
|
|
21
|
+
if (r(e) !== null) return !1;
|
|
22
|
+
let n = t(e);
|
|
23
|
+
if (!n) return !1;
|
|
24
|
+
let i = a(e), o = n.code !== null && c.has(n.code);
|
|
25
|
+
return o && i !== void 0 && i >= 400 && i < 500 || n.code === "SIMULATION_REVERTED" && i === 400 && u(n) ? !0 : d(e) === s.REJECTED && (o || u(n));
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
let t =
|
|
27
|
+
function p(e) {
|
|
28
|
+
if (r(e) !== null) return !1;
|
|
29
|
+
let t = o(e);
|
|
29
30
|
return t === "rate-limited" || t === "gateway-not-ready";
|
|
30
31
|
}
|
|
32
|
+
function m(e) {
|
|
33
|
+
return n(e) || f(e) || p(e);
|
|
34
|
+
}
|
|
35
|
+
function h(e) {
|
|
36
|
+
let t = i(e), n = t === "GASLESS_RELAY_REJECTED" ? s.REJECTED : t === "GASLESS_RELAY_REVERTED" ? s.REVERTED : null;
|
|
37
|
+
if (n === null) return !1;
|
|
38
|
+
let r = d(e);
|
|
39
|
+
return r === void 0 || r === n;
|
|
40
|
+
}
|
|
31
41
|
//#endregion
|
|
32
|
-
export {
|
|
42
|
+
export { f as isConfirmedGaslessFeeLimitError, m as isConfirmedGaslessRefusalError, p as isConfirmedGaslessUnavailableError, h as isGaslessRequestRejectedOrRevertedError };
|
|
33
43
|
|
|
34
44
|
//# sourceMappingURL=fallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.js","names":[],"sources":["../../src/gasless/fallback.ts"],"sourcesContent":["import { gaslessRevertText, parseGaslessErrorDetail, type GaslessErrorDetail } from \"./errors\";\nimport { classifyGaslessHttpStatus } from \"./http\";\nimport { GaslessRequestStatus } from \"./types\";\nimport { getGaslessUnconfirmedSubmit, readGaslessErrorStatus } from \"./unconfirmed-submit\";\n\n/**\n * Vendor codes that mean the gateway's **fee policy** refused the request —\n * daily free quota exhausted, selector blocked, or an insufficient\n * operational-fee allowance.\n */\nconst GASLESS_FEE_LIMIT_CODES = new Set([\"FEE_POLICY_WOULD_REVERT\", \"INSUFFICIENT_ALLOWANCE\"]);\n\n/**\n * Revert fragments that identify a **billing-only** simulation failure: the\n * batch itself simulates, and only the fee charge does not.\n *\n * `OperationalFee:` is the GaslessLayer's require-string prefix (balance and\n * allowance shortfalls), `DailyFreeOpsLimitExceeded` is the free-quota revert,\n * and `FeeLimitExceeded` is the caller's own fee cap. Nothing else in a\n * `SIMULATION_REVERTED` is safe to treat this way: an ordinary revert means the\n * operation would have failed on-chain too, and retrying it through the wallet\n * only burns gas on the same revert.\n */\nconst GASLESS_BILLING_REVERT_FRAGMENTS = [\"OperationalFee:\", \"DailyFreeOpsLimitExceeded\", \"FeeLimitExceeded\"];\n\nfunction isBillingRevert(detail: GaslessErrorDetail): boolean {\n const text = gaslessRevertText(detail);\n return GASLESS_BILLING_REVERT_FRAGMENTS.some((fragment) => text.includes(fragment));\n}\n\n/** The stored workflow status of a record that rides inside an error, if any. */\nfunction recordStatus(err: unknown): unknown {\n const body = typeof err === \"object\" && err !== null && \"responseData\" in err ? err.responseData : err;\n return typeof body === \"object\" && body !== null ? (body as { status?: unknown }).status : undefined;\n}\n\n/**\n * Whether an error is a **definitive fee/quota rejection** — the relay refused\n * the request before any broadcast because the billing account hit its daily\n * quota, lacks allowance, or cannot cover the fee. One of only two situations\n * where a wallet-paid retry of the same intent is safe.\n *\n * Three shapes qualify, all of them pre-broadcast:\n *\n * - a fee code (`FEE_POLICY_WOULD_REVERT` / `INSUFFICIENT_ALLOWANCE`) on any\n * `4xx` — the service answered with a verdict, and a `4xx` is by definition\n * not an acceptance;\n * - a `400 SIMULATION_REVERTED` whose decoded revert is **billing-specific**\n * (`OperationalFee: …`, `DailyFreeOpsLimitExceeded`, `FeeLimitExceeded`) —\n * the operation simulates, only the charge does not;\n * - a stored record that ended `rejected` carrying either of those — the worker\n * refused it before any broadcast.\n *\n * A matching code on an ambiguous transport failure never qualifies, and\n * neither does an unconfirmed submit: the request may still execute.\n *\n * @param err - Anything caught from a gasless submit, or a polled record error.\n * @returns `true` only for a confirmed pre-broadcast fee/quota rejection.\n *\n * @example\n * ```ts\n * if (isConfirmedGaslessFeeLimitError(err)) await payFromWallet();\n * ```\n */\nexport function isConfirmedGaslessFeeLimitError(err: unknown): boolean {\n /** An unconfirmed submit may be executing, whatever the last status said. */\n if (getGaslessUnconfirmedSubmit(err) !== null) return false;\n\n const detail = parseGaslessErrorDetail(err);\n if (!detail) return false;\n const status = readGaslessErrorStatus(err);\n const feeCode = detail.code !== null && GASLESS_FEE_LIMIT_CODES.has(detail.code);\n\n /** Any `4xx` is a verdict the service reached before accepting anything. */\n if (feeCode && status !== undefined && status >= 400 && status < 500) return true;\n if (detail.code === \"SIMULATION_REVERTED\" && status === 400 && isBillingRevert(detail)) return true;\n\n /**\n * A `rejected` terminal surfaced after acceptance: the workflow record rides\n * in `responseData` (manually-constructed SymmApiError) or the value itself\n * is a record. `rejected` means the worker refused it before any broadcast,\n * so a wallet retry cannot double-execute — but only a billing cause makes\n * retrying it from the wallet sensible rather than a second guaranteed revert.\n */\n return recordStatus(err) === GaslessRequestStatus.REJECTED && (feeCode || isBillingRevert(detail));\n}\n\n/**\n * Whether an error means the gasless relay is **definitively unavailable** —\n * the gateway refused the request itself, before any service saw it, so\n * nothing was accepted and nothing can execute.\n *\n * Exactly two statuses qualify: `429` (rate limited, dropped at the gateway)\n * and a `503` carrying the gateway's own `{ error }` envelope (its\n * configuration is not ready). Both are reported only after the SDK's own\n * same-key retries are exhausted, and only when no attempt of that submit was\n * ambiguous: a refusal of the resend says nothing about the attempt before it,\n * so the SDK reports that submit as `GASLESS_SUBMIT_UNCONFIRMED` instead.\n *\n * **`0`, `502`, `504`, a timeout and a bare `503` never qualify**, however much\n * they look like an outage: the request may have reached the service and been\n * accepted, and a wallet-paid retry would then execute the same intent twice.\n * Those surface as `GASLESS_SUBMIT_UNCONFIRMED` instead — replay them with\n * `resubmitGaslessRequest`. A gateway `404` does not qualify either: it names\n * an unknown or disabled instance, which is a configuration error that a wallet\n * retry papers over.\n *\n * Callers must still pair this with a not-yet-accepted guard: after a `202` the\n * workflow exists server-side, and even a `404` while polling (the\n * accept-vs-record race) must never trigger a wallet-paid retry.\n *\n * @param err - Anything caught from a gasless submit.\n * @returns `true` for a pre-acceptance `429` or gateway `503`.\n */\nexport function isConfirmedGaslessUnavailableError(err: unknown): boolean {\n if (getGaslessUnconfirmedSubmit(err) !== null) return false;\n const failure = classifyGaslessHttpStatus(err);\n return failure === \"rate-limited\" || failure === \"gateway-not-ready\";\n}\n"],"mappings":";;;;;AAUA,IAAM,IAA0B,IAAI,IAAI,CAAC,2BAA2B,wBAAwB,CAAC,GAavF,IAAmC;CAAC;CAAmB;CAA6B;AAAkB;AAE5G,SAAS,EAAgB,GAAqC;CAC5D,IAAM,IAAO,EAAkB,CAAM;CACrC,OAAO,EAAiC,MAAM,MAAa,EAAK,SAAS,CAAQ,CAAC;AACpF;AAGA,SAAS,EAAa,GAAuB;CAC3C,IAAM,IAAO,OAAO,KAAQ,YAAY,KAAgB,kBAAkB,IAAM,EAAI,eAAe;CACnG,OAAO,OAAO,KAAS,YAAY,IAAiB,EAA8B,SAAS,KAAA;AAC7F;AA8BA,SAAgB,EAAgC,GAAuB;CAErE,IAAI,EAA4B,CAAG,MAAM,MAAM,OAAO;CAEtD,IAAM,IAAS,EAAwB,CAAG;CAC1C,IAAI,CAAC,GAAQ,OAAO;CACpB,IAAM,IAAS,EAAuB,CAAG,GACnC,IAAU,EAAO,SAAS,QAAQ,EAAwB,IAAI,EAAO,IAAI;CAa/E,OAVI,KAAW,MAAW,KAAA,KAAa,KAAU,OAAO,IAAS,OAC7D,EAAO,SAAS,yBAAyB,MAAW,OAAO,EAAgB,CAAM,IAAU,KASxF,EAAa,CAAG,MAAM,EAAqB,aAAa,KAAW,EAAgB,CAAM;AAClG;AA6BA,SAAgB,EAAmC,GAAuB;CACxE,IAAI,EAA4B,CAAG,MAAM,MAAM,OAAO;CACtD,IAAM,IAAU,EAA0B,CAAG;CAC7C,OAAO,MAAY,kBAAkB,MAAY;AACnD"}
|
|
1
|
+
{"version":3,"file":"fallback.js","names":[],"sources":["../../src/gasless/fallback.ts"],"sourcesContent":["import { gaslessRevertText, parseGaslessErrorDetail, type GaslessErrorDetail } from \"./errors\";\nimport { isGaslessFreeQuotaExhaustedError } from \"./get-gasless-fee-quote/fee-quote-errors\";\nimport { classifyGaslessHttpStatus } from \"./http\";\nimport { GaslessRequestStatus } from \"./types\";\nimport { getGaslessUnconfirmedSubmit, readGaslessErrorCode, readGaslessErrorStatus } from \"./unconfirmed-submit\";\n\n/**\n * Vendor codes that mean the gateway's **fee policy** refused the request —\n * daily free quota exhausted, selector blocked, or an insufficient\n * operational-fee allowance.\n */\nconst GASLESS_FEE_LIMIT_CODES = new Set([\"FEE_POLICY_WOULD_REVERT\", \"INSUFFICIENT_ALLOWANCE\"]);\n\n/**\n * Revert fragments that identify a **billing-only** simulation failure: the\n * batch itself simulates, and only the fee charge does not.\n *\n * `OperationalFee:` is the GaslessLayer's require-string prefix (balance and\n * allowance shortfalls), `DailyFreeOpsLimitExceeded` is the free-quota revert,\n * and `FeeLimitExceeded` is the caller's own fee cap. Nothing else in a\n * `SIMULATION_REVERTED` is safe to treat this way: an ordinary revert means the\n * operation would have failed on-chain too, and retrying it through the wallet\n * only burns gas on the same revert.\n */\nconst GASLESS_BILLING_REVERT_FRAGMENTS = [\"OperationalFee:\", \"DailyFreeOpsLimitExceeded\", \"FeeLimitExceeded\"];\n\nfunction isBillingRevert(detail: GaslessErrorDetail): boolean {\n const text = gaslessRevertText(detail);\n return GASLESS_BILLING_REVERT_FRAGMENTS.some((fragment) => text.includes(fragment));\n}\n\n/** The stored workflow status of a record that rides inside an error, if any. */\nfunction recordStatus(err: unknown): unknown {\n const body = typeof err === \"object\" && err !== null && \"responseData\" in err ? err.responseData : err;\n return typeof body === \"object\" && body !== null ? (body as { status?: unknown }).status : undefined;\n}\n\n/**\n * Whether an error is a **definitive fee/quota rejection** — the relay refused\n * the request before any broadcast because the billing account hit its daily\n * quota, lacks allowance, or cannot cover the fee. One of only two situations\n * where a wallet-paid retry of the same intent is safe.\n *\n * Three shapes qualify, all of them pre-broadcast:\n *\n * - a fee code (`FEE_POLICY_WOULD_REVERT` / `INSUFFICIENT_ALLOWANCE`) on any\n * `4xx` — the service answered with a verdict, and a `4xx` is by definition\n * not an acceptance;\n * - a `400 SIMULATION_REVERTED` whose decoded revert is **billing-specific**\n * (`OperationalFee: …`, `DailyFreeOpsLimitExceeded`, `FeeLimitExceeded`) —\n * the operation simulates, only the charge does not;\n * - a stored record that ended `rejected` carrying either of those — the worker\n * refused it before any broadcast.\n *\n * A matching code on an ambiguous transport failure never qualifies, and\n * neither does an unconfirmed submit: the request may still execute.\n *\n * @param err - Anything caught from a gasless submit, or a polled record error.\n * @returns `true` only for a confirmed pre-broadcast fee/quota rejection.\n *\n * @example\n * ```ts\n * if (isConfirmedGaslessFeeLimitError(err)) await payFromWallet();\n * ```\n */\nexport function isConfirmedGaslessFeeLimitError(err: unknown): boolean {\n /** An unconfirmed submit may be executing, whatever the last status said. */\n if (getGaslessUnconfirmedSubmit(err) !== null) return false;\n\n const detail = parseGaslessErrorDetail(err);\n if (!detail) return false;\n const status = readGaslessErrorStatus(err);\n const feeCode = detail.code !== null && GASLESS_FEE_LIMIT_CODES.has(detail.code);\n\n /** Any `4xx` is a verdict the service reached before accepting anything. */\n if (feeCode && status !== undefined && status >= 400 && status < 500) return true;\n if (detail.code === \"SIMULATION_REVERTED\" && status === 400 && isBillingRevert(detail)) return true;\n\n /**\n * A `rejected` terminal surfaced after acceptance: the workflow record rides\n * in `responseData` (manually-constructed SymmApiError) or the value itself\n * is a record. `rejected` means the worker refused it before any broadcast,\n * so a wallet retry cannot double-execute — but only a billing cause makes\n * retrying it from the wallet sensible rather than a second guaranteed revert.\n */\n return recordStatus(err) === GaslessRequestStatus.REJECTED && (feeCode || isBillingRevert(detail));\n}\n\n/**\n * Whether an error means the gasless relay is **definitively unavailable** —\n * the gateway refused the request itself, before any service saw it, so\n * nothing was accepted and nothing can execute.\n *\n * Exactly two statuses qualify: `429` (rate limited, dropped at the gateway)\n * and a `503` carrying the gateway's own `{ error }` envelope (its\n * configuration is not ready). Both are reported only after the SDK's own\n * same-key retries are exhausted, and only when no attempt of that submit was\n * ambiguous: a refusal of the resend says nothing about the attempt before it,\n * so the SDK reports that submit as `GASLESS_SUBMIT_UNCONFIRMED` instead.\n *\n * **`0`, `502`, `504`, a timeout and a bare `503` never qualify**, however much\n * they look like an outage: the request may have reached the service and been\n * accepted, and a wallet-paid retry would then execute the same intent twice.\n * Those surface as `GASLESS_SUBMIT_UNCONFIRMED` instead — replay them with\n * `resubmitGaslessRequest`. A gateway `404` does not qualify either: it names\n * an unknown or disabled instance, which is a configuration error that a wallet\n * retry papers over.\n *\n * Callers must still pair this with a not-yet-accepted guard: after a `202` the\n * workflow exists server-side, and even a `404` while polling (the\n * accept-vs-record race) must never trigger a wallet-paid retry.\n *\n * @param err - Anything caught from a gasless submit.\n * @returns `true` for a pre-acceptance `429` or gateway `503`.\n */\nexport function isConfirmedGaslessUnavailableError(err: unknown): boolean {\n if (getGaslessUnconfirmedSubmit(err) !== null) return false;\n const failure = classifyGaslessHttpStatus(err);\n return failure === \"rate-limited\" || failure === \"gateway-not-ready\";\n}\n\n/**\n * Whether the service refused this submit before it could execute: the daily\n * free quota, the fee policy or allowance, or a confirmed outage before\n * acceptance. It is the same rule the SDK applies before its own automatic\n * wallet fallback, so a caller that decides the wallet path itself (a write\n * with `gasless.idempotencyKey` never falls back on its own) applies the same\n * rule.\n *\n * It describes this submit only. If you retried a key, a refusal does not prove\n * that an earlier attempt under that key was refused, so never send a retried\n * action through the wallet on this answer.\n *\n * @param error - Anything a gasless write or relay threw, including a React-wrapped error.\n * @returns `true` when this submit did not and will not execute.\n *\n * @example\n * ```ts\n * if (isFirstAttempt && isConfirmedGaslessRefusalError(error)) {\n * await createSubAccounts(config, { ...inputs, gasless: false });\n * }\n * ```\n */\nexport function isConfirmedGaslessRefusalError(error: unknown): boolean {\n return (\n isGaslessFreeQuotaExhaustedError(error) ||\n isConfirmedGaslessFeeLimitError(error) ||\n isConfirmedGaslessUnavailableError(error)\n );\n}\n\n/**\n * Whether a gasless request was accepted and then ended without any on-chain\n * effect: `rejected` (refused by the service's worker before broadcast) or\n * `reverted` (mined and reverted, with every operation and fee rolled back).\n * The service does not try it again, so the action under its key did not\n * happen.\n *\n * A `failed` request is deliberately excluded: the service lost track of it,\n * and its transaction may still mine. Treat it as unresolved.\n *\n * @param error - Anything a gasless write, relay or confirmation threw, including a React-wrapped error.\n * @returns `true` when the error's code is `GASLESS_RELAY_REJECTED` or `GASLESS_RELAY_REVERTED`\n * and the request record it carries, when present, has the matching status.\n *\n * @example\n * ```ts\n * if (isGaslessRequestRejectedOrRevertedError(error)) await pendingActions.remove(key);\n * ```\n */\nexport function isGaslessRequestRejectedOrRevertedError(error: unknown): boolean {\n const code = readGaslessErrorCode(error);\n const expected =\n code === \"GASLESS_RELAY_REJECTED\"\n ? GaslessRequestStatus.REJECTED\n : code === \"GASLESS_RELAY_REVERTED\"\n ? GaslessRequestStatus.REVERTED\n : null;\n if (expected === null) return false;\n const status = recordStatus(error);\n return status === undefined || status === expected;\n}\n"],"mappings":";;;;;;AAWA,IAAM,IAA0B,IAAI,IAAI,CAAC,2BAA2B,wBAAwB,CAAC,GAavF,IAAmC;CAAC;CAAmB;CAA6B;AAAkB;AAE5G,SAAS,EAAgB,GAAqC;CAC5D,IAAM,IAAO,EAAkB,CAAM;CACrC,OAAO,EAAiC,MAAM,MAAa,EAAK,SAAS,CAAQ,CAAC;AACpF;AAGA,SAAS,EAAa,GAAuB;CAC3C,IAAM,IAAO,OAAO,KAAQ,YAAY,KAAgB,kBAAkB,IAAM,EAAI,eAAe;CACnG,OAAO,OAAO,KAAS,YAAY,IAAiB,EAA8B,SAAS,KAAA;AAC7F;AA8BA,SAAgB,EAAgC,GAAuB;CAErE,IAAI,EAA4B,CAAG,MAAM,MAAM,OAAO;CAEtD,IAAM,IAAS,EAAwB,CAAG;CAC1C,IAAI,CAAC,GAAQ,OAAO;CACpB,IAAM,IAAS,EAAuB,CAAG,GACnC,IAAU,EAAO,SAAS,QAAQ,EAAwB,IAAI,EAAO,IAAI;CAa/E,OAVI,KAAW,MAAW,KAAA,KAAa,KAAU,OAAO,IAAS,OAC7D,EAAO,SAAS,yBAAyB,MAAW,OAAO,EAAgB,CAAM,IAAU,KASxF,EAAa,CAAG,MAAM,EAAqB,aAAa,KAAW,EAAgB,CAAM;AAClG;AA6BA,SAAgB,EAAmC,GAAuB;CACxE,IAAI,EAA4B,CAAG,MAAM,MAAM,OAAO;CACtD,IAAM,IAAU,EAA0B,CAAG;CAC7C,OAAO,MAAY,kBAAkB,MAAY;AACnD;AAwBA,SAAgB,EAA+B,GAAyB;CACtE,OACE,EAAiC,CAAK,KACtC,EAAgC,CAAK,KACrC,EAAmC,CAAK;AAE5C;AAqBA,SAAgB,EAAwC,GAAyB;CAC/E,IAAM,IAAO,EAAqB,CAAK,GACjC,IACJ,MAAS,2BACL,EAAqB,WACrB,MAAS,2BACP,EAAqB,WACrB;CACR,IAAI,MAAa,MAAM,OAAO;CAC9B,IAAM,IAAS,EAAa,CAAK;CACjC,OAAO,MAAW,KAAA,KAAa,MAAW;AAC5C"}
|