@symmio/trading-core 0.1.1 → 1.0.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/README.md +2 -2
- package/dist/balance-history/get-balance-history/balance-history-filter.d.ts +1 -1
- package/dist/balance-history/get-balance-history/get-balance-history.d.ts +3 -3
- package/dist/balance-history/get-balance-history/index.d.ts +5 -5
- package/dist/balance-history/get-balance-history/query-document.d.ts +2 -2
- package/dist/balance-history/get-balance-history/query.d.ts +4 -4
- package/dist/balance-history/get-balance-history/to-balance-history-row.d.ts +2 -2
- package/dist/balance-history/index.d.ts +1 -1
- package/dist/core/chains/actions/get-chain-config.d.ts +1 -1
- package/dist/core/chains/actions/list-supported-chains.d.ts +1 -1
- package/dist/core/chains/index.d.ts +5 -5
- package/dist/core/chains/registry.d.ts +1 -1
- package/dist/core/config/config-key.d.ts +1 -1
- package/dist/core/config/create-config.d.ts +44 -8
- package/dist/core/config/create-config.d.ts.map +1 -1
- package/dist/core/config/create-config.js +29 -22
- package/dist/core/config/create-config.js.map +1 -1
- package/dist/core/config/index.d.ts +1 -1
- package/dist/core/config/merge-chain-config.d.ts +2 -2
- package/dist/index.d.ts +58 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -127
- package/dist/muon/client.d.ts +1 -1
- package/dist/muon/deallocate-upnl-sig/get-deallocate-upnl-sig.d.ts +3 -3
- package/dist/muon/deallocate-upnl-sig/index.d.ts +2 -2
- package/dist/muon/deallocate-upnl-sig/query.d.ts +4 -4
- package/dist/muon/index.d.ts +11 -11
- package/dist/muon/party-a-overview/get-muon-party-a-overview.d.ts +4 -4
- package/dist/muon/party-a-overview/get-muon-party-a-overview.d.ts.map +1 -1
- package/dist/muon/party-a-overview/get-muon-party-a-overview.js.map +1 -1
- package/dist/muon/party-a-overview/index.d.ts +2 -2
- package/dist/muon/party-a-overview/query.d.ts +4 -4
- package/dist/muon/price/get-muon-price.d.ts +3 -3
- package/dist/muon/price/index.d.ts +2 -2
- package/dist/muon/price/query.d.ts +4 -4
- package/dist/muon/price-range/get-muon-price-range.d.ts +4 -4
- package/dist/muon/price-range/get-muon-price-range.d.ts.map +1 -1
- package/dist/muon/price-range/get-muon-price-range.js.map +1 -1
- package/dist/muon/price-range/index.d.ts +2 -2
- package/dist/muon/price-range/query.d.ts +4 -4
- package/dist/muon/settle-upnl/get-muon-settle-upnl.d.ts +4 -4
- package/dist/muon/settle-upnl/get-muon-settle-upnl.d.ts.map +1 -1
- package/dist/muon/settle-upnl/get-muon-settle-upnl.js.map +1 -1
- package/dist/muon/settle-upnl/index.d.ts +2 -2
- package/dist/muon/settle-upnl/query.d.ts +4 -4
- package/dist/muon/upnl/get-muon-upnl.d.ts +4 -4
- package/dist/muon/upnl/get-muon-upnl.d.ts.map +1 -1
- package/dist/muon/upnl/get-muon-upnl.js.map +1 -1
- package/dist/muon/upnl/index.d.ts +2 -2
- package/dist/muon/upnl/query.d.ts +4 -4
- package/dist/muon/upnl-a/get-muon-upnl-a.d.ts +4 -4
- package/dist/muon/upnl-a/get-muon-upnl-a.d.ts.map +1 -1
- package/dist/muon/upnl-a/get-muon-upnl-a.js.map +1 -1
- package/dist/muon/upnl-a/index.d.ts +2 -2
- package/dist/muon/upnl-a/query.d.ts +4 -4
- package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.d.ts +4 -4
- package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.d.ts.map +1 -1
- package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.js.map +1 -1
- package/dist/muon/upnl-a-with-symbol-price/index.d.ts +2 -2
- package/dist/muon/upnl-a-with-symbol-price/query.d.ts +4 -4
- package/dist/muon/upnl-b/get-muon-upnl-b.d.ts +3 -3
- package/dist/muon/upnl-b/index.d.ts +2 -2
- package/dist/muon/upnl-b/query.d.ts +4 -4
- package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.d.ts +4 -4
- package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.d.ts.map +1 -1
- package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.js.map +1 -1
- package/dist/muon/upnl-with-symbol-price/index.d.ts +2 -2
- package/dist/muon/upnl-with-symbol-price/query.d.ts +4 -4
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/search/index.d.ts +2 -2
- package/dist/notifications/search/query.d.ts +4 -4
- package/dist/notifications/search/search-notifications.d.ts +3 -3
- package/dist/notifications/types.d.ts +1 -1
- package/dist/price-service/enigma/health/get-enigma-price-service-health.d.ts +2 -2
- package/dist/price-service/enigma/health/index.d.ts +2 -2
- package/dist/price-service/enigma/health/query.d.ts +4 -4
- package/dist/price-service/enigma/index.d.ts +5 -5
- package/dist/price-service/enigma/metadata/get-enigma-price-service-metadata.d.ts +3 -3
- package/dist/price-service/enigma/metadata/index.d.ts +2 -2
- package/dist/price-service/enigma/metadata/query.d.ts +4 -4
- package/dist/price-service/enigma/prices-by-addresses/get-enigma-price-service-prices-by-addresses.d.ts +3 -3
- package/dist/price-service/enigma/prices-by-addresses/index.d.ts +2 -2
- package/dist/price-service/enigma/prices-by-addresses/query.d.ts +4 -4
- package/dist/price-service/enigma/prices-by-names/get-enigma-price-service-prices-by-names.d.ts +3 -3
- package/dist/price-service/enigma/prices-by-names/index.d.ts +2 -2
- package/dist/price-service/enigma/prices-by-names/query.d.ts +4 -4
- package/dist/price-service/enigma/symbols-info/get-enigma-price-service-symbols-info.d.ts +3 -3
- package/dist/price-service/enigma/symbols-info/index.d.ts +2 -2
- package/dist/price-service/enigma/symbols-info/query.d.ts +4 -4
- package/dist/price-service/index.d.ts +1 -1
- package/dist/quotes/apply-notification.d.ts +2 -2
- package/dist/quotes/fees/index.d.ts +2 -2
- package/dist/quotes/fingerprint.d.ts +1 -1
- package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts +3 -3
- package/dist/quotes/get-quote-events-by-type/index.d.ts +4 -4
- package/dist/quotes/get-quote-events-by-type/query-document.d.ts +2 -2
- package/dist/quotes/get-quote-events-by-type/query.d.ts +5 -5
- package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts +2 -2
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +3 -3
- package/dist/quotes/get-quote-funding/index.d.ts +4 -4
- package/dist/quotes/get-quote-funding/query-document.d.ts +1 -1
- package/dist/quotes/get-quote-funding/query.d.ts +4 -4
- package/dist/quotes/get-quote-funding/to-funding-row.d.ts +2 -2
- package/dist/quotes/get-quote-history/close-type.d.ts +2 -2
- package/dist/quotes/get-quote-history/get-quote-history.d.ts +3 -3
- package/dist/quotes/get-quote-history/index.d.ts +5 -5
- package/dist/quotes/get-quote-history/query-document.d.ts +2 -2
- package/dist/quotes/get-quote-history/query.d.ts +4 -4
- package/dist/quotes/get-quote-history/to-history-row.d.ts +2 -2
- package/dist/quotes/get-quote-history/types.d.ts +1 -1
- package/dist/quotes/get-sub-account-quotes/get-sub-account-quotes.d.ts +3 -3
- package/dist/quotes/get-sub-account-quotes/index.d.ts +2 -2
- package/dist/quotes/get-sub-account-quotes/query.d.ts +4 -4
- package/dist/quotes/grouping/aggregate-metrics.d.ts +2 -2
- package/dist/quotes/grouping/group-quotes.d.ts +2 -2
- package/dist/quotes/grouping/group-strategy.d.ts +1 -1
- package/dist/quotes/grouping/index.d.ts +5 -5
- package/dist/quotes/grouping/partition-quotes.d.ts +1 -1
- package/dist/quotes/grouping/quote-group.d.ts +3 -3
- package/dist/quotes/index.d.ts +16 -16
- package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +1 -1
- package/dist/quotes/liquidation/index.d.ts +1 -1
- package/dist/quotes/open-quantity.d.ts +1 -1
- package/dist/quotes/reconcile-quotes.d.ts +5 -5
- package/dist/quotes/resolve-quote-accounts.d.ts +3 -3
- package/dist/quotes/should-accelerate.d.ts +1 -1
- package/dist/quotes/to-unified-quote.d.ts +4 -4
- package/dist/quotes/unified-quote.d.ts +3 -3
- package/dist/quotes/upnl/calculate-quote-pnl.d.ts +1 -1
- package/dist/quotes/upnl/calculate-quote-upnl.d.ts +1 -1
- package/dist/quotes/upnl/index.d.ts +3 -3
- package/dist/shared/utils/simulate-before-write.d.ts +2 -2
- package/dist/solvers/error-codes/get-solver-error-codes.d.ts +2 -2
- package/dist/solvers/error-codes/index.d.ts +2 -2
- package/dist/solvers/error-codes/query.d.ts +4 -4
- package/dist/solvers/estimated-price/get-estimated-price.d.ts +58 -0
- package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -0
- package/dist/solvers/estimated-price/get-estimated-price.js +30 -0
- package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -0
- package/dist/solvers/estimated-price/index.d.ts +5 -0
- package/dist/solvers/estimated-price/index.d.ts.map +1 -0
- package/dist/solvers/estimated-price/price-impact.d.ts +25 -0
- package/dist/solvers/estimated-price/price-impact.d.ts.map +1 -0
- package/dist/solvers/estimated-price/price-impact.js +9 -0
- package/dist/solvers/estimated-price/price-impact.js.map +1 -0
- package/dist/solvers/estimated-price/query.d.ts +26 -0
- package/dist/solvers/estimated-price/query.d.ts.map +1 -0
- package/dist/solvers/estimated-price/query.js +28 -0
- package/dist/solvers/estimated-price/query.js.map +1 -0
- package/dist/solvers/estimated-price/to-estimated-price.d.ts +9 -0
- package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -0
- package/dist/solvers/estimated-price/to-estimated-price.js +8 -0
- package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -0
- package/dist/solvers/funding-info/get-funding-info.d.ts +37 -0
- package/dist/solvers/funding-info/get-funding-info.d.ts.map +1 -0
- package/dist/solvers/funding-info/get-funding-info.js +24 -0
- package/dist/solvers/funding-info/get-funding-info.js.map +1 -0
- package/dist/solvers/funding-info/index.d.ts +6 -0
- package/dist/solvers/funding-info/index.d.ts.map +1 -0
- package/dist/solvers/funding-info/project-funding-rate.d.ts +30 -0
- package/dist/solvers/funding-info/project-funding-rate.d.ts.map +1 -0
- package/dist/solvers/funding-info/project-funding-rate.js +9 -0
- package/dist/solvers/funding-info/project-funding-rate.js.map +1 -0
- package/dist/solvers/funding-info/query.d.ts +28 -0
- package/dist/solvers/funding-info/query.d.ts.map +1 -0
- package/dist/solvers/funding-info/query.js +24 -0
- package/dist/solvers/funding-info/query.js.map +1 -0
- package/dist/solvers/funding-info/to-funding-info.d.ts +14 -0
- package/dist/solvers/funding-info/to-funding-info.d.ts.map +1 -0
- package/dist/solvers/funding-info/to-funding-info.js +15 -0
- package/dist/solvers/funding-info/to-funding-info.js.map +1 -0
- package/dist/solvers/funding-info/types.d.ts +35 -0
- package/dist/solvers/funding-info/types.d.ts.map +1 -0
- package/dist/solvers/instant-close/get-instant-closes/get-instant-closes.d.ts +3 -3
- package/dist/solvers/instant-close/get-instant-closes/index.d.ts +3 -3
- package/dist/solvers/instant-close/get-instant-closes/query.d.ts +4 -4
- package/dist/solvers/instant-close/get-instant-closes/to-pending-instant-close.d.ts +1 -1
- package/dist/solvers/instant-close/index.d.ts +7 -7
- package/dist/solvers/instant-close/instant-close/index.d.ts +2 -2
- package/dist/solvers/instant-close/instant-close/instant-close.d.ts +3 -3
- package/dist/solvers/instant-close/instant-close/query.d.ts +3 -3
- package/dist/solvers/instant-close/instant-close-auto/index.d.ts +2 -2
- package/dist/solvers/instant-close/instant-close-auto/instant-close-auto.d.ts +3 -3
- package/dist/solvers/instant-close/instant-close-auto/query.d.ts +3 -3
- package/dist/solvers/instant-close/instant-close-bulk/index.d.ts +2 -2
- package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.d.ts +3 -3
- package/dist/solvers/instant-close/instant-close-bulk/query.d.ts +3 -3
- package/dist/solvers/instant-close/instant-close-bulk-auto/index.d.ts +2 -2
- package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.d.ts +4 -4
- package/dist/solvers/instant-close/instant-close-bulk-auto/query.d.ts +3 -3
- package/dist/solvers/instant-close/prepare-instant-close-params/index.d.ts +1 -1
- package/dist/solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.d.ts +4 -4
- package/dist/solvers/instant-close/shared/close-math.d.ts +1 -1
- package/dist/solvers/instant-close/shared/hedger-api.d.ts +3 -3
- package/dist/solvers/instant-close/shared/index.d.ts +5 -5
- package/dist/solvers/instant-close/shared/quote-constraints.d.ts +1 -1
- package/dist/solvers/instant-close/shared/types.d.ts +2 -2
- package/dist/solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.d.ts +2 -2
- package/dist/solvers/instant-open/get-instant-open-quote-id/index.d.ts +2 -2
- package/dist/solvers/instant-open/get-instant-open-quote-id/query.d.ts +4 -4
- package/dist/solvers/instant-open/get-instant-opens/get-instant-opens.d.ts +3 -3
- package/dist/solvers/instant-open/get-instant-opens/index.d.ts +3 -3
- package/dist/solvers/instant-open/get-instant-opens/query.d.ts +4 -4
- package/dist/solvers/instant-open/get-instant-opens/to-pending-instant-open.d.ts +2 -2
- package/dist/solvers/instant-open/index.d.ts +6 -6
- package/dist/solvers/instant-open/instant-open/index.d.ts +2 -2
- package/dist/solvers/instant-open/instant-open/instant-open.d.ts +3 -3
- package/dist/solvers/instant-open/instant-open/query.d.ts +3 -3
- package/dist/solvers/instant-open/instant-open-auto/index.d.ts +2 -2
- package/dist/solvers/instant-open/instant-open-auto/instant-open-auto.d.ts +3 -3
- package/dist/solvers/instant-open/instant-open-auto/query.d.ts +3 -3
- package/dist/solvers/instant-open/prepare-instant-open-params/index.d.ts +2 -2
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts +6 -6
- package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/index.d.ts +4 -4
- package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-fee-rates.d.ts +3 -3
- package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.d.ts +3 -3
- package/dist/solvers/instant-open/shared/calldata.d.ts +1 -1
- package/dist/solvers/instant-open/shared/eip712.d.ts +2 -2
- package/dist/solvers/instant-open/shared/hedger-api.d.ts +3 -3
- package/dist/solvers/instant-open/shared/index.d.ts +8 -8
- package/dist/solvers/instant-open/shared/operations.d.ts +2 -2
- package/dist/solvers/instant-open/shared/quote-constraints.d.ts +3 -3
- package/dist/solvers/instant-open/shared/trade-math.d.ts +49 -1
- package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/trade-math.js +5 -1
- package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
- package/dist/solvers/instant-open/shared/types.d.ts +4 -4
- package/dist/solvers/locked-params/get-locked-params.d.ts +3 -3
- package/dist/solvers/locked-params/index.d.ts +3 -3
- package/dist/solvers/locked-params/query.d.ts +4 -4
- package/dist/solvers/market-info/get-market-info.d.ts +32 -0
- package/dist/solvers/market-info/get-market-info.d.ts.map +1 -0
- package/dist/solvers/market-info/get-market-info.js +23 -0
- package/dist/solvers/market-info/get-market-info.js.map +1 -0
- package/dist/solvers/market-info/index.d.ts +5 -0
- package/dist/solvers/market-info/index.d.ts.map +1 -0
- package/dist/solvers/market-info/query.d.ts +29 -0
- package/dist/solvers/market-info/query.d.ts.map +1 -0
- package/dist/solvers/market-info/query.js +21 -0
- package/dist/solvers/market-info/query.js.map +1 -0
- package/dist/solvers/market-info/to-market-info.d.ts +13 -0
- package/dist/solvers/market-info/to-market-info.d.ts.map +1 -0
- package/dist/solvers/market-info/to-market-info.js +28 -0
- package/dist/solvers/market-info/to-market-info.js.map +1 -0
- package/dist/solvers/market-info/types.d.ts +32 -0
- package/dist/solvers/market-info/types.d.ts.map +1 -0
- package/dist/solvers/markets/get-markets.d.ts +3 -3
- package/dist/solvers/markets/index.d.ts +3 -3
- package/dist/solvers/markets/query.d.ts +4 -4
- package/dist/solvers/notional-cap/check-notional-cap.d.ts +2 -2
- package/dist/solvers/notional-cap/get-notional-cap-all.d.ts +3 -3
- package/dist/solvers/notional-cap/get-notional-cap-all.d.ts.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-all.js +1 -5
- package/dist/solvers/notional-cap/get-notional-cap-all.js.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-by-symbol-id.d.ts +3 -3
- package/dist/solvers/notional-cap/get-open-interest-by-symbol-id.d.ts +2 -2
- package/dist/solvers/notional-cap/index.d.ts +9 -9
- package/dist/solvers/notional-cap/query-all.d.ts +4 -4
- package/dist/solvers/notional-cap/query-open-interest.d.ts +4 -4
- package/dist/solvers/notional-cap/query.d.ts +4 -4
- package/dist/solvers/notional-cap/to-market-notional-cap.d.ts +2 -2
- package/dist/solvers/notional-cap/to-market-notional-cap.d.ts.map +1 -1
- package/dist/solvers/notional-cap/to-market-notional-cap.js +1 -5
- package/dist/solvers/notional-cap/to-market-notional-cap.js.map +1 -1
- package/dist/solvers/shared/index.d.ts +1 -1
- package/dist/solvers/shared/resolvers/index.d.ts +3 -3
- package/dist/solvers/shared/resolvers/resolve-mark-price.d.ts +1 -1
- package/dist/solvers/shared/resolvers/resolve-market.d.ts +2 -2
- package/dist/solvers/types/generated/enigma-solver.js +16 -4
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/symmio-contracts/abi/index.d.ts +3 -3
- package/dist/symmio-contracts/abi/v0.8.5/index.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/add-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/get-sub-account.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-account.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/actions/predict-next-virtual-account.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/remove-margin.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/index.d.ts +49 -49
- package/dist/symmio-contracts/account-layer/query/add-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/create-sub-accounts.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/delete-sub-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/deposit-and-allocate-for-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/deposit-for-account.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/edit-account-name.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/get-account-balance-info.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-account-balance-of.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-sub-account-virtual-nonce.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-sub-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-sub-accounts-count-of-user.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts-addresses.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-user-sub-accounts.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-virtual-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/get-virtual-accounts-addresses-of-sub-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/predict-next-virtual-account.d.ts +4 -4
- package/dist/symmio-contracts/account-layer/query/remove-margin.d.ts +2 -2
- package/dist/symmio-contracts/account-layer/query/simulate-add-margin.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/query/simulate-create-sub-accounts.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/query/simulate-delete-sub-account.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/query/simulate-deposit-and-allocate-for-account.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/query/simulate-deposit-for-account.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/query/simulate-edit-account-name.d.ts +3 -3
- package/dist/symmio-contracts/account-layer/query/simulate-remove-margin.d.ts +3 -3
- package/dist/symmio-contracts/collateral/actions/approve-collateral.d.ts +2 -2
- package/dist/symmio-contracts/collateral/actions/get-collateral-allowance.d.ts +2 -2
- package/dist/symmio-contracts/collateral/actions/get-collateral-balance.d.ts +2 -2
- package/dist/symmio-contracts/collateral/actions/simulate-approve-collateral.d.ts +3 -3
- package/dist/symmio-contracts/collateral/index.d.ts +8 -8
- package/dist/symmio-contracts/collateral/query/approve-collateral.d.ts +2 -2
- package/dist/symmio-contracts/collateral/query/get-collateral-allowance.d.ts +4 -4
- package/dist/symmio-contracts/collateral/query/get-collateral-balance.d.ts +4 -4
- package/dist/symmio-contracts/collateral/query/simulate-approve-collateral.d.ts +3 -3
- package/dist/symmio-contracts/instant-layer/actions/get-delegation-expiry.d.ts +2 -2
- package/dist/symmio-contracts/instant-layer/actions/get-is-delegation-active.d.ts +2 -2
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.d.ts +3 -3
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.d.ts +4 -4
- package/dist/symmio-contracts/instant-layer/index.d.ts +9 -9
- package/dist/symmio-contracts/instant-layer/query/get-delegation-expiry.d.ts +4 -4
- package/dist/symmio-contracts/instant-layer/query/get-is-delegation-active.d.ts +4 -4
- package/dist/symmio-contracts/instant-layer/query/grant-delegation.d.ts +2 -2
- package/dist/symmio-contracts/instant-layer/query/simulate-grant-delegation.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/allocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/get-fee-for-user.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/get-last-withdraw-request-id.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/get-onchain-contract-markets.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.d.ts +4 -4
- package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/get-quote.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/get-withdrawable-time.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +3 -3
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/actions/simulate-allocate.d.ts +4 -4
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate.d.ts +4 -4
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.d.ts +4 -4
- package/dist/symmio-contracts/symmio/actions/simulate-initiate-withdraw.d.ts +4 -4
- package/dist/symmio-contracts/symmio/actions/simulate-request-cancel-withdraw.d.ts +4 -4
- package/dist/symmio-contracts/symmio/index.d.ts +40 -40
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.d.ts +2 -2
- package/dist/symmio-contracts/symmio/parts.d.ts +1 -1
- package/dist/symmio-contracts/symmio/query/allocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/query/deallocate.d.ts +2 -2
- package/dist/symmio-contracts/symmio/query/finalize-withdraw-request.d.ts +2 -2
- package/dist/symmio-contracts/symmio/query/get-fee-for-user.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-last-withdraw-request-id.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-onchain-contract-markets.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-party-a-open-positions.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-party-a-pending-quotes.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-pending-withdraw-requests.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-quote.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-withdraw-requests.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/get-withdrawable-time.d.ts +4 -4
- package/dist/symmio-contracts/symmio/query/initiate-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/query/request-cancel-withdraw.d.ts +2 -2
- package/dist/symmio-contracts/symmio/query/simulate-allocate.d.ts +3 -3
- package/dist/symmio-contracts/symmio/query/simulate-deallocate.d.ts +3 -3
- package/dist/symmio-contracts/symmio/query/simulate-finalize-withdraw-request.d.ts +3 -3
- package/dist/symmio-contracts/symmio/query/simulate-initiate-withdraw.d.ts +3 -3
- package/dist/symmio-contracts/symmio/query/simulate-request-cancel-withdraw.d.ts +3 -3
- package/dist/symmio-contracts/symmio/types.d.ts +1 -1
- package/dist/symmio-contracts/symmio/types.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/types.js.map +1 -1
- package/dist/symmio-subgraph/index.d.ts +1 -1
- package/dist/symmio-subgraph/query-subgraph/index.d.ts +2 -2
- package/dist/symmio-subgraph/query-subgraph/query-subgraph.d.ts +3 -3
- package/dist/symmio-subgraph/query-subgraph/query.d.ts +4 -4
- package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +4 -4
- package/dist/symmio-subgraph/types/generated/analytics/index.d.ts +1 -1
- package/dist/symmio-subgraph/types/generated/events/gql.d.ts +1 -1
- package/dist/symmio-subgraph/types/generated/events/index.d.ts +1 -1
- package/dist/tpsl/config/get-tpsl-config.d.ts +3 -3
- package/dist/tpsl/config/index.d.ts +2 -2
- package/dist/tpsl/config/query.d.ts +4 -4
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.d.ts +37 -0
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.d.ts.map +1 -0
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.js +43 -0
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.js.map +1 -0
- package/dist/tpsl/delete-quote-tpsl/index.d.ts +3 -0
- package/dist/tpsl/delete-quote-tpsl/index.d.ts.map +1 -0
- package/dist/tpsl/delete-quote-tpsl/query.d.ts +15 -0
- package/dist/tpsl/delete-quote-tpsl/query.d.ts.map +1 -0
- package/dist/tpsl/delete-quote-tpsl/query.js +12 -0
- package/dist/tpsl/delete-quote-tpsl/query.js.map +1 -0
- package/dist/tpsl/get-quote-tpsl/get-quote-tpsl.d.ts +4 -4
- package/dist/tpsl/get-quote-tpsl/index.d.ts +2 -2
- package/dist/tpsl/get-quote-tpsl/query.d.ts +7 -5
- package/dist/tpsl/get-quote-tpsl/query.d.ts.map +1 -1
- package/dist/tpsl/get-quote-tpsl/query.js +4 -1
- package/dist/tpsl/get-quote-tpsl/query.js.map +1 -1
- package/dist/tpsl/index.d.ts +8 -7
- package/dist/tpsl/index.d.ts.map +1 -1
- package/dist/tpsl/internal/resolve-tpsl-config.d.ts +2 -2
- package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.d.ts +1 -1
- package/dist/tpsl/set-quote-tpsl/build-conditional-order-message.d.ts +1 -1
- package/dist/tpsl/set-quote-tpsl/index.d.ts +5 -5
- package/dist/tpsl/set-quote-tpsl/query.d.ts +3 -3
- package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.d.ts +4 -4
- package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.js +11 -11
- package/dist/tpsl/set-quote-tpsl/sign-tpsl-request.d.ts +2 -2
- package/dist/tpsl/signing-spec/delete-query.d.ts +12 -0
- package/dist/tpsl/signing-spec/delete-query.d.ts.map +1 -0
- package/dist/tpsl/signing-spec/delete-query.js +21 -0
- package/dist/tpsl/signing-spec/delete-query.js.map +1 -0
- package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.d.ts +18 -0
- package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.d.ts.map +1 -0
- package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.js +25 -0
- package/dist/tpsl/signing-spec/get-tpsl-delete-signing-spec.js.map +1 -0
- package/dist/tpsl/signing-spec/get-tpsl-signing-spec.d.ts +3 -3
- package/dist/tpsl/signing-spec/index.d.ts +4 -2
- package/dist/tpsl/signing-spec/index.d.ts.map +1 -1
- package/dist/tpsl/signing-spec/query.d.ts +4 -4
- package/dist/tpsl/slippage.d.ts +1 -1
- package/dist/tpsl/types/generated/tpsl-handler.js +6 -3
- package/dist/tpsl/types/generated/tpsl-handler.js.map +1 -1
- package/dist/tpsl/validate-tpsl.d.ts +2 -2
- package/dist/transfers/get-transfer-history/get-transfer-history.d.ts +3 -3
- package/dist/transfers/get-transfer-history/index.d.ts +4 -4
- package/dist/transfers/get-transfer-history/query-document.d.ts +2 -2
- package/dist/transfers/get-transfer-history/query.d.ts +4 -4
- package/dist/transfers/get-transfer-history/to-transfer-row.d.ts +2 -2
- package/dist/transfers/index.d.ts +1 -1
- package/dist/websocket/index.d.ts +3 -3
- package/dist/websocket/notifications/build-subscribe-message.d.ts +1 -1
- package/dist/websocket/notifications/index.d.ts +5 -5
- package/dist/websocket/notifications/normalize-notification.d.ts +1 -1
- package/dist/websocket/notifications/parse-notification-frame.d.ts +2 -2
- package/dist/websocket/notifications/watch-notifications.d.ts +4 -4
- package/dist/websocket/prices/index.d.ts +3 -3
- package/dist/websocket/prices/parse-price-frame.d.ts +1 -1
- package/dist/websocket/prices/watch-enigma-prices.d.ts +5 -5
- package/dist/websocket/socket/create-reconnecting-socket.d.ts +2 -2
- package/dist/websocket/socket/get-socket-pool.d.ts +2 -2
- package/dist/websocket/socket/index.d.ts +4 -4
- package/dist/websocket/socket/socket-pool.d.ts +2 -2
- package/dist/websocket/tpsl/index.d.ts +3 -3
- package/dist/websocket/tpsl/parse-tpsl-frame.d.ts +1 -1
- package/dist/websocket/tpsl/types.d.ts +1 -1
- package/dist/websocket/tpsl/watch-tpsl-notifications.d.ts +4 -4
- package/package.json +11 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-price-range.js","names":[],"sources":["../../../src/muon/price-range/get-muon-price-range.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_PRICE_RANGE, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonPriceRange}. */\nexport type GetMuonPriceRangeParameters = Compute<\n ChainIdParameter & {\n /** Window start in unix seconds. */\n t0: bigint;\n /** Window end in unix seconds. */\n t1: bigint;\n /** The partyA (
|
|
1
|
+
{"version":3,"file":"get-muon-price-range.js","names":[],"sources":["../../../src/muon/price-range/get-muon-price-range.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_PRICE_RANGE, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonPriceRange}. */\nexport type GetMuonPriceRangeParameters = Compute<\n ChainIdParameter & {\n /** Window start in unix seconds. */\n t0: bigint;\n /** Window end in unix seconds. */\n t1: bigint;\n /** The partyA (virtual account for lowcap) to attest. */\n partyA: Address;\n /** The partyB counterparty of the position. */\n partyB: Address;\n /** The market symbol id the range is computed for. */\n symbolId: bigint;\n }\n>;\n\n/**\n * Normalized `priceRange` attestation: the shared signature envelope plus the\n * TWAP-style price-range fields used by `forceClosePosition` /\n * `settleAndForceClosePosition` validation.\n *\n * @remarks\n * TODO(muon-verify): beyond the signature envelope, the result field set/nesting\n * is best-effort from the Muon docs and has not been checked against a live\n * gateway; optional fields are absent when the gateway omits them.\n */\nexport interface GetMuonPriceRangeReturnType extends MuonAttestationBase {\n /** The attested partyA. */\n partyA: Address;\n /** The attested partyB. */\n partyB: Address;\n /** The market symbol id the range was computed for. */\n symbolId: bigint;\n /** Window start in unix seconds (echoed by the gateway). */\n startTime?: bigint;\n /** Window end in unix seconds (echoed by the gateway). */\n endTime?: bigint;\n /** Lowest observed price across the window (18-decimal). */\n lowest?: bigint;\n /** Highest observed price across the window (18-decimal). */\n highest?: bigint;\n /** TWAP/mean price across the window (18-decimal). */\n mean?: bigint;\n /** Spot price at the attestation (18-decimal). */\n price?: bigint;\n /** PartyA's unrealized PnL at the attestation (18-decimal, signed). */\n uPnlA?: bigint;\n /** PartyB's unrealized PnL at the attestation (18-decimal, signed). */\n uPnlB?: bigint;\n}\n\n/**\n * Fetch a fresh Muon `priceRange` attestation for a position over the\n * `[t0, t1]` window and normalize it to typed fields. The oracle URLs and the\n * SYMMIO diamond address (the `symmio` request param) are resolved from\n * `config`; gateways are tried in order until one succeeds.\n *\n * @remarks\n * `priceRange` produces the TWAP-style range a partyB needs to validate a\n * `forceClosePosition` / `settleAndForceClosePosition` against the configured\n * gap thresholds.\n *\n * @param config - The SDK config.\n * @param parameters - Window, parties, symbol id, and optional chain id.\n * @returns The normalized `priceRange` attestation.\n * @throws {SymmError} when the chain is unsupported, no Muon URLs are configured,\n * or every oracle returns an unsuccessful or malformed attestation.\n *\n * @example\n * ```ts\n * const r = await getMuonPriceRange(config, {\n * t0: 1_700_000_000n,\n * t1: 1_700_000_900n,\n * partyA: \"0xva…\",\n * partyB: \"0xpb…\",\n * symbolId: 1n,\n * });\n * console.log(r.lowest, r.highest, r.mean);\n * ```\n */\nexport async function getMuonPriceRange(\n config: Config,\n parameters: GetMuonPriceRangeParameters,\n): Promise<GetMuonPriceRangeReturnType> {\n const { chainId, addresses, muon } = config.getChainConfig(parameters.chainId);\n const raw = await fetchMuon(muon.urls, MUON_METHOD_PRICE_RANGE, {\n t0: parameters.t0.toString(),\n t1: parameters.t1.toString(),\n partyA: parameters.partyA,\n partyB: parameters.partyB,\n chainId: chainId.toString(),\n symmio: addresses.symmioAddress,\n symbolId: parameters.symbolId.toString(),\n });\n const result = raw.data.result;\n return {\n ...toMuonAttestationBase(raw),\n partyA: parameters.partyA,\n partyB: parameters.partyB,\n symbolId: parameters.symbolId,\n startTime: muonBigInt(result.startTime),\n endTime: muonBigInt(result.endTime),\n lowest: muonBigInt(result.lowest),\n highest: muonBigInt(result.highest),\n mean: muonBigInt(result.mean),\n price: muonBigInt(result.price),\n uPnlA: muonBigInt(result.uPnlA),\n uPnlB: muonBigInt(result.uPnlB),\n };\n}\n"],"mappings":";;;AAsFA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,YAAS,cAAW,YAAS,EAAO,eAAe,EAAW,OAAO,GACvE,IAAM,MAAM,EAAU,EAAK,MAAM,GAAyB;EAC9D,IAAI,EAAW,GAAG,SAAS;EAC3B,IAAI,EAAW,GAAG,SAAS;EAC3B,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,SAAS,EAAQ,SAAS;EAC1B,QAAQ,EAAU;EAClB,UAAU,EAAW,SAAS,SAAS;CACzC,CAAC,GACK,IAAS,EAAI,KAAK;CACxB,OAAO;EACL,GAAG,EAAsB,CAAG;EAC5B,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,UAAU,EAAW;EACrB,WAAW,EAAW,EAAO,SAAS;EACtC,SAAS,EAAW,EAAO,OAAO;EAClC,QAAQ,EAAW,EAAO,MAAM;EAChC,SAAS,EAAW,EAAO,OAAO;EAClC,MAAM,EAAW,EAAO,IAAI;EAC5B,OAAO,EAAW,EAAO,KAAK;EAC9B,OAAO,EAAW,EAAO,KAAK;EAC9B,OAAO,EAAW,EAAO,KAAK;CAChC;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-price-range';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-price-range.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonPriceRangeParameters, GetMuonPriceRangeReturnType } from './get-muon-price-range';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonPriceRangeParameters, GetMuonPriceRangeReturnType } from './get-muon-price-range.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonPriceRangeQueryOptions} query. */
|
|
6
6
|
export type GetMuonPriceRangeData = GetMuonPriceRangeReturnType;
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { Config } from '../../core/config';
|
|
3
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
4
|
-
import { MuonAttestationBase } from '../types';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { MuonAttestationBase } from '../types.js';
|
|
5
5
|
/** Parameters for {@link getMuonSettleUpnl}. */
|
|
6
6
|
export type GetMuonSettleUpnlParameters = Compute<ChainIdParameter & {
|
|
7
|
-
/** The partyA (
|
|
7
|
+
/** The partyA (virtual account for lowcap) whose quotes to settle. */
|
|
8
8
|
partyA: Address;
|
|
9
9
|
/** Quote ids to include in the settlement attestation. */
|
|
10
10
|
quoteIds: readonly bigint[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-settle-upnl.d.ts","sourceRoot":"","sources":["../../../src/muon/settle-upnl/get-muon-settle-upnl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE7E,gDAAgD;AAChD,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,gBAAgB,GAAG;IACjB,
|
|
1
|
+
{"version":3,"file":"get-muon-settle-upnl.d.ts","sourceRoot":"","sources":["../../../src/muon/settle-upnl/get-muon-settle-upnl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE7E,gDAAgD;AAChD,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,gBAAgB,GAAG;IACjB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CACF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,2BAA2B,GACtC,OAAO,CAAC,2BAA2B,CAAC,CAgBtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-settle-upnl.js","names":[],"sources":["../../../src/muon/settle-upnl/get-muon-settle-upnl.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, toMuonArrayParam, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_SETTLE_UPNL, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonSettleUpnl}. */\nexport type GetMuonSettleUpnlParameters = Compute<\n ChainIdParameter & {\n /** The partyA (
|
|
1
|
+
{"version":3,"file":"get-muon-settle-upnl.js","names":[],"sources":["../../../src/muon/settle-upnl/get-muon-settle-upnl.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, toMuonArrayParam, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_SETTLE_UPNL, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonSettleUpnl}. */\nexport type GetMuonSettleUpnlParameters = Compute<\n ChainIdParameter & {\n /** The partyA (virtual account for lowcap) whose quotes to settle. */\n partyA: Address;\n /** Quote ids to include in the settlement attestation. */\n quoteIds: readonly bigint[];\n }\n>;\n\n/**\n * Normalized `settle_upnl` attestation: the shared signature envelope plus the\n * partyA's settlement uPnL fields for the requested quotes.\n *\n * @remarks\n * Verified against the live gateway: `settle_upnl` returns `uPnlA` plus a nested\n * `quoteSettlementData` (rows of `[quoteId, price, …]`) that is intentionally not\n * typed here yet. `notionalValueSumA` stays optional (absent when omitted).\n */\nexport interface GetMuonSettleUpnlReturnType extends MuonAttestationBase {\n /** The attested partyA. */\n partyA: Address;\n /** Quote ids included in the attestation. */\n quoteIds: bigint[];\n /** Signed unrealized PnL for partyA (18-decimal, signed). */\n uPnlA?: bigint;\n /** Sum of notional values across partyA's settled positions. */\n notionalValueSumA?: bigint;\n}\n\n/**\n * Fetch a fresh Muon `settle_upnl` attestation for `partyA` over `quoteIds` and\n * normalize it to typed fields. The oracle URLs and the SYMMIO diamond address\n * (the `symmio` request param) are resolved from `config`; gateways are tried in\n * order until one succeeds.\n *\n * @remarks\n * Produces the uPnL settlement data that `settleUpnl` requires. The per-quote\n * settlement data is omitted from the normalized result for now (see the\n * TODO(muon-verify) note on {@link GetMuonSettleUpnlReturnType}).\n *\n * @param config - The SDK config.\n * @param parameters - PartyA address, quote ids, and optional chain id.\n * @returns The normalized `settle_upnl` attestation.\n * @throws {SymmError} when the chain is unsupported, no Muon URLs are configured,\n * or every oracle returns an unsuccessful or malformed attestation.\n *\n * @example\n * ```ts\n * const s = await getMuonSettleUpnl(config, { partyA: \"0xva…\", quoteIds: [10n, 11n] });\n * console.log(s.uPnlA, s.quoteIds);\n * ```\n */\nexport async function getMuonSettleUpnl(\n config: Config,\n parameters: GetMuonSettleUpnlParameters,\n): Promise<GetMuonSettleUpnlReturnType> {\n const { chainId, addresses, muon } = config.getChainConfig(parameters.chainId);\n const raw = await fetchMuon(muon.urls, MUON_METHOD_SETTLE_UPNL, {\n partyA: parameters.partyA,\n chainId: chainId.toString(),\n symmio: addresses.symmioAddress,\n quoteIds: toMuonArrayParam(parameters.quoteIds),\n });\n const result = raw.data.result;\n return {\n ...toMuonAttestationBase(raw),\n partyA: parameters.partyA,\n quoteIds: muonBigIntArray(result.quoteIds),\n uPnlA: muonBigInt(result.uPnlA),\n notionalValueSumA: muonBigInt(result.notionalValueSumA),\n };\n}\n"],"mappings":";;;AA2DA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,YAAS,cAAW,YAAS,EAAO,eAAe,EAAW,OAAO,GACvE,IAAM,MAAM,EAAU,EAAK,MAAM,GAAyB;EAC9D,QAAQ,EAAW;EACnB,SAAS,EAAQ,SAAS;EAC1B,QAAQ,EAAU;EAClB,UAAU,EAAiB,EAAW,QAAQ;CAChD,CAAC,GACK,IAAS,EAAI,KAAK;CACxB,OAAO;EACL,GAAG,EAAsB,CAAG;EAC5B,QAAQ,EAAW;EACnB,UAAU,EAAgB,EAAO,QAAQ;EACzC,OAAO,EAAW,EAAO,KAAK;EAC9B,mBAAmB,EAAW,EAAO,iBAAiB;CACxD;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-settle-upnl';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-settle-upnl.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonSettleUpnlParameters, GetMuonSettleUpnlReturnType } from './get-muon-settle-upnl';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonSettleUpnlParameters, GetMuonSettleUpnlReturnType } from './get-muon-settle-upnl.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonSettleUpnlQueryOptions} query. */
|
|
6
6
|
export type GetMuonSettleUpnlData = GetMuonSettleUpnlReturnType;
|
|
7
7
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { Config } from '../../core/config';
|
|
3
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
4
|
-
import { MuonAttestationBase } from '../types';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { MuonAttestationBase } from '../types.js';
|
|
5
5
|
/** Parameters for {@link getMuonUpnl}. */
|
|
6
6
|
export type GetMuonUpnlParameters = Compute<ChainIdParameter & {
|
|
7
7
|
/** The partyB (solver/hedger) side of the pair to attest. */
|
|
8
8
|
partyB: Address;
|
|
9
|
-
/** The partyA (
|
|
9
|
+
/** The partyA (virtual account for lowcap) to attest. */
|
|
10
10
|
partyA: Address;
|
|
11
11
|
}>;
|
|
12
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl/get-muon-upnl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE3E,0CAA0C;AAC1C,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,gBAAgB,GAAG;IACjB,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"get-muon-upnl.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl/get-muon-upnl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE3E,0CAA0C;AAC1C,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,gBAAgB,GAAG;IACjB,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB,CACF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gEAAgE;IAChE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoBnH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl.js","names":[],"sources":["../../../src/muon/upnl/get-muon-upnl.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_PAIR, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnl}. */\nexport type GetMuonUpnlParameters = Compute<\n ChainIdParameter & {\n /** The partyB (solver/hedger) side of the pair to attest. */\n partyB: Address;\n /** The partyA (
|
|
1
|
+
{"version":3,"file":"get-muon-upnl.js","names":[],"sources":["../../../src/muon/upnl/get-muon-upnl.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_PAIR, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnl}. */\nexport type GetMuonUpnlParameters = Compute<\n ChainIdParameter & {\n /** The partyB (solver/hedger) side of the pair to attest. */\n partyB: Address;\n /** The partyA (virtual account for lowcap) to attest. */\n partyA: Address;\n }\n>;\n\n/**\n * Normalized `uPnl` attestation: the shared signature envelope plus the combined\n * partyA + partyB unrealized-PnL fields, with a per-party breakdown.\n *\n * @remarks\n * TODO(muon-verify): beyond the shared signature envelope, the field set/nesting\n * is best-effort from the Muon docs; optional fields are absent when the gateway\n * omits them.\n */\nexport interface GetMuonUpnlReturnType extends MuonAttestationBase {\n /** The attested partyB. */\n partyB: Address;\n /** The attested partyA. */\n partyA: Address;\n /** PartyA's signed unrealized PnL (18-decimal, signed). */\n uPnlA?: bigint;\n /** PartyB's signed unrealized PnL (18-decimal, signed). */\n uPnlB?: bigint;\n /** Sum of notional values across the partyA's positions. */\n notionalValueSumA?: bigint;\n /** Sum of notional values across the partyB's positions. */\n notionalValueSumB?: bigint;\n /** Quote ids included in the partyA side of the attestation. */\n quoteIdsA: bigint[];\n /** Quote ids included in the partyB side of the attestation. */\n quoteIdsB: bigint[];\n}\n\n/**\n * Fetch a fresh Muon `uPnl` attestation for a `partyB` / `partyA` pair and\n * normalize it to typed fields. The oracle URLs and the SYMMIO diamond address\n * (the `symmio` request param) are resolved from `config`; gateways are tried in\n * order until one succeeds.\n *\n * @remarks\n * Returns the combined attestation: partyA and partyB uPnL in one response, with\n * a per-party breakdown. For a single-party uPnL use `getMuonUpnlA` /\n * `getMuonUpnlB` instead.\n *\n * @param config - The SDK config.\n * @param parameters - PartyB and partyA addresses and optional chain id.\n * @returns The normalized `uPnl` attestation.\n * @throws {SymmError} when the chain is unsupported, no Muon URLs are configured,\n * or every oracle returns an unsuccessful or malformed attestation.\n *\n * @example\n * ```ts\n * const a = await getMuonUpnl(config, { partyB: \"0xb…\", partyA: \"0xva…\" });\n * console.log(a.uPnlA, a.uPnlB);\n * ```\n */\nexport async function getMuonUpnl(config: Config, parameters: GetMuonUpnlParameters): Promise<GetMuonUpnlReturnType> {\n const { chainId, addresses, muon } = config.getChainConfig(parameters.chainId);\n const raw = await fetchMuon(muon.urls, MUON_METHOD_UPNL_PAIR, {\n partyB: parameters.partyB,\n partyA: parameters.partyA,\n chainId: chainId.toString(),\n symmio: addresses.symmioAddress,\n });\n const result = raw.data.result;\n return {\n ...toMuonAttestationBase(raw),\n partyB: parameters.partyB,\n partyA: parameters.partyA,\n uPnlA: muonBigInt(result.uPnlA),\n uPnlB: muonBigInt(result.uPnlB),\n notionalValueSumA: muonBigInt(result.notionalValueSumA),\n notionalValueSumB: muonBigInt(result.notionalValueSumB),\n quoteIdsA: muonBigIntArray(result.quoteIdsA),\n quoteIdsB: muonBigIntArray(result.quoteIdsB),\n };\n}\n"],"mappings":";;;AAmEA,eAAsB,EAAY,GAAgB,GAAmE;CACnH,IAAM,EAAE,YAAS,cAAW,YAAS,EAAO,eAAe,EAAW,OAAO,GACvE,IAAM,MAAM,EAAU,EAAK,MAAM,GAAuB;EAC5D,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,SAAS,EAAQ,SAAS;EAC1B,QAAQ,EAAU;CACpB,CAAC,GACK,IAAS,EAAI,KAAK;CACxB,OAAO;EACL,GAAG,EAAsB,CAAG;EAC5B,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,OAAO,EAAW,EAAO,KAAK;EAC9B,OAAO,EAAW,EAAO,KAAK;EAC9B,mBAAmB,EAAW,EAAO,iBAAiB;EACtD,mBAAmB,EAAW,EAAO,iBAAiB;EACtD,WAAW,EAAgB,EAAO,SAAS;EAC3C,WAAW,EAAgB,EAAO,SAAS;CAC7C;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-upnl';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-upnl.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonUpnlParameters, GetMuonUpnlReturnType } from './get-muon-upnl';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonUpnlParameters, GetMuonUpnlReturnType } from './get-muon-upnl.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonUpnlQueryOptions} query. */
|
|
6
6
|
export type GetMuonUpnlData = GetMuonUpnlReturnType;
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { Config } from '../../core/config';
|
|
3
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
4
|
-
import { MuonAttestationBase } from '../types';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { MuonAttestationBase } from '../types.js';
|
|
5
5
|
/** Parameters for {@link getMuonUpnlA}. */
|
|
6
6
|
export type GetMuonUpnlAParameters = Compute<ChainIdParameter & {
|
|
7
|
-
/** The partyA (
|
|
7
|
+
/** The partyA (virtual account for lowcap) to attest. */
|
|
8
8
|
partyA: Address;
|
|
9
9
|
}>;
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl-a.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl-a/get-muon-upnl-a.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAExE,2CAA2C;AAC3C,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,gBAAgB,GAAG;IACjB,
|
|
1
|
+
{"version":3,"file":"get-muon-upnl-a.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl-a/get-muon-upnl-a.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAExE,2CAA2C;AAC3C,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,gBAAgB,GAAG;IACjB,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB,CACF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAgBjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl-a.js","names":[],"sources":["../../../src/muon/upnl-a/get-muon-upnl-a.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, requireMuonBigInt, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_A, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnlA}. */\nexport type GetMuonUpnlAParameters = Compute<\n ChainIdParameter & {\n /** The partyA (
|
|
1
|
+
{"version":3,"file":"get-muon-upnl-a.js","names":[],"sources":["../../../src/muon/upnl-a/get-muon-upnl-a.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, requireMuonBigInt, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_A, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnlA}. */\nexport type GetMuonUpnlAParameters = Compute<\n ChainIdParameter & {\n /** The partyA (virtual account for lowcap) to attest. */\n partyA: Address;\n }\n>;\n\n/**\n * Normalized `uPnl_A` attestation: the shared signature envelope plus partyA's\n * computed uPnL fields.\n *\n * @remarks\n * TODO(muon-verify): beyond `uPnl` (verified via Vibe-ui), the field set/nesting\n * is best-effort from the Muon docs; optional fields are absent when the gateway\n * omits them.\n */\nexport interface GetMuonUpnlAReturnType extends MuonAttestationBase {\n /** The attested partyA. */\n partyA: Address;\n /** Signed unrealized PnL (18-decimal, signed). */\n uPnl: bigint;\n /** Sum of notional values across the partyA's positions. */\n notionalValueSum?: bigint;\n /** Symbol ids included in the attestation. */\n symbolIds: bigint[];\n /** Quote ids included in the attestation. */\n quoteIds: bigint[];\n}\n\n/**\n * Fetch a fresh Muon `uPnl_A` attestation for `partyA` and normalize it to typed\n * fields. The oracle URLs and the SYMMIO diamond address (the `symmio` request\n * param) are resolved from `config`; gateways are tried in order until one\n * succeeds.\n *\n * @remarks\n * Returns the raw attestation. For the contract-ready {@link SingleUpnlSig} that\n * `removeMargin` needs, use `getDeallocateUpnlSig` instead.\n *\n * @param config - The SDK config.\n * @param parameters - PartyA address and optional chain id.\n * @returns The normalized `uPnl_A` attestation.\n * @throws {SymmError} when the chain is unsupported, no Muon URLs are configured,\n * or every oracle returns an unsuccessful or malformed attestation.\n *\n * @example\n * ```ts\n * const a = await getMuonUpnlA(config, { partyA: \"0xva…\" });\n * console.log(a.uPnl, a.quoteIds);\n * ```\n */\nexport async function getMuonUpnlA(\n config: Config,\n parameters: GetMuonUpnlAParameters,\n): Promise<GetMuonUpnlAReturnType> {\n const { chainId, addresses, muon } = config.getChainConfig(parameters.chainId);\n const raw = await fetchMuon(muon.urls, MUON_METHOD_UPNL_A, {\n partyA: parameters.partyA,\n chainId: chainId.toString(),\n symmio: addresses.symmioAddress,\n });\n const result = raw.data.result;\n return {\n ...toMuonAttestationBase(raw),\n partyA: parameters.partyA,\n uPnl: requireMuonBigInt(result.uPnl, \"uPnl\"),\n notionalValueSum: muonBigInt(result.notionalValueSum),\n symbolIds: muonBigIntArray(result.symbolIds),\n quoteIds: muonBigIntArray(result.quoteIds),\n };\n}\n"],"mappings":";;;AA0DA,eAAsB,EACpB,GACA,GACiC;CACjC,IAAM,EAAE,YAAS,cAAW,YAAS,EAAO,eAAe,EAAW,OAAO,GACvE,IAAM,MAAM,EAAU,EAAK,MAAM,GAAoB;EACzD,QAAQ,EAAW;EACnB,SAAS,EAAQ,SAAS;EAC1B,QAAQ,EAAU;CACpB,CAAC,GACK,IAAS,EAAI,KAAK;CACxB,OAAO;EACL,GAAG,EAAsB,CAAG;EAC5B,QAAQ,EAAW;EACnB,MAAM,EAAkB,EAAO,MAAM,MAAM;EAC3C,kBAAkB,EAAW,EAAO,gBAAgB;EACpD,WAAW,EAAgB,EAAO,SAAS;EAC3C,UAAU,EAAgB,EAAO,QAAQ;CAC3C;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-upnl-a';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-upnl-a.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonUpnlAParameters, GetMuonUpnlAReturnType } from './get-muon-upnl-a';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonUpnlAParameters, GetMuonUpnlAReturnType } from './get-muon-upnl-a.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonUpnlAQueryOptions} query. */
|
|
6
6
|
export type GetMuonUpnlAData = GetMuonUpnlAReturnType;
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { Config } from '../../core/config';
|
|
3
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
4
|
-
import { MuonAttestationBase } from '../types';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { MuonAttestationBase } from '../types.js';
|
|
5
5
|
/** Parameters for {@link getMuonUpnlAWithSymbolPrice}. */
|
|
6
6
|
export type GetMuonUpnlAWithSymbolPriceParameters = Compute<ChainIdParameter & {
|
|
7
|
-
/** The partyA (
|
|
7
|
+
/** The partyA (virtual account, lowcap) to attest. */
|
|
8
8
|
partyA: Address;
|
|
9
9
|
/** The symbol whose price is attested alongside the uPnL. */
|
|
10
10
|
symbolId: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl-a-with-symbol-price.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAwC,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1F,0DAA0D;AAC1D,MAAM,MAAM,qCAAqC,GAAG,OAAO,CACzD,gBAAgB,GAAG;IACjB,
|
|
1
|
+
{"version":3,"file":"get-muon-upnl-a-with-symbol-price.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAwC,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1F,0DAA0D;AAC1D,MAAM,MAAM,qCAAqC,GAAG,OAAO,CACzD,gBAAgB,GAAG;IACjB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,qCAAsC,SAAQ,mBAAmB;IAChF,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,qCAAqC,GAChD,OAAO,CAAC,qCAAqC,CAAC,CAmBhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl-a-with-symbol-price.js","names":[],"sources":["../../../src/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, requireMuonBigInt, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnlAWithSymbolPrice}. */\nexport type GetMuonUpnlAWithSymbolPriceParameters = Compute<\n ChainIdParameter & {\n /** The partyA (
|
|
1
|
+
{"version":3,"file":"get-muon-upnl-a-with-symbol-price.js","names":[],"sources":["../../../src/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, requireMuonBigInt, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnlAWithSymbolPrice}. */\nexport type GetMuonUpnlAWithSymbolPriceParameters = Compute<\n ChainIdParameter & {\n /** The partyA (virtual account, lowcap) to attest. */\n partyA: Address;\n /** The symbol whose price is attested alongside the uPnL. */\n symbolId: bigint;\n }\n>;\n\n/**\n * Normalized `uPnl_A_withSymbolPrice` attestation: the shared signature envelope\n * plus partyA's computed uPnL fields and the requested symbol's price.\n *\n * @remarks\n * TODO(muon-verify): beyond `uPnl` (verified via Vibe-ui), the field set/nesting\n * is best-effort from the Muon docs; optional fields are absent when the gateway\n * omits them.\n */\nexport interface GetMuonUpnlAWithSymbolPriceReturnType extends MuonAttestationBase {\n /** The attested partyA. */\n partyA: Address;\n /** The symbol whose price is attested. */\n symbolId: bigint;\n /** The attested price for `symbolId` (18-decimal). */\n price?: bigint;\n /** Signed unrealized PnL (18-decimal, signed). */\n uPnl: bigint;\n /** Sum of notional values across the partyA's positions. */\n notionalValueSum?: bigint;\n /** Symbol ids included in the attestation. */\n symbolIds: bigint[];\n /** Quote ids included in the attestation. */\n quoteIds: bigint[];\n}\n\n/**\n * Fetch a fresh Muon `uPnl_A_withSymbolPrice` attestation for `partyA` and a\n * single `symbolId`, and normalize it to typed fields. The oracle URLs and the\n * SYMMIO diamond address (the `symmio` request param) are resolved from `config`;\n * gateways are tried in order until one succeeds.\n *\n * @remarks\n * This attestation bundles partyA's uPnL with one symbol's price; it feeds the\n * `sendQuoteWithAffiliate` flow.\n *\n * @param config - The SDK config.\n * @param parameters - PartyA address, symbol id, and optional chain id.\n * @returns The normalized `uPnl_A_withSymbolPrice` attestation.\n * @throws {SymmError} when the chain is unsupported, no Muon URLs are configured,\n * or every oracle returns an unsuccessful or malformed attestation.\n *\n * @example\n * ```ts\n * const a = await getMuonUpnlAWithSymbolPrice(config, { partyA: \"0xva…\", symbolId: 1n });\n * console.log(a.uPnl, a.price);\n * ```\n */\nexport async function getMuonUpnlAWithSymbolPrice(\n config: Config,\n parameters: GetMuonUpnlAWithSymbolPriceParameters,\n): Promise<GetMuonUpnlAWithSymbolPriceReturnType> {\n const { chainId, addresses, muon } = config.getChainConfig(parameters.chainId);\n const raw = await fetchMuon(muon.urls, MUON_METHOD_UPNL_A_WITH_SYMBOL_PRICE, {\n partyA: parameters.partyA,\n chainId: chainId.toString(),\n symbolId: parameters.symbolId.toString(),\n symmio: addresses.symmioAddress,\n });\n const result = raw.data.result;\n return {\n ...toMuonAttestationBase(raw),\n partyA: parameters.partyA,\n symbolId: parameters.symbolId,\n price: muonBigInt(result.price),\n uPnl: requireMuonBigInt(result.uPnl, \"uPnl\"),\n notionalValueSum: muonBigInt(result.notionalValueSum),\n symbolIds: muonBigIntArray(result.symbolIds),\n quoteIds: muonBigIntArray(result.quoteIds),\n };\n}\n"],"mappings":";;;AAgEA,eAAsB,EACpB,GACA,GACgD;CAChD,IAAM,EAAE,YAAS,cAAW,YAAS,EAAO,eAAe,EAAW,OAAO,GACvE,IAAM,MAAM,EAAU,EAAK,MAAM,GAAsC;EAC3E,QAAQ,EAAW;EACnB,SAAS,EAAQ,SAAS;EAC1B,UAAU,EAAW,SAAS,SAAS;EACvC,QAAQ,EAAU;CACpB,CAAC,GACK,IAAS,EAAI,KAAK;CACxB,OAAO;EACL,GAAG,EAAsB,CAAG;EAC5B,QAAQ,EAAW;EACnB,UAAU,EAAW;EACrB,OAAO,EAAW,EAAO,KAAK;EAC9B,MAAM,EAAkB,EAAO,MAAM,MAAM;EAC3C,kBAAkB,EAAW,EAAO,gBAAgB;EACpD,WAAW,EAAgB,EAAO,SAAS;EAC3C,UAAU,EAAgB,EAAO,QAAQ;CAC3C;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-upnl-a-with-symbol-price';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-upnl-a-with-symbol-price.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonUpnlAWithSymbolPriceParameters, GetMuonUpnlAWithSymbolPriceReturnType } from './get-muon-upnl-a-with-symbol-price';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonUpnlAWithSymbolPriceParameters, GetMuonUpnlAWithSymbolPriceReturnType } from './get-muon-upnl-a-with-symbol-price.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonUpnlAWithSymbolPriceQueryOptions} query. */
|
|
6
6
|
export type GetMuonUpnlAWithSymbolPriceData = GetMuonUpnlAWithSymbolPriceReturnType;
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { Config } from '../../core/config';
|
|
3
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
4
|
-
import { MuonAttestationBase } from '../types';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { MuonAttestationBase } from '../types.js';
|
|
5
5
|
/** Parameters for {@link getMuonUpnlB}. */
|
|
6
6
|
export type GetMuonUpnlBParameters = Compute<ChainIdParameter & {
|
|
7
7
|
/** The partyB (a hedger/solver) to attest. */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-upnl-b';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-upnl-b.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonUpnlBParameters, GetMuonUpnlBReturnType } from './get-muon-upnl-b';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonUpnlBParameters, GetMuonUpnlBReturnType } from './get-muon-upnl-b.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonUpnlBQueryOptions} query. */
|
|
6
6
|
export type GetMuonUpnlBData = GetMuonUpnlBReturnType;
|
|
7
7
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { Config } from '../../core/config';
|
|
3
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
4
|
-
import { MuonAttestationBase } from '../types';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { MuonAttestationBase } from '../types.js';
|
|
5
5
|
/** Parameters for {@link getMuonUpnlWithSymbolPrice}. */
|
|
6
6
|
export type GetMuonUpnlWithSymbolPriceParameters = Compute<ChainIdParameter & {
|
|
7
7
|
/** The partyB (solver) side of the attestation. */
|
|
8
8
|
partyB: Address;
|
|
9
|
-
/** The partyA (
|
|
9
|
+
/** The partyA (virtual account, lowcap) to attest. */
|
|
10
10
|
partyA: Address;
|
|
11
11
|
/** The symbol id whose price is included in the attestation. */
|
|
12
12
|
symbolId: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl-with-symbol-price.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAsC,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAExF,yDAAyD;AACzD,MAAM,MAAM,oCAAoC,GAAG,OAAO,CACxD,gBAAgB,GAAG;IACjB,mDAAmD;IACnD,MAAM,EAAE,OAAO,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"get-muon-upnl-with-symbol-price.d.ts","sourceRoot":"","sources":["../../../src/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAsC,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAExF,yDAAyD;AACzD,MAAM,MAAM,oCAAoC,GAAG,OAAO,CACxD,gBAAgB,GAAG;IACjB,mDAAmD;IACnD,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,oCAAqC,SAAQ,mBAAmB;IAC/E,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,oCAAoC,GAC/C,OAAO,CAAC,oCAAoC,CAAC,CAqB/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-muon-upnl-with-symbol-price.js","names":[],"sources":["../../../src/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_WITH_SYMBOL_PRICE, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnlWithSymbolPrice}. */\nexport type GetMuonUpnlWithSymbolPriceParameters = Compute<\n ChainIdParameter & {\n /** The partyB (solver) side of the attestation. */\n partyB: Address;\n /** The partyA (
|
|
1
|
+
{"version":3,"file":"get-muon-upnl-with-symbol-price.js","names":[],"sources":["../../../src/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchMuon, muonBigInt, muonBigIntArray, toMuonAttestationBase } from \"../client\";\nimport { MUON_METHOD_UPNL_WITH_SYMBOL_PRICE, type MuonAttestationBase } from \"../types\";\n\n/** Parameters for {@link getMuonUpnlWithSymbolPrice}. */\nexport type GetMuonUpnlWithSymbolPriceParameters = Compute<\n ChainIdParameter & {\n /** The partyB (solver) side of the attestation. */\n partyB: Address;\n /** The partyA (virtual account, lowcap) to attest. */\n partyA: Address;\n /** The symbol id whose price is included in the attestation. */\n symbolId: bigint;\n }\n>;\n\n/**\n * Normalized `uPnlWithSymbolPrice` attestation: the shared signature envelope plus\n * both parties' computed uPnL fields and a single symbol price.\n *\n * @remarks\n * TODO(muon-verify): beyond `uPnl` (verified via Vibe-ui), the field set/nesting\n * is best-effort from the Muon docs; optional fields are absent when the gateway\n * omits them.\n */\nexport interface GetMuonUpnlWithSymbolPriceReturnType extends MuonAttestationBase {\n /** The attested partyB. */\n partyB: Address;\n /** The attested partyA. */\n partyA: Address;\n /** The symbol id the price is for. */\n symbolId: bigint;\n /** The attested symbol price (18-decimal). */\n price?: bigint;\n /** Signed unrealized PnL for partyA (18-decimal, signed). */\n uPnlA?: bigint;\n /** Signed unrealized PnL for partyB (18-decimal, signed). */\n uPnlB?: bigint;\n /** Quote ids included on partyA's side of the attestation. */\n quoteIdsA: bigint[];\n /** Quote ids included on partyB's side of the attestation. */\n quoteIdsB: bigint[];\n}\n\n/**\n * Fetch a fresh Muon `uPnlWithSymbolPrice` attestation for a `partyB`/`partyA`\n * pair and a `symbolId`, normalized to typed fields. The oracle URLs and the\n * SYMMIO diamond address (the `symmio` request param) are resolved from `config`;\n * gateways are tried in order until one succeeds.\n *\n * @remarks\n * This attestation carries both parties' uPnL plus a symbol price — the shape a\n * solver's `openPosition` call needs.\n *\n * @param config - The SDK config.\n * @param parameters - PartyB, partyA, symbol id, and optional chain id.\n * @returns The normalized `uPnlWithSymbolPrice` attestation.\n * @throws {SymmError} when the chain is unsupported, no Muon URLs are configured,\n * or every oracle returns an unsuccessful or malformed attestation.\n *\n * @example\n * ```ts\n * const a = await getMuonUpnlWithSymbolPrice(config, {\n * partyB: \"0xsolver…\",\n * partyA: \"0xva…\",\n * symbolId: 1n,\n * });\n * console.log(a.price, a.uPnlA, a.uPnlB);\n * ```\n */\nexport async function getMuonUpnlWithSymbolPrice(\n config: Config,\n parameters: GetMuonUpnlWithSymbolPriceParameters,\n): Promise<GetMuonUpnlWithSymbolPriceReturnType> {\n const { chainId, addresses, muon } = config.getChainConfig(parameters.chainId);\n const raw = await fetchMuon(muon.urls, MUON_METHOD_UPNL_WITH_SYMBOL_PRICE, {\n partyB: parameters.partyB,\n partyA: parameters.partyA,\n chainId: chainId.toString(),\n symbolId: parameters.symbolId.toString(),\n symmio: addresses.symmioAddress,\n });\n const result = raw.data.result;\n return {\n ...toMuonAttestationBase(raw),\n partyB: parameters.partyB,\n partyA: parameters.partyA,\n symbolId: parameters.symbolId,\n price: muonBigInt(result.price),\n uPnlA: muonBigInt(result.uPnlA),\n uPnlB: muonBigInt(result.uPnlB),\n quoteIdsA: muonBigIntArray(result.quoteIdsA),\n quoteIdsB: muonBigIntArray(result.quoteIdsB),\n };\n}\n"],"mappings":";;;AAwEA,eAAsB,EACpB,GACA,GAC+C;CAC/C,IAAM,EAAE,YAAS,cAAW,YAAS,EAAO,eAAe,EAAW,OAAO,GACvE,IAAM,MAAM,EAAU,EAAK,MAAM,GAAoC;EACzE,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,SAAS,EAAQ,SAAS;EAC1B,UAAU,EAAW,SAAS,SAAS;EACvC,QAAQ,EAAU;CACpB,CAAC,GACK,IAAS,EAAI,KAAK;CACxB,OAAO;EACL,GAAG,EAAsB,CAAG;EAC5B,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,UAAU,EAAW;EACrB,OAAO,EAAW,EAAO,KAAK;EAC9B,OAAO,EAAW,EAAO,KAAK;EAC9B,OAAO,EAAW,EAAO,KAAK;EAC9B,WAAW,EAAgB,EAAO,SAAS;EAC3C,WAAW,EAAgB,EAAO,SAAS;CAC7C;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-muon-upnl-with-symbol-price';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-muon-upnl-with-symbol-price.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { GetMuonUpnlWithSymbolPriceParameters, GetMuonUpnlWithSymbolPriceReturnType } from './get-muon-upnl-with-symbol-price';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetMuonUpnlWithSymbolPriceParameters, GetMuonUpnlWithSymbolPriceReturnType } from './get-muon-upnl-with-symbol-price.js';
|
|
5
5
|
/** Data resolved by the {@link getMuonUpnlWithSymbolPriceQueryOptions} query. */
|
|
6
6
|
export type GetMuonUpnlWithSymbolPriceData = GetMuonUpnlWithSymbolPriceReturnType;
|
|
7
7
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './search';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export * from './search/index.js';
|
|
2
|
+
export * from './types.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './query';
|
|
2
|
-
export * from './search-notifications';
|
|
1
|
+
export * from './query.js';
|
|
2
|
+
export * from './search-notifications.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter, ExactPartial } from '../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query';
|
|
4
|
-
import { SearchNotificationsParameters, SearchNotificationsReturnType } from './search-notifications';
|
|
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 { SearchNotificationsParameters, SearchNotificationsReturnType } from './search-notifications.js';
|
|
5
5
|
/** Data resolved by the {@link searchNotificationsQueryOptions} query. */
|
|
6
6
|
export type SearchNotificationsData = SearchNotificationsReturnType;
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Config } from '../../core/config';
|
|
2
|
-
import { ChainIdParameter, Compute } from '../../shared/types/properties';
|
|
3
|
-
import { NotificationSearchFilter, NotificationSearchResult } from '../types';
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
3
|
+
import { NotificationSearchFilter, NotificationSearchResult } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link searchNotifications}.
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RawPositionNotification } from '../websocket/notifications/types';
|
|
1
|
+
import { RawPositionNotification } from '../websocket/notifications/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* A scalar the notification search backend matches by exact equality. The
|
|
4
4
|
* `POST /api/v1/search` endpoint treats every `query` entry as an equality
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Config } from '../../../core/config';
|
|
2
|
-
import { ChainIdParameter, Compute } from '../../../shared/types/properties';
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
|
|
3
3
|
/** Health-check payload returned by the Enigma price service. */
|
|
4
4
|
export type EnigmaPriceServiceHealth = unknown;
|
|
5
5
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-enigma-price-service-health';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-enigma-price-service-health.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query';
|
|
4
|
-
import { GetEnigmaPriceServiceHealthParameters, GetEnigmaPriceServiceHealthReturnType } from './get-enigma-price-service-health';
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
|
|
4
|
+
import { GetEnigmaPriceServiceHealthParameters, GetEnigmaPriceServiceHealthReturnType } from './get-enigma-price-service-health.js';
|
|
5
5
|
/** Data resolved by the {@link getEnigmaPriceServiceHealthQueryOptions} query. */
|
|
6
6
|
export type GetEnigmaPriceServiceHealthData = GetEnigmaPriceServiceHealthReturnType;
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './health';
|
|
2
|
-
export * from './metadata';
|
|
3
|
-
export * from './prices-by-addresses';
|
|
4
|
-
export * from './prices-by-names';
|
|
5
|
-
export * from './symbols-info';
|
|
1
|
+
export * from './health/index.js';
|
|
2
|
+
export * from './metadata/index.js';
|
|
3
|
+
export * from './prices-by-addresses/index.js';
|
|
4
|
+
export * from './prices-by-names/index.js';
|
|
5
|
+
export * from './symbols-info/index.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Config } from '../../../core/config';
|
|
2
|
-
import { ChainIdParameter, Compute } from '../../../shared/types/properties';
|
|
3
|
-
import { GetMetadataApiV1MetadataGet200, MetadataResponse } from '../types/generated/enigma-price-service';
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
|
|
3
|
+
import { GetMetadataApiV1MetadataGet200, MetadataResponse } from '../types/generated/enigma-price-service.js';
|
|
4
4
|
/** Symbol metadata returned by the Enigma price service. */
|
|
5
5
|
export type EnigmaMetadata = MetadataResponse;
|
|
6
6
|
/** Mapping of symbol address to Enigma metadata. */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-enigma-price-service-metadata';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-enigma-price-service-metadata.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query';
|
|
4
|
-
import { GetEnigmaPriceServiceMetadataParameters, GetEnigmaPriceServiceMetadataReturnType } from './get-enigma-price-service-metadata';
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
|
|
4
|
+
import { GetEnigmaPriceServiceMetadataParameters, GetEnigmaPriceServiceMetadataReturnType } from './get-enigma-price-service-metadata.js';
|
|
5
5
|
/** Data resolved by the {@link getEnigmaPriceServiceMetadataQueryOptions} query. */
|
|
6
6
|
export type GetEnigmaPriceServiceMetadataData = GetEnigmaPriceServiceMetadataReturnType;
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Config } from '../../../core/config';
|
|
2
|
-
import { ChainIdParameter, Compute } from '../../../shared/types/properties';
|
|
3
|
-
import { GetPricesBySymbolAddressesApiV1PricesGet200, PriceData } from '../types/generated/enigma-price-service';
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
|
|
3
|
+
import { GetPricesBySymbolAddressesApiV1PricesGet200, PriceData } from '../types/generated/enigma-price-service.js';
|
|
4
4
|
/** Mark-price data returned by the Enigma price service for one symbol. */
|
|
5
5
|
export type EnigmaPriceData = PriceData;
|
|
6
6
|
/** Mapping of symbol address to Enigma mark-price data. */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get-enigma-price-service-prices-by-addresses';
|
|
2
|
-
export * from './query';
|
|
1
|
+
export * from './get-enigma-price-service-prices-by-addresses.js';
|
|
2
|
+
export * from './query.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Config } from '../../../core/config';
|
|
2
|
-
import { Compute, ConfigKeyParameter } from '../../../shared/types/properties';
|
|
3
|
-
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query';
|
|
4
|
-
import { GetEnigmaPriceServicePricesByAddressesParameters, GetEnigmaPriceServicePricesByAddressesReturnType } from './get-enigma-price-service-prices-by-addresses';
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
|
|
4
|
+
import { GetEnigmaPriceServicePricesByAddressesParameters, GetEnigmaPriceServicePricesByAddressesReturnType } from './get-enigma-price-service-prices-by-addresses.js';
|
|
5
5
|
/** Data resolved by the {@link getEnigmaPriceServicePricesByAddressesQueryOptions} query. */
|
|
6
6
|
export type GetEnigmaPriceServicePricesByAddressesData = GetEnigmaPriceServicePricesByAddressesReturnType;
|
|
7
7
|
/**
|