@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
package/dist/pools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/pools/types.ts"],"sourcesContent":["import type { MarketStatus } from \"./types/generated/listing-backend\";\n\n/**\n * Fixed-point scale of every money and rate field the listing service returns.\n *\n * The service reports these as decimal **strings** at 18 decimals, regardless of\n * the token's own decimals or the collateral's (`\"1000000000000000000\"` = `1`).\n * The SDK keeps them as `bigint` at this scale so nothing is lost; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` from `@symmio/utils/decimal` at\n * the display edge.\n *\n * **What the descaled number means differs by field.** For money fields it is a\n * USD amount (`1e18` = `$1`). For rate fields it is **already a percentage**\n * (`1e18` = `1%`), *not* a fraction — do **not** multiply by 100 to render one.\n *\n * Verified against the live service: a pool with `tvl` `177.78` and `reward_24h`\n * `0.0055` annualizes to `1.1295%`, and its `apr_24h` descales to exactly\n * `1.1295`.\n */\nexport const LISTING_VALUE_DECIMALS = 18;\n\n/**\n * Lifecycle status of a market in the permissionless-listing service.\n *\n * The service — not the chain — owns this state machine. A market becomes\n * tradable only at {@link ListingMarketStatus.LISTED}; before that it has no\n * `symbolId` and no solver market behind it.\n *\n * - `WAITING_FOR_DEPOSIT` — application accepted, the listing deposit has not\n * landed at the custodial address yet.\n * - `UNDER_REVIEW` — deposit received, awaiting the operator's decision.\n * - `REJECTED` — the operator declined the listing; the deposit is refundable.\n * - `LISTED` — live and tradable; `symbolId` is assigned.\n * - `DELISTED` — was live, has since been withdrawn from trading.\n */\nexport enum ListingMarketStatus {\n WAITING_FOR_DEPOSIT = \"waiting_for_deposit\",\n UNDER_REVIEW = \"under_review\",\n REJECTED = \"rejected\",\n LISTED = \"listed\",\n DELISTED = \"delisted\",\n}\n\n/**\n * Chains the listing service accepts a listing deposit on.\n *\n * This is the chain the **token** lives on and where its listing collateral was\n * deposited — it is **not** the chain the resulting market trades on. A market\n * whose token is on Solana or BSC still trades on the SYMMIO deployment the\n * listing service is configured for.\n *\n * `SOLANA = 0` is a sentinel the service uses for its one non-EVM chain, not a\n * real chain id: a `ListingMarket` on it carries a base58 `contractAddress`, so\n * never feed one to an EVM address helper without checking `chainId` first.\n */\nexport enum ListingDepositChainId {\n /** Sentinel for Solana — not an EVM chain id. Addresses are base58. */\n SOLANA = 0,\n BSC = 56,\n BASE = 8453,\n SONIC = 146,\n ARBITRUM_ONE = 42161,\n HYPER_EVM = 999,\n}\n\n/**\n * The same metric measured over each trailing window the listing service\n * reports.\n *\n * Every entry is a `bigint` at {@link LISTING_VALUE_DECIMALS}, or `null` when\n * the service has no value for that window — a young market has no 30-day\n * figure, and `null` means *absent*, never zero.\n */\nexport interface ListingTrailingWindows {\n /** Trailing 1 hour. */\n h1: bigint | null;\n /** Trailing 6 hours. */\n h6: bigint | null;\n /** Trailing 24 hours. */\n h24: bigint | null;\n /** Trailing 30 days. */\n d30: bigint | null;\n}\n\n/**\n * A metric the service reports over the trailing windows **and** since listing.\n *\n * Only the two APY series carry a lifetime column; APR does not, which is why\n * `lifetime` lives here rather than on {@link ListingTrailingWindows}.\n */\nexport interface ListingApyWindows extends ListingTrailingWindows {\n /** Since the market was listed. */\n lifetime: bigint | null;\n}\n\n/**\n * One market in the permissionless-listing catalog — a row of the pools list.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; `null`\n * means the service reported no value, which is distinct from zero.\n */\nexport interface ListingMarket {\n /**\n * The listed token's contract address on {@link ListingMarket.chainId}.\n *\n * Typed as `string`, **not** viem's `Address`: Solana listings\n * (`chainId === ListingDepositChainId.SOLANA`) carry a base58 address that is\n * not 0x-prefixed. This is also the id used to address a single market in the\n * rest of the listing API.\n */\n contractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n chainId: ListingDepositChainId;\n /**\n * The solver market id this listing trades under, or `null` when it has none\n * yet. Assigned when the market reaches {@link ListingMarketStatus.LISTED};\n * everything downstream (prices, notional caps, quotes, subgraph rows) keys\n * off it, so a `null` here means the market is not tradable.\n */\n symbolId: number | null;\n /** Token ticker, e.g. `\"SYMM\"`. */\n tokenTicker: string;\n /** Token display name, e.g. `\"Symmio\"`. */\n tokenName: string;\n /** Maximum leverage the market allows, as a whole multiplier (`20` = 20x). */\n maxLeverage: number;\n /** Token market capitalization, in USD. */\n marketCap: bigint | null;\n /** Trailing 24-hour trading volume, in USD. */\n vol24h: bigint | null;\n /** Total value locked in the market's pool, in USD. */\n tvl: bigint | null;\n /** Notional the solver will still take on this market, in USD. */\n liquidity: bigint | null;\n /** Notional currently open on this market, in USD. */\n openInterest: bigint | null;\n /** LP rewards accrued over the trailing 24 hours, in USD. */\n reward24h: bigint | null;\n /** Headline APR: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n apr: bigint | null;\n /**\n * APR broken out per trailing window, same units as {@link ListingMarket.apr}.\n * There is no lifetime APR — use {@link ListingMarket.apr} for the headline.\n */\n aprByWindow: ListingTrailingWindows;\n /** APY attributed to TVL growth, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n priceDrivenApy: ListingApyWindows;\n /** When the market went live, as a Unix timestamp in **seconds**. `null` before it is listed. */\n listingTime: number | null;\n /** Where the market sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n}\n\n/** One page of {@link ListingMarket} rows, with the totals needed to paginate. */\nexport interface ListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: ListingMarket[];\n}\n\n/**\n * A {@link ListingMarket} enriched with the signed-in user's position in it — one\n * row of \"Your Pools\", the markets that generated a deposit address for the user.\n */\nexport interface UserListingMarket extends ListingMarket {\n /** The user's current deposit into this pool, in USD (18-dec bigint). `null` when the deposit address exists but nothing has been deposited yet. */\n userDeposit: bigint | null;\n /** The user's share of the pool, as a percentage number (not 18-dec scaled). */\n userSharePercentage: number;\n /** The user's accrued revenue from this pool, in USD (18-dec bigint), or `null` when absent. */\n userRevenue: bigint | null;\n}\n\n/** One page of {@link UserListingMarket} rows, with the totals needed to paginate. */\nexport interface UserListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: UserListingMarket[];\n}\n\n/**\n * The signed-in user's LP position and profit in a single pool — the authed\n * per-token read behind a pool's \"your position\" panel.\n *\n * Every field is a `bigint` at {@link LISTING_VALUE_DECIMALS} (18), independent\n * of the token's or collateral's own decimals; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge. An absent\n * figure is normalized to `0n`, not `null`.\n */\nexport interface UserPoolProfit {\n /** LP balance valued in the pool's token units, 18-dec bigint. */\n userBalanceInTokens: bigint;\n /** LP balance valued in USDC, 18-dec bigint USD. */\n userBalanceInUsdc: bigint;\n /** Rewards the user can claim now, 18-dec bigint USD. */\n claimableReward: bigint;\n /** Rewards already claimed, 18-dec bigint USD. */\n claimedReward: bigint;\n /** Token amount the user deposited, 18-dec bigint. */\n userDepositedTokenAmount: bigint;\n /** The user's LP shares, 18-dec bigint. */\n userLpAmount: bigint;\n /** LP shares queued for withdrawal (the pending-withdrawal amount), 18-dec bigint. */\n pendingWithdrawLpAmount: bigint;\n /**\n * LP shares free to withdraw right now — `userLpAmount − pendingWithdrawLpAmount`,\n * floored at `0n`. This is the ceiling a withdrawal (`withdrawLp`) may request;\n * the shares already counted in {@link UserPoolProfit.pendingWithdrawLpAmount}\n * are spoken for. Derived by the SDK, not a field the service returns. 18-dec\n * bigint.\n */\n availableLpAmount: bigint;\n}\n\n/**\n * The receipt returned by `claimProfit` — the outcome of a `/v2/claim` request.\n *\n * The claim is synchronous: a `200` means the USDC was moved to the target\n * sub-account. `amountClaimed` is the moved figure normalized to a `bigint` at\n * `LISTING_VALUE_DECIMALS` (18), `claimRequestId` references the claim in the\n * service, and `transactionHash` is the on-chain transfer hash when the service\n * has one (`null` otherwise).\n */\nexport interface PoolClaimResult {\n /** The service's status string, e.g. `\"ok\"`. */\n status: string;\n /** USDC moved to the sub-account, 18-dec bigint USD. */\n amountClaimed: bigint;\n /** Claim id — reference it to restore or look up the claim later. */\n claimRequestId: string;\n /** On-chain hash of the claim transfer, or `null` when the service has none yet. */\n transactionHash: string | null;\n}\n\n/**\n * One past pool-reward claim, from the user's claim history (`getClaimHistory`).\n *\n * The internal `wallet_id` / `market_id` UUIDs the service carries are dropped —\n * they address rows in the backend, not anything a consumer renders.\n */\nexport interface PoolClaim {\n /** Claim id — reference it to look the claim up in the service. */\n claimRequestId: string;\n /** Sub-account address that received the claimed USDC. */\n accountAddress: string;\n /** USDC claimed, 18-dec bigint USD. */\n amount: bigint;\n /** On-chain hash of the claim transfer, or `null` when the service has none. */\n transactionHash: string | null;\n /** When the claim was created, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolClaim} rows — the signed-in user's claim history. */\nexport interface PoolClaimHistoryPage {\n /** Total claims matching the query across all pages — what a pager divides. */\n count: number;\n /** The claims themselves, newest first. */\n items: PoolClaim[];\n}\n\n/**\n * The receipt returned by `cancelWithdraw` — the outcome of cancelling a queued\n * LP withdrawal.\n */\nexport interface PoolCancelWithdrawResult {\n /** The affected withdrawal's transaction id, echoed by the service. */\n transactionId: string;\n /**\n * The withdrawal's resulting status, e.g. `\"canceled\"`. Carried through as the\n * service's raw string — its enum (`canceled` | `pending` | `transferred` | …)\n * is a superset of {@link PoolTransactionStatus}, so it is not narrowed to it.\n */\n status: string;\n}\n\n/**\n * The receipt returned by `refundMarket` — the outcome of refunding a deposit on\n * a rejected market.\n */\nexport interface PoolRefundResult {\n /** On-chain hash of the refund transfer. */\n transactionHash: string;\n}\n\n/**\n * The signed-in user's **retry allowance** for one rejected market\n * (`getRetryListingInfo`) — how many listing retries remain and the cooldown\n * before the next.\n */\nexport interface RetryListingInfo {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries the user has left for this market. */\n remainingRetries: number;\n /** Seconds until the next retry is allowed, or `null` when no cooldown is in effect. */\n remainingCooldownSeconds: number | null;\n}\n\n/**\n * The result of `retryListing` — the retry allowance left after re-submitting a\n * rejected market.\n */\nexport interface RetryListingResult {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries left after this one. */\n remainingRetries: number;\n /** Seconds before the next retry is allowed. */\n cooldownSeconds: number;\n}\n\n/**\n * The signed-in user's deposit wallet for one market — the get-or-create result\n * of the authed `/v2/market/deposit-address` endpoint. This is the address the\n * user sends funds to in order to deposit into the market's pool.\n */\nexport interface MarketDepositAddress {\n /** The market's token contract address (EVM 0x… or Solana base58). */\n tokenContractAddress: string;\n /** The signed-in user this deposit wallet belongs to. */\n userAddress: string;\n /** The market's deposit chain. */\n depositChain: ListingDepositChainId;\n /** The deposit address — where the user sends funds to deposit into this market. `null` when the service returned none. */\n depositAddress: string | null;\n /** The token's on-chain decimals. */\n tokenDecimal: number;\n /** The market's listing lifecycle status. */\n marketStatus: ListingMarketStatus;\n}\n\n/**\n * The listing-pipeline status of a single market — the normalized result of\n * `getListingStatus`, keyed by the market's token address and deposit chain.\n *\n * `marketStatus` is the overall lifecycle status (the same machine as\n * {@link ListingMarketStatus}); the remaining fields describe where the listing\n * is in the backend's step pipeline and whether the current step is retrying or\n * has errored.\n */\nexport interface ListingStatus {\n /** Overall lifecycle status of the market, mapped from the service's `market_status`. */\n marketStatus: ListingMarketStatus;\n /** The step the listing pipeline is currently on, or `null` when it is not in a step. */\n currentStep: string | null;\n /** The ordered pipeline steps the listing moves through. */\n steps: string[];\n /** Error code reported for the current step, or `null` when there is no error. */\n errorCode: number | null;\n /** Human-readable detail for the current step's error, or `null`. */\n errorDetail: string | null;\n /** How many times the current step has been retried. */\n retryCount: number;\n /** The maximum retries allowed for the current step. */\n retryLimit: number;\n}\n\n/**\n * The protocol's global new-market listing cap for the current rolling weekly\n * window — how many pools may still be listed across the protocol before the\n * window resets.\n */\nexport interface WeeklyListingLimit {\n /** Total new-market listings allowed per rolling weekly window. */\n limit: number;\n /** Listings still available in the current window — `0` means no more pools can be listed until reset. */\n remaining: number;\n /** When the window resets, as the Unix timestamp the service returns (`reset_at`). */\n resetAt: number;\n}\n\n/**\n * Server-side sort keys accepted by `getListingMarkets`.\n *\n * Mirrors the service's `sort_by` enum verbatim — snake_case, not the SDK's\n * camelCase field names — because the value is a wire literal, and translating\n * it would break silently the moment the service adds a key.\n *\n * Note the two bare keys: `tvl_driven_apy` and `price_driven_apy` have no\n * matching bare response field. They sort by the **lifetime** column\n * (`tvl_driven_apy_lifetime` / `price_driven_apy_lifetime`).\n */\nexport type ListingMarketSortField =\n | \"liquidity\"\n | \"tvl\"\n | \"market_cap\"\n | \"vol24h\"\n | \"open_interest\"\n | \"apr_1h\"\n | \"apr_6h\"\n | \"apr_24h\"\n | \"apr_30d\"\n | \"reward_24h\"\n | \"apr\"\n | \"tvl_driven_apy_1h\"\n | \"tvl_driven_apy_6h\"\n | \"tvl_driven_apy_24h\"\n | \"tvl_driven_apy_30d\"\n | \"tvl_driven_apy\"\n | \"price_driven_apy_1h\"\n | \"price_driven_apy_6h\"\n | \"price_driven_apy_24h\"\n | \"price_driven_apy_30d\"\n | \"price_driven_apy\"\n | \"listing_time\";\n\n/** Sort direction. */\nexport type ListingSortDirection = \"asc\" | \"desc\";\n\n/**\n * An inclusive `[min, max]` bound on one of the service's value fields. Either\n * end may be omitted for a one-sided bound.\n *\n * Bounds use the **same 18-decimal scale as the response**\n * ({@link LISTING_VALUE_DECIMALS}), not the human-readable figure. Filtering for\n * \"market cap of at least one million USD\" is\n * `{ min: parseUnits(\"1000000\", LISTING_VALUE_DECIMALS) }`, not `{ min: 1_000_000 }`\n * — the latter is a bound of `0.000000000001` USD and silently matches nothing\n * useful. Verified against the live service.\n */\nexport interface ListingValueRange {\n /** Inclusive lower bound at 18 decimals (`__ge` on the wire). */\n min?: bigint;\n /** Inclusive upper bound at 18 decimals (`__le` on the wire). */\n max?: bigint;\n}\n\n/**\n * An inclusive `[min, max]` bound on a timestamp field, in Unix **seconds**\n * (not milliseconds, and not 18-decimal scaled).\n */\nexport interface ListingTimeRange {\n /** Inclusive lower bound, Unix seconds (`__ge` on the wire). */\n min?: number;\n /** Inclusive upper bound, Unix seconds (`__le` on the wire). */\n max?: number;\n}\n\n/**\n * Range filters `getListingMarkets` accepts. Every key is optional; omitted keys\n * are not sent.\n *\n * All {@link ListingValueRange} bounds are at {@link LISTING_VALUE_DECIMALS};\n * `listingTime` is the one exception and takes Unix seconds.\n */\nexport interface ListingMarketFilters {\n /** Token market capitalization, USD. */\n marketCap?: ListingValueRange;\n /** Trailing 24-hour volume, USD. */\n vol24h?: ListingValueRange;\n /** Total value locked, USD. */\n tvl?: ListingValueRange;\n /** Available notional, USD. */\n liquidity?: ListingValueRange;\n /** Open notional, USD. */\n openInterest?: ListingValueRange;\n /** Trailing 24-hour LP rewards, USD. */\n reward24h?: ListingValueRange;\n /** Headline APR bounds, at the field's own scale (`1e18` = `1%`). */\n apr?: ListingValueRange;\n /** APR over the trailing hour. */\n apr1h?: ListingValueRange;\n /** APR over the trailing 6 hours. */\n apr6h?: ListingValueRange;\n /** APR over the trailing 24 hours. */\n apr24h?: ListingValueRange;\n /** APR over the trailing 30 days. */\n apr30d?: ListingValueRange;\n /** TVL-driven APY over the trailing hour. */\n tvlDrivenApy1h?: ListingValueRange;\n /** TVL-driven APY over the trailing 6 hours. */\n tvlDrivenApy6h?: ListingValueRange;\n /** TVL-driven APY over the trailing 24 hours. */\n tvlDrivenApy24h?: ListingValueRange;\n /** TVL-driven APY over the trailing 30 days. */\n tvlDrivenApy30d?: ListingValueRange;\n /** TVL-driven APY over the market's lifetime. */\n tvlDrivenApy?: ListingValueRange;\n /** Price-driven APY over the trailing hour. */\n priceDrivenApy1h?: ListingValueRange;\n /** Price-driven APY over the trailing 6 hours. */\n priceDrivenApy6h?: ListingValueRange;\n /** Price-driven APY over the trailing 24 hours. */\n priceDrivenApy24h?: ListingValueRange;\n /** Price-driven APY over the trailing 30 days. */\n priceDrivenApy30d?: ListingValueRange;\n /** Price-driven APY over the market's lifetime. */\n priceDrivenApy?: ListingValueRange;\n /** Listing timestamp bounds, Unix seconds. */\n listingTime?: ListingTimeRange;\n}\n\n/**\n * Which side of the pool's book a {@link PoolPosition} row describes.\n *\n * The pool's inventory is reported as two aggregates, not a list of individual\n * trades — the detail read gives one long total and one short total.\n */\nexport enum PoolPositionSide {\n LONG = \"long\",\n SHORT = \"short\",\n}\n\n/**\n * One side of a pool's aggregate position book.\n *\n * Every figure is a `bigint` at {@link LISTING_VALUE_DECIMALS}. `upnl` is signed\n * — a losing side reports a negative value — and is the only field here that\n * routinely is.\n */\nexport interface PoolPosition {\n /** Which side this row aggregates. */\n side: PoolPositionSide;\n /** Total size held on this side, in the pool token's units. */\n size: bigint;\n /** Notional value of the side, in USD. */\n value: bigint;\n /** Size-weighted average open price of the side, in USD. */\n avgOpenPrice: bigint;\n /** Unrealized PnL of the side, in USD. Signed. */\n upnl: bigint;\n}\n\n/**\n * A pool's public detail — the aggregate stats and inventory position behind a\n * pool page.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; recall\n * that a descaled *rate* is already a percentage (`1e18` = `1%`) while a\n * descaled *money* field is USD (`1e18` = `$1`). `null` means the backend\n * reported no value, which is not zero.\n *\n * A **delisted** pool is a documented special case: the backend returns cached\n * remaining token and USDC balances with `tvl` fixed at zero.\n */\nexport interface ListingMarketDetail {\n /** The pool's token contract address — its id in the listing API. */\n tokenContractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n depositChain: ListingDepositChainId;\n /** Token display name. */\n tokenName: string;\n /** Token ticker, or `null` when the backend has none. */\n tokenTicker: string | null;\n /** Token decimals. */\n tokenDecimal: number;\n /** Solver market id, or `null` when the pool is not tradable yet. */\n symbolId: number | null;\n /** Where the pool sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /** Maximum leverage the market allows, as a whole multiplier. */\n maxLeverage: number;\n /** Share of revenue routed to token buybacks, as a percentage (`50` = 50%). */\n buybackRatio: number;\n /** When the market went live, as a Unix timestamp in **seconds**. */\n listingTime: number | null;\n /** Pool age in **seconds**, or `null` before listing. */\n age: number | null;\n /** Number of distinct LPs in the pool. */\n activeLps: number;\n /** Total value locked in the pool, USD. `0` for a delisted pool by design. */\n tvl: bigint | null;\n /** Collateral held by the pool, USD. */\n totalUsdcInPool: bigint;\n /** Pool token held by the pool, in the token's own units. */\n totalTokenInPool: bigint;\n /** Accrued maintenance fees, USD. */\n maintenanceFees: bigint;\n /** LP rewards per window, USD. */\n rewards: ListingApyWindows;\n /** Solver revenue per window, USD. */\n solverRevenue: ListingApyWindows;\n /** Headline APY per window, as a percentage. */\n apy: ListingApyWindows;\n /** APY attributed to TVL growth, per window, as a percentage. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window, as a percentage. */\n priceDrivenApy: ListingApyWindows;\n /** The pool's aggregate long side, or `null` when the backend reported none. */\n longPosition: PoolPosition | null;\n /** The pool's aggregate short side, or `null` when the backend reported none. */\n shortPosition: PoolPosition | null;\n}\n\n/** Whether a pool transaction is money going in or coming out. */\nexport enum PoolTransactionType {\n DEPOSIT = \"deposit\",\n WITHDRAW = \"withdraw\",\n}\n\n/**\n * Where a pool transaction sits in its lifecycle, as the backend reports it to\n * users.\n */\nexport enum PoolTransactionStatus {\n PENDING = \"pending\",\n SUCCESS = \"success\",\n REJECTED = \"rejected\",\n REFUND = \"refund\",\n CANCELED = \"canceled\",\n}\n\n/**\n * One deposit or withdrawal against a pool.\n *\n * `amount`, `usdcAmount` and `tokenAmount` are `bigint` at\n * {@link LISTING_VALUE_DECIMALS}. The refund fields are populated only for a\n * refunded row.\n */\nexport interface PoolTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** The wallet that made it. */\n walletAddress: string;\n /** Amount moved, in the transaction's own denomination. */\n amount: bigint;\n /** Collateral value moved, USD. */\n usdcAmount: bigint;\n /** Token amount moved, in the pool token's units. */\n tokenAmount: bigint;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** Hash of the refund transaction, or `null` when this is not a refund. */\n refundTransactionHash: string | null;\n /** When the refund completed, Unix **seconds**; `null` when not a refund. */\n refundTime: number | null;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** When the transaction happened, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolTransaction} rows for a pool. */\nexport interface PoolTransactionPage {\n /** The pool's token contract address, echoed by the backend. */\n marketAddress: string;\n /** Total rows matching the query across all pages. */\n count: number;\n /** The rows themselves. */\n items: PoolTransaction[];\n}\n\n/**\n * One row of the signed-in user's transaction history (`getUserTransactions`) —\n * a deposit or withdrawal they made, on any pool.\n *\n * Unlike {@link PoolTransaction} (one pool, every LP), this is one user, every\n * pool — so each row carries its own token identity (`tokenAddress`,\n * `tokenName`, `tokenTicker`, `tokenDecimals`, `chainId`).\n */\nexport interface UserTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** Amount moved, 18-dec bigint (a 1e18-scaled figure, like every listing value). */\n amount: bigint;\n /** The token's own decimals, as reported by the service — metadata, not the `amount` scale. */\n tokenDecimals: number;\n /** The pool's token contract address (EVM `0x…` or Solana base58). */\n tokenAddress: string;\n /** The token's name. */\n tokenName: string;\n /** The token's ticker. */\n tokenTicker: string;\n /** The chain the transaction's token lives on. */\n chainId: ListingDepositChainId;\n /** The temporary deposit wallet involved, or `null` when the service omits it. */\n wallet: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** When the transaction happened, Unix **seconds**; `null` when the service omits it. */\n time: number | null;\n}\n\n/** One page of {@link UserTransaction} rows — the signed-in user's transaction history. */\nexport interface UserTransactionPage {\n /** Total rows matching the query across all pages — what a pager divides. */\n count: number;\n /** The rows themselves, newest first. */\n items: UserTransaction[];\n}\n\n/**\n * The generated `MarketStatus` enum and {@link ListingMarketStatus} carry the\n * same string values; this alias documents that the cast in the mapper is\n * value-preserving rather than a widening.\n *\n * @internal\n */\nexport type GeneratedMarketStatus = MarketStatus;\n\n/**\n * One deposit chain a new listing may use, from the listing service's public\n * config ({@link ListingConfig.supportedDepositChains}).\n */\nexport interface ListingDepositChain {\n /** Numeric chain id to send with market/deposit requests. */\n chainId: ListingDepositChainId;\n /** Human-readable chain name, e.g. \"HyperEVM\". */\n chainName: string;\n}\n\n/**\n * The client mutation limits the listing service enforces, from its public\n * config ({@link ListingConfig.rateLimits}).\n */\nexport interface ListingRateLimits {\n /** Max successful market-config updates per user+market in a rolling 24h window. */\n marketConfigUpdatesPerDay: number;\n /** Max successful profit claims per user+market in a rolling 24h window. */\n profitClaimsPerDay: number;\n}\n\n/**\n * The listing service's public client configuration — the deposit guidance,\n * listing fee, supported deposit chains, rate limits, and protocol reward share\n * a create-listing flow needs.\n *\n * The three USDC figures are `bigint` at {@link LISTING_VALUE_DECIMALS} (18),\n * independent of the collateral token's own decimals; format them with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge.\n */\nexport interface ListingConfig {\n /** Recommended initial USDC deposit to start a listing, USD at LISTING_VALUE_DECIMALS (18) as a bigint. */\n recommendedInitialDepositUsdc: bigint;\n /** Minimum accepted initial USDC deposit after slippage, USD 18-dec bigint. */\n minimumInitialDepositUsdc: bigint;\n /** Listing fee in USDC, USD 18-dec bigint. */\n listingFeeUsdc: bigint;\n /** Deposit chains new markets may use — the source of truth for a chain picker. */\n supportedDepositChains: ListingDepositChain[];\n /** Rolling-24h client mutation limits. */\n rateLimits: ListingRateLimits;\n /** Whole-percent of market revenue to the protocol before buyback/LP. */\n protocolRewardSharePercent: number;\n}\n\n/**\n * One quote in a pool's book, decoded from the analytics subgraph.\n *\n * A pool's book is **every trader's** quotes on that market, not one account's —\n * `partyA` differs from row to row. Amounts and prices are `bigint` at 18\n * decimals (the protocol's own scale, not the listing backend's), and `null`\n * means the subgraph had no value for that field.\n */\nexport interface PoolQuote {\n /** Subgraph row id (`{quoteId}-{source}`); stable, use as a table key. */\n id: string;\n /** Protocol quote id. */\n quoteId: bigint;\n /** Raw `QuoteStatus` ordinal as the subgraph reports it. */\n quoteStatus: number | null;\n /** Raw `PositionType` ordinal — `0` long, `1` short. */\n positionType: number | null;\n /** Raw `OrderType` ordinal of the open — `0` limit, `1` market. */\n orderTypeOpen: number | null;\n /** Market ticker, when the subgraph carries one. */\n symbol: string | null;\n /** Solver market id. */\n symbolId: number | null;\n /** The account that opened the quote. */\n partyA: string;\n /** The solver that took the other side. */\n partyB: string | null;\n /** Quote size. */\n quantity: bigint | null;\n /** How much of {@link PoolQuote.quantity} has been closed. */\n closedAmount: bigint | null;\n /** Size of an in-flight close request. */\n quantityToClose: bigint | null;\n /** Price the quote actually opened at. */\n openedPrice: bigint | null;\n /** Price the opener asked for. */\n requestedOpenPrice: bigint | null;\n /** Size-weighted average of the closes so far. */\n averageClosedPrice: bigint | null;\n /** Price of an in-flight close request. */\n closePrice: bigint | null;\n /** Open price before any modification. */\n initialOpenedPrice: bigint | null;\n /** Size liquidated, when the quote was liquidated. */\n liquidateAmount: bigint | null;\n /** Price the liquidation executed at. */\n liquidatePrice: bigint | null;\n /** Block timestamp of the quote's last update, Unix **seconds**. */\n timestamp: number;\n /** Block the quote was last updated in. */\n blockNumber: bigint;\n}\n\n/**\n * One day of LP reward for a pool.\n *\n * A series of these is what a pool page's rewards chart plots — the public\n * per-pool series from `getPoolRewardChart`, or one market's slice of the\n * signed-in user's {@link UserPoolRewardChart}.\n */\nexport interface PoolRewardPoint {\n /** Start of the reward day, unix **seconds**. */\n timestamp: number;\n /**\n * Reward earned that day, `bigint` at {@link LISTING_VALUE_DECIMALS} (18).\n *\n * A **money** field, so the descaled number is a USD amount (`1e18` = `$1`) —\n * unlike the catalog's rate fields, which are already percentages. A day the\n * service reports as absent collapses to `0n` rather than `null`: a missing\n * snapshot and a zero-reward day are the same point on a chart.\n */\n reward: bigint;\n}\n\n/**\n * The signed-in user's daily reward series for **one** market, as returned by\n * `getUserRewardChart` — which reports every market the user has rewards in,\n * one entry each.\n *\n * A market is addressed by the pair `(marketAddress, marketChainId)`, matching\n * {@link ListingMarket.contractAddress} and {@link ListingMarket.chainId}. Note\n * `marketChainId` is the chain the **token** lives on, not the SYMMIO chain the\n * market trades on.\n */\nexport interface UserPoolRewardChart {\n /** The pool's token contract address — matches {@link ListingMarket.contractAddress}. */\n marketAddress: string;\n /** Chain the token lives on — matches {@link ListingMarket.chainId}. */\n marketChainId: ListingDepositChainId;\n /** The user's daily rewards in this pool, in the order the service returns them. */\n rewards: PoolRewardPoint[];\n}\n"],"mappings":";AAmBA,IAAa,IAAyB,IAgB1B,IAAL,yBAAA,GAAA;QACL,EAAA,sBAAA,uBACA,EAAA,eAAA,gBACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAcY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,SAAA,KAAA,UACA,EAAA,EAAA,MAAA,MAAA,OACA,EAAA,EAAA,OAAA,QAAA,QACA,EAAA,EAAA,QAAA,OAAA,SACA,EAAA,EAAA,eAAA,SAAA,gBACA,EAAA,EAAA,YAAA,OAAA;AACF,EAAA,CAAA,CAAA,GAgcY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,QAAA;AACF,EAAA,CAAA,CAAA,GAoFY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAMY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,UAAA,WACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/pools/types.ts"],"sourcesContent":["import type { MarketStatus } from \"./types/generated/listing-backend\";\n\n/**\n * Fixed-point scale of every money and rate field the listing service returns.\n *\n * The service reports these as decimal **strings** at 18 decimals, regardless of\n * the token's own decimals or the collateral's (`\"1000000000000000000\"` = `1`).\n * The SDK keeps them as `bigint` at this scale so nothing is lost; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` from `@symmio/utils/decimal` at\n * the display edge.\n *\n * **What the descaled number means differs by field.** For money fields it is a\n * USD amount (`1e18` = `$1`). For rate fields it is **already a percentage**\n * (`1e18` = `1%`), *not* a fraction — do **not** multiply by 100 to render one.\n *\n * Verified against the live service: a pool with `tvl` `177.78` and `reward_24h`\n * `0.0055` annualizes to `1.1295%`, and its `apr_24h` descales to exactly\n * `1.1295`.\n */\nexport const LISTING_VALUE_DECIMALS = 18;\n\n/**\n * Lifecycle status of a market in the permissionless-listing service.\n *\n * The service — not the chain — owns this state machine. A market becomes\n * tradable only at {@link ListingMarketStatus.LISTED}; before that it has no\n * `symbolId` and no solver market behind it.\n *\n * - `WAITING_FOR_DEPOSIT` — application accepted, the listing deposit has not\n * landed at the custodial address yet.\n * - `UNDER_REVIEW` — deposit received, awaiting the operator's decision.\n * - `REJECTED` — the operator declined the listing; the deposit is refundable.\n * - `LISTED` — live and tradable; `symbolId` is assigned.\n * - `DELISTED` — was live, has since been withdrawn from trading.\n */\nexport enum ListingMarketStatus {\n WAITING_FOR_DEPOSIT = \"waiting_for_deposit\",\n UNDER_REVIEW = \"under_review\",\n REJECTED = \"rejected\",\n LISTED = \"listed\",\n DELISTED = \"delisted\",\n}\n\n/**\n * Why the inventory service has locked a market's pool against new deposits.\n *\n * A lock blocks deposits only: trading, withdrawals, claims and every other\n * flow stay available. It is also orthogonal to {@link ListingMarketStatus}: a\n * `LISTED` market can be locked, and the lock lifts without the lifecycle\n * status moving. The catalogue\n * row carries only the flag ({@link ListingMarket.isLocked}); the reasons are on\n * the detail read ({@link ListingMarketDetail.lockReasons}).\n *\n * - `LIQUIDITY_EXPOSURE` — locked on the service's liquidity-exposure limit.\n * - `LOW_TVL` — the pool's TVL is below the service's threshold.\n * - `PRICE_UNAVAILABLE` — the service has no price for the token.\n * - `SHORT_CIRCUIT` — the service's short-circuit guard tripped.\n * - `MANUAL` — an operator locked the market by hand.\n * - `UNKNOWN` — a reason this SDK release does not recognize. The mapper folds\n * every unrecognized wire value here rather than throwing, so a newer backend\n * cannot break the read.\n */\nexport enum MarketLockReason {\n LIQUIDITY_EXPOSURE = \"LIQUIDITY_EXPOSURE\",\n LOW_TVL = \"LOW_TVL\",\n PRICE_UNAVAILABLE = \"PRICE_UNAVAILABLE\",\n SHORT_CIRCUIT = \"SHORT_CIRCUIT\",\n MANUAL = \"MANUAL\",\n UNKNOWN = \"UNKNOWN\",\n}\n\n/**\n * Chains the listing service accepts a listing deposit on.\n *\n * This is the chain the **token** lives on and where its listing collateral was\n * deposited — it is **not** the chain the resulting market trades on. A market\n * whose token is on Solana or BSC still trades on the SYMMIO deployment the\n * listing service is configured for.\n *\n * `SOLANA = 0` is a sentinel the service uses for its one non-EVM chain, not a\n * real chain id: a `ListingMarket` on it carries a base58 `contractAddress`, so\n * never feed one to an EVM address helper without checking `chainId` first.\n */\nexport enum ListingDepositChainId {\n /** Sentinel for Solana — not an EVM chain id. Addresses are base58. */\n SOLANA = 0,\n BSC = 56,\n BASE = 8453,\n SONIC = 146,\n ARBITRUM_ONE = 42161,\n HYPER_EVM = 999,\n}\n\n/**\n * The same metric measured over each trailing window the listing service\n * reports.\n *\n * Every entry is a `bigint` at {@link LISTING_VALUE_DECIMALS}, or `null` when\n * the service has no value for that window — a young market has no 30-day\n * figure, and `null` means *absent*, never zero.\n */\nexport interface ListingTrailingWindows {\n /** Trailing 1 hour. */\n h1: bigint | null;\n /** Trailing 6 hours. */\n h6: bigint | null;\n /** Trailing 24 hours. */\n h24: bigint | null;\n /** Trailing 30 days. */\n d30: bigint | null;\n}\n\n/**\n * A metric the service reports over the trailing windows **and** since listing.\n *\n * Only the two APY series carry a lifetime column; APR does not, which is why\n * `lifetime` lives here rather than on {@link ListingTrailingWindows}.\n */\nexport interface ListingApyWindows extends ListingTrailingWindows {\n /** Since the market was listed. */\n lifetime: bigint | null;\n}\n\n/**\n * One market in the permissionless-listing catalog — a row of the pools list.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; `null`\n * means the service reported no value, which is distinct from zero.\n */\nexport interface ListingMarket {\n /**\n * The listed token's contract address on {@link ListingMarket.chainId}.\n *\n * Typed as `string`, **not** viem's `Address`: Solana listings\n * (`chainId === ListingDepositChainId.SOLANA`) carry a base58 address that is\n * not 0x-prefixed. This is also the id used to address a single market in the\n * rest of the listing API.\n */\n contractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n chainId: ListingDepositChainId;\n /**\n * The solver market id this listing trades under, or `null` when it has none\n * yet. Assigned when the market reaches {@link ListingMarketStatus.LISTED};\n * everything downstream (prices, notional caps, quotes, subgraph rows) keys\n * off it, so a `null` here means the market is not tradable.\n */\n symbolId: number | null;\n /** Token ticker, e.g. `\"SYMM\"`. */\n tokenTicker: string;\n /** Token display name, e.g. `\"Symmio\"`. */\n tokenName: string;\n /** Maximum leverage the market allows, as a whole multiplier (`20` = 20x). */\n maxLeverage: number;\n /** Token market capitalization, in USD. */\n marketCap: bigint | null;\n /** Trailing 24-hour trading volume, in USD. */\n vol24h: bigint | null;\n /** Total value locked in the market's pool, in USD. */\n tvl: bigint | null;\n /** Notional the solver will still take on this market, in USD. */\n liquidity: bigint | null;\n /** Notional currently open on this market, in USD. */\n openInterest: bigint | null;\n /** LP rewards accrued over the trailing 24 hours, in USD. */\n reward24h: bigint | null;\n /** Headline APR: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n apr: bigint | null;\n /**\n * APR broken out per trailing window, same units as {@link ListingMarket.apr}.\n * There is no lifetime APR — use {@link ListingMarket.apr} for the headline.\n */\n aprByWindow: ListingTrailingWindows;\n /** APY attributed to TVL growth, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n priceDrivenApy: ListingApyWindows;\n /** When the market went live, as a Unix timestamp in **seconds**. `null` before it is listed. */\n listingTime: number | null;\n /** Where the market sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /**\n * Whether the inventory service currently has this market's pool locked\n * against new deposits. Only deposits are blocked; trading, withdrawals and\n * every other flow stay available. Independent of\n * {@link ListingMarket.marketStatus}: a `LISTED` market can be locked. The row\n * carries only the flag; the reasons are on\n * {@link ListingMarketDetail.lockReasons}.\n */\n isLocked: boolean;\n}\n\n/** One page of {@link ListingMarket} rows, with the totals needed to paginate. */\nexport interface ListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: ListingMarket[];\n}\n\n/**\n * A {@link ListingMarket} enriched with the signed-in user's position in it — one\n * row of \"Your Pools\", the markets that generated a deposit address for the user.\n */\nexport interface UserListingMarket extends ListingMarket {\n /** The user's current deposit into this pool, in USD (18-dec bigint). `null` when the deposit address exists but nothing has been deposited yet. */\n userDeposit: bigint | null;\n /** The user's share of the pool, as a percentage number (not 18-dec scaled). */\n userSharePercentage: number;\n /** The user's accrued revenue from this pool, in USD (18-dec bigint), or `null` when absent. */\n userRevenue: bigint | null;\n}\n\n/** One page of {@link UserListingMarket} rows, with the totals needed to paginate. */\nexport interface UserListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: UserListingMarket[];\n}\n\n/**\n * The signed-in user's LP position and profit in a single pool — the authed\n * per-token read behind a pool's \"your position\" panel.\n *\n * Every field is a `bigint` at {@link LISTING_VALUE_DECIMALS} (18), independent\n * of the token's or collateral's own decimals; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge. An absent\n * figure is normalized to `0n`, not `null`.\n */\nexport interface UserPoolProfit {\n /** LP balance valued in the pool's token units, 18-dec bigint. */\n userBalanceInTokens: bigint;\n /** LP balance valued in USDC, 18-dec bigint USD. */\n userBalanceInUsdc: bigint;\n /** Rewards the user can claim now, 18-dec bigint USD. */\n claimableReward: bigint;\n /** Rewards already claimed, 18-dec bigint USD. */\n claimedReward: bigint;\n /** Token amount the user deposited, 18-dec bigint. */\n userDepositedTokenAmount: bigint;\n /** The user's LP shares, 18-dec bigint. */\n userLpAmount: bigint;\n /** LP shares queued for withdrawal (the pending-withdrawal amount), 18-dec bigint. */\n pendingWithdrawLpAmount: bigint;\n /**\n * LP shares free to withdraw right now — `userLpAmount − pendingWithdrawLpAmount`,\n * floored at `0n`. This is the ceiling a withdrawal (`withdrawLp`) may request;\n * the shares already counted in {@link UserPoolProfit.pendingWithdrawLpAmount}\n * are spoken for. Derived by the SDK, not a field the service returns. 18-dec\n * bigint.\n */\n availableLpAmount: bigint;\n}\n\n/**\n * The receipt returned by `claimProfit` — the outcome of a `/v2/claim` request.\n *\n * The claim is synchronous: a `200` means the USDC was moved to the target\n * sub-account. `amountClaimed` is the moved figure normalized to a `bigint` at\n * `LISTING_VALUE_DECIMALS` (18), `claimRequestId` references the claim in the\n * service, and `transactionHash` is the on-chain transfer hash when the service\n * has one (`null` otherwise).\n */\nexport interface PoolClaimResult {\n /** The service's status string, e.g. `\"ok\"`. */\n status: string;\n /** USDC moved to the sub-account, 18-dec bigint USD. */\n amountClaimed: bigint;\n /** Claim id — reference it to restore or look up the claim later. */\n claimRequestId: string;\n /** On-chain hash of the claim transfer, or `null` when the service has none yet. */\n transactionHash: string | null;\n}\n\n/**\n * One past pool-reward claim, from the user's claim history (`getClaimHistory`).\n *\n * The internal `wallet_id` / `market_id` UUIDs the service carries are dropped —\n * they address rows in the backend, not anything a consumer renders.\n */\nexport interface PoolClaim {\n /** Claim id — reference it to look the claim up in the service. */\n claimRequestId: string;\n /** Sub-account address that received the claimed USDC. */\n accountAddress: string;\n /** USDC claimed, 18-dec bigint USD. */\n amount: bigint;\n /** On-chain hash of the claim transfer, or `null` when the service has none. */\n transactionHash: string | null;\n /** When the claim was created, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolClaim} rows — the signed-in user's claim history. */\nexport interface PoolClaimHistoryPage {\n /** Total claims matching the query across all pages — what a pager divides. */\n count: number;\n /** The claims themselves, newest first. */\n items: PoolClaim[];\n}\n\n/**\n * The receipt returned by `cancelWithdraw` — the outcome of cancelling a queued\n * LP withdrawal.\n */\nexport interface PoolCancelWithdrawResult {\n /** The affected withdrawal's transaction id, echoed by the service. */\n transactionId: string;\n /**\n * The withdrawal's resulting status, e.g. `\"canceled\"`. Carried through as the\n * service's raw string — its enum (`canceled` | `pending` | `transferred` | …)\n * is a superset of {@link PoolTransactionStatus}, so it is not narrowed to it.\n */\n status: string;\n}\n\n/**\n * The receipt returned by `refundMarket` — the outcome of refunding a deposit on\n * a rejected market.\n */\nexport interface PoolRefundResult {\n /** On-chain hash of the refund transfer. */\n transactionHash: string;\n}\n\n/**\n * The signed-in user's **retry allowance** for one rejected market\n * (`getRetryListingInfo`) — how many listing retries remain and the cooldown\n * before the next.\n */\nexport interface RetryListingInfo {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries the user has left for this market. */\n remainingRetries: number;\n /** Seconds until the next retry is allowed, or `null` when no cooldown is in effect. */\n remainingCooldownSeconds: number | null;\n}\n\n/**\n * The result of `retryListing` — the retry allowance left after re-submitting a\n * rejected market.\n */\nexport interface RetryListingResult {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries left after this one. */\n remainingRetries: number;\n /** Seconds before the next retry is allowed. */\n cooldownSeconds: number;\n}\n\n/**\n * The signed-in user's deposit wallet for one market — the get-or-create result\n * of the authed `/v2/market/deposit-address` endpoint. This is the address the\n * user sends funds to in order to deposit into the market's pool.\n */\nexport interface MarketDepositAddress {\n /** The market's token contract address (EVM 0x… or Solana base58). */\n tokenContractAddress: string;\n /** The signed-in user this deposit wallet belongs to. */\n userAddress: string;\n /** The market's deposit chain. */\n depositChain: ListingDepositChainId;\n /** The deposit address — where the user sends funds to deposit into this market. `null` when the service returned none. */\n depositAddress: string | null;\n /** The token's on-chain decimals. */\n tokenDecimal: number;\n /** The market's listing lifecycle status. */\n marketStatus: ListingMarketStatus;\n}\n\n/**\n * The listing-pipeline status of a single market — the normalized result of\n * `getListingStatus`, keyed by the market's token address and deposit chain.\n *\n * `marketStatus` is the overall lifecycle status (the same machine as\n * {@link ListingMarketStatus}); the remaining fields describe where the listing\n * is in the backend's step pipeline and whether the current step is retrying or\n * has errored.\n */\nexport interface ListingStatus {\n /** Overall lifecycle status of the market, mapped from the service's `market_status`. */\n marketStatus: ListingMarketStatus;\n /** The step the listing pipeline is currently on, or `null` when it is not in a step. */\n currentStep: string | null;\n /** The ordered pipeline steps the listing moves through. */\n steps: string[];\n /** Error code reported for the current step, or `null` when there is no error. */\n errorCode: number | null;\n /** Human-readable detail for the current step's error, or `null`. */\n errorDetail: string | null;\n /** How many times the current step has been retried. */\n retryCount: number;\n /** The maximum retries allowed for the current step. */\n retryLimit: number;\n}\n\n/**\n * The protocol's global new-market listing cap for the current rolling weekly\n * window — how many pools may still be listed across the protocol before the\n * window resets.\n */\nexport interface WeeklyListingLimit {\n /** Total new-market listings allowed per rolling weekly window. */\n limit: number;\n /** Listings still available in the current window — `0` means no more pools can be listed until reset. */\n remaining: number;\n /** When the window resets, as the Unix timestamp the service returns (`reset_at`). */\n resetAt: number;\n}\n\n/**\n * Server-side sort keys accepted by `getListingMarkets`.\n *\n * Mirrors the service's `sort_by` enum verbatim — snake_case, not the SDK's\n * camelCase field names — because the value is a wire literal, and translating\n * it would break silently the moment the service adds a key.\n *\n * Note the two bare keys: `tvl_driven_apy` and `price_driven_apy` have no\n * matching bare response field. They sort by the **lifetime** column\n * (`tvl_driven_apy_lifetime` / `price_driven_apy_lifetime`).\n */\nexport type ListingMarketSortField =\n | \"liquidity\"\n | \"tvl\"\n | \"market_cap\"\n | \"vol24h\"\n | \"open_interest\"\n | \"apr_1h\"\n | \"apr_6h\"\n | \"apr_24h\"\n | \"apr_30d\"\n | \"reward_24h\"\n | \"apr\"\n | \"tvl_driven_apy_1h\"\n | \"tvl_driven_apy_6h\"\n | \"tvl_driven_apy_24h\"\n | \"tvl_driven_apy_30d\"\n | \"tvl_driven_apy\"\n | \"price_driven_apy_1h\"\n | \"price_driven_apy_6h\"\n | \"price_driven_apy_24h\"\n | \"price_driven_apy_30d\"\n | \"price_driven_apy\"\n | \"listing_time\";\n\n/** Sort direction. */\nexport type ListingSortDirection = \"asc\" | \"desc\";\n\n/**\n * An inclusive `[min, max]` bound on one of the service's value fields. Either\n * end may be omitted for a one-sided bound.\n *\n * Bounds use the **same 18-decimal scale as the response**\n * ({@link LISTING_VALUE_DECIMALS}), not the human-readable figure. Filtering for\n * \"market cap of at least one million USD\" is\n * `{ min: parseUnits(\"1000000\", LISTING_VALUE_DECIMALS) }`, not `{ min: 1_000_000 }`\n * — the latter is a bound of `0.000000000001` USD and silently matches nothing\n * useful. Verified against the live service.\n */\nexport interface ListingValueRange {\n /** Inclusive lower bound at 18 decimals (`__ge` on the wire). */\n min?: bigint;\n /** Inclusive upper bound at 18 decimals (`__le` on the wire). */\n max?: bigint;\n}\n\n/**\n * An inclusive `[min, max]` bound on a timestamp field, in Unix **seconds**\n * (not milliseconds, and not 18-decimal scaled).\n */\nexport interface ListingTimeRange {\n /** Inclusive lower bound, Unix seconds (`__ge` on the wire). */\n min?: number;\n /** Inclusive upper bound, Unix seconds (`__le` on the wire). */\n max?: number;\n}\n\n/**\n * Range filters `getListingMarkets` accepts. Every key is optional; omitted keys\n * are not sent.\n *\n * All {@link ListingValueRange} bounds are at {@link LISTING_VALUE_DECIMALS};\n * `listingTime` is the one exception and takes Unix seconds.\n */\nexport interface ListingMarketFilters {\n /** Token market capitalization, USD. */\n marketCap?: ListingValueRange;\n /** Trailing 24-hour volume, USD. */\n vol24h?: ListingValueRange;\n /** Total value locked, USD. */\n tvl?: ListingValueRange;\n /** Available notional, USD. */\n liquidity?: ListingValueRange;\n /** Open notional, USD. */\n openInterest?: ListingValueRange;\n /** Trailing 24-hour LP rewards, USD. */\n reward24h?: ListingValueRange;\n /** Headline APR bounds, at the field's own scale (`1e18` = `1%`). */\n apr?: ListingValueRange;\n /** APR over the trailing hour. */\n apr1h?: ListingValueRange;\n /** APR over the trailing 6 hours. */\n apr6h?: ListingValueRange;\n /** APR over the trailing 24 hours. */\n apr24h?: ListingValueRange;\n /** APR over the trailing 30 days. */\n apr30d?: ListingValueRange;\n /** TVL-driven APY over the trailing hour. */\n tvlDrivenApy1h?: ListingValueRange;\n /** TVL-driven APY over the trailing 6 hours. */\n tvlDrivenApy6h?: ListingValueRange;\n /** TVL-driven APY over the trailing 24 hours. */\n tvlDrivenApy24h?: ListingValueRange;\n /** TVL-driven APY over the trailing 30 days. */\n tvlDrivenApy30d?: ListingValueRange;\n /** TVL-driven APY over the market's lifetime. */\n tvlDrivenApy?: ListingValueRange;\n /** Price-driven APY over the trailing hour. */\n priceDrivenApy1h?: ListingValueRange;\n /** Price-driven APY over the trailing 6 hours. */\n priceDrivenApy6h?: ListingValueRange;\n /** Price-driven APY over the trailing 24 hours. */\n priceDrivenApy24h?: ListingValueRange;\n /** Price-driven APY over the trailing 30 days. */\n priceDrivenApy30d?: ListingValueRange;\n /** Price-driven APY over the market's lifetime. */\n priceDrivenApy?: ListingValueRange;\n /** Listing timestamp bounds, Unix seconds. */\n listingTime?: ListingTimeRange;\n}\n\n/**\n * Which side of the pool's book a {@link PoolPosition} row describes.\n *\n * The pool's inventory is reported as two aggregates, not a list of individual\n * trades — the detail read gives one long total and one short total.\n */\nexport enum PoolPositionSide {\n LONG = \"long\",\n SHORT = \"short\",\n}\n\n/**\n * One side of a pool's aggregate position book.\n *\n * Every figure is a `bigint` at {@link LISTING_VALUE_DECIMALS}. `upnl` is signed\n * — a losing side reports a negative value — and is the only field here that\n * routinely is.\n */\nexport interface PoolPosition {\n /** Which side this row aggregates. */\n side: PoolPositionSide;\n /** Total size held on this side, in the pool token's units. */\n size: bigint;\n /** Notional value of the side, in USD. */\n value: bigint;\n /** Size-weighted average open price of the side, in USD. */\n avgOpenPrice: bigint;\n /** Unrealized PnL of the side, in USD. Signed. */\n upnl: bigint;\n}\n\n/**\n * A pool's public detail — the aggregate stats and inventory position behind a\n * pool page.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; recall\n * that a descaled *rate* is already a percentage (`1e18` = `1%`) while a\n * descaled *money* field is USD (`1e18` = `$1`). `null` means the backend\n * reported no value, which is not zero.\n *\n * A **delisted** pool is a documented special case: the backend returns cached\n * remaining token and USDC balances with `tvl` fixed at zero.\n */\nexport interface ListingMarketDetail {\n /** The pool's token contract address — its id in the listing API. */\n tokenContractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n depositChain: ListingDepositChainId;\n /** Token display name. */\n tokenName: string;\n /** Token ticker, or `null` when the backend has none. */\n tokenTicker: string | null;\n /** Token decimals. */\n tokenDecimal: number;\n /** Solver market id, or `null` when the pool is not tradable yet. */\n symbolId: number | null;\n /** Where the pool sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /**\n * Whether the inventory service currently has this pool locked against new\n * deposits. Only deposits are blocked; trading, withdrawals and every other\n * flow stay available. Independent of {@link ListingMarketDetail.marketStatus}.\n * `false` when the backend reports no lock state, as it does for a delisted\n * pool.\n */\n isLocked: boolean;\n /**\n * Why the pool is locked, one entry per active reason; empty when it is not\n * locked. A reason this SDK release does not recognize arrives as\n * {@link MarketLockReason.UNKNOWN}.\n */\n lockReasons: MarketLockReason[];\n /** Maximum leverage the market allows, as a whole multiplier. */\n maxLeverage: number;\n /** Share of revenue routed to token buybacks, as a percentage (`50` = 50%). */\n buybackRatio: number;\n /** When the market went live, as a Unix timestamp in **seconds**. */\n listingTime: number | null;\n /** Pool age in **seconds**, or `null` before listing. */\n age: number | null;\n /** Number of distinct LPs in the pool. */\n activeLps: number;\n /** Total value locked in the pool, USD. `0` for a delisted pool by design. */\n tvl: bigint | null;\n /** Collateral held by the pool, USD. */\n totalUsdcInPool: bigint;\n /** Pool token held by the pool, in the token's own units. */\n totalTokenInPool: bigint;\n /** Accrued maintenance fees, USD. */\n maintenanceFees: bigint;\n /** LP rewards per window, USD. */\n rewards: ListingApyWindows;\n /** Solver revenue per window, USD. */\n solverRevenue: ListingApyWindows;\n /** Headline APY per window, as a percentage. */\n apy: ListingApyWindows;\n /** APY attributed to TVL growth, per window, as a percentage. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window, as a percentage. */\n priceDrivenApy: ListingApyWindows;\n /** The pool's aggregate long side, or `null` when the backend reported none. */\n longPosition: PoolPosition | null;\n /** The pool's aggregate short side, or `null` when the backend reported none. */\n shortPosition: PoolPosition | null;\n}\n\n/** Whether a pool transaction is money going in or coming out. */\nexport enum PoolTransactionType {\n DEPOSIT = \"deposit\",\n WITHDRAW = \"withdraw\",\n}\n\n/**\n * Where a pool transaction sits in its lifecycle, as the backend reports it to\n * users.\n */\nexport enum PoolTransactionStatus {\n PENDING = \"pending\",\n SUCCESS = \"success\",\n REJECTED = \"rejected\",\n REFUND = \"refund\",\n CANCELED = \"canceled\",\n}\n\n/**\n * One deposit or withdrawal against a pool.\n *\n * `amount`, `usdcAmount` and `tokenAmount` are `bigint` at\n * {@link LISTING_VALUE_DECIMALS}. The refund fields are populated only for a\n * refunded row.\n */\nexport interface PoolTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** The wallet that made it. */\n walletAddress: string;\n /** Amount moved, in the transaction's own denomination. */\n amount: bigint;\n /** Collateral value moved, USD. */\n usdcAmount: bigint;\n /** Token amount moved, in the pool token's units. */\n tokenAmount: bigint;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** Hash of the refund transaction, or `null` when this is not a refund. */\n refundTransactionHash: string | null;\n /** When the refund completed, Unix **seconds**; `null` when not a refund. */\n refundTime: number | null;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** When the transaction happened, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolTransaction} rows for a pool. */\nexport interface PoolTransactionPage {\n /** The pool's token contract address, echoed by the backend, or `null` when the history was not scoped to one pool. */\n marketAddress: string | null;\n /** Total rows matching the query across all pages. */\n count: number;\n /** The rows themselves. */\n items: PoolTransaction[];\n}\n\n/**\n * One row of the signed-in user's transaction history (`getUserTransactions`) —\n * a deposit or withdrawal they made, on any pool.\n *\n * Unlike {@link PoolTransaction} (one pool, every LP), this is one user, every\n * pool — so each row carries its own token identity (`tokenAddress`,\n * `tokenName`, `tokenTicker`, `tokenDecimals`, `chainId`).\n */\nexport interface UserTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** Amount moved, 18-dec bigint (a 1e18-scaled figure, like every listing value). */\n amount: bigint;\n /** The token's own decimals, as reported by the service — metadata, not the `amount` scale. */\n tokenDecimals: number;\n /** The pool's token contract address (EVM `0x…` or Solana base58). */\n tokenAddress: string;\n /** The token's name. */\n tokenName: string;\n /** The token's ticker. */\n tokenTicker: string;\n /** The chain the transaction's token lives on. */\n chainId: ListingDepositChainId;\n /** The temporary deposit wallet involved, or `null` when the service omits it. */\n wallet: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** When the transaction happened, Unix **seconds**; `null` when the service omits it. */\n time: number | null;\n}\n\n/** One page of {@link UserTransaction} rows — the signed-in user's transaction history. */\nexport interface UserTransactionPage {\n /** Total rows matching the query across all pages — what a pager divides. */\n count: number;\n /** The rows themselves, newest first. */\n items: UserTransaction[];\n}\n\n/**\n * The generated `MarketStatus` enum and {@link ListingMarketStatus} carry the\n * same string values; this alias documents that the cast in the mapper is\n * value-preserving rather than a widening.\n *\n * @internal\n */\nexport type GeneratedMarketStatus = MarketStatus;\n\n/**\n * One deposit chain a new listing may use, from the listing service's public\n * config ({@link ListingConfig.supportedDepositChains}).\n */\nexport interface ListingDepositChain {\n /** Numeric chain id to send with market/deposit requests. */\n chainId: ListingDepositChainId;\n /** Human-readable chain name, e.g. \"HyperEVM\". */\n chainName: string;\n}\n\n/**\n * The client mutation limits the listing service enforces, from its public\n * config ({@link ListingConfig.rateLimits}).\n */\nexport interface ListingRateLimits {\n /** Max successful market-config updates per user+market in a rolling 24h window. */\n marketConfigUpdatesPerDay: number;\n /** Max successful profit claims per user+market in a rolling 24h window. */\n profitClaimsPerDay: number;\n}\n\n/**\n * The listing service's public client configuration — the deposit guidance,\n * listing fee, supported deposit chains, rate limits, and protocol reward share\n * a create-listing flow needs.\n *\n * The three USDC figures are `bigint` at {@link LISTING_VALUE_DECIMALS} (18),\n * independent of the collateral token's own decimals; format them with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge.\n */\nexport interface ListingConfig {\n /** Recommended initial USDC deposit to start a listing, USD at LISTING_VALUE_DECIMALS (18) as a bigint. */\n recommendedInitialDepositUsdc: bigint;\n /** Minimum accepted initial USDC deposit after slippage, USD 18-dec bigint. */\n minimumInitialDepositUsdc: bigint;\n /** Listing fee in USDC, USD 18-dec bigint. */\n listingFeeUsdc: bigint;\n /** Deposit chains new markets may use — the source of truth for a chain picker. */\n supportedDepositChains: ListingDepositChain[];\n /** Rolling-24h client mutation limits. */\n rateLimits: ListingRateLimits;\n /** Whole-percent of market revenue to the protocol before buyback/LP. */\n protocolRewardSharePercent: number;\n}\n\n/**\n * One quote in a pool's book, decoded from the analytics subgraph.\n *\n * A pool's book is **every trader's** quotes on that market, not one account's —\n * `partyA` differs from row to row. Amounts and prices are `bigint` at 18\n * decimals (the protocol's own scale, not the listing backend's), and `null`\n * means the subgraph had no value for that field.\n */\nexport interface PoolQuote {\n /** Subgraph row id (`{quoteId}-{source}`); stable, use as a table key. */\n id: string;\n /** Protocol quote id. */\n quoteId: bigint;\n /** Raw `QuoteStatus` ordinal as the subgraph reports it. */\n quoteStatus: number | null;\n /** Raw `PositionType` ordinal — `0` long, `1` short. */\n positionType: number | null;\n /** Raw `OrderType` ordinal of the open — `0` limit, `1` market. */\n orderTypeOpen: number | null;\n /** Market ticker, when the subgraph carries one. */\n symbol: string | null;\n /** Solver market id. */\n symbolId: number | null;\n /** The account that opened the quote. */\n partyA: string;\n /** The solver that took the other side. */\n partyB: string | null;\n /** Quote size. */\n quantity: bigint | null;\n /** How much of {@link PoolQuote.quantity} has been closed. */\n closedAmount: bigint | null;\n /** Size of an in-flight close request. */\n quantityToClose: bigint | null;\n /** Price the quote actually opened at. */\n openedPrice: bigint | null;\n /** Price the opener asked for. */\n requestedOpenPrice: bigint | null;\n /** Size-weighted average of the closes so far. */\n averageClosedPrice: bigint | null;\n /** Price of an in-flight close request. */\n closePrice: bigint | null;\n /** Open price before any modification. */\n initialOpenedPrice: bigint | null;\n /** Size liquidated, when the quote was liquidated. */\n liquidateAmount: bigint | null;\n /** Price the liquidation executed at. */\n liquidatePrice: bigint | null;\n /** Block timestamp of the quote's last update, Unix **seconds**. */\n timestamp: number;\n /** Block the quote was last updated in. */\n blockNumber: bigint;\n}\n\n/**\n * One day of LP reward for a pool.\n *\n * A series of these is what a pool page's rewards chart plots — the public\n * per-pool series from `getPoolRewardChart`, or one market's slice of the\n * signed-in user's {@link UserPoolRewardChart}.\n */\nexport interface PoolRewardPoint {\n /** Start of the reward day, unix **seconds**. */\n timestamp: number;\n /**\n * Reward earned that day, `bigint` at {@link LISTING_VALUE_DECIMALS} (18).\n *\n * A **money** field, so the descaled number is a USD amount (`1e18` = `$1`) —\n * unlike the catalog's rate fields, which are already percentages. A day the\n * service reports as absent collapses to `0n` rather than `null`: a missing\n * snapshot and a zero-reward day are the same point on a chart.\n */\n reward: bigint;\n}\n\n/**\n * The signed-in user's daily reward series for **one** market, as returned by\n * `getUserRewardChart` — which reports every market the user has rewards in,\n * one entry each.\n *\n * A market is addressed by the pair `(marketAddress, marketChainId)`, matching\n * {@link ListingMarket.contractAddress} and {@link ListingMarket.chainId}. Note\n * `marketChainId` is the chain the **token** lives on, not the SYMMIO chain the\n * market trades on.\n */\nexport interface UserPoolRewardChart {\n /** The pool's token contract address — matches {@link ListingMarket.contractAddress}. */\n marketAddress: string;\n /** Chain the token lives on — matches {@link ListingMarket.chainId}. */\n marketChainId: ListingDepositChainId;\n /** The user's daily rewards in this pool, in the order the service returns them. */\n rewards: PoolRewardPoint[];\n}\n"],"mappings":";AAmBA,IAAa,IAAyB,IAgB1B,IAAL,yBAAA,GAAA;QACL,EAAA,sBAAA,uBACA,EAAA,eAAA,gBACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAqBY,IAAL,yBAAA,GAAA;QACL,EAAA,qBAAA,sBACA,EAAA,UAAA,WACA,EAAA,oBAAA,qBACA,EAAA,gBAAA,iBACA,EAAA,SAAA,UACA,EAAA,UAAA;AACF,EAAA,CAAA,CAAA,GAcY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,SAAA,KAAA,UACA,EAAA,EAAA,MAAA,MAAA,OACA,EAAA,EAAA,OAAA,QAAA,QACA,EAAA,EAAA,QAAA,OAAA,SACA,EAAA,EAAA,eAAA,SAAA,gBACA,EAAA,EAAA,YAAA,OAAA;AACF,EAAA,CAAA,CAAA,GAycY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,QAAA;AACF,EAAA,CAAA,CAAA,GAkGY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAMY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,UAAA,WACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -38,8 +38,9 @@ export interface GetQuoteFundingReturnType {
|
|
|
38
38
|
* completeness rendered a wrong total.)
|
|
39
39
|
*
|
|
40
40
|
* The returned funding is what the analytics subgraph has **settled to date**:
|
|
41
|
-
* funding accrued since the quote's last funding charge is not indexed
|
|
42
|
-
* therefore not included
|
|
41
|
+
* funding accrued since the quote's last funding charge is not indexed by the
|
|
42
|
+
* subgraph and is therefore not included — read it with
|
|
43
|
+
* {@link getQuotePendingFunding}.
|
|
43
44
|
*
|
|
44
45
|
* Returns both the resolved rows and any input ids the subgraph did not yet
|
|
45
46
|
* surface — callers (typically the React layer) decide whether to refetch on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quote-funding.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-funding/get-quote-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAI/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,OAAO,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,gBAAgB,GAAG;IACjB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CACF,CAAC;AAEF,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,sEAAsE;IACtE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAcD
|
|
1
|
+
{"version":3,"file":"get-quote-funding.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-funding/get-quote-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAI/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,OAAO,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,gBAAgB,GAAG;IACjB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CACF,CAAC;AAEF,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,sEAAsE;IACtE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAmBpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quote-funding.js","names":[],"sources":["../../../src/quotes/get-quote-funding/get-quote-funding.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { QuotesFundingDocument } from \"./query-document\";\nimport { toQuoteFundingRow } from \"./to-funding-row\";\nimport type { QuoteFundingData } from \"./types\";\n\n/**\n * Maximum number of quote ids sent in one `QuotesFunding` request.\n *\n * The Graph caps a `first` argument at 1000 entities per query (and silently\n * defaults to 100 when `first` is omitted), so {@link getQuoteFunding} chunks\n * its input at this size and merges the responses. Exported so callers that\n * size their own batches (and tests) can reuse the exact ceiling.\n */\nexport const QUOTES_FUNDING_MAX_IDS_PER_REQUEST = 1000;\n\n/**\n * Parameters for {@link getQuoteFunding}.\n */\nexport type GetQuoteFundingParameters = Compute<\n ChainIdParameter & {\n /** On-chain quote ids to read. */\n quoteIds: readonly bigint[];\n }\n>;\n\n/** Return type of {@link getQuoteFunding}. */\nexport interface GetQuoteFundingReturnType {\n /** One row per quote id the subgraph returned. */\n rows: QuoteFundingData[];\n /** Subset of input ids the subgraph did not return (indexing lag). */\n missingQuoteIds: bigint[];\n}\n\n/**\n * Split an id list into request-sized batches of at most\n * {@link QUOTES_FUNDING_MAX_IDS_PER_REQUEST} ids, preserving input order.\n */\nfunction chunkQuoteIds(quoteIds: readonly bigint[]): bigint[][] {\n const batches: bigint[][] = [];\n for (let index = 0; index < quoteIds.length; index += QUOTES_FUNDING_MAX_IDS_PER_REQUEST) {\n batches.push(quoteIds.slice(index, index + QUOTES_FUNDING_MAX_IDS_PER_REQUEST));\n }\n return batches;\n}\n\n/**\n * Read funding totals (`userPaidFunding`, `userReceivedFunding`) for a batch of\n * quotes from the analytics subgraph. Filters by the protocol-level `quoteId`\n * scalar so callers never need the diamond address.\n *\n * The action **pages internally**: `quoteIds` is chunked into requests of at\n * most {@link QUOTES_FUNDING_MAX_IDS_PER_REQUEST} ids, issued concurrently, and\n * the responses are merged. Callers pass the full id list — however long — and\n * never need to chunk it themselves. (Without an explicit `first`, The Graph\n * caps a query at 100 entities, which silently truncated large batches; the\n * extras then surfaced as `missingQuoteIds` and any caller that ignored\n * completeness rendered a wrong total.)\n *\n * The returned funding is what the analytics subgraph has **settled to date**:\n * funding accrued since the quote's last funding charge is not indexed
|
|
1
|
+
{"version":3,"file":"get-quote-funding.js","names":[],"sources":["../../../src/quotes/get-quote-funding/get-quote-funding.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { QuotesFundingDocument } from \"./query-document\";\nimport { toQuoteFundingRow } from \"./to-funding-row\";\nimport type { QuoteFundingData } from \"./types\";\n\n/**\n * Maximum number of quote ids sent in one `QuotesFunding` request.\n *\n * The Graph caps a `first` argument at 1000 entities per query (and silently\n * defaults to 100 when `first` is omitted), so {@link getQuoteFunding} chunks\n * its input at this size and merges the responses. Exported so callers that\n * size their own batches (and tests) can reuse the exact ceiling.\n */\nexport const QUOTES_FUNDING_MAX_IDS_PER_REQUEST = 1000;\n\n/**\n * Parameters for {@link getQuoteFunding}.\n */\nexport type GetQuoteFundingParameters = Compute<\n ChainIdParameter & {\n /** On-chain quote ids to read. */\n quoteIds: readonly bigint[];\n }\n>;\n\n/** Return type of {@link getQuoteFunding}. */\nexport interface GetQuoteFundingReturnType {\n /** One row per quote id the subgraph returned. */\n rows: QuoteFundingData[];\n /** Subset of input ids the subgraph did not return (indexing lag). */\n missingQuoteIds: bigint[];\n}\n\n/**\n * Split an id list into request-sized batches of at most\n * {@link QUOTES_FUNDING_MAX_IDS_PER_REQUEST} ids, preserving input order.\n */\nfunction chunkQuoteIds(quoteIds: readonly bigint[]): bigint[][] {\n const batches: bigint[][] = [];\n for (let index = 0; index < quoteIds.length; index += QUOTES_FUNDING_MAX_IDS_PER_REQUEST) {\n batches.push(quoteIds.slice(index, index + QUOTES_FUNDING_MAX_IDS_PER_REQUEST));\n }\n return batches;\n}\n\n/**\n * Read funding totals (`userPaidFunding`, `userReceivedFunding`) for a batch of\n * quotes from the analytics subgraph. Filters by the protocol-level `quoteId`\n * scalar so callers never need the diamond address.\n *\n * The action **pages internally**: `quoteIds` is chunked into requests of at\n * most {@link QUOTES_FUNDING_MAX_IDS_PER_REQUEST} ids, issued concurrently, and\n * the responses are merged. Callers pass the full id list — however long — and\n * never need to chunk it themselves. (Without an explicit `first`, The Graph\n * caps a query at 100 entities, which silently truncated large batches; the\n * extras then surfaced as `missingQuoteIds` and any caller that ignored\n * completeness rendered a wrong total.)\n *\n * The returned funding is what the analytics subgraph has **settled to date**:\n * funding accrued since the quote's last funding charge is not indexed by the\n * subgraph and is therefore not included — read it with\n * {@link getQuotePendingFunding}.\n *\n * Returns both the resolved rows and any input ids the subgraph did not yet\n * surface — callers (typically the React layer) decide whether to refetch on\n * indexing lag.\n *\n * @param config - The SDK config.\n * @param parameters - Quote ids and optional chain id.\n * @returns Funding rows (merged across all internal requests) plus the input ids\n * the subgraph did not return, computed across the full input set.\n * @throws {SymmError} when the chain has no analytics subgraph.\n * @throws {SymmApiError} when any subgraph request fails.\n *\n * @example\n * ```ts\n * const { rows, missingQuoteIds } = await getQuoteFunding(config, { quoteIds: [7334n, 7335n] });\n * ```\n */\nexport async function getQuoteFunding(\n config: Config,\n parameters: GetQuoteFundingParameters,\n): Promise<GetQuoteFundingReturnType> {\n const { chainId, quoteIds } = parameters;\n\n if (quoteIds.length === 0) return { rows: [], missingQuoteIds: [] };\n\n const responses = await Promise.all(\n chunkQuoteIds(quoteIds).map((batch) =>\n querySubgraph(config, {\n chainId,\n document: QuotesFundingDocument,\n variables: { ids: batch.map((id) => id.toString()), first: QUOTES_FUNDING_MAX_IDS_PER_REQUEST },\n }),\n ),\n );\n\n const rows = responses.flatMap((data) => data.quotes.map(toQuoteFundingRow));\n const seen = new Set(rows.map((row) => row.quoteId));\n const missingQuoteIds = quoteIds.filter((id) => !seen.has(id));\n return { rows, missingQuoteIds };\n}\n"],"mappings":";;;;AAeA,IAAa,IAAqC;AAwBlD,SAAS,EAAc,GAAyC;CAC9D,IAAM,IAAsB,CAAC;CAC7B,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAS,QAAQ,KAAS,GACpD,EAAQ,KAAK,EAAS,MAAM,GAAO,IAAQ,CAAkC,CAAC;CAEhF,OAAO;AACT;AAoCA,eAAsB,EACpB,GACA,GACoC;CACpC,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,EAAS,WAAW,GAAG,OAAO;EAAE,MAAM,CAAC;EAAG,iBAAiB,CAAC;CAAE;CAYlE,IAAM,KAAO,MAVW,QAAQ,IAC9B,EAAc,CAAQ,EAAE,KAAK,MAC3B,EAAc,GAAQ;EACpB;EACA,UAAU;EACV,WAAW;GAAE,KAAK,EAAM,KAAK,MAAO,EAAG,SAAS,CAAC;GAAG,OAAO;EAAmC;CAChG,CAAC,CACH,CACF,GAEuB,SAAS,MAAS,EAAK,OAAO,IAAI,CAAiB,CAAC,GACrE,IAAO,IAAI,IAAI,EAAK,KAAK,MAAQ,EAAI,OAAO,CAAC;CAEnD,OAAO;EAAE;EAAM,iBADS,EAAS,QAAQ,MAAO,CAAC,EAAK,IAAI,CAAE,CAC7C;CAAgB;AACjC"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* All amount fields are 18-decimal-wei `bigint`. `netReceived = received − paid`
|
|
5
5
|
* — the P&L perspective every trading venue presents — so a positive value means
|
|
6
|
-
* the position has **earned** funding
|
|
7
|
-
* has **paid** for it.
|
|
6
|
+
* the position has **earned** funding **to date** and a negative value means it
|
|
7
|
+
* has **paid** for it. These are the amounts the subgraph has indexed: funding
|
|
8
|
+
* accrued since the last charge is read on-chain with
|
|
9
|
+
* {@link getQuotePendingFunding} and is not part of these totals.
|
|
8
10
|
*
|
|
9
11
|
* Note this is the inverse of the on-chain `int256`, which is cost-positive. The
|
|
10
12
|
* SDK nets it the way it is read, so consumers never negate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-funding/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-funding/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,kGAAkG;IAClG,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
3
|
+
import { QuotePendingFunding } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link getQuotePendingFunding}.
|
|
6
|
+
*/
|
|
7
|
+
export type GetQuotePendingFundingParameters = Compute<ChainIdParameter & {
|
|
8
|
+
/** Quote ids to read — active positions only (see {@link isActiveQuoteStatus}). Duplicates are read once. */
|
|
9
|
+
quoteIds: readonly bigint[];
|
|
10
|
+
/** Ids per `eth_call`. @default 25 */
|
|
11
|
+
batchSize?: number;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Return type of {@link getQuotePendingFunding}: one {@link QuotePendingFunding}
|
|
15
|
+
* row per distinct input id, sorted by `quoteId` ascending.
|
|
16
|
+
*/
|
|
17
|
+
export type GetQuotePendingFundingReturnType = readonly QuotePendingFunding[];
|
|
18
|
+
/**
|
|
19
|
+
* Read the **pending** (accrued, not yet settled) accumulated funding of a set
|
|
20
|
+
* of quotes from the SYMMIO core diamond.
|
|
21
|
+
*
|
|
22
|
+
* Wraps the diamond view `getQuoteFundingDebts` and **negates** it: the
|
|
23
|
+
* contract is cost-positive (`> 0` means partyA pays), while every SDK funding
|
|
24
|
+
* amount is income-positive, so `pendingNetReceived > 0n` means the position
|
|
25
|
+
* will receive funding and `< 0n` means it owes it.
|
|
26
|
+
*
|
|
27
|
+
* **What the value is.** Each row is exactly what the contract would settle if
|
|
28
|
+
* the quote were charged in the block the RPC ran the call against (its
|
|
29
|
+
* `latest`). It moves in whole-epoch steps
|
|
30
|
+
* (`currentEpoch = floor(block.timestamp / epochDuration)`) and also changes
|
|
31
|
+
* when the solver updates its rates or the quote is charged, partially closed
|
|
32
|
+
* or liquidated — so the amount eventually settled can differ. For a
|
|
33
|
+
* `LIQUIDATED_PENDING` quote treat it as an estimate only.
|
|
34
|
+
*
|
|
35
|
+
* **Pass active positions only.** The view does not check quote status. For a
|
|
36
|
+
* quote a solver locked but never opened (`LOCKED`, `CANCEL_PENDING`, or
|
|
37
|
+
* `CANCELED` / `EXPIRED` after a lock) it returns a meaningless, growing
|
|
38
|
+
* amount. Filter with {@link isActiveQuoteStatus} on a known on-chain status
|
|
39
|
+
* before calling.
|
|
40
|
+
*
|
|
41
|
+
* **Batching.** Ids are de-duplicated, sorted ascending and read in sequential
|
|
42
|
+
* batches of `batchSize` (default 25). Each batch is its own `eth_call` against
|
|
43
|
+
* the RPC's `latest` block, so with more than one batch the rows can come from
|
|
44
|
+
* adjacent blocks. An empty id list resolves to `[]` without any RPC call.
|
|
45
|
+
*
|
|
46
|
+
* **Settled vs pending.** Funding already charged is read from the analytics
|
|
47
|
+
* subgraph with {@link getQuoteFunding}. The two come from different sources at
|
|
48
|
+
* different heights — do not add them into a lifetime total.
|
|
49
|
+
*
|
|
50
|
+
* Behaves the same on v0.8.5 and v0.8.6 chains: the view's inputs and outputs
|
|
51
|
+
* are identical in both generations. One v0.8.5-only edge: with accumulated
|
|
52
|
+
* funding active, a quote whose legacy funding was prepaid into a later epoch
|
|
53
|
+
* makes the view revert, which fails that batch and therefore the whole read.
|
|
54
|
+
*
|
|
55
|
+
* @param config - The SDK config.
|
|
56
|
+
* @param parameters - Quote ids, optional chain id and batch size.
|
|
57
|
+
* @returns One row per distinct id, sorted by `quoteId` ascending.
|
|
58
|
+
* @throws {SymmError} when the chain is not supported, or `batchSize` is not a positive integer.
|
|
59
|
+
* @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const rows = await getQuotePendingFunding(config, { quoteIds: [7334n, 7335n] });
|
|
64
|
+
* const total = rows.reduce((sum, row) => sum + row.pendingNetReceived, 0n);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function getQuotePendingFunding(config: Config, parameters: GetQuotePendingFundingParameters): Promise<GetQuotePendingFundingReturnType>;
|
|
68
|
+
//# sourceMappingURL=get-quote-pending-funding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-quote-pending-funding.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-pending-funding/get-quote-pending-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAanD;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,OAAO,CACpD,gBAAgB,GAAG;IACjB,6GAA6G;IAC7G,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gCAAgC,GAAG,SAAS,mBAAmB,EAAE,CAAC;AAO9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,gCAAgC,GAC3C,OAAO,CAAC,gCAAgC,CAAC,CAkC3C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { symmioAbi as e } from "../../symmio-contracts/abi/v0.8.6/symmio.js";
|
|
2
|
+
import { SymmError as t } from "../../shared/errors/symm-error.js";
|
|
3
|
+
//#region src/quotes/get-quote-pending-funding/get-quote-pending-funding.ts
|
|
4
|
+
var n = 25;
|
|
5
|
+
function r(e, t) {
|
|
6
|
+
return e < t ? -1 : +(e > t);
|
|
7
|
+
}
|
|
8
|
+
async function i(i, a) {
|
|
9
|
+
let { chainId: o, quoteIds: s, batchSize: c = n } = a;
|
|
10
|
+
if (!Number.isInteger(c) || c < 1) throw new t("validation", "INVALID_BATCH_SIZE", `getQuotePendingFunding: \`batchSize\` must be a positive integer, got ${c}.`);
|
|
11
|
+
let l = [...new Set(s)].sort(r);
|
|
12
|
+
if (l.length === 0) return [];
|
|
13
|
+
let { addresses: u } = i.getChainConfig(o), d = i.getClient({ chainId: o }), f = [];
|
|
14
|
+
for (let t = 0; t < l.length; t += c) {
|
|
15
|
+
let n = l.slice(t, t + c), r = await d.readContract({
|
|
16
|
+
address: u.symmioAddress,
|
|
17
|
+
abi: e,
|
|
18
|
+
functionName: "getQuoteFundingDebts",
|
|
19
|
+
args: [n]
|
|
20
|
+
});
|
|
21
|
+
n.forEach((e, t) => {
|
|
22
|
+
let n = r[t];
|
|
23
|
+
n !== void 0 && f.push({
|
|
24
|
+
quoteId: e,
|
|
25
|
+
pendingNetReceived: -n
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return f;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { i as getQuotePendingFunding };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=get-quote-pending-funding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-quote-pending-funding.js","names":[],"sources":["../../../src/quotes/get-quote-pending-funding/get-quote-pending-funding.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { symmioAbi } from \"../../symmio-contracts/abi/v0.8.6/symmio\";\nimport type { QuotePendingFunding } from \"./types\";\n\n/**\n * Default number of quote ids sent in one `getQuoteFundingDebts` `eth_call`.\n *\n * The view costs about 21k gas per id when the id's (symbol, partyB) funding\n * state is already warm, and about 40k for the first id on each pair. 25 ids\n * therefore stay near 1M gas even in the worst case (every id on a different\n * pair). HyperEVM's small blocks are 3M gas and its `eth_call` gas cap is not\n * documented, so the SDK keeps each call well under that budget.\n */\nconst DEFAULT_BATCH_SIZE = 25;\n\n/**\n * Parameters for {@link getQuotePendingFunding}.\n */\nexport type GetQuotePendingFundingParameters = Compute<\n ChainIdParameter & {\n /** Quote ids to read — active positions only (see {@link isActiveQuoteStatus}). Duplicates are read once. */\n quoteIds: readonly bigint[];\n /** Ids per `eth_call`. @default 25 */\n batchSize?: number;\n }\n>;\n\n/**\n * Return type of {@link getQuotePendingFunding}: one {@link QuotePendingFunding}\n * row per distinct input id, sorted by `quoteId` ascending.\n */\nexport type GetQuotePendingFundingReturnType = readonly QuotePendingFunding[];\n\n/** Ascending `bigint` comparator for `Array.prototype.sort`. */\nfunction compareQuoteIds(a: bigint, b: bigint): number {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * Read the **pending** (accrued, not yet settled) accumulated funding of a set\n * of quotes from the SYMMIO core diamond.\n *\n * Wraps the diamond view `getQuoteFundingDebts` and **negates** it: the\n * contract is cost-positive (`> 0` means partyA pays), while every SDK funding\n * amount is income-positive, so `pendingNetReceived > 0n` means the position\n * will receive funding and `< 0n` means it owes it.\n *\n * **What the value is.** Each row is exactly what the contract would settle if\n * the quote were charged in the block the RPC ran the call against (its\n * `latest`). It moves in whole-epoch steps\n * (`currentEpoch = floor(block.timestamp / epochDuration)`) and also changes\n * when the solver updates its rates or the quote is charged, partially closed\n * or liquidated — so the amount eventually settled can differ. For a\n * `LIQUIDATED_PENDING` quote treat it as an estimate only.\n *\n * **Pass active positions only.** The view does not check quote status. For a\n * quote a solver locked but never opened (`LOCKED`, `CANCEL_PENDING`, or\n * `CANCELED` / `EXPIRED` after a lock) it returns a meaningless, growing\n * amount. Filter with {@link isActiveQuoteStatus} on a known on-chain status\n * before calling.\n *\n * **Batching.** Ids are de-duplicated, sorted ascending and read in sequential\n * batches of `batchSize` (default 25). Each batch is its own `eth_call` against\n * the RPC's `latest` block, so with more than one batch the rows can come from\n * adjacent blocks. An empty id list resolves to `[]` without any RPC call.\n *\n * **Settled vs pending.** Funding already charged is read from the analytics\n * subgraph with {@link getQuoteFunding}. The two come from different sources at\n * different heights — do not add them into a lifetime total.\n *\n * Behaves the same on v0.8.5 and v0.8.6 chains: the view's inputs and outputs\n * are identical in both generations. One v0.8.5-only edge: with accumulated\n * funding active, a quote whose legacy funding was prepaid into a later epoch\n * makes the view revert, which fails that batch and therefore the whole read.\n *\n * @param config - The SDK config.\n * @param parameters - Quote ids, optional chain id and batch size.\n * @returns One row per distinct id, sorted by `quoteId` ascending.\n * @throws {SymmError} when the chain is not supported, or `batchSize` is not a positive integer.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const rows = await getQuotePendingFunding(config, { quoteIds: [7334n, 7335n] });\n * const total = rows.reduce((sum, row) => sum + row.pendingNetReceived, 0n);\n * ```\n */\nexport async function getQuotePendingFunding(\n config: Config,\n parameters: GetQuotePendingFundingParameters,\n): Promise<GetQuotePendingFundingReturnType> {\n const { chainId, quoteIds, batchSize = DEFAULT_BATCH_SIZE } = parameters;\n\n if (!Number.isInteger(batchSize) || batchSize < 1) {\n throw new SymmError(\n \"validation\",\n \"INVALID_BATCH_SIZE\",\n `getQuotePendingFunding: \\`batchSize\\` must be a positive integer, got ${batchSize}.`,\n );\n }\n\n const ids = [...new Set(quoteIds)].sort(compareQuoteIds);\n if (ids.length === 0) return [];\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const rows: QuotePendingFunding[] = [];\n for (let start = 0; start < ids.length; start += batchSize) {\n const batch = ids.slice(start, start + batchSize);\n const debts = await client.readContract({\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"getQuoteFundingDebts\",\n args: [batch],\n });\n batch.forEach((quoteId, index) => {\n const debt = debts[index];\n /** The view returns exactly one debt per id; the guard only satisfies the index type. */\n if (debt !== undefined) rows.push({ quoteId, pendingNetReceived: -debt });\n });\n }\n\n return rows;\n}\n"],"mappings":";;;AAeA,IAAM,IAAqB;AAqB3B,SAAS,EAAgB,GAAW,GAAmB;CACrD,OAAO,IAAI,IAAI,KAAK,MAAI;AAC1B;AAmDA,eAAsB,EACpB,GACA,GAC2C;CAC3C,IAAM,EAAE,YAAS,aAAU,eAAY,MAAuB;CAE9D,IAAI,CAAC,OAAO,UAAU,CAAS,KAAK,IAAY,GAC9C,MAAM,IAAI,EACR,cACA,sBACA,yEAAyE,EAAU,EACrF;CAGF,IAAM,IAAM,CAAC,GAAG,IAAI,IAAI,CAAQ,CAAC,EAAE,KAAK,CAAe;CACvD,IAAI,EAAI,WAAW,GAAG,OAAO,CAAC;CAE9B,IAAM,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAS,EAAO,UAAU,EAAE,WAAQ,CAAC,GAErC,IAA8B,CAAC;CACrC,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAI,QAAQ,KAAS,GAAW;EAC1D,IAAM,IAAQ,EAAI,MAAM,GAAO,IAAQ,CAAS,GAC1C,IAAQ,MAAM,EAAO,aAAa;GACtC,SAAS,EAAU;GACnB,KAAK;GACL,cAAc;GACd,MAAM,CAAC,CAAK;EACd,CAAC;EACD,EAAM,SAAS,GAAS,MAAU;GAChC,IAAM,IAAO,EAAM;GAEnB,AAAI,MAAS,KAAA,KAAW,EAAK,KAAK;IAAE;IAAS,oBAAoB,CAAC;GAAK,CAAC;EAC1E,CAAC;CACH;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-pending-funding/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter, ExactPartial } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetQuotePendingFundingParameters, GetQuotePendingFundingReturnType } from './get-quote-pending-funding.js';
|
|
5
|
+
/** Data resolved by the {@link getQuotePendingFundingQueryOptions} query. */
|
|
6
|
+
export type GetQuotePendingFundingData = GetQuotePendingFundingReturnType;
|
|
7
|
+
/**
|
|
8
|
+
* Build the TanStack Query key for {@link getQuotePendingFundingQueryOptions}.
|
|
9
|
+
*
|
|
10
|
+
* Accepts a partial scope so `predicateMatch(getQuotePendingFundingQueryKey, { configKey })`
|
|
11
|
+
* can match every pending-funding read of one chain scope. When `quoteIds` is
|
|
12
|
+
* present it is de-duplicated, sorted and stringified, so the same id set in any
|
|
13
|
+
* order (or with repeats) shares one cache entry — safe because each row
|
|
14
|
+
* carries its own `quoteId`.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Partial query parameters (quote ids, chain id, batch size, config key).
|
|
17
|
+
* @returns A stable, hashable query key.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* getQuotePendingFundingQueryKey({ quoteIds: [7335n, 7334n, 7334n] });
|
|
22
|
+
* // → ["getQuotePendingFunding", { quoteIds: ["7334", "7335"] }]
|
|
23
|
+
* getQuotePendingFundingQueryKey({ configKey });
|
|
24
|
+
* // → ["getQuotePendingFunding", { configKey }] — a scope, e.g. for `predicateMatch`
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function getQuotePendingFundingQueryKey(options?: Compute<ExactPartial<GetQuotePendingFundingParameters> & ConfigKeyParameter>): readonly ["getQuotePendingFunding", Record<string, unknown>];
|
|
28
|
+
/** Query-key type produced by {@link getQuotePendingFundingQueryKey}. */
|
|
29
|
+
export type GetQuotePendingFundingQueryKey = ReturnType<typeof getQuotePendingFundingQueryKey>;
|
|
30
|
+
/**
|
|
31
|
+
* Options accepted by {@link getQuotePendingFundingQueryOptions}: the action's
|
|
32
|
+
* parameters (`quoteIds` required) plus TanStack overrides.
|
|
33
|
+
*/
|
|
34
|
+
export type GetQuotePendingFundingOptions = Compute<GetQuotePendingFundingParameters & QueryParameter<GetQuotePendingFundingData, Error, GetQuotePendingFundingData, GetQuotePendingFundingQueryKey>>;
|
|
35
|
+
/** TanStack Query options returned by {@link getQuotePendingFundingQueryOptions}. */
|
|
36
|
+
export type GetQuotePendingFundingQueryOptions = SymmioQueryOptions<GetQuotePendingFundingData, Error, GetQuotePendingFundingData, GetQuotePendingFundingQueryKey>;
|
|
37
|
+
/**
|
|
38
|
+
* Build TanStack Query options for {@link getQuotePendingFunding}. The query is
|
|
39
|
+
* disabled until at least one `quoteId` is supplied. No polling is set — pass
|
|
40
|
+
* `query.refetchInterval` to keep the value fresh. An unsupported chain surfaces
|
|
41
|
+
* a {@link SymmError} from the query function (it is not silently disabled).
|
|
42
|
+
*
|
|
43
|
+
* @param config - The SDK config.
|
|
44
|
+
* @param options - Query parameters and TanStack overrides.
|
|
45
|
+
* @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* useQuery(
|
|
50
|
+
* getQuotePendingFundingQueryOptions(config, {
|
|
51
|
+
* quoteIds: [7334n, 7335n],
|
|
52
|
+
* query: { refetchInterval: 60_000 },
|
|
53
|
+
* }),
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function getQuotePendingFundingQueryOptions(config: Config, options: GetQuotePendingFundingOptions): GetQuotePendingFundingQueryOptions;
|
|
58
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-pending-funding/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnF,OAAO,EAEL,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AAErC,6EAA6E;AAC7E,MAAM,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,GAAG,kBAAkB,CAAM,gEAK3F;AAED,yEAAyE;AACzE,MAAM,MAAM,8BAA8B,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,gCAAgC,GAC9B,cAAc,CAAC,0BAA0B,EAAE,KAAK,EAAE,0BAA0B,EAAE,8BAA8B,CAAC,CAChH,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,kCAAkC,GAAG,kBAAkB,CACjE,0BAA0B,EAC1B,KAAK,EACL,0BAA0B,EAC1B,8BAA8B,CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,6BAA6B,GACrC,kCAAkC,CAepC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { toQuoteIdKeyPart as t } from "../quote-id-key-part.js";
|
|
3
|
+
import { getQuotePendingFunding as n } from "./get-quote-pending-funding.js";
|
|
4
|
+
//#region src/quotes/get-quote-pending-funding/query.ts
|
|
5
|
+
function r(n = {}) {
|
|
6
|
+
let r = e(n);
|
|
7
|
+
return n.quoteIds !== void 0 && (r.quoteIds = t([...new Set(n.quoteIds)])), ["getQuotePendingFunding", r];
|
|
8
|
+
}
|
|
9
|
+
function i(e, t) {
|
|
10
|
+
return {
|
|
11
|
+
...t.query,
|
|
12
|
+
queryKey: r({
|
|
13
|
+
...t,
|
|
14
|
+
configKey: e.getChainConfigKey(t.chainId)
|
|
15
|
+
}),
|
|
16
|
+
enabled: (t.query?.enabled ?? !0) && t.quoteIds.length > 0,
|
|
17
|
+
queryFn: () => n(e, {
|
|
18
|
+
chainId: t.chainId,
|
|
19
|
+
quoteIds: t.quoteIds,
|
|
20
|
+
batchSize: t.batchSize
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as getQuotePendingFundingQueryKey, i as getQuotePendingFundingQueryOptions };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/quotes/get-quote-pending-funding/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport { toQuoteIdKeyPart } from \"../quote-id-key-part\";\nimport {\n getQuotePendingFunding,\n type GetQuotePendingFundingParameters,\n type GetQuotePendingFundingReturnType,\n} from \"./get-quote-pending-funding\";\n\n/** Data resolved by the {@link getQuotePendingFundingQueryOptions} query. */\nexport type GetQuotePendingFundingData = GetQuotePendingFundingReturnType;\n\n/**\n * Build the TanStack Query key for {@link getQuotePendingFundingQueryOptions}.\n *\n * Accepts a partial scope so `predicateMatch(getQuotePendingFundingQueryKey, { configKey })`\n * can match every pending-funding read of one chain scope. When `quoteIds` is\n * present it is de-duplicated, sorted and stringified, so the same id set in any\n * order (or with repeats) shares one cache entry — safe because each row\n * carries its own `quoteId`.\n *\n * @param options - Partial query parameters (quote ids, chain id, batch size, config key).\n * @returns A stable, hashable query key.\n *\n * @example\n * ```ts\n * getQuotePendingFundingQueryKey({ quoteIds: [7335n, 7334n, 7334n] });\n * // → [\"getQuotePendingFunding\", { quoteIds: [\"7334\", \"7335\"] }]\n * getQuotePendingFundingQueryKey({ configKey });\n * // → [\"getQuotePendingFunding\", { configKey }] — a scope, e.g. for `predicateMatch`\n * ```\n */\nexport function getQuotePendingFundingQueryKey(\n options: Compute<ExactPartial<GetQuotePendingFundingParameters> & ConfigKeyParameter> = {},\n) {\n const filtered = filterQueryOptions(options);\n if (options.quoteIds !== undefined) filtered.quoteIds = toQuoteIdKeyPart([...new Set(options.quoteIds)]);\n return [\"getQuotePendingFunding\", filtered] as const;\n}\n\n/** Query-key type produced by {@link getQuotePendingFundingQueryKey}. */\nexport type GetQuotePendingFundingQueryKey = ReturnType<typeof getQuotePendingFundingQueryKey>;\n\n/**\n * Options accepted by {@link getQuotePendingFundingQueryOptions}: the action's\n * parameters (`quoteIds` required) plus TanStack overrides.\n */\nexport type GetQuotePendingFundingOptions = Compute<\n GetQuotePendingFundingParameters &\n QueryParameter<GetQuotePendingFundingData, Error, GetQuotePendingFundingData, GetQuotePendingFundingQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getQuotePendingFundingQueryOptions}. */\nexport type GetQuotePendingFundingQueryOptions = SymmioQueryOptions<\n GetQuotePendingFundingData,\n Error,\n GetQuotePendingFundingData,\n GetQuotePendingFundingQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getQuotePendingFunding}. The query is\n * disabled until at least one `quoteId` is supplied. No polling is set — pass\n * `query.refetchInterval` to keep the value fresh. An unsupported chain surfaces\n * a {@link SymmError} from the query function (it is not silently disabled).\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(\n * getQuotePendingFundingQueryOptions(config, {\n * quoteIds: [7334n, 7335n],\n * query: { refetchInterval: 60_000 },\n * }),\n * );\n * ```\n */\nexport function getQuotePendingFundingQueryOptions(\n config: Config,\n options: GetQuotePendingFundingOptions,\n): GetQuotePendingFundingQueryOptions {\n return {\n ...options.query,\n queryKey: getQuotePendingFundingQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: (options.query?.enabled ?? true) && options.quoteIds.length > 0,\n queryFn: () =>\n getQuotePendingFunding(config, {\n chainId: options.chainId,\n quoteIds: options.quoteIds,\n batchSize: options.batchSize,\n }),\n };\n}\n"],"mappings":";;;;AAkCA,SAAgB,EACd,IAAwF,CAAC,GACzF;CACA,IAAM,IAAW,EAAmB,CAAO;CAE3C,OADI,EAAQ,aAAa,KAAA,MAAW,EAAS,WAAW,EAAiB,CAAC,GAAG,IAAI,IAAI,EAAQ,QAAQ,CAAC,CAAC,IAChG,CAAC,0BAA0B,CAAQ;AAC5C;AA0CA,SAAgB,EACd,GACA,GACoC;CACpC,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA+B;GACvC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,UAAU,EAAQ,OAAO,WAAW,OAAS,EAAQ,SAAS,SAAS;EACvE,eACE,EAAuB,GAAQ;GAC7B,SAAS,EAAQ;GACjB,UAAU,EAAQ;GAClB,WAAW,EAAQ;EACrB,CAAC;CACL;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pending (not yet settled) accumulated funding for one quote.
|
|
3
|
+
*
|
|
4
|
+
* Read with {@link getQuotePendingFunding}. Settled funding lives elsewhere —
|
|
5
|
+
* {@link getQuoteFunding} reads it from the analytics subgraph.
|
|
6
|
+
*/
|
|
7
|
+
export interface QuotePendingFunding {
|
|
8
|
+
/** On-chain quote id. */
|
|
9
|
+
quoteId: bigint;
|
|
10
|
+
/**
|
|
11
|
+
* Funding accrued since the quote's last settlement, income-positive like every SDK funding
|
|
12
|
+
* amount: `> 0n` the position will receive it, `< 0n` it owes it. 18-decimal collateral units
|
|
13
|
+
* (SYMMIO's internal scale, same as `allocatedBalance`), truncated toward zero per quote.
|
|
14
|
+
* The negation of the contract's cost-positive `getQuoteFundingDebts`. `0n` for pairs whose
|
|
15
|
+
* accumulated funding has not started, closed/liquidated quotes and unknown ids.
|
|
16
|
+
*/
|
|
17
|
+
pendingNetReceived: bigint;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-pending-funding/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -49,7 +49,8 @@ export interface GetQuotesEventsByTypeReturnType {
|
|
|
49
49
|
*
|
|
50
50
|
* - These are the funding charges **settled to date** — what the analytics
|
|
51
51
|
* subgraph has indexed. Funding that has accrued since the last on-chain charge
|
|
52
|
-
* is not indexed and therefore not included here
|
|
52
|
+
* is not indexed by the subgraph and therefore not included here — read it
|
|
53
|
+
* with {@link getQuotePendingFunding}.
|
|
53
54
|
* - The metadata carries the raw on-chain amounts. Net a row the way the rest of
|
|
54
55
|
* the SDK does — `fundingReceived − fundingPaid`, so a **positive** net means
|
|
55
56
|
* the position **earned** funding on that tick, matching
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quotes-events-by-type.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quotes-events-by-type/get-quotes-events-by-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAWvF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,CACnD,gBAAgB,GAAG;IACjB,0FAA0F;IAC1F,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACjC,CACF,CAAC;AAEF,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED
|
|
1
|
+
{"version":3,"file":"get-quotes-events-by-type.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quotes-events-by-type/get-quotes-events-by-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAWvF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,CACnD,gBAAgB,GAAG;IACjB,0FAA0F;IAC1F,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACjC,CACF,CAAC;AAEF,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,+BAA+B,GAC1C,OAAO,CAAC,+BAA+B,CAAC,CAmB1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quotes-events-by-type.js","names":[],"sources":["../../../src/quotes/get-quotes-events-by-type/get-quotes-events-by-type.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { toQuoteEventRow } from \"../get-quote-events-by-type/to-quote-event-row\";\nimport type { QuoteEventRow, QuoteEventType } from \"../get-quote-events-by-type/types\";\nimport { QuoteEventsForQuotesByTypeDocument } from \"./query-document\";\n\n/**\n * Largest page The Graph will serve, and what this action sends when `first` is\n * omitted — asking below the ceiling would truncate an un-paged caller, and\n * leaving `first` out of the query entirely makes The Graph silently fall back\n * to 100.\n */\nconst MAX_PAGE_SIZE = 1000;\n\n/**\n * Parameters for {@link getQuotesEventsByType}.\n */\nexport type GetQuotesEventsByTypeParameters = Compute<\n ChainIdParameter & {\n /** On-chain quote ids to read events for. Order is irrelevant — rows come back merged. */\n quoteIds: readonly bigint[];\n /** Event types to include. Use {@link FUNDING_HISTORY_EVENT_TYPES}, etc. */\n types: readonly QuoteEventType[];\n /**\n * Page size across the whole batch, not per quote id. The subgraph caps it at\n * 1000, and omitting it asks for that ceiling — one round-trip returns as much\n * as the subgraph will serve.\n * @default 1000\n */\n first?: number;\n /** Page offset. @default 0 */\n skip?: number;\n /** Sort direction on the event timestamp. @default \"desc\" (newest first). */\n orderDirection?: \"asc\" | \"desc\";\n }\n>;\n\n/** Return type of {@link getQuotesEventsByType}. */\nexport interface GetQuotesEventsByTypeReturnType {\n /**\n * The decoded event rows for every requested quote id, already merged and\n * sorted by `timestamp` server-side (newest first unless `orderDirection` says\n * otherwise). Each row carries its own `quoteId`, so a caller that needs a\n * per-quote view groups by that field.\n */\n rows: QuoteEventRow[];\n /** `true` when the page came back full — caller should fetch the next page. */\n hasMore: boolean;\n}\n\n/**\n * Batched sibling of `getQuoteEventsByType`: read the non-terminal events\n * (open-price recompute, funding charges) of **many** quotes from the analytics\n * subgraph in one round-trip, filtered to the requested event types.\n *\n * The subgraph does the merge: rows for all `quoteIds` come back interleaved and\n * sorted by `timestamp`, newest first by default, and `first` / `skip` page over\n * that merged stream rather than per quote id. Omit `first` and the action asks\n * for the 1000-row ceiling the subgraph enforces, so an un-paged call returns\n * everything one request can serve.\n *\n * Pass {@link FUNDING_HISTORY_EVENT_TYPES} to build a funding timeline for a\n * whole position group. Two caveats for that use case:\n *\n * - These are the funding charges **settled to date** — what the analytics\n * subgraph has indexed. Funding that has accrued since the last on-chain charge\n * is not indexed and therefore not included here.\n * - The metadata carries the raw on-chain amounts. Net a row the way the rest of\n * the SDK does — `fundingReceived − fundingPaid`, so a **positive** net means\n * the position **earned** funding on that tick, matching\n * `QuoteFundingData.netReceived`. The raw fields themselves are verbatim from\n * the subgraph and are never re-signed.\n *\n * The action does no event-type interpretation beyond decoding the metadata JSON.\n *\n * @param config - The SDK config.\n * @param parameters - Quote ids, types, pagination, sort, optional chain id.\n * @returns The decoded rows plus a `hasMore` flag.\n * @throws {SymmError} when the chain is unsupported or has no analytics subgraph.\n * @throws {SymmApiError} when the subgraph request fails.\n *\n * @example\n * ```ts\n * const { rows, hasMore } = await getQuotesEventsByType(config, {\n * quoteIds: [7334n, 7335n],\n * types: FUNDING_HISTORY_EVENT_TYPES,\n * });\n * ```\n */\nexport async function getQuotesEventsByType(\n config: Config,\n parameters: GetQuotesEventsByTypeParameters,\n): Promise<GetQuotesEventsByTypeReturnType> {\n const { chainId, quoteIds, types, first = MAX_PAGE_SIZE, skip = 0, orderDirection = \"desc\" } = parameters;\n\n if (quoteIds.length === 0 || types.length === 0) return { rows: [], hasMore: false };\n\n const data = await querySubgraph(config, {\n chainId,\n document: QuoteEventsForQuotesByTypeDocument,\n variables: {\n quoteIds: quoteIds.map((id) => id.toString()),\n typeIn: types as string[],\n first,\n skip,\n orderDirection,\n },\n });\n\n const rows = data.quoteEvents.map(toQuoteEventRow);\n return { rows, hasMore: rows.length === first };\n}\n"],"mappings":";;;;AAaA,IAAM,IAAgB;
|
|
1
|
+
{"version":3,"file":"get-quotes-events-by-type.js","names":[],"sources":["../../../src/quotes/get-quotes-events-by-type/get-quotes-events-by-type.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { toQuoteEventRow } from \"../get-quote-events-by-type/to-quote-event-row\";\nimport type { QuoteEventRow, QuoteEventType } from \"../get-quote-events-by-type/types\";\nimport { QuoteEventsForQuotesByTypeDocument } from \"./query-document\";\n\n/**\n * Largest page The Graph will serve, and what this action sends when `first` is\n * omitted — asking below the ceiling would truncate an un-paged caller, and\n * leaving `first` out of the query entirely makes The Graph silently fall back\n * to 100.\n */\nconst MAX_PAGE_SIZE = 1000;\n\n/**\n * Parameters for {@link getQuotesEventsByType}.\n */\nexport type GetQuotesEventsByTypeParameters = Compute<\n ChainIdParameter & {\n /** On-chain quote ids to read events for. Order is irrelevant — rows come back merged. */\n quoteIds: readonly bigint[];\n /** Event types to include. Use {@link FUNDING_HISTORY_EVENT_TYPES}, etc. */\n types: readonly QuoteEventType[];\n /**\n * Page size across the whole batch, not per quote id. The subgraph caps it at\n * 1000, and omitting it asks for that ceiling — one round-trip returns as much\n * as the subgraph will serve.\n * @default 1000\n */\n first?: number;\n /** Page offset. @default 0 */\n skip?: number;\n /** Sort direction on the event timestamp. @default \"desc\" (newest first). */\n orderDirection?: \"asc\" | \"desc\";\n }\n>;\n\n/** Return type of {@link getQuotesEventsByType}. */\nexport interface GetQuotesEventsByTypeReturnType {\n /**\n * The decoded event rows for every requested quote id, already merged and\n * sorted by `timestamp` server-side (newest first unless `orderDirection` says\n * otherwise). Each row carries its own `quoteId`, so a caller that needs a\n * per-quote view groups by that field.\n */\n rows: QuoteEventRow[];\n /** `true` when the page came back full — caller should fetch the next page. */\n hasMore: boolean;\n}\n\n/**\n * Batched sibling of `getQuoteEventsByType`: read the non-terminal events\n * (open-price recompute, funding charges) of **many** quotes from the analytics\n * subgraph in one round-trip, filtered to the requested event types.\n *\n * The subgraph does the merge: rows for all `quoteIds` come back interleaved and\n * sorted by `timestamp`, newest first by default, and `first` / `skip` page over\n * that merged stream rather than per quote id. Omit `first` and the action asks\n * for the 1000-row ceiling the subgraph enforces, so an un-paged call returns\n * everything one request can serve.\n *\n * Pass {@link FUNDING_HISTORY_EVENT_TYPES} to build a funding timeline for a\n * whole position group. Two caveats for that use case:\n *\n * - These are the funding charges **settled to date** — what the analytics\n * subgraph has indexed. Funding that has accrued since the last on-chain charge\n * is not indexed by the subgraph and therefore not included here — read it\n * with {@link getQuotePendingFunding}.\n * - The metadata carries the raw on-chain amounts. Net a row the way the rest of\n * the SDK does — `fundingReceived − fundingPaid`, so a **positive** net means\n * the position **earned** funding on that tick, matching\n * `QuoteFundingData.netReceived`. The raw fields themselves are verbatim from\n * the subgraph and are never re-signed.\n *\n * The action does no event-type interpretation beyond decoding the metadata JSON.\n *\n * @param config - The SDK config.\n * @param parameters - Quote ids, types, pagination, sort, optional chain id.\n * @returns The decoded rows plus a `hasMore` flag.\n * @throws {SymmError} when the chain is unsupported or has no analytics subgraph.\n * @throws {SymmApiError} when the subgraph request fails.\n *\n * @example\n * ```ts\n * const { rows, hasMore } = await getQuotesEventsByType(config, {\n * quoteIds: [7334n, 7335n],\n * types: FUNDING_HISTORY_EVENT_TYPES,\n * });\n * ```\n */\nexport async function getQuotesEventsByType(\n config: Config,\n parameters: GetQuotesEventsByTypeParameters,\n): Promise<GetQuotesEventsByTypeReturnType> {\n const { chainId, quoteIds, types, first = MAX_PAGE_SIZE, skip = 0, orderDirection = \"desc\" } = parameters;\n\n if (quoteIds.length === 0 || types.length === 0) return { rows: [], hasMore: false };\n\n const data = await querySubgraph(config, {\n chainId,\n document: QuoteEventsForQuotesByTypeDocument,\n variables: {\n quoteIds: quoteIds.map((id) => id.toString()),\n typeIn: types as string[],\n first,\n skip,\n orderDirection,\n },\n });\n\n const rows = data.quoteEvents.map(toQuoteEventRow);\n return { rows, hasMore: rows.length === first };\n}\n"],"mappings":";;;;AAaA,IAAM,IAAgB;AA8EtB,eAAsB,EACpB,GACA,GAC0C;CAC1C,IAAM,EAAE,YAAS,aAAU,UAAO,WAAQ,GAAe,UAAO,GAAG,oBAAiB,WAAW;CAE/F,IAAI,EAAS,WAAW,KAAK,EAAM,WAAW,GAAG,OAAO;EAAE,MAAM,CAAC;EAAG,SAAS;CAAM;CAcnF,IAAM,KAAO,MAZM,EAAc,GAAQ;EACvC;EACA,UAAU;EACV,WAAW;GACT,UAAU,EAAS,KAAK,MAAO,EAAG,SAAS,CAAC;GAC5C,QAAQ;GACR;GACA;GACA;EACF;CACF,CAAC,GAEiB,YAAY,IAAI,CAAe;CACjD,OAAO;EAAE;EAAM,SAAS,EAAK,WAAW;CAAM;AAChD"}
|
|
@@ -15,8 +15,9 @@ import { UnifiedQuote } from '../unified-quote.js';
|
|
|
15
15
|
*
|
|
16
16
|
* **Settled-to-date only** — these totals cover funding the protocol has already
|
|
17
17
|
* charged and the analytics subgraph has indexed. Funding accrued since the last
|
|
18
|
-
* charge is **not** included: it is not indexed
|
|
19
|
-
*
|
|
18
|
+
* charge is **not** included: it is not indexed by the subgraph — read it with
|
|
19
|
+
* {@link getQuotePendingFunding}. The two come from different sources at
|
|
20
|
+
* different heights, so do not add them into a lifetime total.
|
|
20
21
|
*
|
|
21
22
|
* **Completeness** — `netReceived` is always the sum over the children that *did*
|
|
22
23
|
* resolve, i.e. a lower bound while rows are still missing; it is never
|
|
@@ -79,14 +80,14 @@ export interface QuoteGroupFunding {
|
|
|
79
80
|
*
|
|
80
81
|
* Sign convention: `netReceived = received − paid`, so **positive means the group
|
|
81
82
|
* earned funding** (see {@link QuoteGroupFunding}). The totals are funding
|
|
82
|
-
* **settled to date**; funding accrued since the last charge is not indexed
|
|
83
|
-
* not included.
|
|
83
|
+
* **settled to date**; funding accrued since the last charge is not indexed by
|
|
84
|
+
* the subgraph and not included — read it with {@link getQuotePendingFunding}.
|
|
84
85
|
*
|
|
85
86
|
* Do **not** substitute `Σ UnifiedQuote.accumulatedPaidFunding` as a shortcut.
|
|
86
|
-
* That field is the quote's cumulative funding *
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* That field is the quote's per-unit cumulative funding-fee *index* recorded at
|
|
88
|
+
* its last settlement, not a settled amount — summing it across quotes is
|
|
89
|
+
* dimensionally meaningless, and it is cost-positive where `netReceived` is
|
|
90
|
+
* income-positive.
|
|
90
91
|
*
|
|
91
92
|
* Pure, order-independent, no IO. Empty input yields all-zero amounts with
|
|
92
93
|
* `isComplete: false`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-group-funding.d.ts","sourceRoot":"","sources":["../../../src/quotes/grouping/aggregate-group-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"aggregate-group-funding.d.ts","sourceRoot":"","sources":["../../../src/quotes/grouping/aggregate-group-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,IAAI,EAAE,SAAS,gBAAgB,EAAE,GAChC,iBAAiB,CA6CnB"}
|