@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
+
import { GaslessRelayEvent } from '../../gasless/types.js';
|
|
2
3
|
/**
|
|
3
4
|
* Contract addresses for a SYMMIO chain deployment.
|
|
4
5
|
*/
|
|
@@ -320,6 +321,196 @@ export interface SymmioInventoryConfig {
|
|
|
320
321
|
*/
|
|
321
322
|
url: string;
|
|
322
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* Failure policy for the transparent gasless execution mode, applied when the
|
|
326
|
+
* relay definitively rejects a request **before** it is accepted (a 4xx, or a
|
|
327
|
+
* pre-broadcast `rejected`).
|
|
328
|
+
*
|
|
329
|
+
* - `"error"` (default): surface a typed error; the consumer decides what to do.
|
|
330
|
+
* - `"wallet"`: silently fall back to the normal gas-paid wallet path.
|
|
331
|
+
*
|
|
332
|
+
* After the service accepts a request (HTTP 202) no fallback ever happens — the
|
|
333
|
+
* relayed transaction may still execute, and a wallet retry would duplicate it.
|
|
334
|
+
*/
|
|
335
|
+
export type GaslessFallback = "error" | "wallet";
|
|
336
|
+
/**
|
|
337
|
+
* Defaults governing how existing contract writes dispatch when the transparent
|
|
338
|
+
* gasless execution mode is active. Every field can be overridden per call via
|
|
339
|
+
* the `gasless` write parameter.
|
|
340
|
+
*/
|
|
341
|
+
export interface GaslessExecutionConfig {
|
|
342
|
+
/**
|
|
343
|
+
* `"wallet"` (default): writes go through the connected wallet as always.
|
|
344
|
+
* `"gasless"`: relayable writes are signed as InstantLayer operations and
|
|
345
|
+
* relayed through GaslessQ; non-relayable writes keep the wallet path.
|
|
346
|
+
*/
|
|
347
|
+
mode?: "wallet" | "gasless";
|
|
348
|
+
/** Pre-acceptance failure policy. Default `"error"`. */
|
|
349
|
+
fallback?: GaslessFallback;
|
|
350
|
+
/**
|
|
351
|
+
* Quote the batch on-chain (the GaslessLayer's `previewFeeQuote`) before
|
|
352
|
+
* prompting the user for a signature, and fail fast when the quote refuses
|
|
353
|
+
* it: `GASLESS_FREE_QUOTA_EXHAUSTED` when the daily free quota is spent (the
|
|
354
|
+
* one case `fallback: "wallet"` recovers from), `GASLESS_FEE_QUOTE_REVERTED`
|
|
355
|
+
* when the contract rejects the batch, and `GASLESS_LAYER_INTERFACE_UNSUPPORTED`
|
|
356
|
+
* when the GaslessLayer predates the multi-wallet interface. A quote that
|
|
357
|
+
* fails for transport reasons does not block, and the quote never checks
|
|
358
|
+
* affordability — the relayer's simulation is authoritative. Default `true`.
|
|
359
|
+
*/
|
|
360
|
+
preflightFee?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Verify on-chain (`isDelegationActive`) that the signing key is authorized
|
|
363
|
+
* for every selector a relayed write carries before prompting the user for a
|
|
364
|
+
* signature, and fail fast when a session key is missing a delegation.
|
|
365
|
+
* Skipped for the sub-account's own owner, who needs no delegation.
|
|
366
|
+
* Default `true`.
|
|
367
|
+
*/
|
|
368
|
+
preflightDelegation?: boolean;
|
|
369
|
+
/** Max wait for the relayer to broadcast before timing out. Default `120_000` ms. */
|
|
370
|
+
broadcastTimeoutMs?: number;
|
|
371
|
+
/** Status poll cadence while the request is `queued`. Default `1_500` ms. */
|
|
372
|
+
queuedPollMs?: number;
|
|
373
|
+
/** Status poll cadence after the request is `submitted`. Default `3_000` ms. */
|
|
374
|
+
submittedPollMs?: number;
|
|
375
|
+
/**
|
|
376
|
+
* How long a status wait lets the gateway's stream settle before falling back
|
|
377
|
+
* to its first HTTP read. It ends early the moment the stream delivers, or
|
|
378
|
+
* reports that it will not (unreachable, not-found, at its subscription cap,
|
|
379
|
+
* disabled). Ignored where the stream is off. Default `1_000` ms.
|
|
380
|
+
*/
|
|
381
|
+
streamSettleMs?: number;
|
|
382
|
+
/**
|
|
383
|
+
* How long a delivering stream may report nothing about a workflow before the
|
|
384
|
+
* wait takes one HTTP read anyway and re-arms. Heartbeats do not count — only
|
|
385
|
+
* records for the request do. Default `15_000` ms.
|
|
386
|
+
*/
|
|
387
|
+
streamStaleMs?: number;
|
|
388
|
+
/**
|
|
389
|
+
* HTTP timeout for each gasless submit, in ms: every relay and
|
|
390
|
+
* deposit-settlement POST, from the explicit actions as well as the
|
|
391
|
+
* transparent mode. A submit that times out is ambiguous (the gateway may
|
|
392
|
+
* already have accepted it) and fails like a network error, with status `0`.
|
|
393
|
+
* Status reads are not bounded by it. Default `30_000`.
|
|
394
|
+
*/
|
|
395
|
+
submitTimeoutMs?: number;
|
|
396
|
+
/**
|
|
397
|
+
* Lifecycle observer for relayed writes — fires at `accepted`, `broadcast`,
|
|
398
|
+
* and `terminal`. Persist request ids in the `accepted` event so in-flight
|
|
399
|
+
* workflows survive reloads.
|
|
400
|
+
*/
|
|
401
|
+
onEvent?: (event: GaslessRelayEvent) => void;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Status-stream availability for one GaslessQ deployment. It is a deployment
|
|
405
|
+
* fact, like the URL. Status WebSockets are optional and disabled by default at
|
|
406
|
+
* the gateway, and each environment enables them separately, so a stream is
|
|
407
|
+
* declared per chain rather than assumed.
|
|
408
|
+
*
|
|
409
|
+
* Where it is enabled, the stream is the primary transport for status waits and
|
|
410
|
+
* HTTP reads become the fallback: a wait subscribes, gives the stream
|
|
411
|
+
* `execution.streamSettleMs` to deliver, and polls only while the stream is not
|
|
412
|
+
* delivering. HTTP status reads stay available whether or not a stream is
|
|
413
|
+
* declared.
|
|
414
|
+
*/
|
|
415
|
+
export interface SymmioGaslessStatusStreamConfig {
|
|
416
|
+
/**
|
|
417
|
+
* Whether this deployment serves the status WebSocket. Set it to `true` only
|
|
418
|
+
* once the operators confirm streams for this environment and protocol
|
|
419
|
+
* instance. A staging confirmation does not cover production.
|
|
420
|
+
*/
|
|
421
|
+
enabled: boolean;
|
|
422
|
+
/**
|
|
423
|
+
* The gateway's `https://` origin, used to locate the stream when `url` is a
|
|
424
|
+
* proxy root, because a proxy that forwards HTTP cannot be assumed to forward
|
|
425
|
+
* WebSockets. Omit it for the gateway `url` forms, whose stream endpoint
|
|
426
|
+
* derives from `url` itself.
|
|
427
|
+
*/
|
|
428
|
+
origin?: string;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Chain-level configuration for the GaslessQ relayer service.
|
|
432
|
+
*
|
|
433
|
+
* GaslessQ relays user-signed InstantLayer operations so account actions need
|
|
434
|
+
* no native gas: the relayer broadcasts and pays, and the **GaslessLayer**
|
|
435
|
+
* contract charges an operational fee from the user's SYMMIO collateral in the
|
|
436
|
+
* same atomic transaction. Optional and chain-level, like `listing`: present
|
|
437
|
+
* only on perps-core (`"0.8.6"`) chains with a GaslessLayer deployment.
|
|
438
|
+
* Resolve it with `resolveGaslessService` / gate on `supportsGaslessService`.
|
|
439
|
+
*
|
|
440
|
+
* The gateway serves anonymous clients by default, so a browser app can call it
|
|
441
|
+
* directly with no `apiKey`, as long as the deployment allows the app's Origin
|
|
442
|
+
* and has not disabled anonymous access.
|
|
443
|
+
*/
|
|
444
|
+
export interface SymmioGaslessConfig {
|
|
445
|
+
/**
|
|
446
|
+
* Where the SDK reaches the GaslessQ gateway. One of:
|
|
447
|
+
*
|
|
448
|
+
* - the gateway **origin** (`https://host`, no path) with `protocolInstance`,
|
|
449
|
+
* the recommended form. The SDK derives
|
|
450
|
+
* `/v1/instances/{protocolInstance}/{operations|deposits}`.
|
|
451
|
+
* - an **instance root** (`…/v1/instances/<protocol-instance>`). The SDK
|
|
452
|
+
* appends `/{service}`.
|
|
453
|
+
* - an **instance-pinned service base**
|
|
454
|
+
* (`…/v1/instances/<protocol-instance>/operations` or `…/deposits`), used
|
|
455
|
+
* as-is and for that one service only.
|
|
456
|
+
* - any other path, absolute or relative, is a **proxy root** (for example a
|
|
457
|
+
* server-side proxy at `/api/gasless`). The SDK appends `/{service}`.
|
|
458
|
+
*
|
|
459
|
+
* The instance-less `/v1/operations` and `/v1/deposits` compatibility routes
|
|
460
|
+
* are rejected with `GASLESS_URL_LEGACY_ROUTE`: the gateway is retiring them,
|
|
461
|
+
* and they pin no instance to verify responses against. A query string, a
|
|
462
|
+
* fragment, credentials (`user:password@`) or a non-HTTP(S) scheme is
|
|
463
|
+
* rejected with `GASLESS_URL_INVALID`.
|
|
464
|
+
*/
|
|
465
|
+
url: string;
|
|
466
|
+
/**
|
|
467
|
+
* Protocol-instance key selecting the deployment at the gateway
|
|
468
|
+
* (`"<protocol-instance>"`, from the deployment handoff). Staging and
|
|
469
|
+
* production can share a chain id, so the key, not the chain, picks the
|
|
470
|
+
* contracts.
|
|
471
|
+
*
|
|
472
|
+
* Required with an origin `url` (`GASLESS_PROTOCOL_INSTANCE_REQUIRED`). With
|
|
473
|
+
* an instance root or service base it may be omitted, but when given it must
|
|
474
|
+
* equal the instance the path pins (`GASLESS_PROTOCOL_INSTANCE_CONFLICT`).
|
|
475
|
+
* With a proxy root it is the instance successful responses are checked
|
|
476
|
+
* against, whenever the proxy forwards the `X-GasLessQ-Protocol-Instance`
|
|
477
|
+
* header.
|
|
478
|
+
*/
|
|
479
|
+
protocolInstance?: string;
|
|
480
|
+
/**
|
|
481
|
+
* The GaslessLayer proxy address — the operational-fee charger and the
|
|
482
|
+
* source of every gasless read (wallet addresses, deposit policy, fee
|
|
483
|
+
* quotes, nonces). A deployment fact with **no runtime discovery**: update it
|
|
484
|
+
* on every gateway redeploy. It must run the multi-wallet GaslessLayer
|
|
485
|
+
* interface (`walletId`-scoped reads, `previewFeeQuote`); a proxy that has not
|
|
486
|
+
* been upgraded to it is unsupported, and its fee quote throws
|
|
487
|
+
* `GASLESS_LAYER_INTERFACE_UNSUPPORTED`.
|
|
488
|
+
*/
|
|
489
|
+
gaslessLayerAddress: Address;
|
|
490
|
+
/**
|
|
491
|
+
* Optional partner key, sent as `Authorization: Bearer <key>`. Omit it to use
|
|
492
|
+
* the gateway's anonymous profile, which is on by default: 10 requests per
|
|
493
|
+
* second per caller IP and protocol instance, shared across operations and
|
|
494
|
+
* deposits, with no `Authorization` header sent at all. Where anonymous access
|
|
495
|
+
* is on, a key only raises the gateway limits. A deployment can turn it off,
|
|
496
|
+
* and then answers keyless requests with `401`, so a key is required there. A
|
|
497
|
+
* key must be authorized for the protocol instance and service it calls, and
|
|
498
|
+
* it changes neither fees, wallet selection nor signatures.
|
|
499
|
+
*
|
|
500
|
+
* Meant for servers and backend-for-frontend proxies. **Never ship a key in a
|
|
501
|
+
* browser bundle**, where anyone can read it. An invalid, disabled or
|
|
502
|
+
* unauthorized key is rejected (`401` / `403`) and never falls back to
|
|
503
|
+
* anonymous access. Errors the SDK throws never carry the key.
|
|
504
|
+
*/
|
|
505
|
+
apiKey?: string;
|
|
506
|
+
/**
|
|
507
|
+
* Status-stream availability for this deployment. Omitted, the deployment is
|
|
508
|
+
* treated as serving no stream.
|
|
509
|
+
*/
|
|
510
|
+
statusStream?: SymmioGaslessStatusStreamConfig;
|
|
511
|
+
/** Transparent execution-mode defaults for existing contract writes. */
|
|
512
|
+
execution?: GaslessExecutionConfig;
|
|
513
|
+
}
|
|
323
514
|
/**
|
|
324
515
|
* The perps-core contracts generation a chain's deployment runs.
|
|
325
516
|
*
|
|
@@ -369,6 +560,12 @@ export interface SymmioChainConfig {
|
|
|
369
560
|
* resolve it with `resolveInventoryService`.
|
|
370
561
|
*/
|
|
371
562
|
inventory?: SymmioInventoryConfig;
|
|
563
|
+
/**
|
|
564
|
+
* Optional GaslessQ relayer service. Set on perps-core (`"0.8.6"`) chains
|
|
565
|
+
* with a GaslessLayer deployment; omitted elsewhere. Resolve it with
|
|
566
|
+
* `resolveGaslessService` / gate on `supportsGaslessService`.
|
|
567
|
+
*/
|
|
568
|
+
gasless?: SymmioGaslessConfig;
|
|
372
569
|
}
|
|
373
570
|
export {};
|
|
374
571
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/chains/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/chains/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,mCAAmC;IACnC,aAAa,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sDAAsD;IACtD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mCAAmC;IACnC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uCAAuC;IACvC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,kBAAkB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAExC;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,6BAA8B,CAAC;AAElE;;;;;;;;;GAS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MAAM,CAAC;IAChB,uFAAuF;IACvF,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,yBAAyB;IACzB,SAAS,EAAE,uBAAuB,CAAC;IACnC,yBAAyB;IACzB,SAAS,EAAE,kBAAkB,CAAC;IAC9B;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACvD,mFAAmF;IACnF,eAAe,EAAE,QAAQ,CAAC;IAC1B,kCAAkC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IACvC,gCAAgC;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/core/chains/types.ts"],"sourcesContent":["import type { Address } from \"viem\";\n\n/**\n * Contract addresses for a SYMMIO chain deployment.\n */\nexport interface SymmioContractAddresses {\n /** Main SYMMIO diamond contract */\n symmioAddress: Address;\n /** InstantLayer contract for instant actions */\n instantLayerAddress: Address;\n /** AccountLayer contract for subaccount management */\n accountLayerAddress: Address;\n /** Affiliates registry contract */\n affiliatesAddress: Address;\n /** Collateral token address (e.g. USDC) */\n collateralAddress: Address;\n /** Decimals of the collateral token */\n collateralDecimals: number;\n}\n\n/**\n * Subgraph endpoints for a SYMMIO chain deployment.\n */\nexport interface SymmioSubgraphUrls {\n /** Analytics subgraph for aggregated data (balance changes, quotes, history). */\n analytics: string;\n /** Events subgraph for raw on-chain events (e.g. `internalTransfers`). */\n events: string;\n}\n\n/**\n * Name of a configured subgraph endpoint (a key of {@link SymmioSubgraphUrls}).\n *\n * Used to pick which subgraph an action queries (`\"analytics\"` | `\"events\"`); the\n * union grows automatically as endpoints are added.\n */\nexport type SymmioSubgraphName = keyof SymmioSubgraphUrls;\n\n/**\n * A solver's id within a chain config — its registry key. Equal to its\n * {@link SymmioSolverKind}: each chain registers at most one solver per kind, so\n * the id *is* the kind (`\"enigma\" | \"rasa\"`). Closed for that reason.\n */\nexport type SolverId = SymmioSolverKind;\n\n/**\n * The solver kinds the SDK can actually serve — one generated client and\n * behavior set per entry. Single source of truth: {@link SymmioSolverKind} is\n * derived from this list, and `createConfig` validates every configured solver\n * against it (`assertSupportedSolver` in `solver-support.ts`). To add a kind,\n * append it here and ship its generated client + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_SOLVER_KINDS = [\"enigma\", \"rasa\"] as const;\n\n/**\n * Schema family a solver's REST API speaks — the discriminant used to select a\n * generated client. Closed (derived from {@link SUPPORTED_SOLVER_KINDS}): the\n * SDK ships one client per kind, so dispatch must be exhaustive.\n *\n * There is deliberately no version axis: each SDK release supports exactly one\n * API generation per kind. When a solver ships a new API generation, the SDK\n * regenerates that kind's client in a new release — consumers pick the\n * generation by pinning the SDK version, not through config.\n */\nexport type SymmioSolverKind = (typeof SUPPORTED_SOLVER_KINDS)[number];\n\n/**\n * Solver / hedger configuration for a SYMMIO chain deployment.\n *\n * In this SDK a \"solver\" is the same actor that fronts the lowcap hedger REST\n * API (`/instant_trade/instant_open`, `/contract-symbols`, …) and acts as\n * `partyB` on-chain. Its `url` is the API base URL, its `address` is partyB.\n *\n * Solvers live under {@link SymmioChainConfig.solvers}, keyed by\n * {@link SolverId} — the key is the solver's id, which is also its kind, so the\n * kind is not repeated here. `config.getSolver({ chainId, solverId })` returns a\n * {@link SymmioResolvedSolver} (this config plus its resolved `id`).\n */\n/**\n * Per-solver capability flags. Gate SDK flows and UI on these so a solver that\n * lacks a feature degrades gracefully instead of erroring. Unset flags default\n * to `false` — a solver must **declare** a capability to enable it.\n */\nexport interface SolverCapabilitiesConfig {\n /**\n * Whether the solver supports closing a whole market + side group of quotes in\n * one flow. Enigma (Virtual-Account isolation, one VA per market + side)\n * supports it; rasa (cross-margin) does not. Default `false`.\n */\n groupClose?: boolean;\n /**\n * Whether the solver supports LIMIT orders — placing a pending open at a\n * user-set price. Majors (rasa) support it; enigma (lowcap) does not. Default\n * `false`.\n */\n limitOrder?: boolean;\n /**\n * Whether this solver's markets are the lowcap **Pools** (listing service).\n * Purely declarative: the SDK's listing functions resolve the listing backend\n * **at chain level** ({@link SymmioChainConfig.listing}) and do **not** gate on\n * this flag. It exists so config can express which solvers do listing, readable\n * via `getSolverCapabilities`. Enigma (lowcap) declares it; rasa does not.\n * Default `false`.\n */\n listingService?: boolean;\n}\n\nexport interface SymmioSolverConfig {\n /** Human-readable solver name */\n name: string;\n /** Solver's on-chain address (used as `partyB` in `sendQuote`) */\n address: Address;\n /** Solver / hedger API base URL */\n url: string;\n /** Optional TP/SL handler — solver supports conditional orders only when set. */\n tpsl?: SymmioTpSlConfig;\n /**\n * Price source for **this solver's** markets. Falls back to the chain's\n * {@link SymmioChainConfig.priceService} when omitted, so set it only where a\n * solver diverges from the chain default — do not duplicate the default.\n *\n * Needed because a chain may register several solvers that price differently:\n * a lowcap solver reads its own price service while a majors solver reads\n * Binance. A single chain-level value cannot be right for both.\n */\n priceService?: SymmioPriceServiceConfig;\n /**\n * Notifications endpoint for **this solver's** position/quote state stream and\n * history search. Required per solver: notifications are inherently\n * solver-specific — the enigma `channel` and the rasa position-state URL are\n * the solver's own — so there is no chain-level default to inherit.\n */\n notifications: SymmioNotificationsConfig;\n /**\n * Optional per-solver capability flags. Gate SDK flows and UI on these\n * ({@link SolverCapabilitiesConfig}); unset flags default to `false`.\n */\n capabilities?: SolverCapabilitiesConfig;\n}\n\n/**\n * A {@link SymmioSolverConfig} resolved from the registry, with its `id`\n * attached. The `id` is the solver's kind (`\"enigma\" | \"rasa\"`) and drives\n * per-kind dispatch inside solver actions. Returned by `config.getSolver`.\n */\nexport interface SymmioResolvedSolver extends SymmioSolverConfig {\n /** The resolved solver id — equal to its kind. */\n id: SolverId;\n}\n\n/**\n * TP/SL (Conditional Order Handler) configuration for a solver.\n *\n * The handler is an off-chain service that signs and executes\n * `requestToClosePosition` calls when the user's TP/SL trigger fires. To\n * authorize it, every user must grant a delegation to {@link cohWalletAddress}\n * for the standard instant-trade selectors.\n */\nexport interface SymmioTpSlConfig {\n /** Handler REST root URL (no `/api/v5/` suffix — orval-generated paths add it). */\n url: string;\n /** Handler WebSocket URL — enigma-protocol notifications scoped by `appName`. */\n wsUrl: string;\n /** `App-Name` header value, e.g. `Arbitrum_COH_Production`. */\n appName: string;\n /** COH wallet address that must be granted delegation to execute TP/SL orders. */\n cohWalletAddress: Address;\n}\n\n/**\n * The price providers the SDK ships a client for. Closed: it drives exhaustive\n * dispatch in `getMarkPrices` / `watchPrices`, and `createConfig` validates every\n * configured price service against it (`assertSupportedPriceServiceType` in\n * `price-service-support.ts`). To add a provider, append it here and ship its\n * adapter + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_PRICE_SERVICE_TYPES = [\"enigma\", \"binance\"] as const;\n\n/**\n * Supported price-service providers.\n *\n * A **second, independent axis** from {@link SymmioSolverKind}: a Rasa solver is\n * priced off Binance today, and nothing in the type system ties the two\n * together. The provider is *derived* from `{ chainId, solverId }` via\n * `solver.priceService ?? chain.priceService` — never selected per call.\n */\nexport type SymmioPriceServiceType = (typeof SUPPORTED_PRICE_SERVICE_TYPES)[number];\n\n/**\n * Price-service configuration for a SYMMIO chain deployment.\n *\n * Both URLs stay **required, including for Binance**. Binance's endpoints are\n * public constants, but keeping them in config is the geo-restriction escape\n * hatch: an integrator whose users are in a blocked region repoints both at\n * their own proxy with no SDK change.\n */\nexport interface SymmioPriceServiceConfig {\n /** Price-service provider type. Selects which client the SDK uses. */\n type: SymmioPriceServiceType;\n /**\n * REST host root, no trailing slash — the client appends the provider's path.\n * `enigma`: `https://lowcap-price.enigma.bz` (+ `/api/v1/prices/names`).\n * `binance`: `https://fapi.binance.com` (+ `/fapi/v1/premiumIndex`).\n */\n url: string;\n /**\n * **Full** WebSocket endpoint — the exact URL the SDK dials, identically for\n * every provider, so nothing downstream needs to know which provider it holds.\n * `enigma`: `wss://lowcap-price.enigma.bz/ws`.\n * `binance`: `wss://fstream.binance.com/market/ws/!markPrice@arr@1s`.\n */\n wsUrl: string;\n}\n\n/**\n * Wire protocol a notifications endpoint speaks. Closed: it drives exhaustive\n * dispatch in `watchNotifications` / `parseNotificationFrame`; to add a\n * protocol, append it here and ship its subscribe + parse path in the same\n * change.\n *\n * - `enigma` — the lowcap solver endpoint (`…/ws/v1/subscribe`). Subscribes\n * with a `channel_patterns` frame and wraps each push as `{ data, address }`.\n * - `rasa` — the Rasa position-state endpoint (`…/ws/position-state-ws3`).\n * Subscribes with an `{ address: [...] }` frame (one socket can carry many\n * SubAccounts) and pushes bare notification frames, no envelope.\n */\nexport type SymmioNotificationsProtocol = \"enigma\" | \"rasa\";\n\n/**\n * Fields every notifications endpoint shares, regardless of wire protocol.\n */\ninterface SymmioNotificationsConfigBase {\n /** Notifications WebSocket URL (`wss://…`). */\n url: string;\n /**\n * Base URL of the notification REST service that backs `searchNotifications`\n * (`POST /api/v1/search`), e.g. `https://notification.rasa.capital/notification`.\n * Optional — when unset, `searchNotifications` requires a per-call `baseUrl`.\n */\n searchUrl?: string;\n}\n\n/**\n * Notifications endpoint speaking the `enigma` protocol (the lowcap\n * solver's channel-scoped stream).\n */\nexport interface SymmioEnigmaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"enigma\";\n /** Channel / `app_name` the subscribe frame targets on this endpoint. */\n channel: string;\n}\n\n/**\n * Notifications endpoint speaking the `rasa` position-state protocol. No\n * channel — the subscribe frame is just the watched SubAccount addresses.\n */\nexport interface SymmioRasaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"rasa\";\n}\n\n/**\n * Notifications WebSocket configuration for a SYMMIO chain deployment.\n *\n * The notifications endpoint streams position/quote state transitions (instant\n * open/close confirmations, fills, cancels, liquidations) for a SubAccount. It\n * is a push channel, not a REST endpoint — `url` is a `ws://`/`wss://` URL.\n * Discriminated on `protocol`; narrow to reach protocol-specific fields\n * (e.g. the enigma `channel`).\n */\nexport type SymmioNotificationsConfig = SymmioEnigmaNotificationsConfig | SymmioRasaNotificationsConfig;\n\n/**\n * Muon oracle configuration for a SYMMIO chain deployment.\n *\n * The Muon network signs off-chain values (e.g. a party's unrealized PnL) that\n * the contracts verify on-chain — `removeMargin` requires such a signature. The\n * gateway is a query-param REST endpoint with no OpenAPI spec; `urls` are tried\n * in order until one returns a successful attestation.\n *\n * @see {@link https://docs.symm.io/api-endpoints-and-deployments/muon-api}\n */\nexport interface SymmioMuonConfig {\n /** Muon oracle gateway base URLs, tried in order (fallback on failure). */\n urls: readonly string[];\n}\n\n/**\n * Pools **listing backend** configuration for a SYMMIO chain deployment.\n *\n * The listing backend is an auth'd REST service that owns the lowcap Pools flow\n * — the pool catalogue, per-pool stats, a user's stake/rewards, and the\n * create/deposit/withdraw/claim actions. It is chain-level: one listing backend\n * is served per chain (a chain has at most one), with no solver or capability\n * involved. Present only where Pools is available (Enigma on Arbitrum); omitted\n * elsewhere.\n *\n * One deployment serves listings whose collateral was deposited on **several**\n * chains — a catalogue row's `chainId` is the token's deposit chain, which is\n * not the chain the resulting market trades on.\n */\nexport interface SymmioListingConfig {\n /**\n * Listing backend **host root** — no version segment and no trailing slash\n * (e.g. `https://listing85.enigma.bz`, staging\n * `https://listing-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/v2`, so a versioned\n * base URL here would request `/v2/v2/market/search` and 404. Point this at\n * staging with a `createConfig` override — there is no separate environment\n * axis.\n */\n url: string;\n}\n\n/**\n * Inventory-service configuration for a SYMMIO chain deployment.\n *\n * The inventory service is the custody backend behind the lowcap Pools: it holds\n * the per-market token and collateral inventory that backs trading, and reports\n * the system-wide TVL those balances add up to. It is a **separate vendor** from\n * both the solver and the {@link SymmioListingConfig} listing backend, with its\n * own deployment and its own OpenAPI spec.\n *\n * Chain-level and optional, like `listing`: present where lowcap Pools are\n * available, omitted elsewhere.\n */\nexport interface SymmioInventoryConfig {\n /**\n * Inventory service **host root** — no path segment and no trailing slash\n * (e.g. `https://inventory85.enigma.bz`, staging\n * `https://inventory-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/api/v1`, so appending\n * `/api` here would request `/api/api/v1/...` and 404.\n */\n url: string;\n}\n\n/**\n * The perps-core contracts generation a chain's deployment runs.\n *\n * A **deployment fact, declared per chain** — it is not probed at runtime (the\n * diamond exposes no version view). It drives the version-sensitive seams the\n * SDK carries for serving mixed-generation chains from one release: which\n * quote-send call the instant-open flow signs (`sendQuote` with solver-fee caps\n * on `\"0.8.6\"`, the legacy `sendQuoteWithAffiliateAndData` on `\"0.8.5\"`), which\n * selector the session-key delegation set includes, and which output shape the\n * withdraw-request reads decode.\n */\nexport type SymmioContractsVersion = \"0.8.5\" | \"0.8.6\";\n\n/**\n * Complete resolved configuration for a SYMMIO chain deployment.\n */\nexport interface SymmioChainConfig {\n /** Chain ID */\n chainId: number;\n /** Contracts generation deployed on this chain. See {@link SymmioContractsVersion}. */\n contractsVersion: SymmioContractsVersion;\n /** Contract addresses */\n addresses: SymmioContractAddresses;\n /** Subgraph endpoints */\n subgraphs: SymmioSubgraphUrls;\n /**\n * Solvers available on this chain, keyed by {@link SolverId} (which is the\n * solver's kind). A chain registers a subset of the kinds, so this is partial.\n * Resolve one with `config.getSolver({ chainId, solverId })`, which defaults to\n * {@link defaultSolverId} when `solverId` is omitted.\n */\n solvers: Partial<Record<SolverId, SymmioSolverConfig>>;\n /** Id of the solver an action targets on this chain when `solverId` is omitted. */\n defaultSolverId: SolverId;\n /** Price-service configuration */\n priceService: SymmioPriceServiceConfig;\n /** Muon oracle configuration */\n muon: SymmioMuonConfig;\n /**\n * Optional Pools listing backend, served per chain. Set on chains where the\n * lowcap Pools flow is available (Enigma on Arbitrum); omitted elsewhere.\n * Resolve it with `resolveListingService` / gate on `supportsListingService`.\n */\n listing?: SymmioListingConfig;\n /**\n * Optional inventory service — the custody backend behind lowcap Pools, and\n * the source of system-wide TVL. Set alongside {@link SymmioChainConfig.listing};\n * resolve it with `resolveInventoryService`.\n */\n inventory?: SymmioInventoryConfig;\n}\n"],"mappings":";AAsDA,IAAa,IAAyB,CAAC,UAAU,MAAM,GA8H1C,IAAgC,CAAC,UAAU,SAAS"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/core/chains/types.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { GaslessRelayEvent } from \"../../gasless/types\";\n\n/**\n * Contract addresses for a SYMMIO chain deployment.\n */\nexport interface SymmioContractAddresses {\n /** Main SYMMIO diamond contract */\n symmioAddress: Address;\n /** InstantLayer contract for instant actions */\n instantLayerAddress: Address;\n /** AccountLayer contract for subaccount management */\n accountLayerAddress: Address;\n /** Affiliates registry contract */\n affiliatesAddress: Address;\n /** Collateral token address (e.g. USDC) */\n collateralAddress: Address;\n /** Decimals of the collateral token */\n collateralDecimals: number;\n}\n\n/**\n * Subgraph endpoints for a SYMMIO chain deployment.\n */\nexport interface SymmioSubgraphUrls {\n /** Analytics subgraph for aggregated data (balance changes, quotes, history). */\n analytics: string;\n /** Events subgraph for raw on-chain events (e.g. `internalTransfers`). */\n events: string;\n}\n\n/**\n * Name of a configured subgraph endpoint (a key of {@link SymmioSubgraphUrls}).\n *\n * Used to pick which subgraph an action queries (`\"analytics\"` | `\"events\"`); the\n * union grows automatically as endpoints are added.\n */\nexport type SymmioSubgraphName = keyof SymmioSubgraphUrls;\n\n/**\n * A solver's id within a chain config — its registry key. Equal to its\n * {@link SymmioSolverKind}: each chain registers at most one solver per kind, so\n * the id *is* the kind (`\"enigma\" | \"rasa\"`). Closed for that reason.\n */\nexport type SolverId = SymmioSolverKind;\n\n/**\n * The solver kinds the SDK can actually serve — one generated client and\n * behavior set per entry. Single source of truth: {@link SymmioSolverKind} is\n * derived from this list, and `createConfig` validates every configured solver\n * against it (`assertSupportedSolver` in `solver-support.ts`). To add a kind,\n * append it here and ship its generated client + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_SOLVER_KINDS = [\"enigma\", \"rasa\"] as const;\n\n/**\n * Schema family a solver's REST API speaks — the discriminant used to select a\n * generated client. Closed (derived from {@link SUPPORTED_SOLVER_KINDS}): the\n * SDK ships one client per kind, so dispatch must be exhaustive.\n *\n * There is deliberately no version axis: each SDK release supports exactly one\n * API generation per kind. When a solver ships a new API generation, the SDK\n * regenerates that kind's client in a new release — consumers pick the\n * generation by pinning the SDK version, not through config.\n */\nexport type SymmioSolverKind = (typeof SUPPORTED_SOLVER_KINDS)[number];\n\n/**\n * Solver / hedger configuration for a SYMMIO chain deployment.\n *\n * In this SDK a \"solver\" is the same actor that fronts the lowcap hedger REST\n * API (`/instant_trade/instant_open`, `/contract-symbols`, …) and acts as\n * `partyB` on-chain. Its `url` is the API base URL, its `address` is partyB.\n *\n * Solvers live under {@link SymmioChainConfig.solvers}, keyed by\n * {@link SolverId} — the key is the solver's id, which is also its kind, so the\n * kind is not repeated here. `config.getSolver({ chainId, solverId })` returns a\n * {@link SymmioResolvedSolver} (this config plus its resolved `id`).\n */\n/**\n * Per-solver capability flags. Gate SDK flows and UI on these so a solver that\n * lacks a feature degrades gracefully instead of erroring. Unset flags default\n * to `false` — a solver must **declare** a capability to enable it.\n */\nexport interface SolverCapabilitiesConfig {\n /**\n * Whether the solver supports closing a whole market + side group of quotes in\n * one flow. Enigma (Virtual-Account isolation, one VA per market + side)\n * supports it; rasa (cross-margin) does not. Default `false`.\n */\n groupClose?: boolean;\n /**\n * Whether the solver supports LIMIT orders — placing a pending open at a\n * user-set price. Majors (rasa) support it; enigma (lowcap) does not. Default\n * `false`.\n */\n limitOrder?: boolean;\n /**\n * Whether this solver's markets are the lowcap **Pools** (listing service).\n * Purely declarative: the SDK's listing functions resolve the listing backend\n * **at chain level** ({@link SymmioChainConfig.listing}) and do **not** gate on\n * this flag. It exists so config can express which solvers do listing, readable\n * via `getSolverCapabilities`. Enigma (lowcap) declares it; rasa does not.\n * Default `false`.\n */\n listingService?: boolean;\n}\n\nexport interface SymmioSolverConfig {\n /** Human-readable solver name */\n name: string;\n /** Solver's on-chain address (used as `partyB` in `sendQuote`) */\n address: Address;\n /** Solver / hedger API base URL */\n url: string;\n /** Optional TP/SL handler — solver supports conditional orders only when set. */\n tpsl?: SymmioTpSlConfig;\n /**\n * Price source for **this solver's** markets. Falls back to the chain's\n * {@link SymmioChainConfig.priceService} when omitted, so set it only where a\n * solver diverges from the chain default — do not duplicate the default.\n *\n * Needed because a chain may register several solvers that price differently:\n * a lowcap solver reads its own price service while a majors solver reads\n * Binance. A single chain-level value cannot be right for both.\n */\n priceService?: SymmioPriceServiceConfig;\n /**\n * Notifications endpoint for **this solver's** position/quote state stream and\n * history search. Required per solver: notifications are inherently\n * solver-specific — the enigma `channel` and the rasa position-state URL are\n * the solver's own — so there is no chain-level default to inherit.\n */\n notifications: SymmioNotificationsConfig;\n /**\n * Optional per-solver capability flags. Gate SDK flows and UI on these\n * ({@link SolverCapabilitiesConfig}); unset flags default to `false`.\n */\n capabilities?: SolverCapabilitiesConfig;\n}\n\n/**\n * A {@link SymmioSolverConfig} resolved from the registry, with its `id`\n * attached. The `id` is the solver's kind (`\"enigma\" | \"rasa\"`) and drives\n * per-kind dispatch inside solver actions. Returned by `config.getSolver`.\n */\nexport interface SymmioResolvedSolver extends SymmioSolverConfig {\n /** The resolved solver id — equal to its kind. */\n id: SolverId;\n}\n\n/**\n * TP/SL (Conditional Order Handler) configuration for a solver.\n *\n * The handler is an off-chain service that signs and executes\n * `requestToClosePosition` calls when the user's TP/SL trigger fires. To\n * authorize it, every user must grant a delegation to {@link cohWalletAddress}\n * for the standard instant-trade selectors.\n */\nexport interface SymmioTpSlConfig {\n /** Handler REST root URL (no `/api/v5/` suffix — orval-generated paths add it). */\n url: string;\n /** Handler WebSocket URL — enigma-protocol notifications scoped by `appName`. */\n wsUrl: string;\n /** `App-Name` header value, e.g. `Arbitrum_COH_Production`. */\n appName: string;\n /** COH wallet address that must be granted delegation to execute TP/SL orders. */\n cohWalletAddress: Address;\n}\n\n/**\n * The price providers the SDK ships a client for. Closed: it drives exhaustive\n * dispatch in `getMarkPrices` / `watchPrices`, and `createConfig` validates every\n * configured price service against it (`assertSupportedPriceServiceType` in\n * `price-service-support.ts`). To add a provider, append it here and ship its\n * adapter + dispatch in the same change.\n *\n * @internal\n */\nexport const SUPPORTED_PRICE_SERVICE_TYPES = [\"enigma\", \"binance\"] as const;\n\n/**\n * Supported price-service providers.\n *\n * A **second, independent axis** from {@link SymmioSolverKind}: a Rasa solver is\n * priced off Binance today, and nothing in the type system ties the two\n * together. The provider is *derived* from `{ chainId, solverId }` via\n * `solver.priceService ?? chain.priceService` — never selected per call.\n */\nexport type SymmioPriceServiceType = (typeof SUPPORTED_PRICE_SERVICE_TYPES)[number];\n\n/**\n * Price-service configuration for a SYMMIO chain deployment.\n *\n * Both URLs stay **required, including for Binance**. Binance's endpoints are\n * public constants, but keeping them in config is the geo-restriction escape\n * hatch: an integrator whose users are in a blocked region repoints both at\n * their own proxy with no SDK change.\n */\nexport interface SymmioPriceServiceConfig {\n /** Price-service provider type. Selects which client the SDK uses. */\n type: SymmioPriceServiceType;\n /**\n * REST host root, no trailing slash — the client appends the provider's path.\n * `enigma`: `https://lowcap-price.enigma.bz` (+ `/api/v1/prices/names`).\n * `binance`: `https://fapi.binance.com` (+ `/fapi/v1/premiumIndex`).\n */\n url: string;\n /**\n * **Full** WebSocket endpoint — the exact URL the SDK dials, identically for\n * every provider, so nothing downstream needs to know which provider it holds.\n * `enigma`: `wss://lowcap-price.enigma.bz/ws`.\n * `binance`: `wss://fstream.binance.com/market/ws/!markPrice@arr@1s`.\n */\n wsUrl: string;\n}\n\n/**\n * Wire protocol a notifications endpoint speaks. Closed: it drives exhaustive\n * dispatch in `watchNotifications` / `parseNotificationFrame`; to add a\n * protocol, append it here and ship its subscribe + parse path in the same\n * change.\n *\n * - `enigma` — the lowcap solver endpoint (`…/ws/v1/subscribe`). Subscribes\n * with a `channel_patterns` frame and wraps each push as `{ data, address }`.\n * - `rasa` — the Rasa position-state endpoint (`…/ws/position-state-ws3`).\n * Subscribes with an `{ address: [...] }` frame (one socket can carry many\n * SubAccounts) and pushes bare notification frames, no envelope.\n */\nexport type SymmioNotificationsProtocol = \"enigma\" | \"rasa\";\n\n/**\n * Fields every notifications endpoint shares, regardless of wire protocol.\n */\ninterface SymmioNotificationsConfigBase {\n /** Notifications WebSocket URL (`wss://…`). */\n url: string;\n /**\n * Base URL of the notification REST service that backs `searchNotifications`\n * (`POST /api/v1/search`), e.g. `https://notification.rasa.capital/notification`.\n * Optional — when unset, `searchNotifications` requires a per-call `baseUrl`.\n */\n searchUrl?: string;\n}\n\n/**\n * Notifications endpoint speaking the `enigma` protocol (the lowcap\n * solver's channel-scoped stream).\n */\nexport interface SymmioEnigmaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"enigma\";\n /** Channel / `app_name` the subscribe frame targets on this endpoint. */\n channel: string;\n}\n\n/**\n * Notifications endpoint speaking the `rasa` position-state protocol. No\n * channel — the subscribe frame is just the watched SubAccount addresses.\n */\nexport interface SymmioRasaNotificationsConfig extends SymmioNotificationsConfigBase {\n /** Wire protocol the endpoint speaks. */\n protocol: \"rasa\";\n}\n\n/**\n * Notifications WebSocket configuration for a SYMMIO chain deployment.\n *\n * The notifications endpoint streams position/quote state transitions (instant\n * open/close confirmations, fills, cancels, liquidations) for a SubAccount. It\n * is a push channel, not a REST endpoint — `url` is a `ws://`/`wss://` URL.\n * Discriminated on `protocol`; narrow to reach protocol-specific fields\n * (e.g. the enigma `channel`).\n */\nexport type SymmioNotificationsConfig = SymmioEnigmaNotificationsConfig | SymmioRasaNotificationsConfig;\n\n/**\n * Muon oracle configuration for a SYMMIO chain deployment.\n *\n * The Muon network signs off-chain values (e.g. a party's unrealized PnL) that\n * the contracts verify on-chain — `removeMargin` requires such a signature. The\n * gateway is a query-param REST endpoint with no OpenAPI spec; `urls` are tried\n * in order until one returns a successful attestation.\n *\n * @see {@link https://docs.symm.io/api-endpoints-and-deployments/muon-api}\n */\nexport interface SymmioMuonConfig {\n /** Muon oracle gateway base URLs, tried in order (fallback on failure). */\n urls: readonly string[];\n}\n\n/**\n * Pools **listing backend** configuration for a SYMMIO chain deployment.\n *\n * The listing backend is an auth'd REST service that owns the lowcap Pools flow\n * — the pool catalogue, per-pool stats, a user's stake/rewards, and the\n * create/deposit/withdraw/claim actions. It is chain-level: one listing backend\n * is served per chain (a chain has at most one), with no solver or capability\n * involved. Present only where Pools is available (Enigma on Arbitrum); omitted\n * elsewhere.\n *\n * One deployment serves listings whose collateral was deposited on **several**\n * chains — a catalogue row's `chainId` is the token's deposit chain, which is\n * not the chain the resulting market trades on.\n */\nexport interface SymmioListingConfig {\n /**\n * Listing backend **host root** — no version segment and no trailing slash\n * (e.g. `https://listing85.enigma.bz`, staging\n * `https://listing-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/v2`, so a versioned\n * base URL here would request `/v2/v2/market/search` and 404. Point this at\n * staging with a `createConfig` override — there is no separate environment\n * axis.\n */\n url: string;\n}\n\n/**\n * Inventory-service configuration for a SYMMIO chain deployment.\n *\n * The inventory service is the custody backend behind the lowcap Pools: it holds\n * the per-market token and collateral inventory that backs trading, and reports\n * the system-wide TVL those balances add up to. It is a **separate vendor** from\n * both the solver and the {@link SymmioListingConfig} listing backend, with its\n * own deployment and its own OpenAPI spec.\n *\n * Chain-level and optional, like `listing`: present where lowcap Pools are\n * available, omitted elsewhere.\n */\nexport interface SymmioInventoryConfig {\n /**\n * Inventory service **host root** — no path segment and no trailing slash\n * (e.g. `https://inventory85.enigma.bz`, staging\n * `https://inventory-staging.enigma.bz`).\n *\n * The generated client's own paths already begin with `/api/v1`, so appending\n * `/api` here would request `/api/api/v1/...` and 404.\n */\n url: string;\n}\n\n/**\n * Failure policy for the transparent gasless execution mode, applied when the\n * relay definitively rejects a request **before** it is accepted (a 4xx, or a\n * pre-broadcast `rejected`).\n *\n * - `\"error\"` (default): surface a typed error; the consumer decides what to do.\n * - `\"wallet\"`: silently fall back to the normal gas-paid wallet path.\n *\n * After the service accepts a request (HTTP 202) no fallback ever happens — the\n * relayed transaction may still execute, and a wallet retry would duplicate it.\n */\nexport type GaslessFallback = \"error\" | \"wallet\";\n\n/**\n * Defaults governing how existing contract writes dispatch when the transparent\n * gasless execution mode is active. Every field can be overridden per call via\n * the `gasless` write parameter.\n */\nexport interface GaslessExecutionConfig {\n /**\n * `\"wallet\"` (default): writes go through the connected wallet as always.\n * `\"gasless\"`: relayable writes are signed as InstantLayer operations and\n * relayed through GaslessQ; non-relayable writes keep the wallet path.\n */\n mode?: \"wallet\" | \"gasless\";\n /** Pre-acceptance failure policy. Default `\"error\"`. */\n fallback?: GaslessFallback;\n /**\n * Quote the batch on-chain (the GaslessLayer's `previewFeeQuote`) before\n * prompting the user for a signature, and fail fast when the quote refuses\n * it: `GASLESS_FREE_QUOTA_EXHAUSTED` when the daily free quota is spent (the\n * one case `fallback: \"wallet\"` recovers from), `GASLESS_FEE_QUOTE_REVERTED`\n * when the contract rejects the batch, and `GASLESS_LAYER_INTERFACE_UNSUPPORTED`\n * when the GaslessLayer predates the multi-wallet interface. A quote that\n * fails for transport reasons does not block, and the quote never checks\n * affordability — the relayer's simulation is authoritative. Default `true`.\n */\n preflightFee?: boolean;\n /**\n * Verify on-chain (`isDelegationActive`) that the signing key is authorized\n * for every selector a relayed write carries before prompting the user for a\n * signature, and fail fast when a session key is missing a delegation.\n * Skipped for the sub-account's own owner, who needs no delegation.\n * Default `true`.\n */\n preflightDelegation?: boolean;\n /** Max wait for the relayer to broadcast before timing out. Default `120_000` ms. */\n broadcastTimeoutMs?: number;\n /** Status poll cadence while the request is `queued`. Default `1_500` ms. */\n queuedPollMs?: number;\n /** Status poll cadence after the request is `submitted`. Default `3_000` ms. */\n submittedPollMs?: number;\n /**\n * How long a status wait lets the gateway's stream settle before falling back\n * to its first HTTP read. It ends early the moment the stream delivers, or\n * reports that it will not (unreachable, not-found, at its subscription cap,\n * disabled). Ignored where the stream is off. Default `1_000` ms.\n */\n streamSettleMs?: number;\n /**\n * How long a delivering stream may report nothing about a workflow before the\n * wait takes one HTTP read anyway and re-arms. Heartbeats do not count — only\n * records for the request do. Default `15_000` ms.\n */\n streamStaleMs?: number;\n /**\n * HTTP timeout for each gasless submit, in ms: every relay and\n * deposit-settlement POST, from the explicit actions as well as the\n * transparent mode. A submit that times out is ambiguous (the gateway may\n * already have accepted it) and fails like a network error, with status `0`.\n * Status reads are not bounded by it. Default `30_000`.\n */\n submitTimeoutMs?: number;\n /**\n * Lifecycle observer for relayed writes — fires at `accepted`, `broadcast`,\n * and `terminal`. Persist request ids in the `accepted` event so in-flight\n * workflows survive reloads.\n */\n onEvent?: (event: GaslessRelayEvent) => void;\n}\n\n/**\n * Status-stream availability for one GaslessQ deployment. It is a deployment\n * fact, like the URL. Status WebSockets are optional and disabled by default at\n * the gateway, and each environment enables them separately, so a stream is\n * declared per chain rather than assumed.\n *\n * Where it is enabled, the stream is the primary transport for status waits and\n * HTTP reads become the fallback: a wait subscribes, gives the stream\n * `execution.streamSettleMs` to deliver, and polls only while the stream is not\n * delivering. HTTP status reads stay available whether or not a stream is\n * declared.\n */\nexport interface SymmioGaslessStatusStreamConfig {\n /**\n * Whether this deployment serves the status WebSocket. Set it to `true` only\n * once the operators confirm streams for this environment and protocol\n * instance. A staging confirmation does not cover production.\n */\n enabled: boolean;\n /**\n * The gateway's `https://` origin, used to locate the stream when `url` is a\n * proxy root, because a proxy that forwards HTTP cannot be assumed to forward\n * WebSockets. Omit it for the gateway `url` forms, whose stream endpoint\n * derives from `url` itself.\n */\n origin?: string;\n}\n\n/**\n * Chain-level configuration for the GaslessQ relayer service.\n *\n * GaslessQ relays user-signed InstantLayer operations so account actions need\n * no native gas: the relayer broadcasts and pays, and the **GaslessLayer**\n * contract charges an operational fee from the user's SYMMIO collateral in the\n * same atomic transaction. Optional and chain-level, like `listing`: present\n * only on perps-core (`\"0.8.6\"`) chains with a GaslessLayer deployment.\n * Resolve it with `resolveGaslessService` / gate on `supportsGaslessService`.\n *\n * The gateway serves anonymous clients by default, so a browser app can call it\n * directly with no `apiKey`, as long as the deployment allows the app's Origin\n * and has not disabled anonymous access.\n */\nexport interface SymmioGaslessConfig {\n /**\n * Where the SDK reaches the GaslessQ gateway. One of:\n *\n * - the gateway **origin** (`https://host`, no path) with `protocolInstance`,\n * the recommended form. The SDK derives\n * `/v1/instances/{protocolInstance}/{operations|deposits}`.\n * - an **instance root** (`…/v1/instances/<protocol-instance>`). The SDK\n * appends `/{service}`.\n * - an **instance-pinned service base**\n * (`…/v1/instances/<protocol-instance>/operations` or `…/deposits`), used\n * as-is and for that one service only.\n * - any other path, absolute or relative, is a **proxy root** (for example a\n * server-side proxy at `/api/gasless`). The SDK appends `/{service}`.\n *\n * The instance-less `/v1/operations` and `/v1/deposits` compatibility routes\n * are rejected with `GASLESS_URL_LEGACY_ROUTE`: the gateway is retiring them,\n * and they pin no instance to verify responses against. A query string, a\n * fragment, credentials (`user:password@`) or a non-HTTP(S) scheme is\n * rejected with `GASLESS_URL_INVALID`.\n */\n url: string;\n /**\n * Protocol-instance key selecting the deployment at the gateway\n * (`\"<protocol-instance>\"`, from the deployment handoff). Staging and\n * production can share a chain id, so the key, not the chain, picks the\n * contracts.\n *\n * Required with an origin `url` (`GASLESS_PROTOCOL_INSTANCE_REQUIRED`). With\n * an instance root or service base it may be omitted, but when given it must\n * equal the instance the path pins (`GASLESS_PROTOCOL_INSTANCE_CONFLICT`).\n * With a proxy root it is the instance successful responses are checked\n * against, whenever the proxy forwards the `X-GasLessQ-Protocol-Instance`\n * header.\n */\n protocolInstance?: string;\n /**\n * The GaslessLayer proxy address — the operational-fee charger and the\n * source of every gasless read (wallet addresses, deposit policy, fee\n * quotes, nonces). A deployment fact with **no runtime discovery**: update it\n * on every gateway redeploy. It must run the multi-wallet GaslessLayer\n * interface (`walletId`-scoped reads, `previewFeeQuote`); a proxy that has not\n * been upgraded to it is unsupported, and its fee quote throws\n * `GASLESS_LAYER_INTERFACE_UNSUPPORTED`.\n */\n gaslessLayerAddress: Address;\n /**\n * Optional partner key, sent as `Authorization: Bearer <key>`. Omit it to use\n * the gateway's anonymous profile, which is on by default: 10 requests per\n * second per caller IP and protocol instance, shared across operations and\n * deposits, with no `Authorization` header sent at all. Where anonymous access\n * is on, a key only raises the gateway limits. A deployment can turn it off,\n * and then answers keyless requests with `401`, so a key is required there. A\n * key must be authorized for the protocol instance and service it calls, and\n * it changes neither fees, wallet selection nor signatures.\n *\n * Meant for servers and backend-for-frontend proxies. **Never ship a key in a\n * browser bundle**, where anyone can read it. An invalid, disabled or\n * unauthorized key is rejected (`401` / `403`) and never falls back to\n * anonymous access. Errors the SDK throws never carry the key.\n */\n apiKey?: string;\n /**\n * Status-stream availability for this deployment. Omitted, the deployment is\n * treated as serving no stream.\n */\n statusStream?: SymmioGaslessStatusStreamConfig;\n /** Transparent execution-mode defaults for existing contract writes. */\n execution?: GaslessExecutionConfig;\n}\n\n/**\n * The perps-core contracts generation a chain's deployment runs.\n *\n * A **deployment fact, declared per chain** — it is not probed at runtime (the\n * diamond exposes no version view). It drives the version-sensitive seams the\n * SDK carries for serving mixed-generation chains from one release: which\n * quote-send call the instant-open flow signs (`sendQuote` with solver-fee caps\n * on `\"0.8.6\"`, the legacy `sendQuoteWithAffiliateAndData` on `\"0.8.5\"`), which\n * selector the session-key delegation set includes, and which output shape the\n * withdraw-request reads decode.\n */\nexport type SymmioContractsVersion = \"0.8.5\" | \"0.8.6\";\n\n/**\n * Complete resolved configuration for a SYMMIO chain deployment.\n */\nexport interface SymmioChainConfig {\n /** Chain ID */\n chainId: number;\n /** Contracts generation deployed on this chain. See {@link SymmioContractsVersion}. */\n contractsVersion: SymmioContractsVersion;\n /** Contract addresses */\n addresses: SymmioContractAddresses;\n /** Subgraph endpoints */\n subgraphs: SymmioSubgraphUrls;\n /**\n * Solvers available on this chain, keyed by {@link SolverId} (which is the\n * solver's kind). A chain registers a subset of the kinds, so this is partial.\n * Resolve one with `config.getSolver({ chainId, solverId })`, which defaults to\n * {@link defaultSolverId} when `solverId` is omitted.\n */\n solvers: Partial<Record<SolverId, SymmioSolverConfig>>;\n /** Id of the solver an action targets on this chain when `solverId` is omitted. */\n defaultSolverId: SolverId;\n /** Price-service configuration */\n priceService: SymmioPriceServiceConfig;\n /** Muon oracle configuration */\n muon: SymmioMuonConfig;\n /**\n * Optional Pools listing backend, served per chain. Set on chains where the\n * lowcap Pools flow is available (Enigma on Arbitrum); omitted elsewhere.\n * Resolve it with `resolveListingService` / gate on `supportsListingService`.\n */\n listing?: SymmioListingConfig;\n /**\n * Optional inventory service — the custody backend behind lowcap Pools, and\n * the source of system-wide TVL. Set alongside {@link SymmioChainConfig.listing};\n * resolve it with `resolveInventoryService`.\n */\n inventory?: SymmioInventoryConfig;\n /**\n * Optional GaslessQ relayer service. Set on perps-core (`\"0.8.6\"`) chains\n * with a GaslessLayer deployment; omitted elsewhere. Resolve it with\n * `resolveGaslessService` / gate on `supportsGaslessService`.\n */\n gasless?: SymmioGaslessConfig;\n}\n"],"mappings":";AAuDA,IAAa,IAAyB,CAAC,UAAU,MAAM,GA8H1C,IAAgC,CAAC,UAAU,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-chain-config.d.ts","sourceRoot":"","sources":["../../../src/core/config/merge-chain-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"merge-chain-config.d.ts","sourceRoot":"","sources":["../../../src/core/config/merge-chain-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAML,KAAK,iBAAiB,EASvB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAClE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAUnC"}
|
|
@@ -23,23 +23,53 @@ function i(e, t) {
|
|
|
23
23
|
...e.subgraphs,
|
|
24
24
|
...t.subgraphs
|
|
25
25
|
},
|
|
26
|
-
solvers:
|
|
26
|
+
solvers: d(e.chainId, e.solvers, t.solvers),
|
|
27
27
|
defaultSolverId: t.defaultSolverId ?? e.defaultSolverId,
|
|
28
|
-
priceService:
|
|
28
|
+
priceService: l(e.chainId, e.priceService, t.priceService),
|
|
29
29
|
muon: { urls: t.muon?.urls ?? e.muon.urls },
|
|
30
|
-
...
|
|
31
|
-
...
|
|
30
|
+
...c(e.listing, t.listing),
|
|
31
|
+
...s(e.inventory, t.inventory),
|
|
32
|
+
...a(e.chainId, e.gasless, t.gasless)
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
function a(
|
|
35
|
+
function a(t, n, r) {
|
|
36
|
+
if (!n && !r) return {};
|
|
37
|
+
if (!r) return { gasless: n };
|
|
38
|
+
let i = r.url ?? n?.url, a = r.gaslessLayerAddress ?? n?.gaslessLayerAddress;
|
|
39
|
+
if (i === void 0 || a === void 0) throw new e("config", "GASLESS_OVERRIDE_INCOMPLETE", `createConfig: the gasless override for chain ${t} must declare ${i === void 0 ? "`url`" : "`gaslessLayerAddress`"} — there is no built-in gasless config to inherit it from.`);
|
|
40
|
+
let s = r.execution || n?.execution ? {
|
|
41
|
+
...n?.execution ?? {},
|
|
42
|
+
...r.execution ?? {}
|
|
43
|
+
} : void 0, c = r.protocolInstance ?? n?.protocolInstance, l = r.apiKey ?? n?.apiKey, u = o(t, n?.statusStream, r.statusStream);
|
|
44
|
+
return { gasless: {
|
|
45
|
+
url: i,
|
|
46
|
+
gaslessLayerAddress: a,
|
|
47
|
+
...c === void 0 ? {} : { protocolInstance: c },
|
|
48
|
+
...l === void 0 ? {} : { apiKey: l },
|
|
49
|
+
...u ? { statusStream: u } : {},
|
|
50
|
+
...s ? { execution: s } : {}
|
|
51
|
+
} };
|
|
52
|
+
}
|
|
53
|
+
function o(t, n, r) {
|
|
54
|
+
let i = r?.enabled ?? n?.enabled, a = r?.origin ?? n?.origin;
|
|
55
|
+
if (i === void 0) {
|
|
56
|
+
if (a === void 0) return;
|
|
57
|
+
throw new e("config", "GASLESS_OVERRIDE_INCOMPLETE", `createConfig: the gasless statusStream override for chain ${t} sets \`origin\` but not \`enabled\` — there is no statusStream block to inherit it from.`);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
enabled: i,
|
|
61
|
+
...a === void 0 ? {} : { origin: a }
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function s(e, t) {
|
|
35
65
|
let n = t?.url ?? e?.url;
|
|
36
66
|
return n === void 0 ? {} : { inventory: { url: n } };
|
|
37
67
|
}
|
|
38
|
-
function
|
|
68
|
+
function c(e, t) {
|
|
39
69
|
let n = t?.url ?? e?.url;
|
|
40
70
|
return n === void 0 ? {} : { listing: { url: n } };
|
|
41
71
|
}
|
|
42
|
-
function
|
|
72
|
+
function l(t, n, r) {
|
|
43
73
|
if (!r) return n;
|
|
44
74
|
let i = {
|
|
45
75
|
...n,
|
|
@@ -48,7 +78,7 @@ function s(t, n, r) {
|
|
|
48
78
|
if (r.type !== void 0 && r.type !== n.type && (r.url === void 0 || r.wsUrl === void 0)) throw new e("config", "PRICE_SERVICE_OVERRIDE_INCOMPLETE", `createConfig: the priceService override for chain ${t} changes type from "${n.type}" to "${r.type}" but omits ${r.url === void 0 ? "`url`" : "`wsUrl`"}. Supply both URLs when switching provider — inheriting the previous provider's endpoints would point the "${r.type}" client at "${n.type}" hosts.`);
|
|
49
79
|
return i;
|
|
50
80
|
}
|
|
51
|
-
function
|
|
81
|
+
function u(t, n, r) {
|
|
52
82
|
if (!r) return n;
|
|
53
83
|
if (r.protocol !== void 0 && r.protocol !== n.protocol) {
|
|
54
84
|
let i = r.url === void 0 ? "`url`" : r.protocol === "enigma" && r.channel === void 0 ? "`channel`" : null;
|
|
@@ -61,13 +91,13 @@ function c(t, n, r) {
|
|
|
61
91
|
};
|
|
62
92
|
return i.protocol === "rasa" && delete i.channel, i;
|
|
63
93
|
}
|
|
64
|
-
function
|
|
94
|
+
function d(e, t, n) {
|
|
65
95
|
if (!n) return t;
|
|
66
96
|
let r = { ...t };
|
|
67
|
-
for (let [i, a] of Object.entries(n)) a && (r[i] =
|
|
97
|
+
for (let [i, a] of Object.entries(n)) a && (r[i] = f(e, t[i], a));
|
|
68
98
|
return r;
|
|
69
99
|
}
|
|
70
|
-
function
|
|
100
|
+
function f(t, n, r) {
|
|
71
101
|
let i = {
|
|
72
102
|
...n ?? {},
|
|
73
103
|
...r
|
|
@@ -77,22 +107,22 @@ function u(t, n, r) {
|
|
|
77
107
|
...a
|
|
78
108
|
} : n?.tpsl ? i.tpsl = n.tpsl : delete i.tpsl;
|
|
79
109
|
let o = r.priceService;
|
|
80
|
-
o ? i.priceService = n?.priceService ?
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
110
|
+
o ? i.priceService = n?.priceService ? l(t, n.priceService, o) : p(t, o) : n?.priceService ? i.priceService = n.priceService : delete i.priceService;
|
|
111
|
+
let s = r.notifications;
|
|
112
|
+
if (s) i.notifications = n?.notifications ? u(t, n.notifications, s) : m(t, s);
|
|
83
113
|
else if (n?.notifications) i.notifications = n.notifications;
|
|
84
114
|
else throw new e("config", "SOLVER_NOTIFICATIONS_REQUIRED", `createConfig: a new solver on chain ${t} added via symmioConfig must declare a \`notifications\` block — it is required per solver and there is no base to inherit it from.`);
|
|
85
|
-
let
|
|
86
|
-
return
|
|
115
|
+
let c = r.capabilities;
|
|
116
|
+
return c ? i.capabilities = {
|
|
87
117
|
...n?.capabilities ?? {},
|
|
88
|
-
...
|
|
118
|
+
...c
|
|
89
119
|
} : n?.capabilities ? i.capabilities = n.capabilities : delete i.capabilities, i;
|
|
90
120
|
}
|
|
91
|
-
function
|
|
121
|
+
function p(t, n) {
|
|
92
122
|
if (n.type === void 0 || n.url === void 0 || n.wsUrl === void 0) throw new e("config", "PRICE_SERVICE_OVERRIDE_INCOMPLETE", `createConfig: a solver-nested priceService on chain ${t} must declare \`type\`, \`url\` and \`wsUrl\` — there is no per-solver base to inherit the missing fields from. Omit the block entirely to fall back to the chain's price service.`);
|
|
93
123
|
return n;
|
|
94
124
|
}
|
|
95
|
-
function
|
|
125
|
+
function m(t, n) {
|
|
96
126
|
let r = n.url === void 0 ? "`url`" : n.protocol === void 0 ? "`protocol`" : n.protocol === "enigma" && n.channel === void 0 ? "`channel`" : null;
|
|
97
127
|
if (r) throw new e("config", "NOTIFICATIONS_OVERRIDE_INCOMPLETE", `createConfig: a solver-nested notifications block on chain ${t} must declare ${r} — there is no per-solver base to inherit the missing fields from.`);
|
|
98
128
|
return n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-chain-config.js","names":[],"sources":["../../../src/core/config/merge-chain-config.ts"],"sourcesContent":["import { SymmError } from \"../../shared/errors/symm-error\";\nimport type { DeepPartial } from \"../../shared/types/properties\";\nimport {\n getChainConfig,\n listSupportedChains,\n type SolverCapabilitiesConfig,\n type SolverId,\n type SymmioChainConfig,\n type SymmioInventoryConfig,\n type SymmioListingConfig,\n type SymmioNotificationsConfig,\n type SymmioPriceServiceConfig,\n type SymmioSolverConfig,\n type SymmioTpSlConfig,\n} from \"../chains\";\n\n/**\n * Build the per-chain config registry a {@link Config} holds: every built-in\n * supported chain, deep-merged with the caller's overrides.\n *\n * @param overrides - Optional per-chain partial overrides keyed by chain id.\n * @returns A registry mapping chain id to its fully-resolved config.\n *\n * @internal\n */\nexport function buildChainConfigs(\n overrides?: Partial<Record<number, DeepPartial<SymmioChainConfig>>>,\n): Record<number, SymmioChainConfig> {\n const registry: Record<number, SymmioChainConfig> = {};\n\n for (const chainId of listSupportedChains()) {\n const base = getChainConfig(chainId);\n const override = overrides?.[chainId];\n registry[chainId] = override ? mergeChainConfig(base, override) : base;\n }\n\n return registry;\n}\n\n/**\n * Deep-merge a single chain's overrides onto its built-in defaults. Only the\n * known nested groups (`addresses`, `subgraphs`, `solvers`, `priceService`,\n * `notifications`, `muon`, `listing`, `inventory`) are merged; unknown keys are ignored.\n *\n * @internal\n */\nfunction mergeChainConfig(base: SymmioChainConfig, override: DeepPartial<SymmioChainConfig>): SymmioChainConfig {\n return {\n ...base,\n ...(override.chainId !== undefined ? { chainId: override.chainId } : {}),\n contractsVersion: override.contractsVersion ?? base.contractsVersion,\n addresses: { ...base.addresses, ...override.addresses },\n subgraphs: { ...base.subgraphs, ...override.subgraphs },\n solvers: mergeSolvers(base.chainId, base.solvers, override.solvers),\n defaultSolverId: override.defaultSolverId ?? base.defaultSolverId,\n priceService: mergePriceService(base.chainId, base.priceService, override.priceService),\n muon: {\n /** `urls` is replaced wholesale when overridden, otherwise inherited from base. */\n urls: override.muon?.urls ?? base.muon.urls,\n },\n ...mergeListing(base.listing, override.listing),\n ...mergeInventory(base.inventory, override.inventory),\n };\n}\n\n/**\n * Merge an inventory-service override onto its base. Mirrors\n * {@link mergeListing}: returns a partial so the key stays **absent** when\n * neither side configures the service.\n */\nfunction mergeInventory(\n base: SymmioInventoryConfig | undefined,\n override: DeepPartial<SymmioInventoryConfig> | undefined,\n): Pick<SymmioChainConfig, \"inventory\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { inventory: { url } };\n}\n\n/**\n * Merge a listing-service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures the\n * service — an explicit `listing: undefined` would still be an own property and\n * would read as \"configured but empty\" to anything doing a key check.\n */\nfunction mergeListing(\n base: SymmioListingConfig | undefined,\n override: DeepPartial<SymmioListingConfig> | undefined,\n): Pick<SymmioChainConfig, \"listing\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { listing: { url } };\n}\n\n/**\n * Merge a price-service override onto its base.\n *\n * A plain spread is wrong once more than one provider exists: an override that\n * switches `type` without restating both URLs would inherit the *previous*\n * provider's endpoints, pointing one provider's client at another's host. That\n * type-checks cleanly and fails at runtime as a confusing 404, so a `type` swap\n * is required to supply the whole block.\n *\n * A same-type (or type-less) override still merges field-by-field, so the common\n * `{ url, wsUrl }` staging override keeps working.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE` when the override\n * changes `type` but omits `url` or `wsUrl`.\n */\nfunction mergePriceService(\n chainId: number,\n base: SymmioPriceServiceConfig,\n override: DeepPartial<SymmioPriceServiceConfig> | undefined,\n): SymmioPriceServiceConfig {\n if (!override) return base;\n\n const merged = { ...base, ...override } as SymmioPriceServiceConfig;\n const swapsProvider = override.type !== undefined && override.type !== base.type;\n if (swapsProvider && (override.url === undefined || override.wsUrl === undefined)) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: the priceService override for chain ${chainId} changes type from \"${base.type}\" to \"${override.type}\" but omits ${override.url === undefined ? \"`url`\" : \"`wsUrl`\"}. Supply both URLs when switching provider — inheriting the previous provider's endpoints would point the \"${override.type}\" client at \"${base.type}\" hosts.`,\n );\n }\n return merged;\n}\n\n/**\n * Merge a notifications override onto its base.\n *\n * Same trap as {@link mergePriceService}: once the config is a per-protocol\n * union, an override that switches `protocol` without restating the endpoint\n * would inherit the *previous* protocol's fields — a `rasa → enigma` swap\n * without a `channel` (or either swap without a `url`) type-checks as a\n * `DeepPartial` and fails at runtime. So a `protocol` swap must supply the\n * whole block; a same-protocol override still merges field-by-field.\n *\n * A swap takes the override block **alone** — nothing is inherited, including\n * the optional `searchUrl` (the previous protocol's REST search service does\n * not index the new protocol's stream).\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE` when the override\n * changes `protocol` but omits `url`, or targets `enigma` without a\n * `channel`.\n */\nfunction mergeNotifications(\n chainId: number,\n base: SymmioNotificationsConfig,\n override: DeepPartial<SymmioNotificationsConfig> | undefined,\n): SymmioNotificationsConfig {\n if (!override) return base;\n\n const swapsProtocol = override.protocol !== undefined && override.protocol !== base.protocol;\n if (swapsProtocol) {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: the notifications override for chain ${chainId} changes protocol from \"${base.protocol}\" to \"${override.protocol}\" but omits ${missing}. Supply the whole block when switching protocol — inheriting the previous protocol's fields would point the \"${override.protocol}\" subscriber at \"${base.protocol}\" endpoints.`,\n );\n }\n return { ...override } as SymmioNotificationsConfig;\n }\n\n const merged = { ...base, ...override } as SymmioNotificationsConfig;\n if (merged.protocol === \"rasa\") {\n // A cast override could still sneak a `channel` key onto the rasa variant.\n delete (merged as { channel?: string }).channel;\n }\n return merged;\n}\n\n/**\n * Merge a per-chain solver map by id: each overridden solver is deep-merged onto\n * its base (or added when the id is new). Solvers the override does not mention\n * are inherited unchanged.\n */\nfunction mergeSolvers(\n chainId: number,\n base: Partial<Record<SolverId, SymmioSolverConfig>>,\n override: DeepPartial<Record<SolverId, SymmioSolverConfig>> | undefined,\n): Partial<Record<SolverId, SymmioSolverConfig>> {\n if (!override) return base;\n const merged: Partial<Record<SolverId, SymmioSolverConfig>> = { ...base };\n for (const [id, solverOverride] of Object.entries(override) as [SolverId, DeepPartial<SymmioSolverConfig>][]) {\n if (!solverOverride) continue;\n merged[id] = mergeSolver(chainId, base[id], solverOverride);\n }\n return merged;\n}\n\n/**\n * Merge one solver's fields. The optional nested `tpsl` and `priceService` blocks\n * are deep-merged so a partial override (e.g. only the `url`) keeps the base's\n * other fields. When neither base nor override declares a block, it stays absent\n * — for `priceService` that absence is meaningful: it is what makes the solver\n * fall back to the chain-level price service.\n */\nfunction mergeSolver(\n chainId: number,\n base: SymmioSolverConfig | undefined,\n override: DeepPartial<SymmioSolverConfig>,\n): SymmioSolverConfig {\n const merged = { ...(base ?? {}), ...(override as Partial<SymmioSolverConfig>) } as SymmioSolverConfig;\n\n const overrideTpsl = override.tpsl;\n if (overrideTpsl) {\n merged.tpsl = {\n ...(base?.tpsl ?? ({} as SymmioTpSlConfig)),\n ...(overrideTpsl as Partial<SymmioTpSlConfig>),\n } as SymmioTpSlConfig;\n } else if (base?.tpsl) {\n merged.tpsl = base.tpsl;\n } else {\n delete merged.tpsl;\n }\n\n const overridePriceService = override.priceService;\n if (overridePriceService) {\n // With no base block there is nothing to inherit, so the override must be\n // complete — route it through the same type-swap guard by treating it as a\n // swap away from the base (or chain) provider.\n merged.priceService = base?.priceService\n ? mergePriceService(chainId, base.priceService, overridePriceService)\n : assertCompletePriceService(chainId, overridePriceService);\n } else if (base?.priceService) {\n merged.priceService = base.priceService;\n } else {\n delete merged.priceService;\n }\n\n const overrideNotifications = override.notifications;\n if (overrideNotifications) {\n // With a base solver, deep-merge (same protocol-swap guard as the chain path\n // used to apply). With no base, the override must be a complete block.\n merged.notifications = base?.notifications\n ? mergeNotifications(chainId, base.notifications, overrideNotifications)\n : assertCompleteNotifications(chainId, overrideNotifications);\n } else if (base?.notifications) {\n merged.notifications = base.notifications;\n } else {\n throw new SymmError(\n \"config\",\n \"SOLVER_NOTIFICATIONS_REQUIRED\",\n `createConfig: a new solver on chain ${chainId} added via symmioConfig must declare a \\`notifications\\` block — it is required per solver and there is no base to inherit it from.`,\n );\n }\n\n const overrideCapabilities = override.capabilities;\n if (overrideCapabilities) {\n merged.capabilities = {\n ...(base?.capabilities ?? {}),\n ...(overrideCapabilities as SolverCapabilitiesConfig),\n };\n } else if (base?.capabilities) {\n merged.capabilities = base.capabilities;\n } else {\n delete merged.capabilities;\n }\n\n return merged;\n}\n\n/**\n * Validate a solver-nested price service that has no base to inherit from: every\n * field must be present, since there is nothing to fall back to.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompletePriceService(\n chainId: number,\n override: DeepPartial<SymmioPriceServiceConfig>,\n): SymmioPriceServiceConfig {\n if (override.type === undefined || override.url === undefined || override.wsUrl === undefined) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested priceService on chain ${chainId} must declare \\`type\\`, \\`url\\` and \\`wsUrl\\` — there is no per-solver base to inherit the missing fields from. Omit the block entirely to fall back to the chain's price service.`,\n );\n }\n return override as SymmioPriceServiceConfig;\n}\n\n/**\n * Validate a solver-nested notifications block that has no base to inherit from\n * (a brand-new solver added via `symmioConfig`): `url` and `protocol` are always\n * required, and `enigma` additionally requires a `channel`.\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompleteNotifications(\n chainId: number,\n override: DeepPartial<SymmioNotificationsConfig>,\n): SymmioNotificationsConfig {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === undefined\n ? \"`protocol`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested notifications block on chain ${chainId} must declare ${missing} — there is no per-solver base to inherit the missing fields from.`,\n );\n }\n return override as SymmioNotificationsConfig;\n}\n"],"mappings":";;;;AAyBA,SAAgB,EACd,GACmC;CACnC,IAAM,IAA8C,CAAC;CAErD,KAAK,IAAM,KAAW,EAAoB,GAAG;EAC3C,IAAM,IAAO,EAAe,CAAO,GAC7B,IAAW,IAAY;EAC7B,EAAS,KAAW,IAAW,EAAiB,GAAM,CAAQ,IAAI;CACpE;CAEA,OAAO;AACT;AASA,SAAS,EAAiB,GAAyB,GAA6D;CAC9G,OAAO;EACL,GAAG;EAC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AAM,gBACzB,EAAmB,GAAS,EAAK,eAAe,CAAqB,IACrE,EAA4B,GAAS,CAAqB;MACzD,IAAI,GAAM,eACf,EAAO,gBAAgB,EAAK;MAE5B,MAAM,IAAI,EACR,UACA,iCACA,uCAAuC,EAAQ,oIACjD;CAGF,IAAM,IAAuB,EAAS;CAYtC,OAXI,IACF,EAAO,eAAe;EACpB,GAAI,GAAM,gBAAgB,CAAC;EAC3B,GAAI;CACN,IACS,GAAM,eACf,EAAO,eAAe,EAAK,eAE3B,OAAO,EAAO,cAGT;AACT;AAQA,SAAS,EACP,GACA,GAC0B;CAC1B,IAAI,EAAS,SAAS,KAAA,KAAa,EAAS,QAAQ,KAAA,KAAa,EAAS,UAAU,KAAA,GAClF,MAAM,IAAI,EACR,UACA,qCACA,uDAAuD,EAAQ,mLACjE;CAEF,OAAO;AACT;AASA,SAAS,EACP,GACA,GAC2B;CAC3B,IAAM,IACJ,EAAS,QAAQ,KAAA,IACb,UACA,EAAS,aAAa,KAAA,IACpB,eACA,EAAS,aAAa,YAAa,EAAkC,YAAY,KAAA,IAC/E,cACA;CACV,IAAI,GACF,MAAM,IAAI,EACR,UACA,qCACA,8DAA8D,EAAQ,gBAAgB,EAAQ,mEAChG;CAEF,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"merge-chain-config.js","names":[],"sources":["../../../src/core/config/merge-chain-config.ts"],"sourcesContent":["import { SymmError } from \"../../shared/errors/symm-error\";\nimport type { DeepPartial } from \"../../shared/types/properties\";\nimport {\n getChainConfig,\n listSupportedChains,\n type GaslessExecutionConfig,\n type SolverCapabilitiesConfig,\n type SolverId,\n type SymmioChainConfig,\n type SymmioGaslessConfig,\n type SymmioGaslessStatusStreamConfig,\n type SymmioInventoryConfig,\n type SymmioListingConfig,\n type SymmioNotificationsConfig,\n type SymmioPriceServiceConfig,\n type SymmioSolverConfig,\n type SymmioTpSlConfig,\n} from \"../chains\";\n\n/**\n * Build the per-chain config registry a {@link Config} holds: every built-in\n * supported chain, deep-merged with the caller's overrides.\n *\n * @param overrides - Optional per-chain partial overrides keyed by chain id.\n * @returns A registry mapping chain id to its fully-resolved config.\n *\n * @internal\n */\nexport function buildChainConfigs(\n overrides?: Partial<Record<number, DeepPartial<SymmioChainConfig>>>,\n): Record<number, SymmioChainConfig> {\n const registry: Record<number, SymmioChainConfig> = {};\n\n for (const chainId of listSupportedChains()) {\n const base = getChainConfig(chainId);\n const override = overrides?.[chainId];\n registry[chainId] = override ? mergeChainConfig(base, override) : base;\n }\n\n return registry;\n}\n\n/**\n * Deep-merge a single chain's overrides onto its built-in defaults. Only the\n * known nested groups (`addresses`, `subgraphs`, `solvers`, `priceService`,\n * `notifications`, `muon`, `listing`, `inventory`, `gasless`) are merged; unknown keys are ignored.\n *\n * @internal\n */\nfunction mergeChainConfig(base: SymmioChainConfig, override: DeepPartial<SymmioChainConfig>): SymmioChainConfig {\n return {\n ...base,\n ...(override.chainId !== undefined ? { chainId: override.chainId } : {}),\n contractsVersion: override.contractsVersion ?? base.contractsVersion,\n addresses: { ...base.addresses, ...override.addresses },\n subgraphs: { ...base.subgraphs, ...override.subgraphs },\n solvers: mergeSolvers(base.chainId, base.solvers, override.solvers),\n defaultSolverId: override.defaultSolverId ?? base.defaultSolverId,\n priceService: mergePriceService(base.chainId, base.priceService, override.priceService),\n muon: {\n /** `urls` is replaced wholesale when overridden, otherwise inherited from base. */\n urls: override.muon?.urls ?? base.muon.urls,\n },\n ...mergeListing(base.listing, override.listing),\n ...mergeInventory(base.inventory, override.inventory),\n ...mergeGasless(base.chainId, base.gasless, override.gasless),\n };\n}\n\n/**\n * Merge a GaslessQ service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures\n * the service (same invariant as {@link mergeListing}). With a base, fields\n * merge one by one and the nested `execution` and `statusStream` blocks\n * deep-merge. With no base, the override must be a complete block — `url` and\n * `gaslessLayerAddress` are both required, since there is nothing to inherit\n * them from and a half-built block would only fail later, at request time, with\n * a confusing error.\n *\n * @throws {SymmError} `GASLESS_OVERRIDE_INCOMPLETE` when a base-less override\n * omits `url` or `gaslessLayerAddress`, or when a `statusStream` sets\n * `origin` with no `enabled` to inherit.\n */\nfunction mergeGasless(\n chainId: number,\n base: SymmioGaslessConfig | undefined,\n override: DeepPartial<SymmioGaslessConfig> | undefined,\n): Pick<SymmioChainConfig, \"gasless\"> | Record<string, never> {\n if (!base && !override) return {};\n if (!override) return { gasless: base };\n\n const url = override.url ?? base?.url;\n const gaslessLayerAddress = override.gaslessLayerAddress ?? base?.gaslessLayerAddress;\n if (url === undefined || gaslessLayerAddress === undefined) {\n throw new SymmError(\n \"config\",\n \"GASLESS_OVERRIDE_INCOMPLETE\",\n `createConfig: the gasless override for chain ${chainId} must declare ${url === undefined ? \"`url`\" : \"`gaslessLayerAddress`\"} — there is no built-in gasless config to inherit it from.`,\n );\n }\n\n const execution =\n override.execution || base?.execution\n ? { ...(base?.execution ?? {}), ...((override.execution ?? {}) as GaslessExecutionConfig) }\n : undefined;\n\n const protocolInstance = override.protocolInstance ?? base?.protocolInstance;\n const apiKey = override.apiKey ?? base?.apiKey;\n const statusStream = mergeGaslessStatusStream(chainId, base?.statusStream, override.statusStream);\n\n return {\n gasless: {\n url,\n gaslessLayerAddress,\n ...(protocolInstance !== undefined ? { protocolInstance } : {}),\n ...(apiKey !== undefined ? { apiKey } : {}),\n ...(statusStream ? { statusStream } : {}),\n ...(execution ? { execution } : {}),\n },\n };\n}\n\n/**\n * Merge a gasless `statusStream` override onto its base, field by field, so an\n * override that restates only `origin` keeps the base's `enabled` (and an\n * explicit `undefined` never erases a base value).\n *\n * The block stays absent when neither side declares a field. `enabled` has no\n * default: an `origin` with nothing to inherit `enabled` from is a half-built\n * block, and silently reading it as \"disabled\" would hide the mistake.\n *\n * @throws {SymmError} `GASLESS_OVERRIDE_INCOMPLETE` when the merged block has\n * an `origin` but no `enabled`.\n */\nfunction mergeGaslessStatusStream(\n chainId: number,\n base?: SymmioGaslessStatusStreamConfig,\n override?: DeepPartial<SymmioGaslessStatusStreamConfig>,\n): SymmioGaslessStatusStreamConfig | undefined {\n const enabled = override?.enabled ?? base?.enabled;\n const origin = override?.origin ?? base?.origin;\n if (enabled === undefined) {\n if (origin === undefined) return undefined;\n throw new SymmError(\n \"config\",\n \"GASLESS_OVERRIDE_INCOMPLETE\",\n `createConfig: the gasless statusStream override for chain ${chainId} sets \\`origin\\` but not \\`enabled\\` — there is no statusStream block to inherit it from.`,\n );\n }\n return { enabled, ...(origin !== undefined ? { origin } : {}) };\n}\n\n/**\n * Merge an inventory-service override onto its base. Mirrors\n * {@link mergeListing}: returns a partial so the key stays **absent** when\n * neither side configures the service.\n */\nfunction mergeInventory(\n base: SymmioInventoryConfig | undefined,\n override: DeepPartial<SymmioInventoryConfig> | undefined,\n): Pick<SymmioChainConfig, \"inventory\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { inventory: { url } };\n}\n\n/**\n * Merge a listing-service override onto its base.\n *\n * Returns a partial so the key stays **absent** when neither side configures the\n * service — an explicit `listing: undefined` would still be an own property and\n * would read as \"configured but empty\" to anything doing a key check.\n */\nfunction mergeListing(\n base: SymmioListingConfig | undefined,\n override: DeepPartial<SymmioListingConfig> | undefined,\n): Pick<SymmioChainConfig, \"listing\"> | Record<string, never> {\n const url = override?.url ?? base?.url;\n return url === undefined ? {} : { listing: { url } };\n}\n\n/**\n * Merge a price-service override onto its base.\n *\n * A plain spread is wrong once more than one provider exists: an override that\n * switches `type` without restating both URLs would inherit the *previous*\n * provider's endpoints, pointing one provider's client at another's host. That\n * type-checks cleanly and fails at runtime as a confusing 404, so a `type` swap\n * is required to supply the whole block.\n *\n * A same-type (or type-less) override still merges field-by-field, so the common\n * `{ url, wsUrl }` staging override keeps working.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE` when the override\n * changes `type` but omits `url` or `wsUrl`.\n */\nfunction mergePriceService(\n chainId: number,\n base: SymmioPriceServiceConfig,\n override: DeepPartial<SymmioPriceServiceConfig> | undefined,\n): SymmioPriceServiceConfig {\n if (!override) return base;\n\n const merged = { ...base, ...override } as SymmioPriceServiceConfig;\n const swapsProvider = override.type !== undefined && override.type !== base.type;\n if (swapsProvider && (override.url === undefined || override.wsUrl === undefined)) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: the priceService override for chain ${chainId} changes type from \"${base.type}\" to \"${override.type}\" but omits ${override.url === undefined ? \"`url`\" : \"`wsUrl`\"}. Supply both URLs when switching provider — inheriting the previous provider's endpoints would point the \"${override.type}\" client at \"${base.type}\" hosts.`,\n );\n }\n return merged;\n}\n\n/**\n * Merge a notifications override onto its base.\n *\n * Same trap as {@link mergePriceService}: once the config is a per-protocol\n * union, an override that switches `protocol` without restating the endpoint\n * would inherit the *previous* protocol's fields — a `rasa → enigma` swap\n * without a `channel` (or either swap without a `url`) type-checks as a\n * `DeepPartial` and fails at runtime. So a `protocol` swap must supply the\n * whole block; a same-protocol override still merges field-by-field.\n *\n * A swap takes the override block **alone** — nothing is inherited, including\n * the optional `searchUrl` (the previous protocol's REST search service does\n * not index the new protocol's stream).\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE` when the override\n * changes `protocol` but omits `url`, or targets `enigma` without a\n * `channel`.\n */\nfunction mergeNotifications(\n chainId: number,\n base: SymmioNotificationsConfig,\n override: DeepPartial<SymmioNotificationsConfig> | undefined,\n): SymmioNotificationsConfig {\n if (!override) return base;\n\n const swapsProtocol = override.protocol !== undefined && override.protocol !== base.protocol;\n if (swapsProtocol) {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: the notifications override for chain ${chainId} changes protocol from \"${base.protocol}\" to \"${override.protocol}\" but omits ${missing}. Supply the whole block when switching protocol — inheriting the previous protocol's fields would point the \"${override.protocol}\" subscriber at \"${base.protocol}\" endpoints.`,\n );\n }\n return { ...override } as SymmioNotificationsConfig;\n }\n\n const merged = { ...base, ...override } as SymmioNotificationsConfig;\n if (merged.protocol === \"rasa\") {\n // A cast override could still sneak a `channel` key onto the rasa variant.\n delete (merged as { channel?: string }).channel;\n }\n return merged;\n}\n\n/**\n * Merge a per-chain solver map by id: each overridden solver is deep-merged onto\n * its base (or added when the id is new). Solvers the override does not mention\n * are inherited unchanged.\n */\nfunction mergeSolvers(\n chainId: number,\n base: Partial<Record<SolverId, SymmioSolverConfig>>,\n override: DeepPartial<Record<SolverId, SymmioSolverConfig>> | undefined,\n): Partial<Record<SolverId, SymmioSolverConfig>> {\n if (!override) return base;\n const merged: Partial<Record<SolverId, SymmioSolverConfig>> = { ...base };\n for (const [id, solverOverride] of Object.entries(override) as [SolverId, DeepPartial<SymmioSolverConfig>][]) {\n if (!solverOverride) continue;\n merged[id] = mergeSolver(chainId, base[id], solverOverride);\n }\n return merged;\n}\n\n/**\n * Merge one solver's fields. The optional nested `tpsl` and `priceService` blocks\n * are deep-merged so a partial override (e.g. only the `url`) keeps the base's\n * other fields. When neither base nor override declares a block, it stays absent\n * — for `priceService` that absence is meaningful: it is what makes the solver\n * fall back to the chain-level price service.\n */\nfunction mergeSolver(\n chainId: number,\n base: SymmioSolverConfig | undefined,\n override: DeepPartial<SymmioSolverConfig>,\n): SymmioSolverConfig {\n const merged = { ...(base ?? {}), ...(override as Partial<SymmioSolverConfig>) } as SymmioSolverConfig;\n\n const overrideTpsl = override.tpsl;\n if (overrideTpsl) {\n merged.tpsl = {\n ...(base?.tpsl ?? ({} as SymmioTpSlConfig)),\n ...(overrideTpsl as Partial<SymmioTpSlConfig>),\n } as SymmioTpSlConfig;\n } else if (base?.tpsl) {\n merged.tpsl = base.tpsl;\n } else {\n delete merged.tpsl;\n }\n\n const overridePriceService = override.priceService;\n if (overridePriceService) {\n // With no base block there is nothing to inherit, so the override must be\n // complete — route it through the same type-swap guard by treating it as a\n // swap away from the base (or chain) provider.\n merged.priceService = base?.priceService\n ? mergePriceService(chainId, base.priceService, overridePriceService)\n : assertCompletePriceService(chainId, overridePriceService);\n } else if (base?.priceService) {\n merged.priceService = base.priceService;\n } else {\n delete merged.priceService;\n }\n\n const overrideNotifications = override.notifications;\n if (overrideNotifications) {\n // With a base solver, deep-merge (same protocol-swap guard as the chain path\n // used to apply). With no base, the override must be a complete block.\n merged.notifications = base?.notifications\n ? mergeNotifications(chainId, base.notifications, overrideNotifications)\n : assertCompleteNotifications(chainId, overrideNotifications);\n } else if (base?.notifications) {\n merged.notifications = base.notifications;\n } else {\n throw new SymmError(\n \"config\",\n \"SOLVER_NOTIFICATIONS_REQUIRED\",\n `createConfig: a new solver on chain ${chainId} added via symmioConfig must declare a \\`notifications\\` block — it is required per solver and there is no base to inherit it from.`,\n );\n }\n\n const overrideCapabilities = override.capabilities;\n if (overrideCapabilities) {\n merged.capabilities = {\n ...(base?.capabilities ?? {}),\n ...(overrideCapabilities as SolverCapabilitiesConfig),\n };\n } else if (base?.capabilities) {\n merged.capabilities = base.capabilities;\n } else {\n delete merged.capabilities;\n }\n\n return merged;\n}\n\n/**\n * Validate a solver-nested price service that has no base to inherit from: every\n * field must be present, since there is nothing to fall back to.\n *\n * @throws {SymmError} `PRICE_SERVICE_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompletePriceService(\n chainId: number,\n override: DeepPartial<SymmioPriceServiceConfig>,\n): SymmioPriceServiceConfig {\n if (override.type === undefined || override.url === undefined || override.wsUrl === undefined) {\n throw new SymmError(\n \"config\",\n \"PRICE_SERVICE_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested priceService on chain ${chainId} must declare \\`type\\`, \\`url\\` and \\`wsUrl\\` — there is no per-solver base to inherit the missing fields from. Omit the block entirely to fall back to the chain's price service.`,\n );\n }\n return override as SymmioPriceServiceConfig;\n}\n\n/**\n * Validate a solver-nested notifications block that has no base to inherit from\n * (a brand-new solver added via `symmioConfig`): `url` and `protocol` are always\n * required, and `enigma` additionally requires a `channel`.\n *\n * @throws {SymmError} `NOTIFICATIONS_OVERRIDE_INCOMPLETE`\n */\nfunction assertCompleteNotifications(\n chainId: number,\n override: DeepPartial<SymmioNotificationsConfig>,\n): SymmioNotificationsConfig {\n const missing =\n override.url === undefined\n ? \"`url`\"\n : override.protocol === undefined\n ? \"`protocol`\"\n : override.protocol === \"enigma\" && (override as { channel?: string }).channel === undefined\n ? \"`channel`\"\n : null;\n if (missing) {\n throw new SymmError(\n \"config\",\n \"NOTIFICATIONS_OVERRIDE_INCOMPLETE\",\n `createConfig: a solver-nested notifications block on chain ${chainId} must declare ${missing} — there is no per-solver base to inherit the missing fields from.`,\n );\n }\n return override as SymmioNotificationsConfig;\n}\n"],"mappings":";;;;AA4BA,SAAgB,EACd,GACmC;CACnC,IAAM,IAA8C,CAAC;CAErD,KAAK,IAAM,KAAW,EAAoB,GAAG;EAC3C,IAAM,IAAO,EAAe,CAAO,GAC7B,IAAW,IAAY;EAC7B,EAAS,KAAW,IAAW,EAAiB,GAAM,CAAQ,IAAI;CACpE;CAEA,OAAO;AACT;AASA,SAAS,EAAiB,GAAyB,GAA6D;CAC9G,OAAO;EACL,GAAG;EACH,GAAI,EAAS,YAAY,KAAA,IAA4C,CAAC,IAAjC,EAAE,SAAS,EAAS,QAAQ;EACjE,kBAAkB,EAAS,oBAAoB,EAAK;EACpD,WAAW;GAAE,GAAG,EAAK;GAAW,GAAG,EAAS;EAAU;EACtD,WAAW;GAAE,GAAG,EAAK;GAAW,GAAG,EAAS;EAAU;EACtD,SAAS,EAAa,EAAK,SAAS,EAAK,SAAS,EAAS,OAAO;EAClE,iBAAiB,EAAS,mBAAmB,EAAK;EAClD,cAAc,EAAkB,EAAK,SAAS,EAAK,cAAc,EAAS,YAAY;EACtF,MAAM,EAEJ,MAAM,EAAS,MAAM,QAAQ,EAAK,KAAK,KACzC;EACA,GAAG,EAAa,EAAK,SAAS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A,uDAAuD,EAAQ,mLACjE;CAEF,OAAO;AACT;AASA,SAAS,EACP,GACA,GAC2B;CAC3B,IAAM,IACJ,EAAS,QAAQ,KAAA,IACb,UACA,EAAS,aAAa,KAAA,IACpB,eACA,EAAS,aAAa,YAAa,EAAkC,YAAY,KAAA,IAC/E,cACA;CACV,IAAI,GACF,MAAM,IAAI,EACR,UACA,qCACA,8DAA8D,EAAQ,gBAAgB,EAAQ,mEAChG;CAEF,OAAO;AACT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SymmError } from '../shared/errors/symm-error.js';
|
|
2
|
+
/** The error an aborted gasless wait, poll delay or rate-limit wait rejects with. @internal */
|
|
3
|
+
export declare function gaslessAbortedError(what: string): SymmError;
|
|
4
|
+
/**
|
|
5
|
+
* Sleep that rejects as soon as `signal` aborts, instead of holding the caller
|
|
6
|
+
* until the timer it is waiting on happens to fire.
|
|
7
|
+
*
|
|
8
|
+
* @param ms - How long to wait.
|
|
9
|
+
* @param signal - Abort signal; an already-aborted one rejects synchronously.
|
|
10
|
+
* @param what - What is being waited on, for the error message.
|
|
11
|
+
* @returns A promise that resolves after `ms`.
|
|
12
|
+
* @throws {SymmError} `GASLESS_WAIT_ABORTED` when `signal` aborts first.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function gaslessSleep(ms: number, signal?: AbortSignal, what?: string): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=abortable-sleep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortable-sleep.d.ts","sourceRoot":"","sources":["../../src/gasless/abortable-sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAE3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,SAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAatG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SymmError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
//#region src/gasless/abortable-sleep.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return new e("api", "GASLESS_WAIT_ABORTED", `Gasless: ${t} was aborted.`);
|
|
5
|
+
}
|
|
6
|
+
function n(e, n, r = "the status wait") {
|
|
7
|
+
return new Promise((i, a) => {
|
|
8
|
+
let o = setTimeout(() => {
|
|
9
|
+
n?.removeEventListener("abort", s), i();
|
|
10
|
+
}, e);
|
|
11
|
+
function s() {
|
|
12
|
+
clearTimeout(o), a(t(r));
|
|
13
|
+
}
|
|
14
|
+
if (n?.aborted) return s();
|
|
15
|
+
n?.addEventListener("abort", s, { once: !0 });
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as gaslessAbortedError, n as gaslessSleep };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=abortable-sleep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortable-sleep.js","names":[],"sources":["../../src/gasless/abortable-sleep.ts"],"sourcesContent":["import { SymmError } from \"../shared/errors/symm-error\";\n\n/** The error an aborted gasless wait, poll delay or rate-limit wait rejects with. @internal */\nexport function gaslessAbortedError(what: string): SymmError {\n return new SymmError(\"api\", \"GASLESS_WAIT_ABORTED\", `Gasless: ${what} was aborted.`);\n}\n\n/**\n * Sleep that rejects as soon as `signal` aborts, instead of holding the caller\n * until the timer it is waiting on happens to fire.\n *\n * @param ms - How long to wait.\n * @param signal - Abort signal; an already-aborted one rejects synchronously.\n * @param what - What is being waited on, for the error message.\n * @returns A promise that resolves after `ms`.\n * @throws {SymmError} `GASLESS_WAIT_ABORTED` when `signal` aborts first.\n *\n * @internal\n */\nexport function gaslessSleep(ms: number, signal?: AbortSignal, what = \"the status wait\"): Promise<void> {\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n signal?.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n function onAbort() {\n clearTimeout(timer);\n reject(gaslessAbortedError(what));\n }\n if (signal?.aborted) return onAbort();\n signal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n}\n"],"mappings":";;AAGA,SAAgB,EAAoB,GAAyB;CAC3D,OAAO,IAAI,EAAU,OAAO,wBAAwB,YAAY,EAAK,cAAc;AACrF;AAcA,SAAgB,EAAa,GAAY,GAAsB,IAAO,mBAAkC;CACtG,OAAO,IAAI,SAAS,GAAS,MAAW;EACtC,IAAM,IAAQ,iBAAiB;GAE7B,AADA,GAAQ,oBAAoB,SAAS,CAAO,GAC5C,EAAQ;EACV,GAAG,CAAE;EACL,SAAS,IAAU;GAEjB,AADA,aAAa,CAAK,GAClB,EAAO,EAAoB,CAAI,CAAC;EAClC;EACA,IAAI,GAAQ,SAAS,OAAO,EAAQ;EACpC,GAAQ,iBAAiB,SAAS,GAAS,EAAE,MAAM,GAAK,CAAC;CAC3D,CAAC;AACH"}
|