@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-group-funding.js","names":[],"sources":["../../../src/quotes/grouping/aggregate-group-funding.ts"],"sourcesContent":["import type { QuoteFundingData } from \"../get-quote-funding/types\";\nimport type { UnifiedQuote } from \"../unified-quote\";\n\n/**\n * Aggregated funding for one group of quotes, folded from the per-quote\n * {@link QuoteFundingData} rows the analytics subgraph returned for its children.\n *\n * Every amount is 18-decimal wei `bigint`, matching {@link UnifiedQuote}.\n *\n * **Sign convention** — `netReceived = received − paid`, the P&L perspective. A\n * **positive** `netReceived` means the group has **earned** funding; a negative\n * one means it has **paid** for it. This matches\n * {@link QuoteFundingData.netReceived} and {@link QuoteGroupUpnl.upnl}, so a\n * \"green = income\" UI renders it directly. It is the inverse of the on-chain\n * `int256`, which is cost-positive.\n *\n * **Settled-to-date only** — these totals cover funding the protocol has already\n * charged and the analytics subgraph has indexed. Funding accrued since the last\n * charge is **not** included: it is not indexed
|
|
1
|
+
{"version":3,"file":"aggregate-group-funding.js","names":[],"sources":["../../../src/quotes/grouping/aggregate-group-funding.ts"],"sourcesContent":["import type { QuoteFundingData } from \"../get-quote-funding/types\";\nimport type { UnifiedQuote } from \"../unified-quote\";\n\n/**\n * Aggregated funding for one group of quotes, folded from the per-quote\n * {@link QuoteFundingData} rows the analytics subgraph returned for its children.\n *\n * Every amount is 18-decimal wei `bigint`, matching {@link UnifiedQuote}.\n *\n * **Sign convention** — `netReceived = received − paid`, the P&L perspective. A\n * **positive** `netReceived` means the group has **earned** funding; a negative\n * one means it has **paid** for it. This matches\n * {@link QuoteFundingData.netReceived} and {@link QuoteGroupUpnl.upnl}, so a\n * \"green = income\" UI renders it directly. It is the inverse of the on-chain\n * `int256`, which is cost-positive.\n *\n * **Settled-to-date only** — these totals cover funding the protocol has already\n * charged and the analytics subgraph has indexed. Funding accrued since the last\n * charge is **not** included: it is not indexed by the subgraph — read it with\n * {@link getQuotePendingFunding}. The two come from different sources at\n * different heights, so do not add them into a lifetime total.\n *\n * **Completeness** — `netReceived` is always the sum over the children that *did*\n * resolve, i.e. a lower bound while rows are still missing; it is never\n * suppressed. Read {@link isComplete} to decide whether to trust it, and treat\n * `isComplete: false` as \"funding unknown\", not as \"no funding\".\n */\nexport interface QuoteGroupFunding {\n /** Σ funding partyA paid across the group's resolved children (wei). */\n paid: bigint;\n /** Σ funding partyA received across the group's resolved children (wei). */\n received: bigint;\n /**\n * Σ `received − paid` across the group's resolved children (wei). **Positive =\n * the group earned funding**; negative = it paid for it. A lower bound while\n * {@link isComplete} is `false`.\n */\n netReceived: bigint;\n /** Number of distinct child quote ids that produced a funding row. */\n resolvedCount: number;\n /**\n * Number of distinct on-chain quote ids among the children — the rows this\n * group expects. Optimistic children (no `quoteId` yet) are not counted.\n */\n expectedCount: number;\n /**\n * Expected quote ids with no funding row yet (subgraph indexing lag), in the\n * order the ids first appear in the group's children.\n */\n missingQuoteIds: bigint[];\n /**\n * `true` only when the group has at least one on-chain child **and** every one\n * of them resolved — i.e. the amounts above are the group's complete\n * settled-to-date funding.\n *\n * An all-optimistic group (or an empty one) has nothing to resolve and reports\n * `false` with `net: 0n`, so a consumer can tell \"funding unknown\" apart from\n * \"no funding\".\n */\n isComplete: boolean;\n}\n\n/**\n * Fold the per-quote funding rows of a group's children into a single\n * {@link QuoteGroupFunding}.\n *\n * Behaviour:\n *\n * - **De-duplicated by `quoteId`.** The fold runs over the *distinct* on-chain\n * ids among `quotes`, so a quote listed twice contributes its funding once.\n * Duplicate rows for the same id in `rows` are likewise counted once.\n * - **Optimistic children are skipped.** A child with no `quoteId` has nothing to\n * look up, so it neither inflates `expectedCount` nor lands in\n * `missingQuoteIds`.\n * - **Extra rows are ignored.** A row whose `quoteId` is not among the children\n * is never summed — passing a shared, over-fetched row set is safe.\n * - **`netReceived` is never suppressed.** It is the sum over whatever resolved:\n * a lower bound while `isComplete` is `false`.\n * - **`isComplete` is `expectedCount > 0 && missingQuoteIds.length === 0`.** An\n * all-optimistic or empty group therefore reports `isComplete: false` with\n * zero amounts — \"funding unknown\", not \"no funding\".\n *\n * Sign convention: `netReceived = received − paid`, so **positive means the group\n * earned funding** (see {@link QuoteGroupFunding}). The totals are funding\n * **settled to date**; funding accrued since the last charge is not indexed by\n * the subgraph and not included — read it with {@link getQuotePendingFunding}.\n *\n * Do **not** substitute `Σ UnifiedQuote.accumulatedPaidFunding` as a shortcut.\n * That field is the quote's per-unit cumulative funding-fee *index* recorded at\n * its last settlement, not a settled amount — summing it across quotes is\n * dimensionally meaningless, and it is cost-positive where `netReceived` is\n * income-positive.\n *\n * Pure, order-independent, no IO. Empty input yields all-zero amounts with\n * `isComplete: false`.\n *\n * @param quotes - The group's child quotes (optimistic children allowed).\n * @param rows - Funding rows fetched for those quotes; extras and duplicates are tolerated.\n * @returns The aggregated funding for the group.\n *\n * @example\n * ```ts\n * const funding = aggregateGroupFunding(group.quotes, rows);\n * if (!funding.isComplete) {\n * // still indexing — show a loading state rather than \"0 funding\"\n * } else if (funding.netReceived > 0n) {\n * // the group has earned funding\n * }\n * ```\n */\nexport function aggregateGroupFunding(\n quotes: readonly UnifiedQuote[],\n rows: readonly QuoteFundingData[],\n): QuoteGroupFunding {\n /** Distinct on-chain ids among the children, in first-appearance order. */\n const expectedQuoteIds: bigint[] = [];\n const seenQuoteIds = new Set<bigint>();\n for (const quote of quotes) {\n /** Optimistic / off-chain children have no id to resolve — skip them entirely. */\n if (quote.quoteId === undefined) continue;\n if (seenQuoteIds.has(quote.quoteId)) continue;\n seenQuoteIds.add(quote.quoteId);\n expectedQuoteIds.push(quote.quoteId);\n }\n\n /** First row per id — a repeated row for the same quote must not double-count. */\n const rowByQuoteId = new Map<bigint, QuoteFundingData>();\n for (const row of rows) {\n if (!rowByQuoteId.has(row.quoteId)) rowByQuoteId.set(row.quoteId, row);\n }\n\n let paid = 0n;\n let received = 0n;\n let resolvedCount = 0;\n const missingQuoteIds: bigint[] = [];\n\n /** Folding over the expected ids (not over `quotes`) is what de-duplicates, and what ignores extra rows. */\n for (const quoteId of expectedQuoteIds) {\n const row = rowByQuoteId.get(quoteId);\n if (row === undefined) {\n missingQuoteIds.push(quoteId);\n continue;\n }\n paid += row.paid;\n received += row.received;\n resolvedCount += 1;\n }\n\n return {\n paid,\n received,\n /** Derived from the sums so the aggregate keeps the row-level `netReceived = received − paid` invariant. */\n netReceived: received - paid,\n resolvedCount,\n expectedCount: expectedQuoteIds.length,\n missingQuoteIds,\n isComplete: expectedQuoteIds.length > 0 && missingQuoteIds.length === 0,\n };\n}\n"],"mappings":";AA8GA,SAAgB,EACd,GACA,GACmB;CAEnB,IAAM,IAA6B,CAAC,GAC9B,oBAAe,IAAI,IAAY;CACrC,KAAK,IAAM,KAAS,GAEd,EAAM,YAAY,KAAA,MAClB,EAAa,IAAI,EAAM,OAAO,MAClC,EAAa,IAAI,EAAM,OAAO,GAC9B,EAAiB,KAAK,EAAM,OAAO;CAIrC,IAAM,oBAAe,IAAI,IAA8B;CACvD,KAAK,IAAM,KAAO,GAChB,AAAK,EAAa,IAAI,EAAI,OAAO,KAAG,EAAa,IAAI,EAAI,SAAS,CAAG;CAGvE,IAAI,IAAO,IACP,IAAW,IACX,IAAgB,GACd,IAA4B,CAAC;CAGnC,KAAK,IAAM,KAAW,GAAkB;EACtC,IAAM,IAAM,EAAa,IAAI,CAAO;EACpC,IAAI,MAAQ,KAAA,GAAW;GACrB,EAAgB,KAAK,CAAO;GAC5B;EACF;EAGA,AAFA,KAAQ,EAAI,MACZ,KAAY,EAAI,UAChB,KAAiB;CACnB;CAEA,OAAO;EACL;EACA;EAEA,aAAa,IAAW;EACxB;EACA,eAAe,EAAiB;EAChC;EACA,YAAY,EAAiB,SAAS,KAAK,EAAgB,WAAW;CACxE;AACF"}
|
|
@@ -1,4 +1,34 @@
|
|
|
1
|
+
import { QuoteStatus } from '../../symmio-contracts/symmio/types.js';
|
|
1
2
|
import { UnifiedQuote } from '../unified-quote.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether an on-chain status is an active position (`OPENED`, `CLOSE_PENDING`,
|
|
5
|
+
* `CANCEL_CLOSE_PENDING`, `LIQUIDATED_PENDING`) — the only statuses whose pending
|
|
6
|
+
* funding is meaningful. Same set as {@link isActivePosition}.
|
|
7
|
+
*
|
|
8
|
+
* Unlike {@link isActivePosition}, it takes a **known** status and has no
|
|
9
|
+
* lifecycle fallback: a row whose `quoteStatus` is still `undefined` (an
|
|
10
|
+
* optimistic or just-anchored row) is not something to call it with. Use it to
|
|
11
|
+
* pick which quotes to pass to {@link getQuotePendingFunding}, whose view does not
|
|
12
|
+
* check status and returns a meaningless amount for a locked-but-never-opened
|
|
13
|
+
* quote.
|
|
14
|
+
*
|
|
15
|
+
* @param status - The quote's on-chain status.
|
|
16
|
+
* @returns `true` for an active-position status.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* isActiveQuoteStatus(QuoteStatus.OPENED); // true
|
|
21
|
+
* isActiveQuoteStatus(QuoteStatus.LOCKED); // false
|
|
22
|
+
*
|
|
23
|
+
* const quoteIds = quotes.flatMap((quote) =>
|
|
24
|
+
* quote.quoteId !== undefined && quote.quoteStatus !== undefined && isActiveQuoteStatus(quote.quoteStatus)
|
|
25
|
+
* ? [quote.quoteId]
|
|
26
|
+
* : [],
|
|
27
|
+
* );
|
|
28
|
+
* const rows = await getQuotePendingFunding(config, { quoteIds });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function isActiveQuoteStatus(status: QuoteStatus): boolean;
|
|
2
32
|
/**
|
|
3
33
|
* Whether a quote is a **resting/pending order** — submitted but not yet an open
|
|
4
34
|
* position.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partition-quotes.d.ts","sourceRoot":"","sources":["../../../src/quotes/grouping/partition-quotes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"partition-quotes.d.ts","sourceRoot":"","sources":["../../../src/quotes/grouping/partition-quotes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmBrE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAEhE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAW3D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAe7D;AAED,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,iBAAiB,CAQlF"}
|
|
@@ -11,11 +11,14 @@ var r = new Set([
|
|
|
11
11
|
t.CANCEL_CLOSE_PENDING,
|
|
12
12
|
t.LIQUIDATED_PENDING
|
|
13
13
|
]);
|
|
14
|
-
function a(
|
|
15
|
-
return
|
|
14
|
+
function a(e) {
|
|
15
|
+
return i.has(e);
|
|
16
16
|
}
|
|
17
17
|
function o(t) {
|
|
18
|
-
|
|
18
|
+
return t.quoteStatus === void 0 ? t.lifecycle === n.OPTIMISTIC || t.lifecycle === n.PRICE_FILLED || t.lifecycle === n.WRITE_ONCHAIN || t.lifecycle === n.ONCHAIN ? t.orderType === e.LIMIT : !1 : r.has(t.quoteStatus);
|
|
19
|
+
}
|
|
20
|
+
function s(t) {
|
|
21
|
+
if (t.quoteStatus !== void 0) return a(t.quoteStatus);
|
|
19
22
|
switch (t.lifecycle) {
|
|
20
23
|
case n.OPTIMISTIC:
|
|
21
24
|
case n.PRICE_FILLED:
|
|
@@ -27,15 +30,15 @@ function o(t) {
|
|
|
27
30
|
default: return !1;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
function
|
|
33
|
+
function c(e) {
|
|
31
34
|
let t = [], n = [];
|
|
32
|
-
for (let r of e)
|
|
35
|
+
for (let r of e) o(r) ? n.push(r) : s(r) && t.push(r);
|
|
33
36
|
return {
|
|
34
37
|
positions: t,
|
|
35
38
|
pending: n
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
//#endregion
|
|
39
|
-
export {
|
|
42
|
+
export { s as isActivePosition, a as isActiveQuoteStatus, o as isPendingOrder, c as partitionQuotes };
|
|
40
43
|
|
|
41
44
|
//# sourceMappingURL=partition-quotes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partition-quotes.js","names":[],"sources":["../../../src/quotes/grouping/partition-quotes.ts"],"sourcesContent":["import { OrderType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport { QuoteLifecycle, type UnifiedQuote } from \"../unified-quote\";\n\n/**\n * On-chain statuses of a resting order that has **not** become a position yet.\n * These are the statuses `getPartyAPendingQuotes` returns.\n */\nconst PENDING_STATUSES = new Set<QuoteStatus>([QuoteStatus.PENDING, QuoteStatus.LOCKED, QuoteStatus.CANCEL_PENDING]);\n\n/**\n * On-chain statuses of an open position (including one with a close in flight).\n * These are the statuses `getPartyAOpenPositions` returns.\n */\nconst ACTIVE_STATUSES = new Set<QuoteStatus>([\n QuoteStatus.OPENED,\n QuoteStatus.CLOSE_PENDING,\n QuoteStatus.CANCEL_CLOSE_PENDING,\n QuoteStatus.LIQUIDATED_PENDING,\n]);\n\n/**\n * Whether a quote is a **resting/pending order** — submitted but not yet an open\n * position.\n *\n * An anchored row is classified by its on-chain {@link QuoteStatus}\n * (`PENDING` / `LOCKED` / `CANCEL_PENDING`). An off-chain optimistic row (no\n * status yet) is pending only when it is a not-yet-filled `LIMIT` order; an\n * optimistic `MARKET` open is treated as an opening position instead.\n *\n * Mutually exclusive with {@link isActivePosition}.\n *\n * @param quote - The unified quote to classify.\n * @returns `true` for a resting/pending order.\n */\nexport function isPendingOrder(quote: UnifiedQuote): boolean {\n if (quote.quoteStatus !== undefined) return PENDING_STATUSES.has(quote.quoteStatus);\n if (\n quote.lifecycle === QuoteLifecycle.OPTIMISTIC ||\n quote.lifecycle === QuoteLifecycle.PRICE_FILLED ||\n quote.lifecycle === QuoteLifecycle.WRITE_ONCHAIN ||\n quote.lifecycle === QuoteLifecycle.ONCHAIN\n ) {\n return quote.orderType === OrderType.LIMIT;\n }\n return false;\n}\n\n/**\n * Whether a quote is an **active position** — opened (or opening), possibly with\n * a close in flight.\n *\n * An anchored row is classified by its on-chain {@link QuoteStatus}\n * (`OPENED` / `CLOSE_PENDING` / `CANCEL_CLOSE_PENDING` / `LIQUIDATED_PENDING`).\n * A row with no `quoteStatus` yet is classified by lifecycle + order type: an\n * optimistic/price-filled or just-anchored (`WRITE_ONCHAIN` / `ONCHAIN`) `MARKET`\n * open is an active position, while the matching `LIMIT` order is still resting\n * (pending). The `WRITE_ONCHAIN`-without-`quoteStatus` case is the brief window\n * after a `SendQuoteTransaction` notification anchors the row but before the\n * on-chain poll has returned its full struct — without it the row would drop out of\n * the grouped view for a tick. Any closing-stage row (`OPTIMISTIC_CLOSE` /\n * `CLOSE_PRICE_FILLED` / `WRITE_ONCHAIN_CLOSE`) is always active; terminal rows\n * (`CLOSED` / `CANCELED` / `EXPIRED` / `LIQUIDATED`, or an off-chain `FAILED`) are\n * neither.\n *\n * Mutually exclusive with {@link isPendingOrder}.\n *\n * @param quote - The unified quote to classify.\n * @returns `true` for an active position.\n */\nexport function isActivePosition(quote: UnifiedQuote): boolean {\n if (quote.quoteStatus !== undefined) return
|
|
1
|
+
{"version":3,"file":"partition-quotes.js","names":[],"sources":["../../../src/quotes/grouping/partition-quotes.ts"],"sourcesContent":["import { OrderType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport { QuoteLifecycle, type UnifiedQuote } from \"../unified-quote\";\n\n/**\n * On-chain statuses of a resting order that has **not** become a position yet.\n * These are the statuses `getPartyAPendingQuotes` returns.\n */\nconst PENDING_STATUSES = new Set<QuoteStatus>([QuoteStatus.PENDING, QuoteStatus.LOCKED, QuoteStatus.CANCEL_PENDING]);\n\n/**\n * On-chain statuses of an open position (including one with a close in flight).\n * These are the statuses `getPartyAOpenPositions` returns.\n */\nconst ACTIVE_STATUSES = new Set<QuoteStatus>([\n QuoteStatus.OPENED,\n QuoteStatus.CLOSE_PENDING,\n QuoteStatus.CANCEL_CLOSE_PENDING,\n QuoteStatus.LIQUIDATED_PENDING,\n]);\n\n/**\n * Whether an on-chain status is an active position (`OPENED`, `CLOSE_PENDING`,\n * `CANCEL_CLOSE_PENDING`, `LIQUIDATED_PENDING`) — the only statuses whose pending\n * funding is meaningful. Same set as {@link isActivePosition}.\n *\n * Unlike {@link isActivePosition}, it takes a **known** status and has no\n * lifecycle fallback: a row whose `quoteStatus` is still `undefined` (an\n * optimistic or just-anchored row) is not something to call it with. Use it to\n * pick which quotes to pass to {@link getQuotePendingFunding}, whose view does not\n * check status and returns a meaningless amount for a locked-but-never-opened\n * quote.\n *\n * @param status - The quote's on-chain status.\n * @returns `true` for an active-position status.\n *\n * @example\n * ```ts\n * isActiveQuoteStatus(QuoteStatus.OPENED); // true\n * isActiveQuoteStatus(QuoteStatus.LOCKED); // false\n *\n * const quoteIds = quotes.flatMap((quote) =>\n * quote.quoteId !== undefined && quote.quoteStatus !== undefined && isActiveQuoteStatus(quote.quoteStatus)\n * ? [quote.quoteId]\n * : [],\n * );\n * const rows = await getQuotePendingFunding(config, { quoteIds });\n * ```\n */\nexport function isActiveQuoteStatus(status: QuoteStatus): boolean {\n return ACTIVE_STATUSES.has(status);\n}\n\n/**\n * Whether a quote is a **resting/pending order** — submitted but not yet an open\n * position.\n *\n * An anchored row is classified by its on-chain {@link QuoteStatus}\n * (`PENDING` / `LOCKED` / `CANCEL_PENDING`). An off-chain optimistic row (no\n * status yet) is pending only when it is a not-yet-filled `LIMIT` order; an\n * optimistic `MARKET` open is treated as an opening position instead.\n *\n * Mutually exclusive with {@link isActivePosition}.\n *\n * @param quote - The unified quote to classify.\n * @returns `true` for a resting/pending order.\n */\nexport function isPendingOrder(quote: UnifiedQuote): boolean {\n if (quote.quoteStatus !== undefined) return PENDING_STATUSES.has(quote.quoteStatus);\n if (\n quote.lifecycle === QuoteLifecycle.OPTIMISTIC ||\n quote.lifecycle === QuoteLifecycle.PRICE_FILLED ||\n quote.lifecycle === QuoteLifecycle.WRITE_ONCHAIN ||\n quote.lifecycle === QuoteLifecycle.ONCHAIN\n ) {\n return quote.orderType === OrderType.LIMIT;\n }\n return false;\n}\n\n/**\n * Whether a quote is an **active position** — opened (or opening), possibly with\n * a close in flight.\n *\n * An anchored row is classified by its on-chain {@link QuoteStatus}\n * (`OPENED` / `CLOSE_PENDING` / `CANCEL_CLOSE_PENDING` / `LIQUIDATED_PENDING`).\n * A row with no `quoteStatus` yet is classified by lifecycle + order type: an\n * optimistic/price-filled or just-anchored (`WRITE_ONCHAIN` / `ONCHAIN`) `MARKET`\n * open is an active position, while the matching `LIMIT` order is still resting\n * (pending). The `WRITE_ONCHAIN`-without-`quoteStatus` case is the brief window\n * after a `SendQuoteTransaction` notification anchors the row but before the\n * on-chain poll has returned its full struct — without it the row would drop out of\n * the grouped view for a tick. Any closing-stage row (`OPTIMISTIC_CLOSE` /\n * `CLOSE_PRICE_FILLED` / `WRITE_ONCHAIN_CLOSE`) is always active; terminal rows\n * (`CLOSED` / `CANCELED` / `EXPIRED` / `LIQUIDATED`, or an off-chain `FAILED`) are\n * neither.\n *\n * Mutually exclusive with {@link isPendingOrder}.\n *\n * @param quote - The unified quote to classify.\n * @returns `true` for an active position.\n */\nexport function isActivePosition(quote: UnifiedQuote): boolean {\n if (quote.quoteStatus !== undefined) return isActiveQuoteStatus(quote.quoteStatus);\n switch (quote.lifecycle) {\n case QuoteLifecycle.OPTIMISTIC:\n case QuoteLifecycle.PRICE_FILLED:\n case QuoteLifecycle.WRITE_ONCHAIN:\n case QuoteLifecycle.ONCHAIN:\n return quote.orderType !== OrderType.LIMIT;\n case QuoteLifecycle.OPTIMISTIC_CLOSE:\n case QuoteLifecycle.CLOSE_PRICE_FILLED:\n case QuoteLifecycle.WRITE_ONCHAIN_CLOSE:\n return true;\n default:\n return false;\n }\n}\n\n/** Result of {@link partitionQuotes}. */\nexport interface PartitionedQuotes {\n /** Quotes that are open (or opening) positions. */\n positions: UnifiedQuote[];\n /** Quotes that are resting/pending orders. */\n pending: UnifiedQuote[];\n}\n\n/**\n * Split unified quotes into active positions and resting/pending orders — the\n * grouped-view-vs-orders-tab split. Terminal rows (closed / cancelled / expired /\n * liquidated / failed) fall into neither bucket and are dropped, so\n * `positions ∪ pending` is the set of still-live quotes.\n *\n * @param quotes - The unified quotes to split.\n * @returns The `positions` and `pending` buckets, each preserving input order.\n *\n * @example\n * ```ts\n * const { positions, pending } = partitionQuotes(quotes);\n * const groups = groupQuotes(positions, SubAccountIsolationType.MARKET_DIRECTION);\n * ```\n */\nexport function partitionQuotes(quotes: readonly UnifiedQuote[]): PartitionedQuotes {\n const positions: UnifiedQuote[] = [];\n const pending: UnifiedQuote[] = [];\n for (const quote of quotes) {\n if (isPendingOrder(quote)) pending.push(quote);\n else if (isActivePosition(quote)) positions.push(quote);\n }\n return { positions, pending };\n}\n"],"mappings":";;;AAOA,IAAM,IAAmB,IAAI,IAAiB;CAAC,EAAY;CAAS,EAAY;CAAQ,EAAY;AAAc,CAAC,GAM7G,IAAkB,IAAI,IAAiB;CAC3C,EAAY;CACZ,EAAY;CACZ,EAAY;CACZ,EAAY;AACd,CAAC;AA8BD,SAAgB,EAAoB,GAA8B;CAChE,OAAO,EAAgB,IAAI,CAAM;AACnC;AAgBA,SAAgB,EAAe,GAA8B;CAU3D,OATI,EAAM,gBAAgB,KAAA,IAExB,EAAM,cAAc,EAAe,cACnC,EAAM,cAAc,EAAe,gBACnC,EAAM,cAAc,EAAe,iBACnC,EAAM,cAAc,EAAe,UAE5B,EAAM,cAAc,EAAU,QAEhC,KATqC,EAAiB,IAAI,EAAM,WAAW;AAUpF;AAwBA,SAAgB,EAAiB,GAA8B;CAC7D,IAAI,EAAM,gBAAgB,KAAA,GAAW,OAAO,EAAoB,EAAM,WAAW;CACjF,QAAQ,EAAM,WAAd;EACE,KAAK,EAAe;EACpB,KAAK,EAAe;EACpB,KAAK,EAAe;EACpB,KAAK,EAAe,SAClB,OAAO,EAAM,cAAc,EAAU;EACvC,KAAK,EAAe;EACpB,KAAK,EAAe;EACpB,KAAK,EAAe,qBAClB,OAAO;EACT,SACE,OAAO;CACX;AACF;AAyBA,SAAgB,EAAgB,GAAoD;CAClF,IAAM,IAA4B,CAAC,GAC7B,IAA0B,CAAC;CACjC,KAAK,IAAM,KAAS,GAClB,AAAI,EAAe,CAAK,IAAG,EAAQ,KAAK,CAAK,IACpC,EAAiB,CAAK,KAAG,EAAU,KAAK,CAAK;CAExD,OAAO;EAAE;EAAW;CAAQ;AAC9B"}
|
package/dist/quotes/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './fingerprint.js';
|
|
|
5
5
|
export * from './get-quote-events-by-type/index.js';
|
|
6
6
|
export * from './get-quote-funding/index.js';
|
|
7
7
|
export * from './get-quote-history/index.js';
|
|
8
|
+
export * from './get-quote-pending-funding/index.js';
|
|
8
9
|
export * from './get-quotes-events-by-type/index.js';
|
|
9
10
|
export * from './get-sub-account-quotes/index.js';
|
|
10
11
|
export * from './grouping/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/quotes/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/quotes/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
@@ -135,12 +135,12 @@ export interface UnifiedQuote {
|
|
|
135
135
|
/** Maximum funding rate partyA accepts, when known. */
|
|
136
136
|
maxFundingRate?: bigint;
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
139
|
-
* fixed point)
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
138
|
+
* Per-unit cumulative funding-fee **index** recorded at the quote's last
|
|
139
|
+
* settlement (18-decimal fixed point, cost-positive), when known. **Not a
|
|
140
|
+
* currency amount**, so summing this field across quotes is meaningless:
|
|
141
|
+
* `openAmount × (currentFee − accumulatedPaidFunding) / 1e18` is the
|
|
142
|
+
* **pending**, not-yet-settled fee — read that with
|
|
143
|
+
* {@link getQuotePendingFunding}. For settled funding amounts use
|
|
144
144
|
* {@link getQuoteFunding} / {@link aggregateGroupFunding}.
|
|
145
145
|
*/
|
|
146
146
|
accumulatedPaidFunding?: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-quote.js","names":[],"sources":["../../src/quotes/unified-quote.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { PendingInstantClose } from \"../solvers/instant-close/get-instant-closes/to-pending-instant-close\";\nimport type { PendingInstantOpen } from \"../solvers/instant-open/get-instant-opens/types\";\nimport type { LockedValues, OrderType, PositionType, Quote, QuoteStatus } from \"../symmio-contracts/symmio/types\";\n\n/**\n * Where a {@link UnifiedQuote} was sourced from before reconciliation.\n *\n * - `\"onchain\"` — read from the SYMMIO core (`getPartyAOpenPositions` /\n * `getPartyAPendingQuotes` + `getQuote`); the row carries a real `quoteId`.\n * - `\"offchain\"` — only known to a hedger so far (a pending instant-open or\n * instant-close); the row carries a `tempQuoteId` and waits to anchor on-chain.\n */\nexport type QuoteOrigin = \"onchain\" | \"offchain\";\n\n/**\n * The stage of a quote's lifecycle as tracked across the on-chain + off-chain\n * merge. Drives row styling and polling acceleration in the consumer.\n *\n * Lifecycle tracks the **write progression** (off-chain → on-chain), not the\n * on-chain status: once a quote is on-chain it is `ONCHAIN` whether it is\n * `OPENED` or `CLOSE_PENDING` — read {@link UnifiedQuote.quoteStatus} for that\n * distinction. The off-chain stages (`OPTIMISTIC*`, `*PRICE_FILLED`,\n * `WRITE_ONCHAIN*`) are SDK-side overlays that do not exist on the on-chain\n * {@link QuoteStatus}; reconciliation assigns them from notifications and hedger\n * records.\n */\nexport enum QuoteLifecycle {\n /** Submitted to a hedger; no on-chain quote and no fill report yet. */\n OPTIMISTIC = \"optimistic\",\n /** A hedger reported a fill price (`InstantRFQ` success) but the on-chain quote has not landed yet. */\n PRICE_FILLED = \"price-filled\",\n /**\n * The open anchored on-chain per the notification (the `quoteId` is known), but\n * the on-chain read has not returned the quote struct yet. The row is being\n * \"written on-chain\": shown with its anchored id while the SDK waits for the RPC\n * to confirm it. Resolves to {@link QuoteLifecycle.ONCHAIN} once the on-chain\n * read returns the struct.\n */\n WRITE_ONCHAIN = \"write-onchain\",\n /** Anchored on-chain; mirrors a real {@link QuoteStatus}. */\n ONCHAIN = \"onchain\",\n /**\n * A close was just submitted and the hedger's pending-instant-close feed has it,\n * but no close notification has confirmed a price yet — the close-side analog of\n * {@link QuoteLifecycle.OPTIMISTIC}. Advances to {@link QuoteLifecycle.CLOSE_PRICE_FILLED}.\n */\n OPTIMISTIC_CLOSE = \"optimistic-close\",\n /**\n * A close notification reported the close price/fill request\n * (`InstantRequestToClosePosition`) — the close-side analog of\n * {@link QuoteLifecycle.PRICE_FILLED}. Advances to {@link QuoteLifecycle.WRITE_ONCHAIN_CLOSE}.\n */\n CLOSE_PRICE_FILLED = \"close-price-filled\",\n /**\n * The close fill (`FillMarketOrderInstantClose`) or the limit-close anchor\n * (`InstantRequestToLimitClose`) was reported, or a pending instant-close\n * overlays the row while the on-chain status still shows the position open — the\n * close is being \"written on-chain\", awaiting the RPC. The close-side analog of\n * {@link QuoteLifecycle.WRITE_ONCHAIN}. Resolves to {@link QuoteLifecycle.ONCHAIN}\n * once the on-chain read returns the quote (now `CLOSE_PENDING`); read\n * {@link UnifiedQuote.quoteStatus} to see the close is pending.\n */\n WRITE_ONCHAIN_CLOSE = \"write-onchain-close\",\n /** The position is fully closed. */\n CLOSED = \"closed\",\n /** A hedger or notification reported the open/close failed. */\n FAILED = \"failed\",\n}\n\n/**\n * A single quote/position row merged from every source (on-chain reads, pending\n * instant-opens, pending instant-closes, and notifications) into one stable,\n * de-duplicated shape.\n *\n * All amount and price fields are 18-decimal-wei `bigint`, matching the on-chain\n * {@link Quote}. Off-chain hedger amounts are normalized to wei before they reach\n * this type. The `key` is a stable identity for React lists and the removal\n * ledger; `raw` carries the untouched source rows for advanced use.\n */\nexport interface UnifiedQuote {\n /** Stable identity for this row (`onchain:<id>` or `temp:<tempId>`). */\n key: string;\n /** Source the row was reconciled from. */\n origin: QuoteOrigin;\n /** Current lifecycle stage. */\n lifecycle: QuoteLifecycle;\n /** On-chain quote id, once anchored. */\n quoteId?: bigint;\n /** Hedger-local temp id, before the on-chain id exists. */\n tempQuoteId?: number;\n /** Sub-account (partyA) that owns the row. */\n partyA: Address;\n /** PartyB (hedger/solver) that locked/opened the quote, when known. */\n partyB?: Address;\n /** Solver-assigned Virtual Account address (lowcap), when known. */\n vaAddress?: Address;\n /** Market identifier (`symbolId`). */\n symbolId: bigint;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order. */\n orderType: OrderType;\n /** On-chain status, when the row is anchored on-chain. */\n quoteStatus?: QuoteStatus;\n /** Price partyA requested to open at (wei). */\n requestedOpenPrice: bigint;\n /** Price partyB actually opened at (wei), when known. */\n openedPrice?: bigint;\n /** Initial price partyB opened at before any edits (wei), when known. */\n initialOpenedPrice?: bigint;\n /** Average price across executed closes (wei), when known. */\n avgClosedPrice?: bigint;\n /** Requested limit price for a pending close (wei), when known. */\n requestedClosePrice?: bigint;\n /** Market price snapshot at last state change (wei), when known. */\n marketPrice?: bigint;\n /** Total requested quantity (wei) — fixed for the life of the position; partial closes do not shrink it. */\n quantity: bigint;\n /** Quantity already closed (wei), when known. */\n closedAmount?: bigint;\n /**\n * Remaining **open** size (wei): `quantity − closedAmount`, the live quantity\n * still on the position (the figure a UI shows as \"position size\"); `0` once\n * fully closed. Derived from the other amount fields by {@link quoteOpenQuantity}.\n *\n * A size, never a state: a quote that has not opened yet still reports its full\n * `quantity`. To ask whether a row is a position, use `isPendingOrder` /\n * `isActivePosition`, which read {@link UnifiedQuote.quoteStatus}.\n */\n openQuantity: bigint;\n /** Quantity targeted by a pending close (wei), when closing. */\n quantityToClose?: bigint;\n /** Margin locked against the row (wei). */\n lockedValues: LockedValues;\n /** Margin locked at open time — basis for leverage (wei), when known. */\n initialLockedValues?: LockedValues;\n /** Maximum funding rate partyA accepts, when known. */\n maxFundingRate?: bigint;\n /**\n *
|
|
1
|
+
{"version":3,"file":"unified-quote.js","names":[],"sources":["../../src/quotes/unified-quote.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { PendingInstantClose } from \"../solvers/instant-close/get-instant-closes/to-pending-instant-close\";\nimport type { PendingInstantOpen } from \"../solvers/instant-open/get-instant-opens/types\";\nimport type { LockedValues, OrderType, PositionType, Quote, QuoteStatus } from \"../symmio-contracts/symmio/types\";\n\n/**\n * Where a {@link UnifiedQuote} was sourced from before reconciliation.\n *\n * - `\"onchain\"` — read from the SYMMIO core (`getPartyAOpenPositions` /\n * `getPartyAPendingQuotes` + `getQuote`); the row carries a real `quoteId`.\n * - `\"offchain\"` — only known to a hedger so far (a pending instant-open or\n * instant-close); the row carries a `tempQuoteId` and waits to anchor on-chain.\n */\nexport type QuoteOrigin = \"onchain\" | \"offchain\";\n\n/**\n * The stage of a quote's lifecycle as tracked across the on-chain + off-chain\n * merge. Drives row styling and polling acceleration in the consumer.\n *\n * Lifecycle tracks the **write progression** (off-chain → on-chain), not the\n * on-chain status: once a quote is on-chain it is `ONCHAIN` whether it is\n * `OPENED` or `CLOSE_PENDING` — read {@link UnifiedQuote.quoteStatus} for that\n * distinction. The off-chain stages (`OPTIMISTIC*`, `*PRICE_FILLED`,\n * `WRITE_ONCHAIN*`) are SDK-side overlays that do not exist on the on-chain\n * {@link QuoteStatus}; reconciliation assigns them from notifications and hedger\n * records.\n */\nexport enum QuoteLifecycle {\n /** Submitted to a hedger; no on-chain quote and no fill report yet. */\n OPTIMISTIC = \"optimistic\",\n /** A hedger reported a fill price (`InstantRFQ` success) but the on-chain quote has not landed yet. */\n PRICE_FILLED = \"price-filled\",\n /**\n * The open anchored on-chain per the notification (the `quoteId` is known), but\n * the on-chain read has not returned the quote struct yet. The row is being\n * \"written on-chain\": shown with its anchored id while the SDK waits for the RPC\n * to confirm it. Resolves to {@link QuoteLifecycle.ONCHAIN} once the on-chain\n * read returns the struct.\n */\n WRITE_ONCHAIN = \"write-onchain\",\n /** Anchored on-chain; mirrors a real {@link QuoteStatus}. */\n ONCHAIN = \"onchain\",\n /**\n * A close was just submitted and the hedger's pending-instant-close feed has it,\n * but no close notification has confirmed a price yet — the close-side analog of\n * {@link QuoteLifecycle.OPTIMISTIC}. Advances to {@link QuoteLifecycle.CLOSE_PRICE_FILLED}.\n */\n OPTIMISTIC_CLOSE = \"optimistic-close\",\n /**\n * A close notification reported the close price/fill request\n * (`InstantRequestToClosePosition`) — the close-side analog of\n * {@link QuoteLifecycle.PRICE_FILLED}. Advances to {@link QuoteLifecycle.WRITE_ONCHAIN_CLOSE}.\n */\n CLOSE_PRICE_FILLED = \"close-price-filled\",\n /**\n * The close fill (`FillMarketOrderInstantClose`) or the limit-close anchor\n * (`InstantRequestToLimitClose`) was reported, or a pending instant-close\n * overlays the row while the on-chain status still shows the position open — the\n * close is being \"written on-chain\", awaiting the RPC. The close-side analog of\n * {@link QuoteLifecycle.WRITE_ONCHAIN}. Resolves to {@link QuoteLifecycle.ONCHAIN}\n * once the on-chain read returns the quote (now `CLOSE_PENDING`); read\n * {@link UnifiedQuote.quoteStatus} to see the close is pending.\n */\n WRITE_ONCHAIN_CLOSE = \"write-onchain-close\",\n /** The position is fully closed. */\n CLOSED = \"closed\",\n /** A hedger or notification reported the open/close failed. */\n FAILED = \"failed\",\n}\n\n/**\n * A single quote/position row merged from every source (on-chain reads, pending\n * instant-opens, pending instant-closes, and notifications) into one stable,\n * de-duplicated shape.\n *\n * All amount and price fields are 18-decimal-wei `bigint`, matching the on-chain\n * {@link Quote}. Off-chain hedger amounts are normalized to wei before they reach\n * this type. The `key` is a stable identity for React lists and the removal\n * ledger; `raw` carries the untouched source rows for advanced use.\n */\nexport interface UnifiedQuote {\n /** Stable identity for this row (`onchain:<id>` or `temp:<tempId>`). */\n key: string;\n /** Source the row was reconciled from. */\n origin: QuoteOrigin;\n /** Current lifecycle stage. */\n lifecycle: QuoteLifecycle;\n /** On-chain quote id, once anchored. */\n quoteId?: bigint;\n /** Hedger-local temp id, before the on-chain id exists. */\n tempQuoteId?: number;\n /** Sub-account (partyA) that owns the row. */\n partyA: Address;\n /** PartyB (hedger/solver) that locked/opened the quote, when known. */\n partyB?: Address;\n /** Solver-assigned Virtual Account address (lowcap), when known. */\n vaAddress?: Address;\n /** Market identifier (`symbolId`). */\n symbolId: bigint;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order. */\n orderType: OrderType;\n /** On-chain status, when the row is anchored on-chain. */\n quoteStatus?: QuoteStatus;\n /** Price partyA requested to open at (wei). */\n requestedOpenPrice: bigint;\n /** Price partyB actually opened at (wei), when known. */\n openedPrice?: bigint;\n /** Initial price partyB opened at before any edits (wei), when known. */\n initialOpenedPrice?: bigint;\n /** Average price across executed closes (wei), when known. */\n avgClosedPrice?: bigint;\n /** Requested limit price for a pending close (wei), when known. */\n requestedClosePrice?: bigint;\n /** Market price snapshot at last state change (wei), when known. */\n marketPrice?: bigint;\n /** Total requested quantity (wei) — fixed for the life of the position; partial closes do not shrink it. */\n quantity: bigint;\n /** Quantity already closed (wei), when known. */\n closedAmount?: bigint;\n /**\n * Remaining **open** size (wei): `quantity − closedAmount`, the live quantity\n * still on the position (the figure a UI shows as \"position size\"); `0` once\n * fully closed. Derived from the other amount fields by {@link quoteOpenQuantity}.\n *\n * A size, never a state: a quote that has not opened yet still reports its full\n * `quantity`. To ask whether a row is a position, use `isPendingOrder` /\n * `isActivePosition`, which read {@link UnifiedQuote.quoteStatus}.\n */\n openQuantity: bigint;\n /** Quantity targeted by a pending close (wei), when closing. */\n quantityToClose?: bigint;\n /** Margin locked against the row (wei). */\n lockedValues: LockedValues;\n /** Margin locked at open time — basis for leverage (wei), when known. */\n initialLockedValues?: LockedValues;\n /** Maximum funding rate partyA accepts, when known. */\n maxFundingRate?: bigint;\n /**\n * Per-unit cumulative funding-fee **index** recorded at the quote's last\n * settlement (18-decimal fixed point, cost-positive), when known. **Not a\n * currency amount**, so summing this field across quotes is meaningless:\n * `openAmount × (currentFee − accumulatedPaidFunding) / 1e18` is the\n * **pending**, not-yet-settled fee — read that with\n * {@link getQuotePendingFunding}. For settled funding amounts use\n * {@link getQuoteFunding} / {@link aggregateGroupFunding}.\n */\n accumulatedPaidFunding?: bigint;\n /** Block timestamp funding was last applied, when known. */\n lastFundingPaymentTimestamp?: bigint;\n /** Quote deadline (expiry) timestamp, when known. */\n deadline?: bigint;\n /** Trading fee charged on the quote (wei), when known. */\n tradingFee?: bigint;\n /** Fee charged on close (wei), when known. */\n closeFee?: bigint;\n /** Affiliate address attributed to the quote, when known. */\n affiliate?: Address;\n /** PartyB addresses allowed to fill this quote (empty means any), when known. */\n partyBsWhiteList?: readonly Address[];\n /** Parent quote id for a partially-opened child, when known. */\n parentId?: bigint;\n /** Opaque per-quote data, when known. */\n data?: Hex;\n /** Block timestamp the quote was created, when known. */\n createTimestamp?: bigint;\n /** Block timestamp of the last status change (sort key), when known. */\n statusModifyTimestamp?: bigint;\n /** Untouched source rows this was reconciled from. */\n raw: {\n /** The on-chain quote, when the row is anchored. */\n onchain?: Quote;\n /** The pending instant-open record, when sourced off-chain. */\n instantOpen?: PendingInstantOpen;\n /** The pending instant-close record, when closing off-chain. */\n instantClose?: PendingInstantClose;\n };\n}\n"],"mappings":";AA2BA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,aAAA,cAEA,EAAA,eAAA,gBAQA,EAAA,gBAAA,iBAEA,EAAA,UAAA,WAMA,EAAA,mBAAA,oBAMA,EAAA,qBAAA,sBAUA,EAAA,sBAAA,uBAEA,EAAA,SAAA,UAEA,EAAA,SAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip the credential-bearing parts of a URL before it lands in an error: the
|
|
3
|
+
* userinfo, the query string and the fragment. What remains (scheme, host and
|
|
4
|
+
* path) still says where the request went.
|
|
5
|
+
*
|
|
6
|
+
* Works on the raw string, so a URL with nothing to strip comes back
|
|
7
|
+
* unchanged, and relative URLs (a same-origin proxy path) are handled too.
|
|
8
|
+
*
|
|
9
|
+
* @param url - Absolute, protocol-relative or relative request URL.
|
|
10
|
+
* @returns The URL without userinfo, query string or fragment.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function redactUrl(url: string): string;
|
|
15
|
+
//# sourceMappingURL=redact-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-url.d.ts","sourceRoot":"","sources":["../../../src/shared/errors/redact-url.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-url.js","names":[],"sources":["../../../src/shared/errors/redact-url.ts"],"sourcesContent":["/**\n * Userinfo (`user:password@`) right after an absolute or protocol-relative\n * scheme. The authority stops at the first `/`, `?` or `#`; the greedy class\n * runs to the last `@` inside it, which is where the WHATWG parser splits the\n * userinfo from the host.\n */\nconst USERINFO = /^((?:[a-z][a-z\\d+.-]*:)?\\/\\/)[^/?#]*@/i;\n\n/** The query string and fragment: everything from the first `?` or `#`. */\nconst QUERY_AND_FRAGMENT = /[?#].*$/s;\n\n/**\n * Strip the credential-bearing parts of a URL before it lands in an error: the\n * userinfo, the query string and the fragment. What remains (scheme, host and\n * path) still says where the request went.\n *\n * Works on the raw string, so a URL with nothing to strip comes back\n * unchanged, and relative URLs (a same-origin proxy path) are handled too.\n *\n * @param url - Absolute, protocol-relative or relative request URL.\n * @returns The URL without userinfo, query string or fragment.\n *\n * @internal\n */\nexport function redactUrl(url: string): string {\n return url.replace(USERINFO, \"$1\").replace(QUERY_AND_FRAGMENT, \"\");\n}\n"],"mappings":";AAMA,IAAM,IAAW,0CAGX,IAAqB;AAe3B,SAAgB,EAAU,GAAqB;CAC7C,OAAO,EAAI,QAAQ,GAAU,IAAI,EAAE,QAAQ,GAAoB,EAAE;AACnE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse an HTTP `Retry-After` value into a delay in milliseconds.
|
|
3
|
+
*
|
|
4
|
+
* Accepts both forms RFC 9110 §10.2.3 defines: delay-seconds (`"120"`) and an
|
|
5
|
+
* HTTP-date (`"Wed, 21 Oct 2026 07:28:00 GMT"`). A date is measured against
|
|
6
|
+
* `now` and clamps to `0` once it has passed. Anything else — a negative or
|
|
7
|
+
* fractional number, an unparseable date, a delay too large to be a safe
|
|
8
|
+
* integer of milliseconds — yields `null`.
|
|
9
|
+
*
|
|
10
|
+
* @param value - The raw header value, or `undefined` when the header is absent.
|
|
11
|
+
* @param now - Reference time in epoch ms for an HTTP-date. Defaults to `Date.now()`.
|
|
12
|
+
* @returns The delay in ms, or `null` when the header carries no usable value.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseRetryAfterMs(value?: string, now?: number): number | null;
|
|
17
|
+
//# sourceMappingURL=retry-after.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-after.d.ts","sourceRoot":"","sources":["../../../src/shared/errors/retry-after.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,GAAG,IAAI,CAgBzF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/shared/errors/retry-after.ts
|
|
2
|
+
function e(e, t = Date.now()) {
|
|
3
|
+
let n = e?.trim();
|
|
4
|
+
if (!n) return null;
|
|
5
|
+
if (/^\d+$/.test(n)) {
|
|
6
|
+
let e = Number(n) * 1e3;
|
|
7
|
+
return Number.isSafeInteger(e) ? e : null;
|
|
8
|
+
}
|
|
9
|
+
if (!/[a-z]/i.test(n)) return null;
|
|
10
|
+
let r = Date.parse(n);
|
|
11
|
+
return Number.isNaN(r) ? null : Math.max(0, r - t);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as parseRetryAfterMs };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=retry-after.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-after.js","names":[],"sources":["../../../src/shared/errors/retry-after.ts"],"sourcesContent":["/**\n * Parse an HTTP `Retry-After` value into a delay in milliseconds.\n *\n * Accepts both forms RFC 9110 §10.2.3 defines: delay-seconds (`\"120\"`) and an\n * HTTP-date (`\"Wed, 21 Oct 2026 07:28:00 GMT\"`). A date is measured against\n * `now` and clamps to `0` once it has passed. Anything else — a negative or\n * fractional number, an unparseable date, a delay too large to be a safe\n * integer of milliseconds — yields `null`.\n *\n * @param value - The raw header value, or `undefined` when the header is absent.\n * @param now - Reference time in epoch ms for an HTTP-date. Defaults to `Date.now()`.\n * @returns The delay in ms, or `null` when the header carries no usable value.\n *\n * @internal\n */\nexport function parseRetryAfterMs(value?: string, now: number = Date.now()): number | null {\n const trimmed = value?.trim();\n if (!trimmed) return null;\n\n if (/^\\d+$/.test(trimmed)) {\n const ms = Number(trimmed) * 1000;\n return Number.isSafeInteger(ms) ? ms : null;\n }\n\n /**\n * An HTTP-date always spells out a weekday or month. Without a letter the\n * value is a malformed number, which `Date.parse` would happily read as a year.\n */\n if (!/[a-z]/i.test(trimmed)) return null;\n const at = Date.parse(trimmed);\n return Number.isNaN(at) ? null : Math.max(0, at - now);\n}\n"],"mappings":";AAeA,SAAgB,EAAkB,GAAgB,IAAc,KAAK,IAAI,GAAkB;CACzF,IAAM,IAAU,GAAO,KAAK;CAC5B,IAAI,CAAC,GAAS,OAAO;CAErB,IAAI,QAAQ,KAAK,CAAO,GAAG;EACzB,IAAM,IAAK,OAAO,CAAO,IAAI;EAC7B,OAAO,OAAO,cAAc,CAAE,IAAI,IAAK;CACzC;CAMA,IAAI,CAAC,SAAS,KAAK,CAAO,GAAG,OAAO;CACpC,IAAM,IAAK,KAAK,MAAM,CAAO;CAC7B,OAAO,OAAO,MAAM,CAAE,IAAI,OAAO,KAAK,IAAI,GAAG,IAAK,CAAG;AACvD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
import { SymmApiError } from './symm-error.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build a {@link SymmApiError} from an axios error without keeping the request
|
|
5
|
+
* headers or body.
|
|
6
|
+
*
|
|
7
|
+
* {@link SymmApiError.fromAxios} keeps the axios error as `cause`, and that
|
|
8
|
+
* error's request config holds the request headers (an `Authorization` key)
|
|
9
|
+
* and the serialized body (signed payloads). This variant keeps every field
|
|
10
|
+
* `fromAxios` derives (`status`, `statusText`, `method`, `responseData`,
|
|
11
|
+
* `retryAfterMs`) but:
|
|
12
|
+
*
|
|
13
|
+
* - replaces `cause` with a sanitized `Error` carrying only the axios `name`,
|
|
14
|
+
* `message` and `code`, plus the request's `status`, `method` and `url`;
|
|
15
|
+
* - strips userinfo, the query string and the fragment from `url`, from the
|
|
16
|
+
* composed message and from the cause.
|
|
17
|
+
*
|
|
18
|
+
* `responseData` stays the raw response body. A server that echoes request
|
|
19
|
+
* input in its error body (a FastAPI `422` puts it in `detail[].input`) still
|
|
20
|
+
* exposes those values there.
|
|
21
|
+
*
|
|
22
|
+
* @param err - The axios error.
|
|
23
|
+
* @param options - The SDK error code and the request's base URL, as for `fromAxios`.
|
|
24
|
+
* @returns A `SymmApiError` whose `cause` holds no request headers or body.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function toSanitizedApiError(err: AxiosError, options: {
|
|
29
|
+
code: string;
|
|
30
|
+
baseURL: string;
|
|
31
|
+
}): SymmApiError;
|
|
32
|
+
//# sourceMappingURL=sanitized-api-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitized-api-error.d.ts","sourceRoot":"","sources":["../../../src/shared/errors/sanitized-api-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAyB,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAe7G"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SymmApiError as e, formatApiErrorMessage as t } from "./symm-error.js";
|
|
2
|
+
import { redactUrl as n } from "./redact-url.js";
|
|
3
|
+
//#region src/shared/errors/sanitized-api-error.ts
|
|
4
|
+
function r(r, a) {
|
|
5
|
+
let o = e.fromAxios(r, a), { code: s, status: c, statusText: l, method: u } = o, d = n(o.url);
|
|
6
|
+
return new e({
|
|
7
|
+
code: s,
|
|
8
|
+
message: t({
|
|
9
|
+
code: s,
|
|
10
|
+
message: r.message,
|
|
11
|
+
method: u,
|
|
12
|
+
url: d,
|
|
13
|
+
status: c,
|
|
14
|
+
statusText: l
|
|
15
|
+
}),
|
|
16
|
+
status: c,
|
|
17
|
+
statusText: l,
|
|
18
|
+
responseData: o.responseData,
|
|
19
|
+
url: d,
|
|
20
|
+
method: u,
|
|
21
|
+
retryAfterMs: o.retryAfterMs,
|
|
22
|
+
cause: i(r, {
|
|
23
|
+
status: c,
|
|
24
|
+
method: u,
|
|
25
|
+
url: d
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function i(e, t) {
|
|
30
|
+
let n = Error(typeof e.message == "string" ? e.message : "");
|
|
31
|
+
return n.name = typeof e.name == "string" && e.name !== "" ? e.name : "AxiosError", Object.assign(n, {
|
|
32
|
+
...typeof e.code == "string" ? { code: e.code } : {},
|
|
33
|
+
status: t.status,
|
|
34
|
+
method: t.method,
|
|
35
|
+
url: t.url
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { r as toSanitizedApiError };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=sanitized-api-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitized-api-error.js","names":[],"sources":["../../../src/shared/errors/sanitized-api-error.ts"],"sourcesContent":["import type { AxiosError } from \"axios\";\nimport { redactUrl } from \"./redact-url\";\nimport { formatApiErrorMessage, SymmApiError } from \"./symm-error\";\n\n/**\n * Build a {@link SymmApiError} from an axios error without keeping the request\n * headers or body.\n *\n * {@link SymmApiError.fromAxios} keeps the axios error as `cause`, and that\n * error's request config holds the request headers (an `Authorization` key)\n * and the serialized body (signed payloads). This variant keeps every field\n * `fromAxios` derives (`status`, `statusText`, `method`, `responseData`,\n * `retryAfterMs`) but:\n *\n * - replaces `cause` with a sanitized `Error` carrying only the axios `name`,\n * `message` and `code`, plus the request's `status`, `method` and `url`;\n * - strips userinfo, the query string and the fragment from `url`, from the\n * composed message and from the cause.\n *\n * `responseData` stays the raw response body. A server that echoes request\n * input in its error body (a FastAPI `422` puts it in `detail[].input`) still\n * exposes those values there.\n *\n * @param err - The axios error.\n * @param options - The SDK error code and the request's base URL, as for `fromAxios`.\n * @returns A `SymmApiError` whose `cause` holds no request headers or body.\n *\n * @internal\n */\nexport function toSanitizedApiError(err: AxiosError, options: { code: string; baseURL: string }): SymmApiError {\n const error = SymmApiError.fromAxios(err, options);\n const { code, status, statusText, method } = error;\n const url = redactUrl(error.url);\n return new SymmApiError({\n code,\n message: formatApiErrorMessage({ code, message: err.message, method, url, status, statusText }),\n status,\n statusText,\n responseData: error.responseData,\n url,\n method,\n retryAfterMs: error.retryAfterMs,\n cause: toSanitizedHttpCause(err, { status, method, url }),\n });\n}\n\n/**\n * A credential-free stand-in for an axios error, used as a sanitized\n * `SymmApiError`'s `cause`. It keeps what a log line needs (the axios `name`,\n * `message` and `code`, plus the request's `status`, `method` and\n * already-redacted `url`) and drops `config`, `request` and `response`, which\n * hold the request headers and body.\n */\nfunction toSanitizedHttpCause(err: AxiosError, request: { status: number; method: string; url: string }): Error {\n const cause = new Error(typeof err.message === \"string\" ? err.message : \"\");\n cause.name = typeof err.name === \"string\" && err.name !== \"\" ? err.name : \"AxiosError\";\n return Object.assign(cause, {\n ...(typeof err.code === \"string\" ? { code: err.code } : {}),\n status: request.status,\n method: request.method,\n url: request.url,\n });\n}\n"],"mappings":";;;AA6BA,SAAgB,EAAoB,GAAiB,GAA0D;CAC7G,IAAM,IAAQ,EAAa,UAAU,GAAK,CAAO,GAC3C,EAAE,SAAM,WAAQ,eAAY,cAAW,GACvC,IAAM,EAAU,EAAM,GAAG;CAC/B,OAAO,IAAI,EAAa;EACtB;EACA,SAAS,EAAsB;GAAE;GAAM,SAAS,EAAI;GAAS;GAAQ;GAAK;GAAQ;EAAW,CAAC;EAC9F;EACA;EACA,cAAc,EAAM;EACpB;EACA;EACA,cAAc,EAAM;EACpB,OAAO,EAAqB,GAAK;GAAE;GAAQ;GAAQ;EAAI,CAAC;CAC1D,CAAC;AACH;AASA,SAAS,EAAqB,GAAiB,GAAiE;CAC9G,IAAM,IAAY,MAAM,OAAO,EAAI,WAAY,WAAW,EAAI,UAAU,EAAE;CAE1E,OADA,EAAM,OAAO,OAAO,EAAI,QAAS,YAAY,EAAI,SAAS,KAAK,EAAI,OAAO,cACnE,OAAO,OAAO,GAAO;EAC1B,GAAI,OAAO,EAAI,QAAS,WAAW,EAAE,MAAM,EAAI,KAAK,IAAI,CAAC;EACzD,QAAQ,EAAQ;EAChB,QAAQ,EAAQ;EAChB,KAAK,EAAQ;CACf,CAAC;AACH"}
|
|
@@ -48,6 +48,17 @@ export declare class SymmApiError extends SymmError {
|
|
|
48
48
|
readonly url: string;
|
|
49
49
|
/** HTTP method (e.g., "GET", "POST"). */
|
|
50
50
|
readonly method: string;
|
|
51
|
+
/**
|
|
52
|
+
* How long the server asked the client to wait before retrying, in
|
|
53
|
+
* milliseconds, parsed from a `Retry-After` response header (delay-seconds or
|
|
54
|
+
* an HTTP-date). `null` when the response carried no usable header, or when
|
|
55
|
+
* there was no response at all.
|
|
56
|
+
*
|
|
57
|
+
* A cross-origin browser only sees `Retry-After` when the server lists it in
|
|
58
|
+
* `Access-Control-Expose-Headers`, so `null` means "unknown", not "retry
|
|
59
|
+
* immediately". Back off anyway, e.g. at least one second plus jitter.
|
|
60
|
+
*/
|
|
61
|
+
readonly retryAfterMs: number | null;
|
|
51
62
|
constructor(options: {
|
|
52
63
|
code: string;
|
|
53
64
|
message: string;
|
|
@@ -56,17 +67,24 @@ export declare class SymmApiError extends SymmError {
|
|
|
56
67
|
responseData?: unknown;
|
|
57
68
|
url: string;
|
|
58
69
|
method: string;
|
|
70
|
+
/** Retry delay in ms from `Retry-After`. Defaults to `null`. */
|
|
71
|
+
retryAfterMs?: number | null;
|
|
59
72
|
cause?: Error;
|
|
60
73
|
});
|
|
61
74
|
/**
|
|
62
75
|
* Build a `SymmApiError` from an axios error.
|
|
63
76
|
*
|
|
64
|
-
* Pulls `status`, `statusText`, `url`, `method`,
|
|
65
|
-
* axios error and keeps the original axios error as
|
|
66
|
-
*
|
|
67
|
-
*
|
|
77
|
+
* Pulls `status`, `statusText`, `url`, `method`, `responseData` and
|
|
78
|
+
* `retryAfterMs` off the axios error and keeps the original axios error as
|
|
79
|
+
* `cause`. The composed message is
|
|
80
|
+
* `"<code>: <axios message> (<METHOD> <URL> → <status> <statusText>)"` so a
|
|
81
|
+
* single log line carries the code, original message, and request
|
|
68
82
|
* coordinates.
|
|
69
83
|
*
|
|
84
|
+
* The axios error keeps its request config, headers and body included, so
|
|
85
|
+
* redact `cause` before forwarding it to third-party logging when the request
|
|
86
|
+
* carried a credential.
|
|
87
|
+
*
|
|
70
88
|
* Use inside an action's `catch` after re-throwing any pre-existing
|
|
71
89
|
* `SymmError`:
|
|
72
90
|
*
|
|
@@ -91,4 +109,21 @@ export declare class SymmApiError extends SymmError {
|
|
|
91
109
|
baseURL: string;
|
|
92
110
|
}): SymmApiError;
|
|
93
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Compose the one-line message {@link SymmApiError.fromAxios} gives an HTTP
|
|
114
|
+
* failure: `"<code>: <message> (<METHOD> <URL> → <status> <statusText>)"`.
|
|
115
|
+
*
|
|
116
|
+
* @param parts - The SDK code, the transport's own message and the request coordinates.
|
|
117
|
+
* @returns The composed message.
|
|
118
|
+
*
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
121
|
+
export declare function formatApiErrorMessage(parts: {
|
|
122
|
+
code: string;
|
|
123
|
+
message: string;
|
|
124
|
+
method: string;
|
|
125
|
+
url: string;
|
|
126
|
+
status: number;
|
|
127
|
+
statusText: string;
|
|
128
|
+
}): string;
|
|
94
129
|
//# sourceMappingURL=symm-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symm-error.d.ts","sourceRoot":"","sources":["../../../src/shared/errors/symm-error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAC;AAE5D;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAClC,SAAkB,IAAI,EAAE,MAAM,CAAe;IAE7C,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKvF;AAED
|
|
1
|
+
{"version":3,"file":"symm-error.d.ts","sourceRoot":"","sources":["../../../src/shared/errors/symm-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIxC;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAC;AAE5D;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAClC,SAAkB,IAAI,EAAE,MAAM,CAAe;IAE7C,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKvF;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,SAAS;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,8DAA8D;IAC9D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B,+BAA+B;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;;;;;;;OASG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEzB,OAAO,EAAE;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,gEAAgE;QAChE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;KACf;IAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,MAAM,CAAC,SAAS,CACd,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;QACP,kEAAkE;QAClE,IAAI,EAAE,MAAM,CAAC;QACb,gFAAgF;QAChF,OAAO,EAAE,MAAM,CAAC;KACjB,GACA,YAAY;CAkBhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAET"}
|
|
@@ -1,35 +1,49 @@
|
|
|
1
|
+
import { readHttpHeader as e } from "../utils/http-header.js";
|
|
2
|
+
import { parseRetryAfterMs as t } from "./retry-after.js";
|
|
1
3
|
//#region src/shared/errors/symm-error.ts
|
|
2
|
-
var
|
|
4
|
+
var n = class extends Error {
|
|
3
5
|
name = "SymmError";
|
|
4
6
|
kind;
|
|
5
7
|
code;
|
|
6
8
|
constructor(e, t, n, r) {
|
|
7
9
|
super(n, r), this.kind = e, this.code = t;
|
|
8
10
|
}
|
|
9
|
-
},
|
|
11
|
+
}, r = class r extends n {
|
|
10
12
|
status;
|
|
11
13
|
statusText;
|
|
12
14
|
responseData;
|
|
13
15
|
url;
|
|
14
16
|
method;
|
|
17
|
+
retryAfterMs;
|
|
15
18
|
constructor(e) {
|
|
16
|
-
super("api", e.code, e.message, { cause: e.cause }), this.status = e.status, this.statusText = e.statusText, this.responseData = e.responseData, this.url = e.url, this.method = e.method;
|
|
19
|
+
super("api", e.code, e.message, { cause: e.cause }), this.status = e.status, this.statusText = e.statusText, this.responseData = e.responseData, this.url = e.url, this.method = e.method, this.retryAfterMs = e.retryAfterMs ?? null;
|
|
17
20
|
}
|
|
18
|
-
static fromAxios(
|
|
19
|
-
let
|
|
20
|
-
return new
|
|
21
|
-
code:
|
|
22
|
-
message:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
static fromAxios(n, a) {
|
|
22
|
+
let o = n.response?.status ?? 0, s = n.response?.statusText ?? "Unknown", c = n.config?.url ? `${a.baseURL}${n.config.url}` : a.baseURL, l = n.config?.method?.toUpperCase() ?? "GET";
|
|
23
|
+
return new r({
|
|
24
|
+
code: a.code,
|
|
25
|
+
message: i({
|
|
26
|
+
code: a.code,
|
|
27
|
+
message: n.message,
|
|
28
|
+
method: l,
|
|
29
|
+
url: c,
|
|
30
|
+
status: o,
|
|
31
|
+
statusText: s
|
|
32
|
+
}),
|
|
33
|
+
status: o,
|
|
34
|
+
statusText: s,
|
|
35
|
+
responseData: n.response?.data,
|
|
36
|
+
url: c,
|
|
37
|
+
method: l,
|
|
38
|
+
retryAfterMs: t(e(n.response?.headers, "retry-after")),
|
|
39
|
+
cause: n
|
|
29
40
|
});
|
|
30
41
|
}
|
|
31
42
|
};
|
|
43
|
+
function i(e) {
|
|
44
|
+
return `${e.code}: ${e.message} (${e.method} ${e.url} → ${e.status} ${e.statusText})`;
|
|
45
|
+
}
|
|
32
46
|
//#endregion
|
|
33
|
-
export {
|
|
47
|
+
export { r as SymmApiError, n as SymmError, i as formatApiErrorMessage };
|
|
34
48
|
|
|
35
49
|
//# sourceMappingURL=symm-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symm-error.js","names":[],"sources":["../../../src/shared/errors/symm-error.ts"],"sourcesContent":["/**\n * Broad classification of SDK errors.\n *\n * - `config` — SDK configuration issues (missing chain, no wallet client).\n * - `api` — HTTP/REST API failures (solver, price service).\n * - `validation` — Input validation failures (missing required params).\n */\nexport type SymmErrorKind = \"config\" | \"api\" | \"validation\";\n\n/**\n * Base error class for SDK-level failures.\n *\n * Every SDK error includes:\n * - `kind` — broad category for error handling branches\n * - `code` — specific error identifier within that kind\n *\n * On-chain failures surface as viem errors and are not wrapped.\n */\nexport class SymmError extends Error {\n override readonly name: string = \"SymmError\";\n\n /** Broad classification (e.g., \"config\", \"api\", \"validation\"). */\n readonly kind: SymmErrorKind;\n\n /** Specific error identifier (e.g., \"UNSUPPORTED_CHAIN\", \"MISSING_USER\"). */\n readonly code: string;\n\n constructor(kind: SymmErrorKind, code: string, message: string, options?: ErrorOptions) {\n super(message, options);\n this.kind = kind;\n this.code = code;\n }\n}\n\
|
|
1
|
+
{"version":3,"file":"symm-error.js","names":[],"sources":["../../../src/shared/errors/symm-error.ts"],"sourcesContent":["import type { AxiosError } from \"axios\";\nimport { readHttpHeader } from \"../utils/http-header\";\nimport { parseRetryAfterMs } from \"./retry-after\";\n\n/**\n * Broad classification of SDK errors.\n *\n * - `config` — SDK configuration issues (missing chain, no wallet client).\n * - `api` — HTTP/REST API failures (solver, price service).\n * - `validation` — Input validation failures (missing required params).\n */\nexport type SymmErrorKind = \"config\" | \"api\" | \"validation\";\n\n/**\n * Base error class for SDK-level failures.\n *\n * Every SDK error includes:\n * - `kind` — broad category for error handling branches\n * - `code` — specific error identifier within that kind\n *\n * On-chain failures surface as viem errors and are not wrapped.\n */\nexport class SymmError extends Error {\n override readonly name: string = \"SymmError\";\n\n /** Broad classification (e.g., \"config\", \"api\", \"validation\"). */\n readonly kind: SymmErrorKind;\n\n /** Specific error identifier (e.g., \"UNSUPPORTED_CHAIN\", \"MISSING_USER\"). */\n readonly code: string;\n\n constructor(kind: SymmErrorKind, code: string, message: string, options?: ErrorOptions) {\n super(message, options);\n this.kind = kind;\n this.code = code;\n }\n}\n\n/**\n * Error class for HTTP/API failures from solver or other REST endpoints.\n *\n * Captures full request/response context for debugging and error handling.\n * Always has `kind: \"api\"`.\n */\nexport class SymmApiError extends SymmError {\n /** HTTP status code (e.g., 400, 401, 500). */\n readonly status: number;\n\n /** HTTP status text (e.g., \"Bad Request\", \"Unauthorized\"). */\n readonly statusText: string;\n\n /**\n * Raw response body from the server.\n *\n * For solver/hedger endpoints this is typically the documented\n * `XfiberErrorResponse`-style payload: `{code?, error_category?,\n * error_message?, error_detail?}`. Consumers cast it to the shape they expect\n * and render whatever fields they care about.\n */\n readonly responseData: unknown;\n\n /** Request URL that failed. */\n readonly url: string;\n\n /** HTTP method (e.g., \"GET\", \"POST\"). */\n readonly method: string;\n\n /**\n * How long the server asked the client to wait before retrying, in\n * milliseconds, parsed from a `Retry-After` response header (delay-seconds or\n * an HTTP-date). `null` when the response carried no usable header, or when\n * there was no response at all.\n *\n * A cross-origin browser only sees `Retry-After` when the server lists it in\n * `Access-Control-Expose-Headers`, so `null` means \"unknown\", not \"retry\n * immediately\". Back off anyway, e.g. at least one second plus jitter.\n */\n readonly retryAfterMs: number | null;\n\n constructor(options: {\n code: string;\n message: string;\n status: number;\n statusText: string;\n responseData?: unknown;\n url: string;\n method: string;\n /** Retry delay in ms from `Retry-After`. Defaults to `null`. */\n retryAfterMs?: number | null;\n cause?: Error;\n }) {\n super(\"api\", options.code, options.message, { cause: options.cause });\n this.status = options.status;\n this.statusText = options.statusText;\n this.responseData = options.responseData;\n this.url = options.url;\n this.method = options.method;\n this.retryAfterMs = options.retryAfterMs ?? null;\n }\n\n /**\n * Build a `SymmApiError` from an axios error.\n *\n * Pulls `status`, `statusText`, `url`, `method`, `responseData` and\n * `retryAfterMs` off the axios error and keeps the original axios error as\n * `cause`. The composed message is\n * `\"<code>: <axios message> (<METHOD> <URL> → <status> <statusText>)\"` so a\n * single log line carries the code, original message, and request\n * coordinates.\n *\n * The axios error keeps its request config, headers and body included, so\n * redact `cause` before forwarding it to third-party logging when the request\n * carried a credential.\n *\n * Use inside an action's `catch` after re-throwing any pre-existing\n * `SymmError`:\n *\n * @example\n * ```ts\n * try {\n * const response = await getMarketsApi({ baseURL });\n * return response.data;\n * } catch (err) {\n * if (err instanceof SymmError) throw err;\n * if (isAxiosError(err)) {\n * throw SymmApiError.fromAxios(err, { code: \"FETCH_MARKETS_FAILED\", baseURL });\n * }\n * throw new SymmError(\"api\", \"FETCH_MARKETS_FAILED\", `Failed to fetch markets: ${String(err)}`);\n * }\n * ```\n */\n static fromAxios(\n err: AxiosError,\n options: {\n /** Specific error identifier (e.g., `\"FETCH_MARKETS_FAILED\"`). */\n code: string;\n /** Base URL of the request; combined with `err.config.url` for the full URL. */\n baseURL: string;\n },\n ): SymmApiError {\n const status = err.response?.status ?? 0;\n const statusText = err.response?.statusText ?? \"Unknown\";\n const url = err.config?.url ? `${options.baseURL}${err.config.url}` : options.baseURL;\n const method = err.config?.method?.toUpperCase() ?? \"GET\";\n\n return new SymmApiError({\n code: options.code,\n message: formatApiErrorMessage({ code: options.code, message: err.message, method, url, status, statusText }),\n status,\n statusText,\n responseData: err.response?.data,\n url,\n method,\n retryAfterMs: parseRetryAfterMs(readHttpHeader(err.response?.headers, \"retry-after\")),\n cause: err,\n });\n }\n}\n\n/**\n * Compose the one-line message {@link SymmApiError.fromAxios} gives an HTTP\n * failure: `\"<code>: <message> (<METHOD> <URL> → <status> <statusText>)\"`.\n *\n * @param parts - The SDK code, the transport's own message and the request coordinates.\n * @returns The composed message.\n *\n * @internal\n */\nexport function formatApiErrorMessage(parts: {\n code: string;\n message: string;\n method: string;\n url: string;\n status: number;\n statusText: string;\n}): string {\n return `${parts.code}: ${parts.message} (${parts.method} ${parts.url} → ${parts.status} ${parts.statusText})`;\n}\n"],"mappings":";;;AAsBA,IAAa,IAAb,cAA+B,MAAM;CACnC,OAAiC;CAGjC;CAGA;CAEA,YAAY,GAAqB,GAAc,GAAiB,GAAwB;EAGtF,AAFA,MAAM,GAAS,CAAO,GACtB,KAAK,OAAO,GACZ,KAAK,OAAO;CACd;AACF,GAQa,IAAb,MAAa,UAAqB,EAAU;CAE1C;CAGA;CAUA;CAGA;CAGA;CAYA;CAEA,YAAY,GAWT;EAOD,AANA,MAAM,OAAO,EAAQ,MAAM,EAAQ,SAAS,EAAE,OAAO,EAAQ,MAAM,CAAC,GACpE,KAAK,SAAS,EAAQ,QACtB,KAAK,aAAa,EAAQ,YAC1B,KAAK,eAAe,EAAQ,cAC5B,KAAK,MAAM,EAAQ,KACnB,KAAK,SAAS,EAAQ,QACtB,KAAK,eAAe,EAAQ,gBAAgB;CAC9C;CAiCA,OAAO,UACL,GACA,GAMc;EACd,IAAM,IAAS,EAAI,UAAU,UAAU,GACjC,IAAa,EAAI,UAAU,cAAc,WACzC,IAAM,EAAI,QAAQ,MAAM,GAAG,EAAQ,UAAU,EAAI,OAAO,QAAQ,EAAQ,SACxE,IAAS,EAAI,QAAQ,QAAQ,YAAY,KAAK;EAEpD,OAAO,IAAI,EAAa;GACtB,MAAM,EAAQ;GACd,SAAS,EAAsB;IAAE,MAAM,EAAQ;IAAM,SAAS,EAAI;IAAS;IAAQ;IAAK;IAAQ;GAAW,CAAC;GAC5G;GACA;GACA,cAAc,EAAI,UAAU;GAC5B;GACA;GACA,cAAc,EAAkB,EAAe,EAAI,UAAU,SAAS,aAAa,CAAC;GACpF,OAAO;EACT,CAAC;CACH;AACF;AAWA,SAAgB,EAAsB,GAO3B;CACT,OAAO,GAAG,EAAM,KAAK,IAAI,EAAM,QAAQ,IAAI,EAAM,OAAO,GAAG,EAAM,IAAI,KAAK,EAAM,OAAO,GAAG,EAAM,WAAW;AAC7G"}
|