@symmio/trading-core 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/chains/types.d.ts +197 -0
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core/chains/types.js.map +1 -1
- package/dist/core/config/merge-chain-config.d.ts.map +1 -1
- package/dist/core/config/merge-chain-config.js +49 -19
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/gasless/abortable-sleep.d.ts +17 -0
- package/dist/gasless/abortable-sleep.d.ts.map +1 -0
- package/dist/gasless/abortable-sleep.js +21 -0
- package/dist/gasless/abortable-sleep.js.map +1 -0
- package/dist/gasless/assert-gateway-coherence.d.ts +20 -0
- package/dist/gasless/assert-gateway-coherence.d.ts.map +1 -0
- package/dist/gasless/assert-gateway-coherence.js +26 -0
- package/dist/gasless/assert-gateway-coherence.js.map +1 -0
- package/dist/gasless/batch/calls.d.ts +121 -0
- package/dist/gasless/batch/calls.d.ts.map +1 -0
- package/dist/gasless/batch/calls.js +36 -0
- package/dist/gasless/batch/calls.js.map +1 -0
- package/dist/gasless/batch/index.d.ts +2 -0
- package/dist/gasless/batch/index.d.ts.map +1 -0
- package/dist/gasless/batch/resolve-gasless-batch.d.ts +118 -0
- package/dist/gasless/batch/resolve-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/batch/resolve-gasless-batch.js +89 -0
- package/dist/gasless/batch/resolve-gasless-batch.js.map +1 -0
- package/dist/gasless/classify-gasless-failure.d.ts +99 -0
- package/dist/gasless/classify-gasless-failure.d.ts.map +1 -0
- package/dist/gasless/classify-gasless-failure.js +60 -0
- package/dist/gasless/classify-gasless-failure.js.map +1 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts +121 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.d.ts.map +1 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js +73 -0
- package/dist/gasless/confirm-gasless-request/confirm-gasless-request.js.map +1 -0
- package/dist/gasless/confirm-gasless-request/index.d.ts +2 -0
- package/dist/gasless/confirm-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/constants.d.ts +24 -0
- package/dist/gasless/constants.d.ts.map +1 -0
- package/dist/gasless/constants.js +6 -0
- package/dist/gasless/constants.js.map +1 -0
- package/dist/gasless/delegation-preflight.d.ts +39 -0
- package/dist/gasless/delegation-preflight.d.ts.map +1 -0
- package/dist/gasless/delegation-preflight.js +33 -0
- package/dist/gasless/delegation-preflight.js.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts +73 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.d.ts.map +1 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js +189 -0
- package/dist/gasless/dispatch/maybe-relay-as-gasless.js.map +1 -0
- package/dist/gasless/eip712.d.ts +79 -0
- package/dist/gasless/eip712.d.ts.map +1 -0
- package/dist/gasless/eip712.js +60 -0
- package/dist/gasless/eip712.js.map +1 -0
- package/dist/gasless/errors.d.ts +132 -0
- package/dist/gasless/errors.d.ts.map +1 -0
- package/dist/gasless/errors.js +110 -0
- package/dist/gasless/errors.js.map +1 -0
- package/dist/gasless/events.d.ts +37 -0
- package/dist/gasless/events.d.ts.map +1 -0
- package/dist/gasless/events.js +34 -0
- package/dist/gasless/events.js.map +1 -0
- package/dist/gasless/fallback.d.ts +58 -0
- package/dist/gasless/fallback.d.ts.map +1 -0
- package/dist/gasless/fallback.js +34 -0
- package/dist/gasless/fallback.js.map +1 -0
- package/dist/gasless/format-gasless-operation.d.ts +37 -0
- package/dist/gasless/format-gasless-operation.d.ts.map +1 -0
- package/dist/gasless/format-gasless-operation.js +33 -0
- package/dist/gasless/format-gasless-operation.js.map +1 -0
- package/dist/gasless/gasless-url.d.ts +82 -0
- package/dist/gasless/gasless-url.d.ts.map +1 -0
- package/dist/gasless/gasless-url.js +70 -0
- package/dist/gasless/gasless-url.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/calls.d.ts +73 -0
- package/dist/gasless/gasless-wallet-execute/calls.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/calls.js +24 -0
- package/dist/gasless/gasless-wallet-execute/calls.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts +148 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js +120 -0
- package/dist/gasless/gasless-wallet-execute/gasless-wallet-execute.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/index.d.ts +5 -0
- package/dist/gasless/gasless-wallet-execute/index.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/query.d.ts +18 -0
- package/dist/gasless/gasless-wallet-execute/query.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/query.js +12 -0
- package/dist/gasless/gasless-wallet-execute/query.js.map +1 -0
- package/dist/gasless/gasless-wallet-execute/selectors.d.ts +38 -0
- package/dist/gasless/gasless-wallet-execute/selectors.d.ts.map +1 -0
- package/dist/gasless/gasless-wallet-execute/selectors.js +15 -0
- package/dist/gasless/gasless-wallet-execute/selectors.js.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts +72 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js +42 -0
- package/dist/gasless/get-gasless-batch-fee-quote/get-gasless-batch-fee-quote.js.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts +3 -0
- package/dist/gasless/get-gasless-batch-fee-quote/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts +47 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.js +50 -0
- package/dist/gasless/get-gasless-batch-fee-quote/query.js.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts +80 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js +61 -0
- package/dist/gasless/get-gasless-deposit-policy/get-gasless-deposit-policy.js.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/index.d.ts +3 -0
- package/dist/gasless/get-gasless-deposit-policy/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/query.d.ts +51 -0
- package/dist/gasless/get-gasless-deposit-policy/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-deposit-policy/query.js +25 -0
- package/dist/gasless/get-gasless-deposit-policy/query.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts +27 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js +22 -0
- package/dist/gasless/get-gasless-fee-quote/encode-relay-batch-call-data.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts +61 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js +59 -0
- package/dist/gasless/get-gasless-fee-quote/fee-quote-errors.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts +79 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js +53 -0
- package/dist/gasless/get-gasless-fee-quote/get-gasless-fee-quote.js.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/index.d.ts +4 -0
- package/dist/gasless/get-gasless-fee-quote/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/query.d.ts +41 -0
- package/dist/gasless/get-gasless-fee-quote/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-fee-quote/query.js +31 -0
- package/dist/gasless/get-gasless-fee-quote/query.js.map +1 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.d.ts +51 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.js +15 -0
- package/dist/gasless/get-gasless-request/get-gasless-request.js.map +1 -0
- package/dist/gasless/get-gasless-request/index.d.ts +4 -0
- package/dist/gasless/get-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/query.d.ts +64 -0
- package/dist/gasless/get-gasless-request/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/query.js +42 -0
- package/dist/gasless/get-gasless-request/query.js.map +1 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.d.ts +26 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.js +62 -0
- package/dist/gasless/get-gasless-request/to-gasless-request.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts +40 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js +15 -0
- package/dist/gasless/get-gasless-request-transactions/get-gasless-request-transactions.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/index.d.ts +4 -0
- package/dist/gasless/get-gasless-request-transactions/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/query.d.ts +75 -0
- package/dist/gasless/get-gasless-request-transactions/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/query.js +37 -0
- package/dist/gasless/get-gasless-request-transactions/query.js.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts +21 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.d.ts.map +1 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js +27 -0
- package/dist/gasless/get-gasless-request-transactions/to-gasless-request-transaction.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts +48 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js +20 -0
- package/dist/gasless/get-gasless-wallet-address/get-gasless-wallet-address.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-address/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/query.d.ts +46 -0
- package/dist/gasless/get-gasless-wallet-address/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-address/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-address/query.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts +57 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js +17 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/get-gasless-wallet-creation-fee.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts +51 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-creation-fee/query.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts +51 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js +21 -0
- package/dist/gasless/get-gasless-wallet-nonce/get-gasless-wallet-nonce.js.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/index.d.ts +3 -0
- package/dist/gasless/get-gasless-wallet-nonce/index.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.d.ts +47 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.d.ts.map +1 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.js +25 -0
- package/dist/gasless/get-gasless-wallet-nonce/query.js.map +1 -0
- package/dist/gasless/get-session-key-selectors.d.ts +83 -0
- package/dist/gasless/get-session-key-selectors.d.ts.map +1 -0
- package/dist/gasless/get-session-key-selectors.js +25 -0
- package/dist/gasless/get-session-key-selectors.js.map +1 -0
- package/dist/gasless/http.d.ts +229 -0
- package/dist/gasless/http.d.ts.map +1 -0
- package/dist/gasless/http.js +165 -0
- package/dist/gasless/http.js.map +1 -0
- package/dist/gasless/index.d.ts +34 -0
- package/dist/gasless/index.d.ts.map +1 -0
- package/dist/gasless/is-newer-gasless-request.d.ts +32 -0
- package/dist/gasless/is-newer-gasless-request.d.ts.map +1 -0
- package/dist/gasless/is-newer-gasless-request.js +21 -0
- package/dist/gasless/is-newer-gasless-request.js.map +1 -0
- package/dist/gasless/nonce-lock.d.ts +180 -0
- package/dist/gasless/nonce-lock.d.ts.map +1 -0
- package/dist/gasless/nonce-lock.js +102 -0
- package/dist/gasless/nonce-lock.js.map +1 -0
- package/dist/gasless/observe-gasless-request.d.ts +65 -0
- package/dist/gasless/observe-gasless-request.d.ts.map +1 -0
- package/dist/gasless/observe-gasless-request.js +56 -0
- package/dist/gasless/observe-gasless-request.js.map +1 -0
- package/dist/gasless/query-poll-delay.d.ts +39 -0
- package/dist/gasless/query-poll-delay.d.ts.map +1 -0
- package/dist/gasless/query-poll-delay.js +14 -0
- package/dist/gasless/query-poll-delay.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/index.d.ts +3 -0
- package/dist/gasless/relay-gasless-batch/index.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/query.d.ts +18 -0
- package/dist/gasless/relay-gasless-batch/query.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/query.js +12 -0
- package/dist/gasless/relay-gasless-batch/query.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts +106 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js +145 -0
- package/dist/gasless/relay-gasless-batch/relay-gasless-batch.js.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts +36 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.d.ts.map +1 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js +24 -0
- package/dist/gasless/relay-gasless-batch/sign-gasless-batch.js.map +1 -0
- package/dist/gasless/relay-grant-delegation/index.d.ts +3 -0
- package/dist/gasless/relay-grant-delegation/index.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/query.d.ts +18 -0
- package/dist/gasless/relay-grant-delegation/query.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/query.js +12 -0
- package/dist/gasless/relay-grant-delegation/query.js.map +1 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts +69 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.d.ts.map +1 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js +57 -0
- package/dist/gasless/relay-grant-delegation/relay-grant-delegation.js.map +1 -0
- package/dist/gasless/relay-instant-operations/index.d.ts +3 -0
- package/dist/gasless/relay-instant-operations/index.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/query.d.ts +18 -0
- package/dist/gasless/relay-instant-operations/query.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/query.js +12 -0
- package/dist/gasless/relay-instant-operations/query.js.map +1 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts +127 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.d.ts.map +1 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js +42 -0
- package/dist/gasless/relay-instant-operations/relay-instant-operations.js.map +1 -0
- package/dist/gasless/relayable-writes.d.ts +163 -0
- package/dist/gasless/relayable-writes.d.ts.map +1 -0
- package/dist/gasless/relayable-writes.js +113 -0
- package/dist/gasless/relayable-writes.js.map +1 -0
- package/dist/gasless/resolve-gasless.d.ts +52 -0
- package/dist/gasless/resolve-gasless.d.ts.map +1 -0
- package/dist/gasless/resolve-gasless.js +19 -0
- package/dist/gasless/resolve-gasless.js.map +1 -0
- package/dist/gasless/resolve-wallet-identities.d.ts +30 -0
- package/dist/gasless/resolve-wallet-identities.d.ts.map +1 -0
- package/dist/gasless/resolve-wallet-identities.js +21 -0
- package/dist/gasless/resolve-wallet-identities.js.map +1 -0
- package/dist/gasless/resubmit-gasless-request/index.d.ts +3 -0
- package/dist/gasless/resubmit-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/query.d.ts +19 -0
- package/dist/gasless/resubmit-gasless-request/query.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/query.js +12 -0
- package/dist/gasless/resubmit-gasless-request/query.js.map +1 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts +50 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.d.ts.map +1 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js +52 -0
- package/dist/gasless/resubmit-gasless-request/resubmit-gasless-request.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts +3 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/index.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts +18 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.js +12 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/query.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts +66 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js +36 -0
- package/dist/gasless/settle-gasless-deposit-existing-account/settle-gasless-deposit-existing-account.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts +3 -0
- package/dist/gasless/settle-gasless-deposit-new-account/index.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts +18 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.js +12 -0
- package/dist/gasless/settle-gasless-deposit-new-account/query.js.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts +106 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.d.ts.map +1 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js +43 -0
- package/dist/gasless/settle-gasless-deposit-new-account/settle-gasless-deposit-new-account.js.map +1 -0
- package/dist/gasless/status-read-limiter.d.ts +44 -0
- package/dist/gasless/status-read-limiter.d.ts.map +1 -0
- package/dist/gasless/status-read-limiter.js +28 -0
- package/dist/gasless/status-read-limiter.js.map +1 -0
- package/dist/gasless/to-gasless-deposit-receipt.d.ts +61 -0
- package/dist/gasless/to-gasless-deposit-receipt.d.ts.map +1 -0
- package/dist/gasless/to-gasless-deposit-receipt.js +36 -0
- package/dist/gasless/to-gasless-deposit-receipt.js.map +1 -0
- package/dist/gasless/to-gasless-submit-receipt.d.ts +60 -0
- package/dist/gasless/to-gasless-submit-receipt.d.ts.map +1 -0
- package/dist/gasless/to-gasless-submit-receipt.js +26 -0
- package/dist/gasless/to-gasless-submit-receipt.js.map +1 -0
- package/dist/gasless/transient-read.d.ts +32 -0
- package/dist/gasless/transient-read.d.ts.map +1 -0
- package/dist/gasless/transient-read.js +28 -0
- package/dist/gasless/transient-read.js.map +1 -0
- package/dist/gasless/types/generated/gasless-deposits.d.ts +170 -0
- package/dist/gasless/types/generated/gasless-deposits.d.ts.map +1 -0
- package/dist/gasless/types/generated/gasless-operations.d.ts +260 -0
- package/dist/gasless/types/generated/gasless-operations.d.ts.map +1 -0
- package/dist/gasless/types.d.ts +493 -0
- package/dist/gasless/types.d.ts.map +1 -0
- package/dist/gasless/types.js +33 -0
- package/dist/gasless/types.js.map +1 -0
- package/dist/gasless/unconfirmed-submit.d.ts +132 -0
- package/dist/gasless/unconfirmed-submit.d.ts.map +1 -0
- package/dist/gasless/unconfirmed-submit.js +49 -0
- package/dist/gasless/unconfirmed-submit.js.map +1 -0
- package/dist/gasless/wait-for-gasless-request/index.d.ts +2 -0
- package/dist/gasless/wait-for-gasless-request/index.d.ts.map +1 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts +114 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.d.ts.map +1 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js +77 -0
- package/dist/gasless/wait-for-gasless-request/wait-for-gasless-request.js.map +1 -0
- package/dist/gasless/wallet-id.d.ts +42 -0
- package/dist/gasless/wallet-id.d.ts.map +1 -0
- package/dist/gasless/wallet-id.js +25 -0
- package/dist/gasless/wallet-id.js.map +1 -0
- package/dist/gasless/wire-parse.d.ts +33 -0
- package/dist/gasless/wire-parse.d.ts.map +1 -0
- package/dist/gasless/wire-parse.js +14 -0
- package/dist/gasless/wire-parse.js.map +1 -0
- package/dist/gasless/wire-types.d.ts +73 -0
- package/dist/gasless/wire-types.d.ts.map +1 -0
- package/dist/gasless/write-request-registry.d.ts +56 -0
- package/dist/gasless/write-request-registry.d.ts.map +1 -0
- package/dist/gasless/write-request-registry.js +22 -0
- package/dist/gasless/write-request-registry.js.map +1 -0
- package/dist/index.d.ts +82 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +568 -497
- package/dist/pools/listing-config/to-listing-config.js +2 -2
- package/dist/pools/listing-config/to-listing-config.js.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.js +46 -40
- package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
- package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
- package/dist/pools/markets/to-listing-market.js +2 -1
- package/dist/pools/markets/to-listing-market.js.map +1 -1
- package/dist/pools/types/generated/listing-backend.d.ts +163 -16
- package/dist/pools/types/generated/listing-backend.d.ts.map +1 -1
- package/dist/pools/types/generated/listing-backend.js.map +1 -1
- package/dist/pools/types.d.ts +52 -2
- package/dist/pools/types.d.ts.map +1 -1
- package/dist/pools/types.js +6 -4
- package/dist/pools/types.js.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +3 -2
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
- package/dist/quotes/get-quote-funding/types.d.ts +4 -2
- package/dist/quotes/get-quote-funding/types.d.ts.map +1 -1
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts +68 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js +34 -0
- package/dist/quotes/get-quote-pending-funding/get-quote-pending-funding.js.map +1 -0
- package/dist/quotes/get-quote-pending-funding/index.d.ts +4 -0
- package/dist/quotes/get-quote-pending-funding/index.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/query.d.ts +58 -0
- package/dist/quotes/get-quote-pending-funding/query.d.ts.map +1 -0
- package/dist/quotes/get-quote-pending-funding/query.js +27 -0
- package/dist/quotes/get-quote-pending-funding/query.js.map +1 -0
- package/dist/quotes/get-quote-pending-funding/types.d.ts +19 -0
- package/dist/quotes/get-quote-pending-funding/types.d.ts.map +1 -0
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +2 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
- package/dist/quotes/grouping/aggregate-group-funding.d.ts +9 -8
- package/dist/quotes/grouping/aggregate-group-funding.d.ts.map +1 -1
- package/dist/quotes/grouping/aggregate-group-funding.js.map +1 -1
- package/dist/quotes/grouping/partition-quotes.d.ts +30 -0
- package/dist/quotes/grouping/partition-quotes.d.ts.map +1 -1
- package/dist/quotes/grouping/partition-quotes.js +9 -6
- package/dist/quotes/grouping/partition-quotes.js.map +1 -1
- package/dist/quotes/index.d.ts +1 -0
- package/dist/quotes/index.d.ts.map +1 -1
- package/dist/quotes/unified-quote.d.ts +6 -6
- package/dist/quotes/unified-quote.js.map +1 -1
- package/dist/shared/errors/redact-url.d.ts +15 -0
- package/dist/shared/errors/redact-url.d.ts.map +1 -0
- package/dist/shared/errors/redact-url.js +9 -0
- package/dist/shared/errors/redact-url.js.map +1 -0
- package/dist/shared/errors/retry-after.d.ts +17 -0
- package/dist/shared/errors/retry-after.d.ts.map +1 -0
- package/dist/shared/errors/retry-after.js +16 -0
- package/dist/shared/errors/retry-after.js.map +1 -0
- package/dist/shared/errors/sanitized-api-error.d.ts +32 -0
- package/dist/shared/errors/sanitized-api-error.d.ts.map +1 -0
- package/dist/shared/errors/sanitized-api-error.js +41 -0
- package/dist/shared/errors/sanitized-api-error.js.map +1 -0
- package/dist/shared/errors/symm-error.d.ts +39 -4
- package/dist/shared/errors/symm-error.d.ts.map +1 -1
- package/dist/shared/errors/symm-error.js +29 -15
- package/dist/shared/errors/symm-error.js.map +1 -1
- package/dist/shared/types/properties.d.ts +53 -5
- package/dist/shared/types/properties.d.ts.map +1 -1
- package/dist/shared/utils/core-units.d.ts +82 -0
- package/dist/shared/utils/core-units.d.ts.map +1 -0
- package/dist/shared/utils/core-units.js +21 -0
- package/dist/shared/utils/core-units.js.map +1 -0
- package/dist/shared/utils/http-header.d.ts +16 -0
- package/dist/shared/utils/http-header.d.ts.map +1 -0
- package/dist/shared/utils/http-header.js +14 -0
- package/dist/shared/utils/http-header.js.map +1 -0
- package/dist/shared/utils/query.js +2 -1
- package/dist/shared/utils/query.js.map +1 -1
- package/dist/solvers/force-close/force-close-auto.d.ts +6 -2
- package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-auto.js +2 -1
- package/dist/solvers/force-close/force-close-auto.js.map +1 -1
- package/dist/solvers/force-close/force-close-position.d.ts +9 -3
- package/dist/solvers/force-close/force-close-position.d.ts.map +1 -1
- package/dist/solvers/force-close/force-close-position.js +2 -1
- package/dist/solvers/force-close/force-close-position.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +12 -12
- package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +7 -7
- package/dist/symmio-contracts/abi/index.d.ts +2 -0
- package/dist/symmio-contracts/abi/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts +2323 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.d.ts.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js +2706 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts +137 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.d.ts.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js +145 -0
- package/dist/symmio-contracts/abi/v0.8.6/gasless-wallet.js.map +1 -0
- package/dist/symmio-contracts/abi/v0.8.6/index.d.ts +2 -0
- package/dist/symmio-contracts/abi/v0.8.6/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts +1879 -37
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js +2180 -50
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +11 -2
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +33 -17
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +9 -2
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +33 -16
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +8 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +8 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +7 -2
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +34 -17
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts +9 -3
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +41 -20
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/types.d.ts +3 -1
- package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
- package/dist/symmio-contracts/account-layer/types.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts +60 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js +35 -0
- package/dist/symmio-contracts/instant-layer/actions/finalize-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts +91 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js +19 -0
- package/dist/symmio-contracts/instant-layer/actions/get-active-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js +15 -0
- package/dist/symmio-contracts/instant-layer/actions/get-instant-layer-nonce.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts +79 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js +32 -0
- package/dist/symmio-contracts/instant-layer/actions/get-pending-revocation-etas.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts +43 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js +14 -0
- package/dist/symmio-contracts/instant-layer/actions/get-revocation-cooldown.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +24 -3
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +48 -22
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts +62 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js +35 -0
- package/dist/symmio-contracts/instant-layer/actions/initiate-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts +12 -0
- package/dist/symmio-contracts/instant-layer/index.d.ts.map +1 -1
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/finalize-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js +29 -0
- package/dist/symmio-contracts/instant-layer/query/get-active-delegations.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts +39 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js +27 -0
- package/dist/symmio-contracts/instant-layer/query/get-instant-layer-nonce.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-is-delegation-active.js +7 -7
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts +42 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js +30 -0
- package/dist/symmio-contracts/instant-layer/query/get-pending-revocation-etas.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts +36 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js +21 -0
- package/dist/symmio-contracts/instant-layer/query/get-revocation-cooldown.js.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts +22 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.d.ts.map +1 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js +12 -0
- package/dist/symmio-contracts/instant-layer/query/initiate-revoke-delegation.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +2 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts +87 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js +38 -0
- package/dist/symmio-contracts/symmio/actions/approve-operational-fee.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +2 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts +15 -3
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js +34 -17
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +2 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +2 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts +85 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js +29 -0
- package/dist/symmio-contracts/symmio/actions/get-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js +2 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +9 -7
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +24 -22
- package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js +4 -2
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts +43 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js +15 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/get-funding-fees-of-party-b.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts +4 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts +43 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js +25 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts +85 -0
- package/dist/symmio-contracts/symmio/get-funding-fees-of-party-b/types.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/index.d.ts +5 -0
- package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +2 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +46 -17
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts +18 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.js +12 -0
- package/dist/symmio-contracts/symmio/query/approve-operational-fee.js.map +1 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts +35 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js +28 -0
- package/dist/symmio-contracts/symmio/query/get-operational-fee-allowance.js.map +1 -0
- package/dist/symmio-contracts/symmio/types.d.ts +6 -6
- package/dist/symmio-contracts/symmio/types.js.map +1 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.d.ts +2 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.d.ts.map +1 -1
- package/dist/symmio-subgraph/executeSubgraphRequest.js +24 -21
- package/dist/symmio-subgraph/executeSubgraphRequest.js.map +1 -1
- package/dist/websocket/gasless/close-code-policy.d.ts +51 -0
- package/dist/websocket/gasless/close-code-policy.d.ts.map +1 -0
- package/dist/websocket/gasless/close-code-policy.js +75 -0
- package/dist/websocket/gasless/close-code-policy.js.map +1 -0
- package/dist/websocket/gasless/gasless-stream-hub.d.ts +61 -0
- package/dist/websocket/gasless/gasless-stream-hub.d.ts.map +1 -0
- package/dist/websocket/gasless/gasless-stream-hub.js +311 -0
- package/dist/websocket/gasless/gasless-stream-hub.js.map +1 -0
- package/dist/websocket/gasless/index.d.ts +7 -0
- package/dist/websocket/gasless/index.d.ts.map +1 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.d.ts +82 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.d.ts.map +1 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.js +136 -0
- package/dist/websocket/gasless/parse-gasless-stream-message.js.map +1 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts +58 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.d.ts.map +1 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.js +59 -0
- package/dist/websocket/gasless/resolve-gasless-stream-url.js.map +1 -0
- package/dist/websocket/gasless/types.d.ts +48 -0
- package/dist/websocket/gasless/types.d.ts.map +1 -0
- package/dist/websocket/gasless/watch-gasless-request.d.ts +72 -0
- package/dist/websocket/gasless/watch-gasless-request.d.ts.map +1 -0
- package/dist/websocket/gasless/watch-gasless-request.js +35 -0
- package/dist/websocket/gasless/watch-gasless-request.js.map +1 -0
- package/dist/websocket/index.d.ts +1 -0
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/socket/create-reconnecting-socket.d.ts +39 -6
- package/dist/websocket/socket/create-reconnecting-socket.d.ts.map +1 -1
- package/dist/websocket/socket/create-reconnecting-socket.js +92 -53
- package/dist/websocket/socket/create-reconnecting-socket.js.map +1 -1
- package/dist/websocket/socket/socket-status.d.ts +7 -2
- package/dist/websocket/socket/socket-status.d.ts.map +1 -1
- package/dist/websocket/socket/socket-status.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { SymmError as e } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { computeBackoffDelay as t } from "../socket/backoff.js";
|
|
3
|
+
import { createReconnectingSocket as n } from "../socket/create-reconnecting-socket.js";
|
|
4
|
+
import { classifyGaslessCloseCode as r } from "./close-code-policy.js";
|
|
5
|
+
import { buildGaslessSubscribeCommand as i, buildGaslessUnsubscribeCommand as a, gaslessStreamSelectorKey as o, parseGaslessStreamMessage as s } from "./parse-gasless-stream-message.js";
|
|
6
|
+
//#region src/websocket/gasless/gasless-stream-hub.ts
|
|
7
|
+
var c = {
|
|
8
|
+
baseDelayMs: 1e3,
|
|
9
|
+
maxDelayMs: 3e4,
|
|
10
|
+
jitter: !0
|
|
11
|
+
}, l = 250, u = 1e4, d = 1e3, f = 6e4, p = 2e3, m = 2e3, h = 1e4, g = 3, _ = 1500, v = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
function y(e, t) {
|
|
13
|
+
let n = e.timers[t];
|
|
14
|
+
n !== void 0 && (clearTimeout(n), e.timers[t] = void 0);
|
|
15
|
+
}
|
|
16
|
+
function b(e) {
|
|
17
|
+
for (let t of Object.keys(e.timers)) y(e, t);
|
|
18
|
+
}
|
|
19
|
+
function x(e, t, n) {
|
|
20
|
+
e.status = t, e.detail = n;
|
|
21
|
+
for (let r of e.selectors.values()) {
|
|
22
|
+
let e = t === "live" && r.state !== "live" ? "degraded" : t;
|
|
23
|
+
for (let t of r.listeners) t.onStatusChange?.(e, n);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function S(e, t, n) {
|
|
27
|
+
let r = t === null ? [...e.selectors.values()] : [e.selectors.get(t)].filter(Boolean);
|
|
28
|
+
for (let e of r) for (let t of e.listeners) t.onError?.(n);
|
|
29
|
+
}
|
|
30
|
+
function C(e) {
|
|
31
|
+
return [...e.selectors.values()].filter((e) => !e.done && e.state !== "not-found" && e.listeners.size > 0);
|
|
32
|
+
}
|
|
33
|
+
function w(e) {
|
|
34
|
+
for (let t of e.selectors.values()) if (t.listeners.size > 0) return !0;
|
|
35
|
+
return !1;
|
|
36
|
+
}
|
|
37
|
+
function T(e) {
|
|
38
|
+
e.idle !== void 0 && (clearTimeout(e.idle), e.idle = void 0);
|
|
39
|
+
}
|
|
40
|
+
function E(e) {
|
|
41
|
+
for (let t of e.selectors.values()) if (t.state === "overflow" && t.listeners.size > 0) return !0;
|
|
42
|
+
return !1;
|
|
43
|
+
}
|
|
44
|
+
function D(e, t, n) {
|
|
45
|
+
T(n), !(n.listeners.size > 0) && (e.selectors.delete(t), e.phase === "ready" && !n.done && n.state === "live" && A(e, {
|
|
46
|
+
key: t,
|
|
47
|
+
kind: "unsubscribe",
|
|
48
|
+
frame: a(n.selector)
|
|
49
|
+
}), e.phase === "ready" && N(e));
|
|
50
|
+
}
|
|
51
|
+
function O(e, t) {
|
|
52
|
+
return e.inFlight?.key === t || e.queue.some((e) => e.key === t);
|
|
53
|
+
}
|
|
54
|
+
function k(e, t, n) {
|
|
55
|
+
if (!(e.phase !== "ready" || n.done) && !(n.state === "live" || n.state === "not-found") && !O(e, t)) {
|
|
56
|
+
if (C(e).filter((e) => e.state !== "overflow").length > e.maxSubscriptions) {
|
|
57
|
+
n.state = "overflow";
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
n.state = "pending", A(e, {
|
|
61
|
+
key: t,
|
|
62
|
+
kind: "subscribe",
|
|
63
|
+
frame: i(n.selector)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function A(e, t) {
|
|
68
|
+
e.queue.push(t), j(e);
|
|
69
|
+
}
|
|
70
|
+
function j(e) {
|
|
71
|
+
if (e.phase !== "ready" || e.inFlight !== null || e.queue.length === 0 || e.timers.command !== void 0) return;
|
|
72
|
+
let t = Math.max(0, l - (Date.now() - e.lastCommandAt));
|
|
73
|
+
e.timers.command = setTimeout(() => {
|
|
74
|
+
if (e.timers.command = void 0, e.phase !== "ready" || e.inFlight !== null) return;
|
|
75
|
+
let t = e.queue.shift();
|
|
76
|
+
t && (e.inFlight = t, e.lastCommandAt = Date.now(), e.socket?.send(t.frame), e.timers.ack = setTimeout(() => {
|
|
77
|
+
e.timers.ack = void 0;
|
|
78
|
+
let t = e.inFlight;
|
|
79
|
+
e.inFlight = null, t && e.queue.unshift(t), j(e);
|
|
80
|
+
}, u));
|
|
81
|
+
}, t);
|
|
82
|
+
}
|
|
83
|
+
function M(e, t) {
|
|
84
|
+
e.inFlight?.key === t && (e.inFlight = null, y(e, "ack"), j(e));
|
|
85
|
+
}
|
|
86
|
+
function N(e) {
|
|
87
|
+
C(e).forEach((t, n) => {
|
|
88
|
+
let r = o(t.selector);
|
|
89
|
+
if (n >= e.maxSubscriptions) {
|
|
90
|
+
t.state = "overflow";
|
|
91
|
+
for (let n of t.listeners) n.onStatusChange?.("degraded", {
|
|
92
|
+
reason: "subscription-limit",
|
|
93
|
+
detail: `The gateway allows ${e.maxSubscriptions} subscriptions per socket; this workflow keeps polling over HTTP until a slot frees.`
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
O(e, r) || (t.state = "pending", A(e, {
|
|
98
|
+
key: r,
|
|
99
|
+
kind: "subscribe",
|
|
100
|
+
frame: i(t.selector)
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function P(e) {
|
|
105
|
+
y(e, "liveness"), e.timers.liveness = setTimeout(() => {
|
|
106
|
+
e.timers.liveness = void 0, F(e), I(e, {
|
|
107
|
+
reason: "unreachable",
|
|
108
|
+
detail: "The gateway stopped sending heartbeats; reconnecting while status reads continue over HTTP."
|
|
109
|
+
});
|
|
110
|
+
}, f);
|
|
111
|
+
}
|
|
112
|
+
function F(e) {
|
|
113
|
+
y(e, "ready"), y(e, "command"), y(e, "ack"), y(e, "liveness"), e.inFlight = null, e.queue = [];
|
|
114
|
+
let t = e.socket;
|
|
115
|
+
e.socket = null, t?.close(1e3);
|
|
116
|
+
}
|
|
117
|
+
function I(e, n) {
|
|
118
|
+
if (e.phase === "disabled") return;
|
|
119
|
+
e.phase = "backoff", x(e, "degraded", n);
|
|
120
|
+
let r = t(e.attempt, c, e.random);
|
|
121
|
+
e.attempt += 1, y(e, "redial"), e.timers.redial = setTimeout(() => {
|
|
122
|
+
if (e.timers.redial = void 0, e.selectors.size === 0) {
|
|
123
|
+
e.phase = "idle";
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
B(e);
|
|
127
|
+
}, r);
|
|
128
|
+
}
|
|
129
|
+
function L(e, t, n) {
|
|
130
|
+
e.phase = "disabled", F(e), y(e, "redial");
|
|
131
|
+
for (let t of e.selectors.values()) t.state = "overflow";
|
|
132
|
+
x(e, "disabled", t), n && S(e, null, n);
|
|
133
|
+
}
|
|
134
|
+
function R(t, n) {
|
|
135
|
+
P(t);
|
|
136
|
+
let r = s(n);
|
|
137
|
+
if (r.type === "throttle") {
|
|
138
|
+
let e = t.inFlight;
|
|
139
|
+
t.inFlight = null, y(t, "ack"), e && t.queue.unshift(e), y(t, "command"), t.timers.command = setTimeout(() => {
|
|
140
|
+
t.timers.command = void 0, j(t);
|
|
141
|
+
}, d + Math.round(t.random() * d));
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (r.type === "unparseable" || r.type === "transport") return;
|
|
145
|
+
if (r.type === "error") {
|
|
146
|
+
let n = r.selector ? o(r.selector) : null;
|
|
147
|
+
n && M(t, n);
|
|
148
|
+
let a = n ? t.selectors.get(n) : void 0;
|
|
149
|
+
if (r.code === "NOT_FOUND" && a) {
|
|
150
|
+
if (a.notFoundRetries < g) {
|
|
151
|
+
a.notFoundRetries += 1;
|
|
152
|
+
let e = a;
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
t.phase !== "ready" || e.done || A(t, {
|
|
155
|
+
key: o(e.selector),
|
|
156
|
+
kind: "subscribe",
|
|
157
|
+
frame: i(e.selector)
|
|
158
|
+
});
|
|
159
|
+
}, _);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
a.state = "not-found";
|
|
163
|
+
for (let e of a.listeners) e.onStatusChange?.("degraded", {
|
|
164
|
+
reason: "not-found",
|
|
165
|
+
detail: "The gateway does not store this workflow on the configured instance; status reads continue over HTTP."
|
|
166
|
+
});
|
|
167
|
+
S(t, n, new e("api", "GASLESS_STREAM_NOT_FOUND", "Gasless: the status stream does not know this request id on the configured protocol instance. Check that the workflow was accepted by this instance; status reads continue over HTTP."));
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (r.code === "SUBSCRIPTION_LIMIT" && a) {
|
|
171
|
+
a.state = "overflow";
|
|
172
|
+
for (let e of a.listeners) e.onStatusChange?.("degraded", {
|
|
173
|
+
reason: "subscription-limit",
|
|
174
|
+
detail: "The socket is at its subscription limit; this workflow keeps polling over HTTP."
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
S(t, n, new e("api", r.code === "INVALID_MESSAGE" ? "GASLESS_STREAM_COMMAND_INVALID" : "GASLESS_STREAM_PROTOCOL_ERROR", `Gasless: the status stream rejected a command with ${r.code}.`));
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (r.protocolInstance !== t.endpoint.protocolInstance) {
|
|
182
|
+
L(t, {
|
|
183
|
+
reason: "instance-mismatch",
|
|
184
|
+
detail: `The status stream answered for protocol instance "${r.protocolInstance}" but the config pins "${t.endpoint.protocolInstance}". Status reads continue over HTTP.`
|
|
185
|
+
}, new e("api", "GASLESS_STREAM_INSTANCE_MISMATCH", `Gasless: the status stream answered for protocol instance "${r.protocolInstance}" but the config pins "${t.endpoint.protocolInstance}".`));
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (r.type === "ready") {
|
|
189
|
+
y(t, "ready"), t.phase = "ready", t.maxSubscriptions = r.maxSubscriptions, x(t, "connecting", null), N(t);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (r.type === "unsubscribed") {
|
|
193
|
+
M(t, o(r.selector));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
let a = o(r.selector), c = t.selectors.get(a);
|
|
197
|
+
if (!c) return;
|
|
198
|
+
r.type === "snapshot" && (M(t, a), t.attempt = 0), c.state = "live", c.notFoundRetries = 0, x(t, "live", null);
|
|
199
|
+
let l = {
|
|
200
|
+
kind: r.type,
|
|
201
|
+
request: r.request,
|
|
202
|
+
transactions: r.transactions
|
|
203
|
+
};
|
|
204
|
+
c.lastUpdate = l;
|
|
205
|
+
for (let e of c.listeners) e.onUpdate(l);
|
|
206
|
+
}
|
|
207
|
+
function z(t, n) {
|
|
208
|
+
if (t.phase === "disabled") return;
|
|
209
|
+
let i = t.phase === "ready";
|
|
210
|
+
t.socket = null, y(t, "ready"), y(t, "command"), y(t, "ack"), y(t, "liveness"), t.inFlight = null, t.queue = [];
|
|
211
|
+
for (let e of t.selectors.values()) e.state === "live" && (e.state = "pending");
|
|
212
|
+
let a = r(n), o = {
|
|
213
|
+
reason: a.reason,
|
|
214
|
+
closeCode: n,
|
|
215
|
+
detail: a.detail
|
|
216
|
+
};
|
|
217
|
+
if (a.action === "disable") {
|
|
218
|
+
L(t, o, new e("api", "GASLESS_STREAM_DISABLED", `Gasless: ${a.detail}`));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (a.action === "retry-bounded" && !i && t.attempt >= 3) {
|
|
222
|
+
L(t, o, new e("api", "GASLESS_STREAM_DISABLED", `Gasless: the status stream closed 3 times without connecting. ${a.detail}`));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
I(t, o);
|
|
226
|
+
}
|
|
227
|
+
function B(e) {
|
|
228
|
+
if (e.phase === "disabled" || e.socket !== null) return;
|
|
229
|
+
e.phase = "connecting", x(e, "connecting", null);
|
|
230
|
+
let t;
|
|
231
|
+
try {
|
|
232
|
+
t = n({
|
|
233
|
+
url: e.endpoint.url,
|
|
234
|
+
webSocketConstructor: e.webSocketConstructor,
|
|
235
|
+
reconnect: { enabled: !1 },
|
|
236
|
+
onMessage: (t) => R(e, t),
|
|
237
|
+
onClose: ({ code: t }) => z(e, t),
|
|
238
|
+
onError: () => {}
|
|
239
|
+
});
|
|
240
|
+
} catch (t) {
|
|
241
|
+
I(e, {
|
|
242
|
+
reason: "unreachable",
|
|
243
|
+
detail: `The status stream could not be opened (${t instanceof Error ? t.message : String(t)}); status reads continue over HTTP.`
|
|
244
|
+
});
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
e.socket = t, P(e), e.timers.ready = setTimeout(() => {
|
|
248
|
+
e.timers.ready = void 0, F(e), z(e, 1006);
|
|
249
|
+
}, h);
|
|
250
|
+
}
|
|
251
|
+
function V(e, t) {
|
|
252
|
+
let { endpoint: n, selector: r, listener: i, random: a = Math.random } = t, s = v.get(e);
|
|
253
|
+
s || (s = /* @__PURE__ */ new Map(), v.set(e, s));
|
|
254
|
+
let c = s.get(n.url);
|
|
255
|
+
c || (c = {
|
|
256
|
+
endpoint: n,
|
|
257
|
+
socket: null,
|
|
258
|
+
phase: "idle",
|
|
259
|
+
status: "idle",
|
|
260
|
+
detail: null,
|
|
261
|
+
maxSubscriptions: 1,
|
|
262
|
+
selectors: /* @__PURE__ */ new Map(),
|
|
263
|
+
queue: [],
|
|
264
|
+
inFlight: null,
|
|
265
|
+
attempt: 0,
|
|
266
|
+
lastCommandAt: 0,
|
|
267
|
+
timers: {},
|
|
268
|
+
random: a,
|
|
269
|
+
webSocketConstructor: e.getWebSocketConstructor()
|
|
270
|
+
}, s.set(n.url, c));
|
|
271
|
+
let l = c, u = s;
|
|
272
|
+
y(l, "idle");
|
|
273
|
+
let d = o(r), f = l.selectors.get(d);
|
|
274
|
+
f || (f = {
|
|
275
|
+
selector: r,
|
|
276
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
277
|
+
state: "pending",
|
|
278
|
+
notFoundRetries: 0,
|
|
279
|
+
done: !1
|
|
280
|
+
}, l.selectors.set(d, f));
|
|
281
|
+
let h = f;
|
|
282
|
+
T(h), h.listeners.add(i), k(l, d, h), i.onStatusChange?.(l.status === "live" && h.state !== "live" ? "degraded" : l.status, l.detail), h.lastUpdate && queueMicrotask(() => {
|
|
283
|
+
let e = h.lastUpdate;
|
|
284
|
+
e && h.listeners.has(i) && i.onUpdate(e);
|
|
285
|
+
}), l.phase === "idle" && B(l);
|
|
286
|
+
let g = !1;
|
|
287
|
+
return () => {
|
|
288
|
+
g || (g = !0, h.listeners.delete(i), !(h.listeners.size > 0) && (T(h), E(l) ? D(l, d, h) : h.idle = setTimeout(() => {
|
|
289
|
+
h.idle = void 0, D(l, d, h);
|
|
290
|
+
}, m), w(l) || (y(l, "idle"), l.timers.idle = setTimeout(() => {
|
|
291
|
+
if (l.timers.idle = void 0, !w(l)) {
|
|
292
|
+
for (let e of l.selectors.values()) T(e);
|
|
293
|
+
l.selectors.clear(), b(l), F(l), l.phase = l.phase === "disabled" ? "disabled" : "idle", u.delete(n.url);
|
|
294
|
+
}
|
|
295
|
+
}, p))));
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function H(e, t, n) {
|
|
299
|
+
let r = v.get(e)?.get(t);
|
|
300
|
+
if (!r) return;
|
|
301
|
+
let i = o(n), s = r.selectors.get(i);
|
|
302
|
+
!s || s.done || (s.done = !0, r.phase === "ready" && s.state === "live" && A(r, {
|
|
303
|
+
key: i,
|
|
304
|
+
kind: "unsubscribe",
|
|
305
|
+
frame: a(n)
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
//#endregion
|
|
309
|
+
export { V as acquireGaslessStreamSelector, H as releaseGaslessStreamSelector };
|
|
310
|
+
|
|
311
|
+
//# sourceMappingURL=gasless-stream-hub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasless-stream-hub.js","names":[],"sources":["../../../src/websocket/gasless/gasless-stream-hub.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { WebSocketConstructor } from \"../../shared/types/websocket\";\nimport { computeBackoffDelay } from \"../socket/backoff\";\nimport { createReconnectingSocket, type ReconnectingSocket } from \"../socket/create-reconnecting-socket\";\nimport { classifyGaslessCloseCode, GASLESS_STREAM_BOUNDED_ATTEMPTS } from \"./close-code-policy\";\nimport {\n buildGaslessSubscribeCommand,\n buildGaslessUnsubscribeCommand,\n gaslessStreamSelectorKey,\n parseGaslessStreamMessage,\n type GaslessStreamSelector,\n} from \"./parse-gasless-stream-message\";\nimport type { GaslessStreamEndpoint } from \"./resolve-gasless-stream-url\";\nimport type { GaslessRequestStreamUpdate, GaslessStreamStatus, GaslessStreamStatusDetail } from \"./types\";\n\n/** Dial backoff: 1 s doubling to 30 s, jittered, reset only after a snapshot. */\nconst BACKOFF = { baseDelayMs: 1_000, maxDelayMs: 30_000, jitter: true } as const;\n/** Minimum spacing between client commands; they share the caller's request quota. */\nconst COMMAND_INTERVAL_MS = 250;\n/** How long a command waits for its snapshot / ack before it is retried. */\nconst COMMAND_ACK_TIMEOUT_MS = 10_000;\n/** A throttled command waits at least this long, since `Retry-After` is not on the socket. */\nconst THROTTLE_BACKOFF_MS = 1_000;\n/** No inbound frame for this long (heartbeats arrive about every 20 s) means the socket is dead. */\nconst LIVENESS_TIMEOUT_MS = 60_000;\n/** Grace period before the last watcher's departure closes the socket (absorbs StrictMode remounts). */\nconst IDLE_CLOSE_MS = 2_000;\n/**\n * Grace period before an unwatched selector is unsubscribed.\n *\n * One relayed write is followed by two waits in sequence — broadcast, then\n * terminal — and without this the handoff between them costs a full\n * unsubscribe/subscribe round trip plus the HTTP read the second wait takes\n * while its new subscription is still pending. Runs alongside\n * {@link IDLE_CLOSE_MS}, not after it, so an idle socket still closes as\n * promptly as before.\n */\nconst SELECTOR_IDLE_MS = 2_000;\n/** The `ready` handshake must arrive within this long after the socket opens. */\nconst READY_TIMEOUT_MS = 10_000;\n/** Resubscribes tolerated for the accept-vs-record race after a 202. */\nconst NOT_FOUND_RETRIES = 3;\n/** Delay between those resubscribes. */\nconst NOT_FOUND_RETRY_MS = 1_500;\n\n/**\n * One watcher of one selector.\n *\n * @internal\n */\nexport interface GaslessStreamListener {\n onUpdate: (update: GaslessRequestStreamUpdate) => void;\n onStatusChange?: (status: GaslessStreamStatus, detail: GaslessStreamStatusDetail | null) => void;\n onError?: (error: SymmError) => void;\n}\n\ninterface SelectorEntry {\n selector: GaslessStreamSelector;\n listeners: Set<GaslessStreamListener>;\n /** `pending` until its snapshot arrives; `overflow` while the socket is at its cap. */\n state: \"pending\" | \"live\" | \"overflow\" | \"not-found\";\n notFoundRetries: number;\n /** Set once a terminal record arrived, so a reconnect does not resubscribe it. */\n done: boolean;\n /** The last frame delivered for this selector, replayed to a late joiner. */\n lastUpdate?: GaslessRequestStreamUpdate;\n /** Pending removal while nobody watches this selector. */\n idle?: ReturnType<typeof setTimeout>;\n}\n\ninterface QueuedCommand {\n key: string;\n kind: \"subscribe\" | \"unsubscribe\";\n frame: string;\n}\n\ninterface Hub {\n endpoint: GaslessStreamEndpoint;\n /** Resolved once per hub: the config's WebSocket implementation. */\n webSocketConstructor: WebSocketConstructor;\n socket: ReconnectingSocket | null;\n phase: \"idle\" | \"connecting\" | \"ready\" | \"backoff\" | \"disabled\";\n status: GaslessStreamStatus;\n detail: GaslessStreamStatusDetail | null;\n maxSubscriptions: number;\n selectors: Map<string, SelectorEntry>;\n queue: QueuedCommand[];\n inFlight: QueuedCommand | null;\n attempt: number;\n /** When the last command was sent, so pacing spans a burst and not an idle socket. */\n lastCommandAt: number;\n timers: {\n redial?: ReturnType<typeof setTimeout>;\n command?: ReturnType<typeof setTimeout>;\n ack?: ReturnType<typeof setTimeout>;\n liveness?: ReturnType<typeof setTimeout>;\n idle?: ReturnType<typeof setTimeout>;\n ready?: ReturnType<typeof setTimeout>;\n };\n random: () => number;\n}\n\nconst hubRegistries = new WeakMap<Config, Map<string, Hub>>();\n\nfunction clearTimer(hub: Hub, name: keyof Hub[\"timers\"]): void {\n const timer = hub.timers[name];\n if (timer !== undefined) {\n clearTimeout(timer);\n hub.timers[name] = undefined;\n }\n}\n\nfunction clearAllTimers(hub: Hub): void {\n for (const name of Object.keys(hub.timers) as (keyof Hub[\"timers\"])[]) clearTimer(hub, name);\n}\n\nfunction setStatus(hub: Hub, status: GaslessStreamStatus, detail: GaslessStreamStatusDetail | null): void {\n hub.status = status;\n hub.detail = detail;\n for (const entry of hub.selectors.values()) {\n /** An overflowed selector is never `live`, whatever the socket is doing. */\n const effective = status === \"live\" && entry.state !== \"live\" ? \"degraded\" : status;\n for (const listener of entry.listeners) listener.onStatusChange?.(effective, detail);\n }\n}\n\nfunction notifyError(hub: Hub, key: string | null, error: SymmError): void {\n const entries = key === null ? [...hub.selectors.values()] : [hub.selectors.get(key)].filter(Boolean);\n for (const entry of entries as SelectorEntry[]) {\n for (const listener of entry.listeners) listener.onError?.(error);\n }\n}\n\n/** Selectors that still want a subscription, capped by what the gateway allows. */\nfunction wantedSelectors(hub: Hub): SelectorEntry[] {\n return [...hub.selectors.values()].filter(\n (entry) => !entry.done && entry.state !== \"not-found\" && entry.listeners.size > 0,\n );\n}\n\n/** Whether anything still watches this hub. Entries inside their idle grace do not count. */\nfunction hasWatchers(hub: Hub): boolean {\n for (const entry of hub.selectors.values()) if (entry.listeners.size > 0) return true;\n return false;\n}\n\n/** Cancel a selector's pending removal — a new watcher arrived in time. */\nfunction clearSelectorIdle(entry: SelectorEntry): void {\n if (entry.idle !== undefined) {\n clearTimeout(entry.idle);\n entry.idle = undefined;\n }\n}\n\n/** Whether a watched selector is sitting over the cap, waiting for a slot. */\nfunction hasOverflowedSelector(hub: Hub): boolean {\n for (const entry of hub.selectors.values()) {\n if (entry.state === \"overflow\" && entry.listeners.size > 0) return true;\n }\n return false;\n}\n\n/** Give up a selector nobody watches: unsubscribe it and hand its slot on. */\nfunction removeSelector(hub: Hub, key: string, entry: SelectorEntry): void {\n clearSelectorIdle(entry);\n if (entry.listeners.size > 0) return;\n\n hub.selectors.delete(key);\n if (hub.phase === \"ready\" && !entry.done && entry.state === \"live\") {\n enqueue(hub, { key, kind: \"unsubscribe\", frame: buildGaslessUnsubscribeCommand(entry.selector) });\n }\n /** A freed slot may let an overflowed selector subscribe. */\n if (hub.phase === \"ready\") subscribeAll(hub);\n}\n\n/** Whether a command for this selector is already queued or in flight. */\nfunction isCommandPending(hub: Hub, key: string): boolean {\n return hub.inFlight?.key === key || hub.queue.some((command) => command.key === key);\n}\n\n/**\n * Subscribe a selector that wants one and has no command out for it yet.\n *\n * Shared by a first watcher and by one that rejoined an entry whose grace had\n * not expired: rejoining a `live` entry needs no command at all, which is the\n * whole point of the grace.\n */\nfunction ensureSubscribed(hub: Hub, key: string, entry: SelectorEntry): void {\n if (hub.phase !== \"ready\" || entry.done) return;\n if (entry.state === \"live\" || entry.state === \"not-found\") return;\n if (isCommandPending(hub, key)) return;\n\n const live = wantedSelectors(hub).filter((candidate) => candidate.state !== \"overflow\").length;\n if (live > hub.maxSubscriptions) {\n entry.state = \"overflow\";\n return;\n }\n entry.state = \"pending\";\n enqueue(hub, { key, kind: \"subscribe\", frame: buildGaslessSubscribeCommand(entry.selector) });\n}\n\nfunction enqueue(hub: Hub, command: QueuedCommand): void {\n hub.queue.push(command);\n pumpQueue(hub);\n}\n\n/** Send one command at a time, paced, and only while the socket is ready. */\nfunction pumpQueue(hub: Hub): void {\n if (hub.phase !== \"ready\" || hub.inFlight !== null || hub.queue.length === 0) return;\n if (hub.timers.command !== undefined) return;\n\n /**\n * Paced from the last command sent, not from now: the interval exists to keep\n * a burst of commands off the caller's request quota, and a socket that has\n * been quiet has already served it. The first subscribe after `ready` is what\n * a status wait is blocked on, so it goes out at once.\n */\n const delay = Math.max(0, COMMAND_INTERVAL_MS - (Date.now() - hub.lastCommandAt));\n\n hub.timers.command = setTimeout(() => {\n hub.timers.command = undefined;\n if (hub.phase !== \"ready\" || hub.inFlight !== null) return;\n const command = hub.queue.shift();\n if (!command) return;\n hub.inFlight = command;\n hub.lastCommandAt = Date.now();\n hub.socket?.send(command.frame);\n hub.timers.ack = setTimeout(() => {\n hub.timers.ack = undefined;\n /** No ack in time: put it back at the head and try again. */\n const pending = hub.inFlight;\n hub.inFlight = null;\n if (pending) hub.queue.unshift(pending);\n pumpQueue(hub);\n }, COMMAND_ACK_TIMEOUT_MS);\n }, delay);\n}\n\nfunction completeInFlight(hub: Hub, key: string): void {\n if (hub.inFlight?.key !== key) return;\n hub.inFlight = null;\n clearTimer(hub, \"ack\");\n pumpQueue(hub);\n}\n\nfunction subscribeAll(hub: Hub): void {\n const wanted = wantedSelectors(hub);\n wanted.forEach((entry, index) => {\n const key = gaslessStreamSelectorKey(entry.selector);\n if (index >= hub.maxSubscriptions) {\n /** Over the cap: this selector stays on HTTP until a slot frees. */\n entry.state = \"overflow\";\n for (const listener of entry.listeners) {\n listener.onStatusChange?.(\"degraded\", {\n reason: \"subscription-limit\",\n detail: `The gateway allows ${hub.maxSubscriptions} subscriptions per socket; this workflow keeps polling over HTTP until a slot frees.`,\n });\n }\n return;\n }\n if (isCommandPending(hub, key)) return;\n entry.state = \"pending\";\n enqueue(hub, { key, kind: \"subscribe\", frame: buildGaslessSubscribeCommand(entry.selector) });\n });\n}\n\nfunction armLiveness(hub: Hub): void {\n clearTimer(hub, \"liveness\");\n hub.timers.liveness = setTimeout(() => {\n hub.timers.liveness = undefined;\n /** Heartbeats stopped: treat it as a dead connection and redial. */\n dropSocket(hub);\n scheduleRedial(hub, {\n reason: \"unreachable\",\n detail: \"The gateway stopped sending heartbeats; reconnecting while status reads continue over HTTP.\",\n });\n }, LIVENESS_TIMEOUT_MS);\n}\n\nfunction dropSocket(hub: Hub): void {\n clearTimer(hub, \"ready\");\n clearTimer(hub, \"command\");\n clearTimer(hub, \"ack\");\n clearTimer(hub, \"liveness\");\n hub.inFlight = null;\n hub.queue = [];\n const socket = hub.socket;\n hub.socket = null;\n socket?.close(1000);\n}\n\nfunction scheduleRedial(hub: Hub, detail: GaslessStreamStatusDetail): void {\n if (hub.phase === \"disabled\") return;\n hub.phase = \"backoff\";\n setStatus(hub, \"degraded\", detail);\n const delay = computeBackoffDelay(hub.attempt, BACKOFF, hub.random);\n hub.attempt += 1;\n clearTimer(hub, \"redial\");\n hub.timers.redial = setTimeout(() => {\n hub.timers.redial = undefined;\n if (hub.selectors.size === 0) {\n hub.phase = \"idle\";\n return;\n }\n connect(hub);\n }, delay);\n}\n\nfunction disable(hub: Hub, detail: GaslessStreamStatusDetail, error?: SymmError): void {\n hub.phase = \"disabled\";\n dropSocket(hub);\n clearTimer(hub, \"redial\");\n for (const entry of hub.selectors.values()) entry.state = \"overflow\";\n setStatus(hub, \"disabled\", detail);\n if (error) notifyError(hub, null, error);\n}\n\nfunction handleMessage(hub: Hub, data: unknown): void {\n armLiveness(hub);\n const message = parseGaslessStreamMessage(data);\n\n /** The throttle notice has no type or instance, so it is handled first. */\n if (message.type === \"throttle\") {\n const pending = hub.inFlight;\n hub.inFlight = null;\n clearTimer(hub, \"ack\");\n if (pending) hub.queue.unshift(pending);\n clearTimer(hub, \"command\");\n hub.timers.command = setTimeout(\n () => {\n hub.timers.command = undefined;\n pumpQueue(hub);\n },\n THROTTLE_BACKOFF_MS + Math.round(hub.random() * THROTTLE_BACKOFF_MS),\n );\n return;\n }\n\n if (message.type === \"unparseable\" || message.type === \"transport\") return;\n\n if (message.type === \"error\") {\n const key = message.selector ? gaslessStreamSelectorKey(message.selector) : null;\n if (key) completeInFlight(hub, key);\n const entry = key ? hub.selectors.get(key) : undefined;\n\n if (message.code === \"NOT_FOUND\" && entry) {\n /**\n * The accepted record may not be readable the instant a 202 returns, and\n * the gateway does not retain a NOT_FOUND subscription, so resubscribe a\n * few times before giving up on the stream for this workflow.\n */\n if (entry.notFoundRetries < NOT_FOUND_RETRIES) {\n entry.notFoundRetries += 1;\n const retried = entry;\n setTimeout(() => {\n if (hub.phase !== \"ready\" || retried.done) return;\n enqueue(hub, {\n key: gaslessStreamSelectorKey(retried.selector),\n kind: \"subscribe\",\n frame: buildGaslessSubscribeCommand(retried.selector),\n });\n }, NOT_FOUND_RETRY_MS);\n return;\n }\n entry.state = \"not-found\";\n for (const listener of entry.listeners) {\n listener.onStatusChange?.(\"degraded\", {\n reason: \"not-found\",\n detail:\n \"The gateway does not store this workflow on the configured instance; status reads continue over HTTP.\",\n });\n }\n notifyError(\n hub,\n key,\n new SymmError(\n \"api\",\n \"GASLESS_STREAM_NOT_FOUND\",\n \"Gasless: the status stream does not know this request id on the configured protocol instance. Check that the workflow was accepted by this instance; status reads continue over HTTP.\",\n ),\n );\n return;\n }\n\n if (message.code === \"SUBSCRIPTION_LIMIT\" && entry) {\n entry.state = \"overflow\";\n for (const listener of entry.listeners) {\n listener.onStatusChange?.(\"degraded\", {\n reason: \"subscription-limit\",\n detail: \"The socket is at its subscription limit; this workflow keeps polling over HTTP.\",\n });\n }\n return;\n }\n\n notifyError(\n hub,\n key,\n new SymmError(\n \"api\",\n message.code === \"INVALID_MESSAGE\" ? \"GASLESS_STREAM_COMMAND_INVALID\" : \"GASLESS_STREAM_PROTOCOL_ERROR\",\n `Gasless: the status stream rejected a command with ${message.code}.`,\n ),\n );\n return;\n }\n\n /** Every remaining frame names an instance; a mismatch means a different deployment answered. */\n if (message.protocolInstance !== hub.endpoint.protocolInstance) {\n disable(\n hub,\n {\n reason: \"instance-mismatch\",\n detail: `The status stream answered for protocol instance \"${message.protocolInstance}\" but the config pins \"${hub.endpoint.protocolInstance}\". Status reads continue over HTTP.`,\n },\n new SymmError(\n \"api\",\n \"GASLESS_STREAM_INSTANCE_MISMATCH\",\n `Gasless: the status stream answered for protocol instance \"${message.protocolInstance}\" but the config pins \"${hub.endpoint.protocolInstance}\".`,\n ),\n );\n return;\n }\n\n if (message.type === \"ready\") {\n clearTimer(hub, \"ready\");\n hub.phase = \"ready\";\n hub.maxSubscriptions = message.maxSubscriptions;\n setStatus(hub, \"connecting\", null);\n subscribeAll(hub);\n return;\n }\n\n if (message.type === \"unsubscribed\") {\n completeInFlight(hub, gaslessStreamSelectorKey(message.selector));\n return;\n }\n\n const key = gaslessStreamSelectorKey(message.selector);\n const entry = hub.selectors.get(key);\n if (!entry) return;\n if (message.type === \"snapshot\") {\n completeInFlight(hub, key);\n /** A delivering socket is healthy, so the dial backoff starts over. */\n hub.attempt = 0;\n }\n entry.state = \"live\";\n entry.notFoundRetries = 0;\n setStatus(hub, \"live\", null);\n const update: GaslessRequestStreamUpdate = {\n kind: message.type,\n request: message.request,\n transactions: message.transactions,\n };\n /** Kept so a watcher that joins this subscription later starts from it. */\n entry.lastUpdate = update;\n for (const listener of entry.listeners) listener.onUpdate(update);\n}\n\nfunction handleClose(hub: Hub, code?: number): void {\n if (hub.phase === \"disabled\") return;\n const reachedReady = hub.phase === \"ready\";\n hub.socket = null;\n clearTimer(hub, \"ready\");\n clearTimer(hub, \"command\");\n clearTimer(hub, \"ack\");\n clearTimer(hub, \"liveness\");\n hub.inFlight = null;\n hub.queue = [];\n for (const entry of hub.selectors.values()) if (entry.state === \"live\") entry.state = \"pending\";\n\n const policy = classifyGaslessCloseCode(code);\n const detail: GaslessStreamStatusDetail = { reason: policy.reason, closeCode: code, detail: policy.detail };\n\n if (policy.action === \"disable\") {\n disable(hub, detail, new SymmError(\"api\", \"GASLESS_STREAM_DISABLED\", `Gasless: ${policy.detail}`));\n return;\n }\n if (policy.action === \"retry-bounded\" && !reachedReady && hub.attempt >= GASLESS_STREAM_BOUNDED_ATTEMPTS) {\n disable(\n hub,\n detail,\n new SymmError(\n \"api\",\n \"GASLESS_STREAM_DISABLED\",\n `Gasless: the status stream closed ${GASLESS_STREAM_BOUNDED_ATTEMPTS} times without connecting. ${policy.detail}`,\n ),\n );\n return;\n }\n scheduleRedial(hub, detail);\n}\n\nfunction connect(hub: Hub): void {\n if (hub.phase === \"disabled\" || hub.socket !== null) return;\n hub.phase = \"connecting\";\n setStatus(hub, \"connecting\", null);\n\n let socket: ReconnectingSocket;\n try {\n socket = createReconnectingSocket({\n url: hub.endpoint.url,\n webSocketConstructor: hub.webSocketConstructor,\n /** The hub owns reconnects: the close code decides whether to redial at all. */\n reconnect: { enabled: false },\n onMessage: (data) => handleMessage(hub, data),\n onClose: ({ code }) => handleClose(hub, code),\n onError: () => {\n /** A transport error is always followed by a close, which carries the policy. */\n },\n });\n } catch (err) {\n scheduleRedial(hub, {\n reason: \"unreachable\",\n detail: `The status stream could not be opened (${err instanceof Error ? err.message : String(err)}); status reads continue over HTTP.`,\n });\n return;\n }\n hub.socket = socket;\n armLiveness(hub);\n hub.timers.ready = setTimeout(() => {\n hub.timers.ready = undefined;\n /** Opened but never greeted: close and redial rather than sending into the void. */\n dropSocket(hub);\n handleClose(hub, 1006);\n }, READY_TIMEOUT_MS);\n}\n\n/**\n * Parameters for {@link acquireGaslessStreamSelector}.\n *\n * @internal\n */\nexport interface AcquireGaslessStreamSelectorParameters {\n /** The resolved stream endpoint; one hub per URL per config. */\n endpoint: GaslessStreamEndpoint;\n /** What this watcher wants to follow. */\n selector: GaslessStreamSelector;\n /** This watcher's callbacks. */\n listener: GaslessStreamListener;\n /** Randomness for backoff and throttle jitter; injectable for tests. */\n random?: () => number;\n}\n\n/**\n * Join (or open) the shared status stream for an endpoint and subscribe one\n * selector.\n *\n * One socket serves every watcher of a `(config, endpoint)` pair: the hub keeps\n * the desired selector set independent of the connection, replays it after each\n * `ready`, paces commands so they do not eat the caller's request quota, and\n * routes every frame to the watchers of its selector. Watchers are told when the\n * stream is not delivering so they can poll instead — the hub itself never\n * issues HTTP.\n *\n * A subscription outlives its last watcher by a short grace, and a watcher that\n * joins one which has already delivered is handed that record. Together they\n * make the handoff between two waits on the same workflow free: no\n * unsubscribe/subscribe round trip, and nothing to read over HTTP.\n *\n * @returns A release function; the socket closes shortly after the last watcher releases.\n *\n * @internal\n */\nexport function acquireGaslessStreamSelector(\n config: Config,\n parameters: AcquireGaslessStreamSelectorParameters,\n): () => void {\n const { endpoint, selector, listener, random = Math.random } = parameters;\n\n let registry = hubRegistries.get(config);\n if (!registry) {\n registry = new Map();\n hubRegistries.set(config, registry);\n }\n\n let hub = registry.get(endpoint.url);\n if (!hub) {\n hub = {\n endpoint,\n socket: null,\n phase: \"idle\",\n status: \"idle\",\n detail: null,\n maxSubscriptions: 1,\n selectors: new Map(),\n queue: [],\n inFlight: null,\n attempt: 0,\n lastCommandAt: 0,\n timers: {},\n random,\n webSocketConstructor: config.getWebSocketConstructor(),\n };\n registry.set(endpoint.url, hub);\n }\n const currentHub = hub;\n const currentRegistry = registry;\n clearTimer(currentHub, \"idle\");\n\n const key = gaslessStreamSelectorKey(selector);\n let entry = currentHub.selectors.get(key);\n if (!entry) {\n entry = { selector, listeners: new Set(), state: \"pending\", notFoundRetries: 0, done: false };\n currentHub.selectors.set(key, entry);\n }\n const currentEntry = entry;\n /** Rejoined inside its grace: the subscription is still good, so keep it. */\n clearSelectorIdle(currentEntry);\n currentEntry.listeners.add(listener);\n ensureSubscribed(currentHub, key, currentEntry);\n\n /** Sync the late joiner to the stream's current health. */\n listener.onStatusChange?.(\n currentHub.status === \"live\" && currentEntry.state !== \"live\" ? \"degraded\" : currentHub.status,\n currentHub.detail,\n );\n\n /**\n * A watcher joining a subscription that already delivered starts from what it\n * delivered: the gateway sends its snapshot once per *subscribe*, not once\n * per listener, so without this a joiner would wait for a change that may\n * never come.\n *\n * Deferred by a microtask because `watchGaslessRequest` releases its selector\n * from inside `onUpdate` when the record is terminal — delivering inline\n * would re-enter the hub in the middle of this acquire.\n */\n if (currentEntry.lastUpdate) {\n queueMicrotask(() => {\n /** Re-read rather than capture: a frame that landed meanwhile is the one to deliver. */\n const update = currentEntry.lastUpdate;\n if (update && currentEntry.listeners.has(listener)) listener.onUpdate(update);\n });\n }\n\n if (currentHub.phase === \"idle\") connect(currentHub);\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n currentEntry.listeners.delete(listener);\n if (currentEntry.listeners.size > 0) return;\n\n /**\n * Nobody is watching, but the next wait on this workflow is often moments\n * away, so the subscription is held briefly before it is given up — unless\n * another selector is over the cap and waiting for exactly this slot. The\n * grace saves a round trip; it is never a claim on a scarce resource.\n */\n clearSelectorIdle(currentEntry);\n if (hasOverflowedSelector(currentHub)) {\n removeSelector(currentHub, key, currentEntry);\n } else {\n currentEntry.idle = setTimeout(() => {\n currentEntry.idle = undefined;\n removeSelector(currentHub, key, currentEntry);\n }, SELECTOR_IDLE_MS);\n }\n\n if (!hasWatchers(currentHub)) {\n clearTimer(currentHub, \"idle\");\n currentHub.timers.idle = setTimeout(() => {\n currentHub.timers.idle = undefined;\n if (hasWatchers(currentHub)) return;\n for (const entry of currentHub.selectors.values()) clearSelectorIdle(entry);\n currentHub.selectors.clear();\n clearAllTimers(currentHub);\n dropSocket(currentHub);\n currentHub.phase = currentHub.phase === \"disabled\" ? \"disabled\" : \"idle\";\n currentRegistry.delete(endpoint.url);\n }, IDLE_CLOSE_MS);\n }\n };\n}\n\n/**\n * Mark a selector finished, so a reconnect does not resubscribe it.\n *\n * The caller decides what \"finished\" means — a terminal workflow status, or a\n * dismissed row — and the hub unsubscribes it from the live socket.\n *\n * @internal\n */\nexport function releaseGaslessStreamSelector(\n config: Config,\n endpointUrl: string,\n selector: GaslessStreamSelector,\n): void {\n const hub = hubRegistries.get(config)?.get(endpointUrl);\n if (!hub) return;\n const key = gaslessStreamSelectorKey(selector);\n const entry = hub.selectors.get(key);\n if (!entry || entry.done) return;\n entry.done = true;\n if (hub.phase === \"ready\" && entry.state === \"live\") {\n enqueue(hub, { key, kind: \"unsubscribe\", frame: buildGaslessUnsubscribeCommand(selector) });\n }\n}\n"],"mappings":";;;;;;AAiBA,IAAM,IAAU;CAAE,aAAa;CAAO,YAAY;CAAQ,QAAQ;AAAK,GAEjE,IAAsB,KAEtB,IAAyB,KAEzB,IAAsB,KAEtB,IAAsB,KAEtB,IAAgB,KAWhB,IAAmB,KAEnB,IAAmB,KAEnB,IAAoB,GAEpB,IAAqB,MA2DrB,oBAAgB,IAAI,QAAkC;AAE5D,SAAS,EAAW,GAAU,GAAiC;CAC7D,IAAM,IAAQ,EAAI,OAAO;CACzB,AAAI,MAAU,KAAA,MACZ,aAAa,CAAK,GAClB,EAAI,OAAO,KAAQ,KAAA;AAEvB;AAEA,SAAS,EAAe,GAAgB;CACtC,KAAK,IAAM,KAAQ,OAAO,KAAK,EAAI,MAAM,GAA8B,EAAW,GAAK,CAAI;AAC7F;AAEA,SAAS,EAAU,GAAU,GAA6B,GAAgD;CAExG,AADA,EAAI,SAAS,GACb,EAAI,SAAS;CACb,KAAK,IAAM,KAAS,EAAI,UAAU,OAAO,GAAG;EAE1C,IAAM,IAAY,MAAW,UAAU,EAAM,UAAU,SAAS,aAAa;EAC7E,KAAK,IAAM,KAAY,EAAM,WAAW,EAAS,iBAAiB,GAAW,CAAM;CACrF;AACF;AAEA,SAAS,EAAY,GAAU,GAAoB,GAAwB;CACzE,IAAM,IAAU,MAAQ,OAAO,CAAC,GAAG,EAAI,UAAU,OAAO,CAAC,IAAI,CAAC,EAAI,UAAU,IAAI,CAAG,CAAC,EAAE,OAAO,OAAO;CACpG,KAAK,IAAM,KAAS,GAClB,KAAK,IAAM,KAAY,EAAM,WAAW,EAAS,UAAU,CAAK;AAEpE;AAGA,SAAS,EAAgB,GAA2B;CAClD,OAAO,CAAC,GAAG,EAAI,UAAU,OAAO,CAAC,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,GAC1B,EAAsB,CAAU,IAClC,EAAe,GAAY,GAAK,CAAY,IAE5C,EAAa,OAAO,iBAAiB;GAEnC,AADA,EAAa,OAAO,KAAA,GACpB,EAAe,GAAY,GAAK,CAAY;EAC9C,GAAG,CAAgB,GAGhB,EAAY,CAAU,MACzB,EAAW,GAAY,MAAM,GAC7B,EAAW,OAAO,OAAO,iBAAiB;GACxC,MAAW,OAAO,OAAO,KAAA,GACrB,GAAY,CAAU,GAC1B;SAAK,IAAM,KAAS,EAAW,UAAU,OAAO,GAAG,EAAkB,CAAK;IAK1E,AAJA,EAAW,UAAU,MAAM,GAC3B,EAAe,CAAU,GACzB,EAAW,CAAU,GACrB,EAAW,QAAQ,EAAW,UAAU,aAAa,aAAa,QAClE,EAAgB,OAAO,EAAS,GAAG;GALuC;EAM5E,GAAG,CAAa;CAEpB;AACF;AAUA,SAAgB,EACd,GACA,GACA,GACM;CACN,IAAM,IAAM,EAAc,IAAI,CAAM,GAAG,IAAI,CAAW;CACtD,IAAI,CAAC,GAAK;CACV,IAAM,IAAM,EAAyB,CAAQ,GACvC,IAAQ,EAAI,UAAU,IAAI,CAAG;CAC/B,CAAC,KAAS,EAAM,SACpB,EAAM,OAAO,IACT,EAAI,UAAU,WAAW,EAAM,UAAU,UAC3C,EAAQ,GAAK;EAAE;EAAK,MAAM;EAAe,OAAO,EAA+B,CAAQ;CAAE,CAAC;AAE9F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './close-code-policy.js';
|
|
2
|
+
export * from './gasless-stream-hub.js';
|
|
3
|
+
export * from './parse-gasless-stream-message.js';
|
|
4
|
+
export * from './resolve-gasless-stream-url.js';
|
|
5
|
+
export * from './types.js';
|
|
6
|
+
export * from './watch-gasless-request.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/websocket/gasless/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { GaslessRequest, GaslessRequestTransaction } from '../../gasless/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Which workflow a stream frame is about: a request id, or one stored
|
|
4
|
+
* transaction attempt by hash. Hash selectors are compared lowercase, the form
|
|
5
|
+
* the gateway echoes.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type GaslessStreamSelector = {
|
|
10
|
+
kind: "request";
|
|
11
|
+
requestId: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "transaction";
|
|
14
|
+
txHash: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A parsed inbound stream frame.
|
|
18
|
+
*
|
|
19
|
+
* `throttle` is the gateway's own rate-limit notice, which arrives as a bare
|
|
20
|
+
* `{"error":"Rate limit exceeded"}` — no `type`, no `protocol_instance`, no
|
|
21
|
+
* selector. It must be recognised before the instance check, or a healthy
|
|
22
|
+
* socket would be torn down every time a command is throttled.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export type GaslessStreamMessage = {
|
|
27
|
+
type: "ready";
|
|
28
|
+
protocolInstance: string;
|
|
29
|
+
maxSubscriptions: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "snapshot" | "update";
|
|
32
|
+
protocolInstance: string;
|
|
33
|
+
selector: GaslessStreamSelector;
|
|
34
|
+
request: GaslessRequest | null;
|
|
35
|
+
transactions: readonly GaslessRequestTransaction[];
|
|
36
|
+
} | {
|
|
37
|
+
type: "unsubscribed";
|
|
38
|
+
protocolInstance: string;
|
|
39
|
+
selector: GaslessStreamSelector;
|
|
40
|
+
} | {
|
|
41
|
+
type: "error";
|
|
42
|
+
protocolInstance: string | null;
|
|
43
|
+
code: string;
|
|
44
|
+
selector: GaslessStreamSelector | null;
|
|
45
|
+
} | {
|
|
46
|
+
type: "throttle";
|
|
47
|
+
message: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "transport";
|
|
50
|
+
kind: "heartbeat" | "pong";
|
|
51
|
+
protocolInstance: string | null;
|
|
52
|
+
} | {
|
|
53
|
+
type: "unparseable";
|
|
54
|
+
detail: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Parse one inbound stream frame into a discriminated message.
|
|
58
|
+
*
|
|
59
|
+
* Parsing never throws: a malformed frame becomes `unparseable`, so one bad
|
|
60
|
+
* message cannot take down a socket that is otherwise delivering. The caller
|
|
61
|
+
* checks `protocolInstance` itself — every frame that carries one exposes it —
|
|
62
|
+
* after handling `throttle` and `error`.
|
|
63
|
+
*
|
|
64
|
+
* A `snapshot`/`update` carries the same models the HTTP reads return, so both
|
|
65
|
+
* transports normalize through `toGaslessRequest` / `toGaslessRequestTransaction`
|
|
66
|
+
* and a consumer cannot tell which one produced a record. A record the
|
|
67
|
+
* normalizer rejects (an unknown status, say) yields `request: null` rather
|
|
68
|
+
* than throwing, leaving the poll fallback to fetch it.
|
|
69
|
+
*
|
|
70
|
+
* @param data - The raw `event.data` from the socket.
|
|
71
|
+
* @returns The parsed message.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseGaslessStreamMessage(data: unknown): GaslessStreamMessage;
|
|
76
|
+
/** Stable map key for a selector, so listeners and pending commands agree. @internal */
|
|
77
|
+
export declare function gaslessStreamSelectorKey(selector: GaslessStreamSelector): string;
|
|
78
|
+
/** The JSON command that subscribes to a selector. @internal */
|
|
79
|
+
export declare function buildGaslessSubscribeCommand(selector: GaslessStreamSelector): string;
|
|
80
|
+
/** The JSON command that releases a selector. @internal */
|
|
81
|
+
export declare function buildGaslessUnsubscribeCommand(selector: GaslessStreamSelector): string;
|
|
82
|
+
//# sourceMappingURL=parse-gasless-stream-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-gasless-stream-message.d.ts","sourceRoot":"","sources":["../../../src/websocket/gasless/parse-gasless-stream-message.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGrF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErH;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACrE;IACE,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACpD,GACD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,qBAAqB,CAAA;CAAE,GACnF;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAA;CAAE,GACxG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAClF;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAgB5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,oBAAoB,CAkF7E;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAEhF;AAED,gEAAgE;AAChE,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAIpF;AAED,2DAA2D;AAC3D,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAItF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { toGaslessRequest as e } from "../../gasless/get-gasless-request/to-gasless-request.js";
|
|
2
|
+
import { toGaslessRequestTransaction as t } from "../../gasless/get-gasless-request-transactions/to-gasless-request-transaction.js";
|
|
3
|
+
//#region src/websocket/gasless/parse-gasless-stream-message.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
return typeof e == "object" && e ? e : null;
|
|
6
|
+
}
|
|
7
|
+
function r(e) {
|
|
8
|
+
let t = n(e);
|
|
9
|
+
if (!t) return null;
|
|
10
|
+
let r = t.request_id;
|
|
11
|
+
if (typeof r == "string" && r !== "") return {
|
|
12
|
+
kind: "request",
|
|
13
|
+
requestId: r
|
|
14
|
+
};
|
|
15
|
+
let i = t.tx_hash;
|
|
16
|
+
return typeof i == "string" && i !== "" ? {
|
|
17
|
+
kind: "transaction",
|
|
18
|
+
txHash: i.toLowerCase()
|
|
19
|
+
} : null;
|
|
20
|
+
}
|
|
21
|
+
function i(i) {
|
|
22
|
+
if (typeof i != "string") return {
|
|
23
|
+
type: "unparseable",
|
|
24
|
+
detail: "the frame was not text"
|
|
25
|
+
};
|
|
26
|
+
let a;
|
|
27
|
+
try {
|
|
28
|
+
a = JSON.parse(i);
|
|
29
|
+
} catch {
|
|
30
|
+
return {
|
|
31
|
+
type: "unparseable",
|
|
32
|
+
detail: "the frame was not valid JSON"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
let o = n(a);
|
|
36
|
+
if (!o) return {
|
|
37
|
+
type: "unparseable",
|
|
38
|
+
detail: "the frame was not a JSON object"
|
|
39
|
+
};
|
|
40
|
+
let s = o.error;
|
|
41
|
+
if (typeof s == "string" && o.type === void 0) return {
|
|
42
|
+
type: "throttle",
|
|
43
|
+
message: s
|
|
44
|
+
};
|
|
45
|
+
let c = typeof o.protocol_instance == "string" ? o.protocol_instance : null, l = o.type;
|
|
46
|
+
if (l === "ready") {
|
|
47
|
+
if (c === null) return {
|
|
48
|
+
type: "unparseable",
|
|
49
|
+
detail: "the ready frame named no protocol instance"
|
|
50
|
+
};
|
|
51
|
+
let e = o.max_subscriptions;
|
|
52
|
+
return {
|
|
53
|
+
type: "ready",
|
|
54
|
+
protocolInstance: c,
|
|
55
|
+
maxSubscriptions: typeof e == "number" && Number.isSafeInteger(e) && e > 0 ? e : 1
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (l === "error") return {
|
|
59
|
+
type: "error",
|
|
60
|
+
protocolInstance: c,
|
|
61
|
+
code: typeof o.code == "string" ? o.code : "GASLESS_STREAM_PROTOCOL_ERROR",
|
|
62
|
+
selector: r(o.subscription)
|
|
63
|
+
};
|
|
64
|
+
if (l === "heartbeat" || l === "pong") return {
|
|
65
|
+
type: "transport",
|
|
66
|
+
kind: l,
|
|
67
|
+
protocolInstance: c
|
|
68
|
+
};
|
|
69
|
+
if (l === "unsubscribed") {
|
|
70
|
+
let e = r(o.subscription);
|
|
71
|
+
return !e || c === null ? {
|
|
72
|
+
type: "unparseable",
|
|
73
|
+
detail: "the unsubscribed frame named no subscription"
|
|
74
|
+
} : {
|
|
75
|
+
type: "unsubscribed",
|
|
76
|
+
protocolInstance: c,
|
|
77
|
+
selector: e
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (l === "snapshot" || l === "update") {
|
|
81
|
+
let i = r(o.subscription);
|
|
82
|
+
if (!i || c === null) return {
|
|
83
|
+
type: "unparseable",
|
|
84
|
+
detail: `the ${l} frame named no subscription`
|
|
85
|
+
};
|
|
86
|
+
let a = n(o.data) ?? {}, s = n(a.request), u = null;
|
|
87
|
+
if (s && Object.keys(s).length > 0) try {
|
|
88
|
+
u = e(s);
|
|
89
|
+
} catch {
|
|
90
|
+
u = null;
|
|
91
|
+
}
|
|
92
|
+
let d = Array.isArray(a.transactions) ? a.transactions : [], f = [];
|
|
93
|
+
for (let e of d) {
|
|
94
|
+
let r = n(e);
|
|
95
|
+
if (r) try {
|
|
96
|
+
f.push(t(r));
|
|
97
|
+
} catch {}
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
type: l,
|
|
101
|
+
protocolInstance: c,
|
|
102
|
+
selector: i,
|
|
103
|
+
request: u,
|
|
104
|
+
transactions: f
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
type: "unparseable",
|
|
109
|
+
detail: `unknown frame type ${typeof l == "string" ? `"${l}"` : "(absent)"}`
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function a(e) {
|
|
113
|
+
return e.kind === "request" ? `request:${e.requestId}` : `transaction:${e.txHash}`;
|
|
114
|
+
}
|
|
115
|
+
function o(e) {
|
|
116
|
+
return e.kind === "request" ? JSON.stringify({
|
|
117
|
+
type: "subscribe",
|
|
118
|
+
request_id: e.requestId
|
|
119
|
+
}) : JSON.stringify({
|
|
120
|
+
type: "subscribe",
|
|
121
|
+
tx_hash: e.txHash
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function s(e) {
|
|
125
|
+
return e.kind === "request" ? JSON.stringify({
|
|
126
|
+
type: "unsubscribe",
|
|
127
|
+
request_id: e.requestId
|
|
128
|
+
}) : JSON.stringify({
|
|
129
|
+
type: "unsubscribe",
|
|
130
|
+
tx_hash: e.txHash
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { o as buildGaslessSubscribeCommand, s as buildGaslessUnsubscribeCommand, a as gaslessStreamSelectorKey, i as parseGaslessStreamMessage };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=parse-gasless-stream-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-gasless-stream-message.js","names":[],"sources":["../../../src/websocket/gasless/parse-gasless-stream-message.ts"],"sourcesContent":["import { toGaslessRequestTransaction } from \"../../gasless/get-gasless-request-transactions/to-gasless-request-transaction\";\nimport { toGaslessRequest } from \"../../gasless/get-gasless-request/to-gasless-request\";\nimport type { GaslessRequest, GaslessRequestTransaction } from \"../../gasless/types\";\nimport type { GaslessWireRequestRecord, GaslessWireTransactionAttempt } from \"../../gasless/wire-types\";\n\n/**\n * Which workflow a stream frame is about: a request id, or one stored\n * transaction attempt by hash. Hash selectors are compared lowercase, the form\n * the gateway echoes.\n *\n * @internal\n */\nexport type GaslessStreamSelector = { kind: \"request\"; requestId: string } | { kind: \"transaction\"; txHash: string };\n\n/**\n * A parsed inbound stream frame.\n *\n * `throttle` is the gateway's own rate-limit notice, which arrives as a bare\n * `{\"error\":\"Rate limit exceeded\"}` — no `type`, no `protocol_instance`, no\n * selector. It must be recognised before the instance check, or a healthy\n * socket would be torn down every time a command is throttled.\n *\n * @internal\n */\nexport type GaslessStreamMessage =\n | { type: \"ready\"; protocolInstance: string; maxSubscriptions: number }\n | {\n type: \"snapshot\" | \"update\";\n protocolInstance: string;\n selector: GaslessStreamSelector;\n request: GaslessRequest | null;\n transactions: readonly GaslessRequestTransaction[];\n }\n | { type: \"unsubscribed\"; protocolInstance: string; selector: GaslessStreamSelector }\n | { type: \"error\"; protocolInstance: string | null; code: string; selector: GaslessStreamSelector | null }\n | { type: \"throttle\"; message: string }\n | { type: \"transport\"; kind: \"heartbeat\" | \"pong\"; protocolInstance: string | null }\n | { type: \"unparseable\"; detail: string };\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return typeof value === \"object\" && value !== null ? (value as Record<string, unknown>) : null;\n}\n\nfunction readSelector(value: unknown): GaslessStreamSelector | null {\n const subscription = asRecord(value);\n if (!subscription) return null;\n const requestId = subscription.request_id;\n if (typeof requestId === \"string\" && requestId !== \"\") return { kind: \"request\", requestId };\n const txHash = subscription.tx_hash;\n if (typeof txHash === \"string\" && txHash !== \"\") return { kind: \"transaction\", txHash: txHash.toLowerCase() };\n return null;\n}\n\n/**\n * Parse one inbound stream frame into a discriminated message.\n *\n * Parsing never throws: a malformed frame becomes `unparseable`, so one bad\n * message cannot take down a socket that is otherwise delivering. The caller\n * checks `protocolInstance` itself — every frame that carries one exposes it —\n * after handling `throttle` and `error`.\n *\n * A `snapshot`/`update` carries the same models the HTTP reads return, so both\n * transports normalize through `toGaslessRequest` / `toGaslessRequestTransaction`\n * and a consumer cannot tell which one produced a record. A record the\n * normalizer rejects (an unknown status, say) yields `request: null` rather\n * than throwing, leaving the poll fallback to fetch it.\n *\n * @param data - The raw `event.data` from the socket.\n * @returns The parsed message.\n *\n * @internal\n */\nexport function parseGaslessStreamMessage(data: unknown): GaslessStreamMessage {\n if (typeof data !== \"string\") return { type: \"unparseable\", detail: \"the frame was not text\" };\n\n let payload: unknown;\n try {\n payload = JSON.parse(data);\n } catch {\n return { type: \"unparseable\", detail: \"the frame was not valid JSON\" };\n }\n\n const frame = asRecord(payload);\n if (!frame) return { type: \"unparseable\", detail: \"the frame was not a JSON object\" };\n\n /**\n * The gateway's throttle notice has no `type` at all, so it is recognised\n * before anything else reads one.\n */\n const gatewayError = frame.error;\n if (typeof gatewayError === \"string\" && frame.type === undefined) {\n return { type: \"throttle\", message: gatewayError };\n }\n\n const protocolInstance = typeof frame.protocol_instance === \"string\" ? frame.protocol_instance : null;\n const type = frame.type;\n\n if (type === \"ready\") {\n if (protocolInstance === null) return { type: \"unparseable\", detail: \"the ready frame named no protocol instance\" };\n const max = frame.max_subscriptions;\n return {\n type: \"ready\",\n protocolInstance,\n maxSubscriptions: typeof max === \"number\" && Number.isSafeInteger(max) && max > 0 ? max : 1,\n };\n }\n\n if (type === \"error\") {\n const code = typeof frame.code === \"string\" ? frame.code : \"GASLESS_STREAM_PROTOCOL_ERROR\";\n return { type: \"error\", protocolInstance, code, selector: readSelector(frame.subscription) };\n }\n\n if (type === \"heartbeat\" || type === \"pong\") {\n return { type: \"transport\", kind: type, protocolInstance };\n }\n\n if (type === \"unsubscribed\") {\n const selector = readSelector(frame.subscription);\n if (!selector || protocolInstance === null) {\n return { type: \"unparseable\", detail: \"the unsubscribed frame named no subscription\" };\n }\n return { type: \"unsubscribed\", protocolInstance, selector };\n }\n\n if (type === \"snapshot\" || type === \"update\") {\n const selector = readSelector(frame.subscription);\n if (!selector || protocolInstance === null) {\n return { type: \"unparseable\", detail: `the ${type} frame named no subscription` };\n }\n const data = asRecord(frame.data) ?? {};\n const rawRequest = asRecord(data.request);\n let request: GaslessRequest | null = null;\n if (rawRequest && Object.keys(rawRequest).length > 0) {\n try {\n request = toGaslessRequest(rawRequest as unknown as GaslessWireRequestRecord);\n } catch {\n request = null;\n }\n }\n const rawTransactions = Array.isArray(data.transactions) ? data.transactions : [];\n const transactions: GaslessRequestTransaction[] = [];\n for (const attempt of rawTransactions) {\n const record = asRecord(attempt);\n if (!record) continue;\n try {\n transactions.push(toGaslessRequestTransaction(record as unknown as GaslessWireTransactionAttempt));\n } catch {\n /** A single unparseable attempt never discards the rest of the frame. */\n }\n }\n return { type: type as \"snapshot\" | \"update\", protocolInstance, selector, request, transactions };\n }\n\n return { type: \"unparseable\", detail: `unknown frame type ${typeof type === \"string\" ? `\"${type}\"` : \"(absent)\"}` };\n}\n\n/** Stable map key for a selector, so listeners and pending commands agree. @internal */\nexport function gaslessStreamSelectorKey(selector: GaslessStreamSelector): string {\n return selector.kind === \"request\" ? `request:${selector.requestId}` : `transaction:${selector.txHash}`;\n}\n\n/** The JSON command that subscribes to a selector. @internal */\nexport function buildGaslessSubscribeCommand(selector: GaslessStreamSelector): string {\n return selector.kind === \"request\"\n ? JSON.stringify({ type: \"subscribe\", request_id: selector.requestId })\n : JSON.stringify({ type: \"subscribe\", tx_hash: selector.txHash });\n}\n\n/** The JSON command that releases a selector. @internal */\nexport function buildGaslessUnsubscribeCommand(selector: GaslessStreamSelector): string {\n return selector.kind === \"request\"\n ? JSON.stringify({ type: \"unsubscribe\", request_id: selector.requestId })\n : JSON.stringify({ type: \"unsubscribe\", tx_hash: selector.txHash });\n}\n"],"mappings":";;;AAuCA,SAAS,EAAS,GAAgD;CAChE,OAAO,OAAO,KAAU,YAAY,IAAkB,IAAoC;AAC5F;AAEA,SAAS,EAAa,GAA8C;CAClE,IAAM,IAAe,EAAS,CAAK;CACnC,IAAI,CAAC,GAAc,OAAO;CAC1B,IAAM,IAAY,EAAa;CAC/B,IAAI,OAAO,KAAc,YAAY,MAAc,IAAI,OAAO;EAAE,MAAM;EAAW;CAAU;CAC3F,IAAM,IAAS,EAAa;CAE5B,OADI,OAAO,KAAW,YAAY,MAAW,KAAW;EAAE,MAAM;EAAe,QAAQ,EAAO,YAAY;CAAE,IACrG;AACT;AAqBA,SAAgB,EAA0B,GAAqC;CAC7E,IAAI,OAAO,KAAS,UAAU,OAAO;EAAE,MAAM;EAAe,QAAQ;CAAyB;CAE7F,IAAI;CACJ,IAAI;EACF,IAAU,KAAK,MAAM,CAAI;CAC3B,QAAQ;EACN,OAAO;GAAE,MAAM;GAAe,QAAQ;EAA+B;CACvE;CAEA,IAAM,IAAQ,EAAS,CAAO;CAC9B,IAAI,CAAC,GAAO,OAAO;EAAE,MAAM;EAAe,QAAQ;CAAkC;CAMpF,IAAM,IAAe,EAAM;CAC3B,IAAI,OAAO,KAAiB,YAAY,EAAM,SAAS,KAAA,GACrD,OAAO;EAAE,MAAM;EAAY,SAAS;CAAa;CAGnD,IAAM,IAAmB,OAAO,EAAM,qBA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