@symmio/trading-core 2.0.0 → 3.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/types.d.ts +1 -1
- package/dist/balance-history/get-balance-history/types.js.map +1 -1
- package/dist/core/chains/actions/get-chain-config.d.ts +1 -1
- package/dist/core/chains/actions/get-chain-config.js.map +1 -1
- package/dist/core/chains/actions/get-default-solver.d.ts +1 -1
- package/dist/core/chains/actions/get-default-solver.js.map +1 -1
- package/dist/core/chains/actions/list-supported-chains.js.map +1 -1
- package/dist/core/chains/registry.d.ts.map +1 -1
- package/dist/core/chains/registry.js +52 -50
- package/dist/core/chains/registry.js.map +1 -1
- package/dist/core/chains/supported-chains.d.ts +3 -3
- package/dist/core/chains/supported-chains.d.ts.map +1 -1
- package/dist/core/chains/supported-chains.js +1 -1
- package/dist/core/chains/supported-chains.js.map +1 -1
- package/dist/core/chains/types.d.ts +18 -4
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core/chains/types.js.map +1 -1
- package/dist/core/config/create-config.d.ts +7 -7
- package/dist/core/config/create-config.d.ts.map +1 -1
- package/dist/core/config/create-config.js +39 -38
- package/dist/core/config/create-config.js.map +1 -1
- package/dist/core/config/merge-chain-config.js +1 -0
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +318 -316
- package/dist/margin/calculate-margin-risk.d.ts +1 -1
- package/dist/margin/calculate-margin-risk.js.map +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/quotes/close-planning/min-remaining-quantity.d.ts +1 -1
- package/dist/quotes/close-planning/min-remaining-quantity.js.map +1 -1
- package/dist/quotes/get-quote-history/query-document.d.ts +1 -1
- package/dist/quotes/get-quote-history/query-document.js.map +1 -1
- package/dist/quotes/get-quote-history/types.d.ts +2 -2
- package/dist/quotes/get-quote-history/types.js.map +1 -1
- package/dist/quotes/grouping/aggregate-metrics.d.ts +1 -1
- package/dist/quotes/grouping/aggregate-metrics.js.map +1 -1
- package/dist/quotes/open-price.d.ts +10 -10
- package/dist/quotes/open-price.d.ts.map +1 -1
- package/dist/quotes/open-price.js +1 -1
- package/dist/quotes/open-price.js.map +1 -1
- package/dist/quotes/upnl/calculate-quote-leverage.d.ts +8 -6
- package/dist/quotes/upnl/calculate-quote-leverage.d.ts.map +1 -1
- package/dist/quotes/upnl/calculate-quote-leverage.js.map +1 -1
- package/dist/shared/utils/query.d.ts +2 -2
- package/dist/shared/utils/query.js.map +1 -1
- package/dist/solvers/force-close/force-close-position.js +1 -1
- package/dist/solvers/force-close/force-close-position.js.map +1 -1
- package/dist/solvers/force-close/get-force-close-params.js +1 -1
- package/dist/solvers/force-close/get-force-close-params.js.map +1 -1
- package/dist/solvers/instant-close/shared/calldata.js +1 -1
- package/dist/solvers/instant-close/shared/calldata.js.map +1 -1
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.d.ts +129 -0
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.d.ts.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.js +115 -0
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.js.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/index.d.ts +3 -0
- package/dist/solvers/instant-open/get-instant-open-fees/index.d.ts.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.d.ts +34 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.d.ts.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.js +33 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.js.map +1 -0
- package/dist/solvers/instant-open/index.d.ts +1 -0
- package/dist/solvers/instant-open/index.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +58 -55
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/types.d.ts +14 -4
- package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -1
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts +45 -10
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts.map +1 -1
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js +157 -72
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js.map +1 -1
- package/dist/solvers/instant-open/shared/calldata.d.ts +35 -7
- package/dist/solvers/instant-open/shared/calldata.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/calldata.js +56 -14
- package/dist/solvers/instant-open/shared/calldata.js.map +1 -1
- package/dist/solvers/instant-open/shared/index.d.ts +1 -0
- package/dist/solvers/instant-open/shared/index.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/open-estimate-guard.d.ts +89 -0
- package/dist/solvers/instant-open/shared/open-estimate-guard.d.ts.map +1 -0
- package/dist/solvers/instant-open/shared/open-estimate-guard.js +52 -0
- package/dist/solvers/instant-open/shared/open-estimate-guard.js.map +1 -0
- package/dist/solvers/instant-open/shared/selectors.d.ts +46 -7
- package/dist/solvers/instant-open/shared/selectors.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/selectors.js +12 -5
- package/dist/solvers/instant-open/shared/selectors.js.map +1 -1
- package/dist/solvers/instant-open/shared/trade-math.d.ts +112 -8
- package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/trade-math.js +59 -25
- package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
- package/dist/solvers/instant-open/shared/types.d.ts +32 -0
- package/dist/solvers/instant-open/shared/types.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/types.js.map +1 -1
- package/dist/solvers/markets/adapters/enigma-markets.d.ts.map +1 -1
- package/dist/solvers/markets/adapters/enigma-markets.js +38 -32
- package/dist/solvers/markets/adapters/enigma-markets.js.map +1 -1
- package/dist/solvers/markets/types.d.ts +15 -0
- package/dist/solvers/markets/types.d.ts.map +1 -1
- package/dist/solvers/revenue/get-solver-revenue.d.ts +11 -11
- package/dist/solvers/revenue/get-solver-revenue.d.ts.map +1 -1
- package/dist/solvers/revenue/get-solver-revenue.js +12 -12
- package/dist/solvers/revenue/get-solver-revenue.js.map +1 -1
- package/dist/solvers/revenue/query.d.ts +2 -2
- package/dist/solvers/revenue/query.d.ts.map +1 -1
- package/dist/solvers/revenue/query.js +1 -1
- package/dist/solvers/revenue/query.js.map +1 -1
- package/dist/solvers/revenue/to-solver-revenue.d.ts +3 -2
- package/dist/solvers/revenue/to-solver-revenue.d.ts.map +1 -1
- package/dist/solvers/revenue/to-solver-revenue.js.map +1 -1
- package/dist/solvers/shared/index.d.ts +1 -0
- package/dist/solvers/shared/index.d.ts.map +1 -1
- package/dist/solvers/shared/resolvers/resolve-market.d.ts +36 -5
- package/dist/solvers/shared/resolvers/resolve-market.d.ts.map +1 -1
- package/dist/solvers/shared/resolvers/resolve-market.js +30 -8
- package/dist/solvers/shared/resolvers/resolve-market.js.map +1 -1
- package/dist/solvers/shared/resolvers/types.d.ts +14 -0
- package/dist/solvers/shared/resolvers/types.d.ts.map +1 -1
- package/dist/solvers/shared/solver-close-fee.d.ts +76 -0
- package/dist/solvers/shared/solver-close-fee.d.ts.map +1 -0
- package/dist/solvers/shared/solver-close-fee.js +26 -0
- package/dist/solvers/shared/solver-close-fee.js.map +1 -0
- package/dist/solvers/symbols/to-solver-symbol.d.ts.map +1 -1
- package/dist/solvers/symbols/to-solver-symbol.js +36 -30
- package/dist/solvers/symbols/to-solver-symbol.js.map +1 -1
- package/dist/solvers/symbols/types.d.ts +22 -1
- package/dist/solvers/symbols/types.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.d.ts +8 -99
- package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js +5 -11
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/solvers/types/generated/rasa-solver.js +2 -2
- package/dist/solvers/types/generated/rasa-solver.js.map +1 -1
- package/dist/symmio-contracts/abi/index.d.ts +4 -4
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/account-layer.d.ts +499 -132
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/account-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/account-layer.js +591 -149
- package/dist/symmio-contracts/abi/v0.8.6/account-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/instant-layer.d.ts +24 -24
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/instant-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/instant-layer.js +28 -28
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/symmio.d.ts +4724 -1019
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/symmio.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/symmio.js +12750 -8308
- package/dist/symmio-contracts/abi/v0.8.6/symmio.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/cancel-registration.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/cancel-registration.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js +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.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js +1 -1
- 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.js +1 -1
- 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 +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/predict-next-virtual-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/predict-next-virtual-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js.map +1 -1
- package/dist/symmio-contracts/account-layer/types.d.ts +10 -10
- package/dist/symmio-contracts/account-layer/types.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-delegation-expiry.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-delegation-expiry.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-is-delegation-active.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-is-delegation-active.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.d.ts +1 -1
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-fee-for-user.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-fee-for-user.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-last-withdraw-request-id.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-last-withdraw-request-id.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-onchain-contract-markets.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-onchain-contract-markets.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.js +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.js +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-quotes.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-quotes.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.js +10 -9
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-quote.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.js +9 -8
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdrawable-time.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdrawable-time.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js +1 -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.js +1 -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.js +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-allocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-request-cancel-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-request-cancel-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.d.ts +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.js +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.d.ts +214 -0
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.js +248 -0
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.js.map +1 -0
- package/dist/symmio-contracts/symmio/parts.d.ts +1 -1
- package/dist/symmio-contracts/symmio/parts.js.map +1 -1
- package/dist/symmio-contracts/symmio/types.d.ts +29 -19
- package/dist/symmio-contracts/symmio/types.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/types.js.map +1 -1
- package/dist/tpsl/grouping/notional.js +6 -6
- package/dist/websocket/tpsl/parse-tpsl-frame.d.ts +1 -1
- package/dist/websocket/tpsl/parse-tpsl-frame.js.map +1 -1
- package/dist/websocket/tpsl/watch-tpsl-notifications.d.ts +1 -1
- package/dist/websocket/tpsl/watch-tpsl-notifications.js.map +1 -1
- package/package.json +1 -1
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.d.ts +0 -27
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.d.ts.map +0 -1
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.js +0 -25
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.js.map +0 -1
- package/dist/solvers/add-solver-whitelist/index.d.ts +0 -3
- package/dist/solvers/add-solver-whitelist/index.d.ts.map +0 -1
- package/dist/solvers/add-solver-whitelist/query.d.ts +0 -19
- package/dist/solvers/add-solver-whitelist/query.d.ts.map +0 -1
- package/dist/solvers/add-solver-whitelist/query.js +0 -12
- package/dist/solvers/add-solver-whitelist/query.js.map +0 -1
- package/dist/symmio-contracts/abi/v0.8.5/account-layer.js.map +0 -1
- package/dist/symmio-contracts/abi/v0.8.5/instant-layer.js.map +0 -1
- package/dist/symmio-contracts/abi/v0.8.5/symmio.js.map +0 -1
- /package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/index.d.ts +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
//#region src/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.ts
|
|
2
|
+
var e = [{
|
|
3
|
+
inputs: [{
|
|
4
|
+
internalType: "address",
|
|
5
|
+
name: "user",
|
|
6
|
+
type: "address"
|
|
7
|
+
}, {
|
|
8
|
+
internalType: "uint256",
|
|
9
|
+
name: "requestId",
|
|
10
|
+
type: "uint256"
|
|
11
|
+
}],
|
|
12
|
+
name: "getWithdrawRequests",
|
|
13
|
+
outputs: [{
|
|
14
|
+
components: [
|
|
15
|
+
{
|
|
16
|
+
internalType: "uint256",
|
|
17
|
+
name: "id",
|
|
18
|
+
type: "uint256"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
internalType: "address",
|
|
22
|
+
name: "user",
|
|
23
|
+
type: "address"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
components: [
|
|
27
|
+
{
|
|
28
|
+
internalType: "uint256",
|
|
29
|
+
name: "id",
|
|
30
|
+
type: "uint256"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
internalType: "uint256",
|
|
34
|
+
name: "amount",
|
|
35
|
+
type: "uint256"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
internalType: "int256",
|
|
39
|
+
name: "chainId",
|
|
40
|
+
type: "int256"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "bytes",
|
|
44
|
+
name: "receiver",
|
|
45
|
+
type: "bytes"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: "address",
|
|
49
|
+
name: "virtualProvider",
|
|
50
|
+
type: "address"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
internalType: "address",
|
|
54
|
+
name: "expressProvider",
|
|
55
|
+
type: "address"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
internalType: "struct WithdrawReceiverPart[]",
|
|
59
|
+
name: "parts",
|
|
60
|
+
type: "tuple[]"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
internalType: "uint256",
|
|
64
|
+
name: "timestamp",
|
|
65
|
+
type: "uint256"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
internalType: "uint256",
|
|
69
|
+
name: "cooldownEndTime",
|
|
70
|
+
type: "uint256"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
internalType: "enum WithdrawStatus",
|
|
74
|
+
name: "status",
|
|
75
|
+
type: "uint8"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
internalType: "bool",
|
|
79
|
+
name: "speedUp",
|
|
80
|
+
type: "bool"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
internalType: "bool",
|
|
84
|
+
name: "isCooldownModified",
|
|
85
|
+
type: "bool"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
internalType: "address",
|
|
89
|
+
name: "provider",
|
|
90
|
+
type: "address"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
internalType: "bool",
|
|
94
|
+
name: "isPureVirtual",
|
|
95
|
+
type: "bool"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
internalType: "bytes",
|
|
99
|
+
name: "providerData",
|
|
100
|
+
type: "bytes"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
internalType: "uint256",
|
|
104
|
+
name: "totalAmount",
|
|
105
|
+
type: "uint256"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
internalType: "uint256",
|
|
109
|
+
name: "totalVirtualAmount",
|
|
110
|
+
type: "uint256"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
internalType: "struct WithdrawRequest",
|
|
114
|
+
name: "",
|
|
115
|
+
type: "tuple"
|
|
116
|
+
}],
|
|
117
|
+
stateMutability: "view",
|
|
118
|
+
type: "function"
|
|
119
|
+
}], t = [{
|
|
120
|
+
inputs: [
|
|
121
|
+
{
|
|
122
|
+
internalType: "address",
|
|
123
|
+
name: "user",
|
|
124
|
+
type: "address"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
internalType: "uint256",
|
|
128
|
+
name: "start",
|
|
129
|
+
type: "uint256"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
internalType: "uint256",
|
|
133
|
+
name: "size",
|
|
134
|
+
type: "uint256"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
name: "getPendingWithdrawRequests",
|
|
138
|
+
outputs: [{
|
|
139
|
+
components: [
|
|
140
|
+
{
|
|
141
|
+
internalType: "uint256",
|
|
142
|
+
name: "id",
|
|
143
|
+
type: "uint256"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
internalType: "address",
|
|
147
|
+
name: "user",
|
|
148
|
+
type: "address"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
components: [
|
|
152
|
+
{
|
|
153
|
+
internalType: "uint256",
|
|
154
|
+
name: "id",
|
|
155
|
+
type: "uint256"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
internalType: "uint256",
|
|
159
|
+
name: "amount",
|
|
160
|
+
type: "uint256"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
internalType: "int256",
|
|
164
|
+
name: "chainId",
|
|
165
|
+
type: "int256"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
internalType: "bytes",
|
|
169
|
+
name: "receiver",
|
|
170
|
+
type: "bytes"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
internalType: "address",
|
|
174
|
+
name: "virtualProvider",
|
|
175
|
+
type: "address"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
internalType: "address",
|
|
179
|
+
name: "expressProvider",
|
|
180
|
+
type: "address"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
internalType: "struct WithdrawReceiverPart[]",
|
|
184
|
+
name: "parts",
|
|
185
|
+
type: "tuple[]"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
internalType: "uint256",
|
|
189
|
+
name: "timestamp",
|
|
190
|
+
type: "uint256"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
internalType: "uint256",
|
|
194
|
+
name: "cooldownEndTime",
|
|
195
|
+
type: "uint256"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
internalType: "enum WithdrawStatus",
|
|
199
|
+
name: "status",
|
|
200
|
+
type: "uint8"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
internalType: "bool",
|
|
204
|
+
name: "speedUp",
|
|
205
|
+
type: "bool"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
internalType: "bool",
|
|
209
|
+
name: "isCooldownModified",
|
|
210
|
+
type: "bool"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
internalType: "address",
|
|
214
|
+
name: "provider",
|
|
215
|
+
type: "address"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
internalType: "bool",
|
|
219
|
+
name: "isPureVirtual",
|
|
220
|
+
type: "bool"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
internalType: "bytes",
|
|
224
|
+
name: "providerData",
|
|
225
|
+
type: "bytes"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
internalType: "uint256",
|
|
229
|
+
name: "totalAmount",
|
|
230
|
+
type: "uint256"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
internalType: "uint256",
|
|
234
|
+
name: "totalVirtualAmount",
|
|
235
|
+
type: "uint256"
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
internalType: "struct WithdrawRequest[]",
|
|
239
|
+
name: "",
|
|
240
|
+
type: "tuple[]"
|
|
241
|
+
}],
|
|
242
|
+
stateMutability: "view",
|
|
243
|
+
type: "function"
|
|
244
|
+
}];
|
|
245
|
+
//#endregion
|
|
246
|
+
export { t as getPendingWithdrawRequestsAbiV085, e as getWithdrawRequestsAbiV085 };
|
|
247
|
+
|
|
248
|
+
//# sourceMappingURL=withdraw-requests-v0-8-5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withdraw-requests-v0-8-5.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.ts"],"sourcesContent":["/**\n * v0.8.5 fragments for the withdraw-request read views.\n *\n * The `WithdrawRequest` output struct **grew** in perps-core v0.8.6 (a trailing\n * `advancedAmount` field), so a v0.8.5 chain's response does not decode against\n * the shipped v0.8.6 ABI. The withdraw read actions pick the fragment matching\n * the chain's `contractsVersion` and return the v0.8.5 decode as-is — the\n * version-grown `advancedAmount` field is optional on `WithdrawRequest` and\n * stays `undefined` on chains whose contracts predate withdraw advances.\n *\n * Pinned from the `version_0.8.5` tag of `SYMM-IO/perps-core`\n * ({@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/abis/symmio.json}).\n *\n * @internal\n */\nexport const getWithdrawRequestsAbiV085 = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"user\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"requestId\",\n type: \"uint256\",\n },\n ],\n name: \"getWithdrawRequests\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"user\",\n type: \"address\",\n },\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"int256\",\n name: \"chainId\",\n type: \"int256\",\n },\n {\n internalType: \"bytes\",\n name: \"receiver\",\n type: \"bytes\",\n },\n {\n internalType: \"address\",\n name: \"virtualProvider\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"expressProvider\",\n type: \"address\",\n },\n ],\n internalType: \"struct WithdrawReceiverPart[]\",\n name: \"parts\",\n type: \"tuple[]\",\n },\n {\n internalType: \"uint256\",\n name: \"timestamp\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"cooldownEndTime\",\n type: \"uint256\",\n },\n {\n internalType: \"enum WithdrawStatus\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"bool\",\n name: \"speedUp\",\n type: \"bool\",\n },\n {\n internalType: \"bool\",\n name: \"isCooldownModified\",\n type: \"bool\",\n },\n {\n internalType: \"address\",\n name: \"provider\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"isPureVirtual\",\n type: \"bool\",\n },\n {\n internalType: \"bytes\",\n name: \"providerData\",\n type: \"bytes\",\n },\n {\n internalType: \"uint256\",\n name: \"totalAmount\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"totalVirtualAmount\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct WithdrawRequest\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n\nexport const getPendingWithdrawRequestsAbiV085 = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"user\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"start\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"size\",\n type: \"uint256\",\n },\n ],\n name: \"getPendingWithdrawRequests\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"address\",\n name: \"user\",\n type: \"address\",\n },\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"int256\",\n name: \"chainId\",\n type: \"int256\",\n },\n {\n internalType: \"bytes\",\n name: \"receiver\",\n type: \"bytes\",\n },\n {\n internalType: \"address\",\n name: \"virtualProvider\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"expressProvider\",\n type: \"address\",\n },\n ],\n internalType: \"struct WithdrawReceiverPart[]\",\n name: \"parts\",\n type: \"tuple[]\",\n },\n {\n internalType: \"uint256\",\n name: \"timestamp\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"cooldownEndTime\",\n type: \"uint256\",\n },\n {\n internalType: \"enum WithdrawStatus\",\n name: \"status\",\n type: \"uint8\",\n },\n {\n internalType: \"bool\",\n name: \"speedUp\",\n type: \"bool\",\n },\n {\n internalType: \"bool\",\n name: \"isCooldownModified\",\n type: \"bool\",\n },\n {\n internalType: \"address\",\n name: \"provider\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"isPureVirtual\",\n type: \"bool\",\n },\n {\n internalType: \"bytes\",\n name: \"providerData\",\n type: \"bytes\",\n },\n {\n internalType: \"uint256\",\n name: \"totalAmount\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"totalVirtualAmount\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct WithdrawRequest[]\",\n name: \"\",\n type: \"tuple[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n"],"mappings":";AAeA,IAAa,IAA6B,CACxC;CACE,QAAQ,CACN;EACE,cAAc;EACd,MAAM;EACN,MAAM;CACR,GACA;EACE,cAAc;EACd,MAAM;EACN,MAAM;CACR,CACF;CACA,MAAM;CACN,SAAS,CACP;EACE,YAAY;GACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,YAAY;KACV;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;IACF;IACA,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,cAAc;EACd,MAAM;EACN,MAAM;CACR,CACF;CACA,iBAAiB;CACjB,MAAM;AACR,CACF,GAEa,IAAoC,CAC/C;CACE,QAAQ;EACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR;EACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR;EACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR;CACF;CACA,MAAM;CACN,SAAS,CACP;EACE,YAAY;GACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,YAAY;KACV;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;KACA;MACE,cAAc;MACd,MAAM;MACN,MAAM;KACR;IACF;IACA,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,cAAc;EACd,MAAM;EACN,MAAM;CACR,CACF;CACA,iBAAiB;CACjB,MAAM;AACR,CACF"}
|
|
@@ -17,7 +17,7 @@ import { WithdrawReceiverPart } from './types.js';
|
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
20
|
-
* const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: "0xabc…", chainId:
|
|
20
|
+
* const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: "0xabc…", chainId: 42161n });
|
|
21
21
|
* await initiateWithdraw(config, { account, parts: [part] });
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","names":[],"sources":["../../../src/symmio-contracts/symmio/parts.ts"],"sourcesContent":["import { zeroAddress, type Address } from \"viem\";\nimport type { WithdrawReceiverPart } from \"./types\";\n\n/**\n * Build a {@link WithdrawReceiverPart} for a standard same-chain withdrawal — no\n * express, no virtual provider.\n *\n * Convenience over hand-constructing the tuple: it fills both provider fields\n * with the zero address. `initiateWithdraw` still accepts the full `parts` array\n * directly, so use this only when you want the classic single-part case.\n *\n * @remarks\n * A 20-byte EVM address is already its own `bytes` representation, so `receiver`\n * is the destination address as-is — no encoding needed for EVM destinations.\n *\n * @param parameters - Part id, amount (collateral units), destination address, destination chain id.\n * @returns A classic (provider-free) withdraw receiver part.\n *\n * @example\n * ```ts\n * const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId:
|
|
1
|
+
{"version":3,"file":"parts.js","names":[],"sources":["../../../src/symmio-contracts/symmio/parts.ts"],"sourcesContent":["import { zeroAddress, type Address } from \"viem\";\nimport type { WithdrawReceiverPart } from \"./types\";\n\n/**\n * Build a {@link WithdrawReceiverPart} for a standard same-chain withdrawal — no\n * express, no virtual provider.\n *\n * Convenience over hand-constructing the tuple: it fills both provider fields\n * with the zero address. `initiateWithdraw` still accepts the full `parts` array\n * directly, so use this only when you want the classic single-part case.\n *\n * @remarks\n * A 20-byte EVM address is already its own `bytes` representation, so `receiver`\n * is the destination address as-is — no encoding needed for EVM destinations.\n *\n * @param parameters - Part id, amount (collateral units), destination address, destination chain id.\n * @returns A classic (provider-free) withdraw receiver part.\n *\n * @example\n * ```ts\n * const part = createClassicWithdrawPart({ id: 0n, amount: 1_000000n, receiver: \"0xabc…\", chainId: 42161n });\n * await initiateWithdraw(config, { account, parts: [part] });\n * ```\n */\nexport function createClassicWithdrawPart(parameters: {\n /** Caller-assigned part id, unique within the request. */\n id: bigint;\n /** Amount of collateral for this part, in the collateral token's smallest unit. */\n amount: bigint;\n /** Destination EVM address. */\n receiver: Address;\n /** Destination chain id (use the source chain id for a same-chain withdrawal). */\n chainId: bigint;\n}): WithdrawReceiverPart {\n return {\n id: parameters.id,\n amount: parameters.amount,\n chainId: parameters.chainId,\n receiver: parameters.receiver,\n virtualProvider: zeroAddress,\n expressProvider: zeroAddress,\n };\n}\n"],"mappings":";;AAwBA,SAAgB,EAA0B,GASjB;CACvB,OAAO;EACL,IAAI,EAAW;EACf,QAAQ,EAAW;EACnB,SAAS,EAAW;EACpB,UAAU,EAAW;EACrB,iBAAiB;EACjB,iBAAiB;CACnB;AACF"}
|
|
@@ -14,7 +14,7 @@ import { SchnorrSign } from '../account-layer/types.js';
|
|
|
14
14
|
*
|
|
15
15
|
* Compare {@link SingleUpnlSig}, which is the uPnL-only variant (no `price`).
|
|
16
16
|
*
|
|
17
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
17
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}
|
|
18
18
|
*/
|
|
19
19
|
export interface SingleUpnlAndPriceSig {
|
|
20
20
|
/** Muon request id (opaque bytes). */
|
|
@@ -44,7 +44,7 @@ export interface SingleUpnlAndPriceSig {
|
|
|
44
44
|
* **Field-order footgun:** `upnlPartyB` comes **before** `upnlPartyA`. Swapping
|
|
45
45
|
* them type-checks green (both are `bigint`) and silently mis-encodes the call.
|
|
46
46
|
*
|
|
47
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
47
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}
|
|
48
48
|
*/
|
|
49
49
|
export interface HighLowPriceSig {
|
|
50
50
|
/** Muon request id (opaque bytes). */
|
|
@@ -79,10 +79,10 @@ export interface HighLowPriceSig {
|
|
|
79
79
|
*
|
|
80
80
|
* @remarks
|
|
81
81
|
* Names and ordering mirror the on-chain `enum WithdrawStatus` in
|
|
82
|
-
* `WithdrawStorage.sol` (perps-core v0.8.
|
|
82
|
+
* `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` returned by
|
|
83
83
|
* the withdraw read views casts directly to this enum without translation.
|
|
84
84
|
*
|
|
85
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
85
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}
|
|
86
86
|
*/
|
|
87
87
|
export declare enum WithdrawStatus {
|
|
88
88
|
/** Created, awaiting provider acceptance (classic withdrawals stay here until finalized). */
|
|
@@ -106,10 +106,10 @@ export declare enum WithdrawStatus {
|
|
|
106
106
|
* withdrawal is a single part with both provider fields set to the zero address.
|
|
107
107
|
*
|
|
108
108
|
* Field shapes and ordering mirror the on-chain `WithdrawReceiverPart` struct in
|
|
109
|
-
* `WithdrawStorage.sol` (perps-core v0.8.
|
|
109
|
+
* `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the object encodes
|
|
110
110
|
* directly as the contract tuple without translation.
|
|
111
111
|
*
|
|
112
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
112
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}
|
|
113
113
|
*/
|
|
114
114
|
export interface WithdrawReceiverPart {
|
|
115
115
|
/** Caller-assigned part id, unique within the request. */
|
|
@@ -130,10 +130,13 @@ export interface WithdrawReceiverPart {
|
|
|
130
130
|
* read views ({@link "getWithdrawRequests"}, {@link "getPendingWithdrawRequests"}).
|
|
131
131
|
*
|
|
132
132
|
* Field shapes and ordering mirror the on-chain `WithdrawRequest` struct in
|
|
133
|
-
* `WithdrawStorage.sol` (perps-core v0.8.
|
|
134
|
-
* {@link WithdrawStatus} enum rather than a raw `uint8`.
|
|
133
|
+
* `WithdrawStorage.sol` (perps-core v0.8.6). `status` is surfaced as the
|
|
134
|
+
* {@link WithdrawStatus} enum rather than a raw `uint8`. Fields a newer
|
|
135
|
+
* contracts generation added are **optional** and `undefined` on chains whose
|
|
136
|
+
* deployment predates them (see `contractsVersion` in the chain config) —
|
|
137
|
+
* today that is {@link WithdrawRequest.advancedAmount}, added in v0.8.6.
|
|
135
138
|
*
|
|
136
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
139
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}
|
|
137
140
|
*/
|
|
138
141
|
export interface WithdrawRequest {
|
|
139
142
|
/** Sequential request id (starts at 1 per user). */
|
|
@@ -162,16 +165,23 @@ export interface WithdrawRequest {
|
|
|
162
165
|
totalAmount: bigint;
|
|
163
166
|
/** Total amount delivered via virtual providers. */
|
|
164
167
|
totalVirtualAmount: bigint;
|
|
168
|
+
/**
|
|
169
|
+
* Collateral already advanced to the provider before cooldown expiry
|
|
170
|
+
* (express credit-line flow). Added in perps-core v0.8.6 — **`undefined` on a
|
|
171
|
+
* `contractsVersion: "0.8.5"` chain**, whose contracts predate withdraw
|
|
172
|
+
* advances.
|
|
173
|
+
*/
|
|
174
|
+
advancedAmount?: bigint;
|
|
165
175
|
}
|
|
166
176
|
/**
|
|
167
177
|
* Direction of a trading position.
|
|
168
178
|
*
|
|
169
179
|
* @remarks
|
|
170
180
|
* Names and ordering mirror the on-chain `enum PositionType` in
|
|
171
|
-
* `QuoteStorage.sol` (perps-core v0.8.
|
|
181
|
+
* `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` carried on a
|
|
172
182
|
* {@link Quote} casts directly to this enum without translation.
|
|
173
183
|
*
|
|
174
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
184
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}
|
|
175
185
|
*/
|
|
176
186
|
export declare enum PositionType {
|
|
177
187
|
/** A long position — profits when the market price rises. */
|
|
@@ -184,10 +194,10 @@ export declare enum PositionType {
|
|
|
184
194
|
*
|
|
185
195
|
* @remarks
|
|
186
196
|
* Names and ordering mirror the on-chain `enum OrderType` in `QuoteStorage.sol`
|
|
187
|
-
* (perps-core v0.8.
|
|
197
|
+
* (perps-core v0.8.6) exactly, so the `uint8` carried on a {@link Quote} casts
|
|
188
198
|
* directly to this enum without translation.
|
|
189
199
|
*
|
|
190
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
200
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}
|
|
191
201
|
*/
|
|
192
202
|
export declare enum OrderType {
|
|
193
203
|
/** Fills only at the requested price or better. */
|
|
@@ -200,14 +210,14 @@ export declare enum OrderType {
|
|
|
200
210
|
*
|
|
201
211
|
* @remarks
|
|
202
212
|
* Names and ordering mirror the on-chain `enum QuoteStatus` in
|
|
203
|
-
* `QuoteStorage.sol` (perps-core v0.8.
|
|
213
|
+
* `QuoteStorage.sol` (perps-core v0.8.6) exactly — all 11 members, including
|
|
204
214
|
* `LIQUIDATED_PENDING` (10) — so the `uint8` carried on a {@link Quote} casts
|
|
205
215
|
* directly to this enum without translation. `getPartyAOpenPositions` returns
|
|
206
216
|
* only `OPENED`, `CLOSE_PENDING`, `CANCEL_CLOSE_PENDING`, and `LIQUIDATED_PENDING`
|
|
207
217
|
* quotes; `getPartyAPendingQuotes` returns only `PENDING`, `LOCKED`, and
|
|
208
218
|
* `CANCEL_PENDING`.
|
|
209
219
|
*
|
|
210
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
220
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}
|
|
211
221
|
*/
|
|
212
222
|
export declare enum QuoteStatus {
|
|
213
223
|
/** Created, awaiting a partyB to lock it. */
|
|
@@ -238,10 +248,10 @@ export declare enum QuoteStatus {
|
|
|
238
248
|
* smallest unit (raw `uint256`).
|
|
239
249
|
*
|
|
240
250
|
* Field shapes and ordering mirror the on-chain `struct LockedValues` in
|
|
241
|
-
* `QuoteStorage.sol` (perps-core v0.8.
|
|
251
|
+
* `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the object decodes directly
|
|
242
252
|
* from the contract tuple without translation.
|
|
243
253
|
*
|
|
244
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
254
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}
|
|
245
255
|
*/
|
|
246
256
|
export interface LockedValues {
|
|
247
257
|
/** Credit Valuation Adjustment locked by partyA. */
|
|
@@ -258,12 +268,12 @@ export interface LockedValues {
|
|
|
258
268
|
* by the quote read views ({@link "getQuote"}, {@link "getPartyAOpenPositions"}).
|
|
259
269
|
*
|
|
260
270
|
* Field shapes and ordering mirror the on-chain `struct Quote` in
|
|
261
|
-
* `QuoteStorage.sol` (perps-core v0.8.
|
|
271
|
+
* `QuoteStorage.sol` (perps-core v0.8.6) exactly — every `uint256`/`int256` is a
|
|
262
272
|
* raw `bigint` (no decimal scaling applied) and the `uint8` enum fields are
|
|
263
273
|
* surfaced as the {@link PositionType}, {@link OrderType}, and {@link QuoteStatus}
|
|
264
274
|
* enums rather than raw numbers. Prices and amounts are 18-decimal fixed point.
|
|
265
275
|
*
|
|
266
|
-
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.
|
|
276
|
+
* @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}
|
|
267
277
|
*/
|
|
268
278
|
export interface Quote {
|
|
269
279
|
/** Sequential quote id (starts at 1; `0n` is the not-found sentinel). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/symmio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,KAAK,EAAE,GAAG,CAAC;IACX,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,gBAAgB,EAAE,GAAG,CAAC;IACtB,wCAAwC;IACxC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,KAAK,EAAE,GAAG,CAAC;IACX,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,gBAAgB,EAAE,GAAG,CAAC;IACtB,wCAAwC;IACxC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,oBAAY,cAAc;IACxB,6FAA6F;IAC7F,OAAO,IAAI;IACX,uCAAuC;IACvC,iBAAiB,IAAI;IACrB,wDAAwD;IACxD,iBAAiB,IAAI;IACrB,mDAAmD;IACnD,SAAS,IAAI;IACb,mEAAmE;IACnE,gBAAgB,IAAI;IACpB,oCAAoC;IACpC,SAAS,IAAI;IACb,iDAAiD;IACjD,SAAS,IAAI;CACd;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAC;IAChB,+FAA+F;IAC/F,QAAQ,EAAE,GAAG,CAAC;IACd,iFAAiF;IACjF,eAAe,EAAE,OAAO,CAAC;IACzB,oFAAoF;IACpF,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/symmio/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/symmio-contracts/symmio/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { SchnorrSign } from \"../account-layer/types\";\n\n/**\n * A Muon attestation covering a party's uPnL **and** a symbol price, mirrored\n * from the on-chain `SingleUpnlAndPriceSig` struct field-for-field (same order)\n * so the object encodes directly as the contract tuple without translation.\n *\n * @remarks\n * This is the `upnlSig` argument of `sendQuoteWithAffiliateAndData`. Solvers\n * that enforce Muon verification (Rasa / majors) require a live attestation\n * here; the lowcap InstantLayer flow instead passes a placeholder and delegates\n * the byte range to the solver. Fetch a fresh one with `getSendQuoteUpnlSig`\n * immediately before signing — the attestation is timestamped and short-lived.\n *\n * Compare {@link SingleUpnlSig}, which is the uPnL-only variant (no `price`).\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/MuonStorage.sol}\n */\nexport interface SingleUpnlAndPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Signed unrealized PnL of the party, `int256` (may be negative). */\n upnl: bigint;\n /** Attested symbol price as 18-decimal fixed point. */\n price: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * A Muon attestation covering a symbol's price range over a time window,\n * mirrored from the on-chain `HighLowPriceSig` struct field-for-field (same\n * order) so the object encodes directly as the contract tuple without\n * translation.\n *\n * @remarks\n * This is what `forceClosePosition` / `settleAndForceClosePosition` verify to\n * prove the market traded through the position's close price during the window.\n * Fetch one with `getForceClosePriceSig`.\n *\n * **Field-order footgun:** `upnlPartyB` comes **before** `upnlPartyA`. Swapping\n * them type-checks green (both are `bigint`) and silently mis-encodes the call.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/MuonStorage.sol}\n */\nexport interface HighLowPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Symbol id the price range is for. */\n symbolId: bigint;\n /** Highest price observed in the window, 18-decimal fixed point. */\n highest: bigint;\n /** Lowest price observed in the window, 18-decimal fixed point. */\n lowest: bigint;\n /** Mean price over the window, 18-decimal fixed point (Muon returns it as `mean`). */\n averagePrice: bigint;\n /** Window start timestamp (seconds). */\n startTime: bigint;\n /** Window end timestamp (seconds). */\n endTime: bigint;\n /** PartyB's signed unrealized PnL, `int256`. Declared **before** `upnlPartyA`. */\n upnlPartyB: bigint;\n /** PartyA's signed unrealized PnL, `int256`. */\n upnlPartyA: bigint;\n /** Current price at attestation time, 18-decimal fixed point. */\n currentPrice: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * Lifecycle status of a SYMMIO withdraw request.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum WithdrawStatus` in\n * `WithdrawStorage.sol` (perps-core v0.8.5) exactly, so the `uint8` returned by\n * the withdraw read views casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/WithdrawStorage.sol}\n */\nexport enum WithdrawStatus {\n /** Created, awaiting provider acceptance (classic withdrawals stay here until finalized). */\n PENDING = 0,\n /** A provider accepted the request. */\n PROVIDER_ACCEPTED = 1,\n /** A provider declined the request; it was refunded. */\n PROVIDER_REJECTED = 2,\n /** Finalized successfully; funds were paid out. */\n COMPLETED = 3,\n /** The user requested cancellation; awaiting provider approval. */\n CANCEL_REQUESTED = 4,\n /** Fully cancelled and refunded. */\n CANCELLED = 5,\n /** Suspended due to a user-level restriction. */\n SUSPENDED = 6,\n}\n\n/**\n * One receiver \"part\" of a withdraw request. A single request may split its\n * amount across several parts (different chains/providers); a plain same-chain\n * withdrawal is a single part with both provider fields set to the zero address.\n *\n * Field shapes and ordering mirror the on-chain `WithdrawReceiverPart` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.5) exactly, so the object encodes\n * directly as the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawReceiverPart {\n /** Caller-assigned part id, unique within the request. */\n id: bigint;\n /** Amount of collateral for this part, in the collateral token's smallest unit. */\n amount: bigint;\n /** Destination chain id (`int256` on-chain; the source chain for a same-chain part). */\n chainId: bigint;\n /** Destination address as raw bytes (a 20-byte EVM address is its own byte representation). */\n receiver: Hex;\n /** Virtual (cross-chain) provider, or the zero address for a same-chain part. */\n virtualProvider: Address;\n /** Express (instant) provider, or the zero address for a standard-cooldown part. */\n expressProvider: Address;\n}\n\n/**\n * A full withdraw request as stored on the SYMMIO core, returned by the withdraw\n * read views ({@link \"getWithdrawRequests\"}, {@link \"getPendingWithdrawRequests\"}).\n *\n * Field shapes and ordering mirror the on-chain `WithdrawRequest` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.5) exactly. `status` is surfaced as the\n * {@link WithdrawStatus} enum rather than a raw `uint8`.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawRequest {\n /** Sequential request id (starts at 1 per user). */\n id: bigint;\n /** The subaccount the request belongs to. */\n user: Address;\n /** The receiver parts the withdrawal is split into. */\n parts: readonly WithdrawReceiverPart[];\n /** Block timestamp at which the request was created. */\n timestamp: bigint;\n /** Earliest timestamp the request can be finalized. */\n cooldownEndTime: bigint;\n /** Current lifecycle status. */\n status: WithdrawStatus;\n /** Whether the request opted into the cooldown speed-up flow. */\n speedUp: boolean;\n /** Whether the cooldown was modified after creation (e.g. by an accepted speed-up). */\n isCooldownModified: boolean;\n /** The provider bound to the request, or the zero address for a classic withdrawal. */\n provider: Address;\n /** Whether the request is a pure-virtual (cross-chain, no express) withdrawal. */\n isPureVirtual: boolean;\n /** Opaque provider data (e.g. a signed option), or `0x`. */\n providerData: Hex;\n /** Total collateral amount across all parts. */\n totalAmount: bigint;\n /** Total amount delivered via virtual providers. */\n totalVirtualAmount: bigint;\n}\n\n/**\n * Direction of a trading position.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum PositionType` in\n * `QuoteStorage.sol` (perps-core v0.8.5) exactly, so the `uint8` carried on a\n * {@link Quote} casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum PositionType {\n /** A long position — profits when the market price rises. */\n LONG = 0,\n /** A short position — profits when the market price falls. */\n SHORT = 1,\n}\n\n/**\n * How an order is priced and filled.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum OrderType` in `QuoteStorage.sol`\n * (perps-core v0.8.5) exactly, so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum OrderType {\n /** Fills only at the requested price or better. */\n LIMIT = 0,\n /** Fills at the prevailing market price. */\n MARKET = 1,\n}\n\n/**\n * Lifecycle status of a quote, from creation through settlement.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum QuoteStatus` in\n * `QuoteStorage.sol` (perps-core v0.8.5) exactly — all 11 members, including\n * `LIQUIDATED_PENDING` (10) — so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation. `getPartyAOpenPositions` returns\n * only `OPENED`, `CLOSE_PENDING`, `CANCEL_CLOSE_PENDING`, and `LIQUIDATED_PENDING`\n * quotes; `getPartyAPendingQuotes` returns only `PENDING`, `LOCKED`, and\n * `CANCEL_PENDING`.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum QuoteStatus {\n /** Created, awaiting a partyB to lock it. */\n PENDING = 0,\n /** A partyB locked the quote and is preparing to open it. */\n LOCKED = 1,\n /** PartyA requested cancellation of a still-pending quote. */\n CANCEL_PENDING = 2,\n /** The pending quote was cancelled before opening. */\n CANCELED = 3,\n /** Opened into a live position. */\n OPENED = 4,\n /** PartyA requested a (full or partial) close of the open position. */\n CLOSE_PENDING = 5,\n /** PartyA requested cancellation of a pending close. */\n CANCEL_CLOSE_PENDING = 6,\n /** The position was fully closed. */\n CLOSED = 7,\n /** The position was liquidated. */\n LIQUIDATED = 8,\n /** The pending quote expired before being opened. */\n EXPIRED = 9,\n /** Liquidation is in progress for the position. */\n LIQUIDATED_PENDING = 10,\n}\n\n/**\n * Margin amounts locked against a {@link Quote}, in the collateral token's\n * smallest unit (raw `uint256`).\n *\n * Field shapes and ordering mirror the on-chain `struct LockedValues` in\n * `QuoteStorage.sol` (perps-core v0.8.5) exactly, so the object decodes directly\n * from the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface LockedValues {\n /** Credit Valuation Adjustment locked by partyA. */\n cva: bigint;\n /** Liquidation Fee locked by partyA. */\n lf: bigint;\n /** PartyA maintenance margin. */\n partyAmm: bigint;\n /** PartyB maintenance margin. */\n partyBmm: bigint;\n}\n\n/**\n * A full trading quote or open position as stored on the SYMMIO core, returned\n * by the quote read views ({@link \"getQuote\"}, {@link \"getPartyAOpenPositions\"}).\n *\n * Field shapes and ordering mirror the on-chain `struct Quote` in\n * `QuoteStorage.sol` (perps-core v0.8.5) exactly — every `uint256`/`int256` is a\n * raw `bigint` (no decimal scaling applied) and the `uint8` enum fields are\n * surfaced as the {@link PositionType}, {@link OrderType}, and {@link QuoteStatus}\n * enums rather than raw numbers. Prices and amounts are 18-decimal fixed point.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface Quote {\n /** Sequential quote id (starts at 1; `0n` is the not-found sentinel). */\n id: bigint;\n /** PartyB addresses allowed to fill this quote (empty means any). */\n partyBsWhiteList: readonly Address[];\n /** Market identifier (`symbolId`) the quote trades. */\n symbolId: bigint;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order. */\n orderType: OrderType;\n /** Price partyB actually opened at (0 until opened). */\n openedPrice: bigint;\n /** Price partyA originally requested to open at. */\n initialOpenedPrice: bigint;\n /** Current requested open price (may differ from `initialOpenedPrice` after edits). */\n requestedOpenPrice: bigint;\n /** Market price snapshot recorded on the quote at its last state change. */\n marketPrice: bigint;\n /** Total quantity partyA requested. */\n quantity: bigint;\n /** Quantity already closed. */\n closedAmount: bigint;\n /** Margin locked at open time (basis for leverage). */\n initialLockedValues: LockedValues;\n /** Margin currently locked. */\n lockedValues: LockedValues;\n /** Maximum funding rate partyA accepts. */\n maxFundingRate: bigint;\n /** Owner of the quote — the virtual account (lowcap). */\n partyA: Address;\n /** The partyB (hedger/solver) that locked/opened the quote, or the zero address. */\n partyB: Address;\n /** Current lifecycle status. */\n quoteStatus: QuoteStatus;\n /** Average price across executed closes. */\n avgClosedPrice: bigint;\n /** Requested limit price for a pending close. */\n requestedClosePrice: bigint;\n /** Quantity of a pending close request. */\n quantityToClose: bigint;\n /** Parent quote id for a partially-opened child, or `0n`. */\n parentId: bigint;\n /** Block timestamp the quote was created. */\n createTimestamp: bigint;\n /** Block timestamp of the last status change (sort key). */\n statusModifyTimestamp: bigint;\n /** Block timestamp funding was last applied. */\n lastFundingPaymentTimestamp: bigint;\n /** Quote deadline (expiry) timestamp. */\n deadline: bigint;\n /** Trading fee charged on the quote. */\n tradingFee: bigint;\n /** Affiliate address attributed to the quote, or the zero address. */\n affiliate: Address;\n /**\n * Cumulative funding-**rate index** already settled on this quote (`int256`,\n * 18-decimal fixed point) — the position's funding rate multiplied by the\n * epochs elapsed since the funding fee started. **Not a currency amount**:\n * the settled fee is only obtained as\n * `openAmount × (currentFee − accumulatedPaidFunding) / 1e18`, so summing this\n * field across quotes is meaningless. For real settled funding amounts use\n * {@link getQuoteFunding} / {@link aggregateGroupFunding}.\n */\n accumulatedPaidFunding: bigint;\n /** Fee charged on close. */\n closeFee: bigint;\n /** Opaque per-quote data, or `0x`. */\n data: Hex;\n}\n"],"mappings":";AAyFA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,mBAAA,KAAA,oBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,YAAA,KAAA;AACF,EAAA,CAAA,CAAA,GA6EY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,OAAA,KAAA,QAEA,EAAA,EAAA,QAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAYY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,QAAA,KAAA,SAEA,EAAA,EAAA,SAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAgBY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,iBAAA,KAAA,kBAEA,EAAA,EAAA,WAAA,KAAA,YAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,gBAAA,KAAA,iBAEA,EAAA,EAAA,uBAAA,KAAA,wBAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,aAAA,KAAA,cAEA,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,qBAAA,MAAA;AACF,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/symmio-contracts/symmio/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { SchnorrSign } from \"../account-layer/types\";\n\n/**\n * A Muon attestation covering a party's uPnL **and** a symbol price, mirrored\n * from the on-chain `SingleUpnlAndPriceSig` struct field-for-field (same order)\n * so the object encodes directly as the contract tuple without translation.\n *\n * @remarks\n * This is the `upnlSig` argument of `sendQuoteWithAffiliateAndData`. Solvers\n * that enforce Muon verification (Rasa / majors) require a live attestation\n * here; the lowcap InstantLayer flow instead passes a placeholder and delegates\n * the byte range to the solver. Fetch a fresh one with `getSendQuoteUpnlSig`\n * immediately before signing — the attestation is timestamped and short-lived.\n *\n * Compare {@link SingleUpnlSig}, which is the uPnL-only variant (no `price`).\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}\n */\nexport interface SingleUpnlAndPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Signed unrealized PnL of the party, `int256` (may be negative). */\n upnl: bigint;\n /** Attested symbol price as 18-decimal fixed point. */\n price: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * A Muon attestation covering a symbol's price range over a time window,\n * mirrored from the on-chain `HighLowPriceSig` struct field-for-field (same\n * order) so the object encodes directly as the contract tuple without\n * translation.\n *\n * @remarks\n * This is what `forceClosePosition` / `settleAndForceClosePosition` verify to\n * prove the market traded through the position's close price during the window.\n * Fetch one with `getForceClosePriceSig`.\n *\n * **Field-order footgun:** `upnlPartyB` comes **before** `upnlPartyA`. Swapping\n * them type-checks green (both are `bigint`) and silently mis-encodes the call.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/MuonStorage.sol}\n */\nexport interface HighLowPriceSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Symbol id the price range is for. */\n symbolId: bigint;\n /** Highest price observed in the window, 18-decimal fixed point. */\n highest: bigint;\n /** Lowest price observed in the window, 18-decimal fixed point. */\n lowest: bigint;\n /** Mean price over the window, 18-decimal fixed point (Muon returns it as `mean`). */\n averagePrice: bigint;\n /** Window start timestamp (seconds). */\n startTime: bigint;\n /** Window end timestamp (seconds). */\n endTime: bigint;\n /** PartyB's signed unrealized PnL, `int256`. Declared **before** `upnlPartyA`. */\n upnlPartyB: bigint;\n /** PartyA's signed unrealized PnL, `int256`. */\n upnlPartyA: bigint;\n /** Current price at attestation time, 18-decimal fixed point. */\n currentPrice: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * Lifecycle status of a SYMMIO withdraw request.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum WithdrawStatus` in\n * `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` returned by\n * the withdraw read views casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport enum WithdrawStatus {\n /** Created, awaiting provider acceptance (classic withdrawals stay here until finalized). */\n PENDING = 0,\n /** A provider accepted the request. */\n PROVIDER_ACCEPTED = 1,\n /** A provider declined the request; it was refunded. */\n PROVIDER_REJECTED = 2,\n /** Finalized successfully; funds were paid out. */\n COMPLETED = 3,\n /** The user requested cancellation; awaiting provider approval. */\n CANCEL_REQUESTED = 4,\n /** Fully cancelled and refunded. */\n CANCELLED = 5,\n /** Suspended due to a user-level restriction. */\n SUSPENDED = 6,\n}\n\n/**\n * One receiver \"part\" of a withdraw request. A single request may split its\n * amount across several parts (different chains/providers); a plain same-chain\n * withdrawal is a single part with both provider fields set to the zero address.\n *\n * Field shapes and ordering mirror the on-chain `WithdrawReceiverPart` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.6) exactly, so the object encodes\n * directly as the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawReceiverPart {\n /** Caller-assigned part id, unique within the request. */\n id: bigint;\n /** Amount of collateral for this part, in the collateral token's smallest unit. */\n amount: bigint;\n /** Destination chain id (`int256` on-chain; the source chain for a same-chain part). */\n chainId: bigint;\n /** Destination address as raw bytes (a 20-byte EVM address is its own byte representation). */\n receiver: Hex;\n /** Virtual (cross-chain) provider, or the zero address for a same-chain part. */\n virtualProvider: Address;\n /** Express (instant) provider, or the zero address for a standard-cooldown part. */\n expressProvider: Address;\n}\n\n/**\n * A full withdraw request as stored on the SYMMIO core, returned by the withdraw\n * read views ({@link \"getWithdrawRequests\"}, {@link \"getPendingWithdrawRequests\"}).\n *\n * Field shapes and ordering mirror the on-chain `WithdrawRequest` struct in\n * `WithdrawStorage.sol` (perps-core v0.8.6). `status` is surfaced as the\n * {@link WithdrawStatus} enum rather than a raw `uint8`. Fields a newer\n * contracts generation added are **optional** and `undefined` on chains whose\n * deployment predates them (see `contractsVersion` in the chain config) —\n * today that is {@link WithdrawRequest.advancedAmount}, added in v0.8.6.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/WithdrawStorage.sol}\n */\nexport interface WithdrawRequest {\n /** Sequential request id (starts at 1 per user). */\n id: bigint;\n /** The subaccount the request belongs to. */\n user: Address;\n /** The receiver parts the withdrawal is split into. */\n parts: readonly WithdrawReceiverPart[];\n /** Block timestamp at which the request was created. */\n timestamp: bigint;\n /** Earliest timestamp the request can be finalized. */\n cooldownEndTime: bigint;\n /** Current lifecycle status. */\n status: WithdrawStatus;\n /** Whether the request opted into the cooldown speed-up flow. */\n speedUp: boolean;\n /** Whether the cooldown was modified after creation (e.g. by an accepted speed-up). */\n isCooldownModified: boolean;\n /** The provider bound to the request, or the zero address for a classic withdrawal. */\n provider: Address;\n /** Whether the request is a pure-virtual (cross-chain, no express) withdrawal. */\n isPureVirtual: boolean;\n /** Opaque provider data (e.g. a signed option), or `0x`. */\n providerData: Hex;\n /** Total collateral amount across all parts. */\n totalAmount: bigint;\n /** Total amount delivered via virtual providers. */\n totalVirtualAmount: bigint;\n /**\n * Collateral already advanced to the provider before cooldown expiry\n * (express credit-line flow). Added in perps-core v0.8.6 — **`undefined` on a\n * `contractsVersion: \"0.8.5\"` chain**, whose contracts predate withdraw\n * advances.\n */\n advancedAmount?: bigint;\n}\n\n/**\n * Direction of a trading position.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum PositionType` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the `uint8` carried on a\n * {@link Quote} casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum PositionType {\n /** A long position — profits when the market price rises. */\n LONG = 0,\n /** A short position — profits when the market price falls. */\n SHORT = 1,\n}\n\n/**\n * How an order is priced and filled.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum OrderType` in `QuoteStorage.sol`\n * (perps-core v0.8.6) exactly, so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum OrderType {\n /** Fills only at the requested price or better. */\n LIMIT = 0,\n /** Fills at the prevailing market price. */\n MARKET = 1,\n}\n\n/**\n * Lifecycle status of a quote, from creation through settlement.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum QuoteStatus` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly — all 11 members, including\n * `LIQUIDATED_PENDING` (10) — so the `uint8` carried on a {@link Quote} casts\n * directly to this enum without translation. `getPartyAOpenPositions` returns\n * only `OPENED`, `CLOSE_PENDING`, `CANCEL_CLOSE_PENDING`, and `LIQUIDATED_PENDING`\n * quotes; `getPartyAPendingQuotes` returns only `PENDING`, `LOCKED`, and\n * `CANCEL_PENDING`.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport enum QuoteStatus {\n /** Created, awaiting a partyB to lock it. */\n PENDING = 0,\n /** A partyB locked the quote and is preparing to open it. */\n LOCKED = 1,\n /** PartyA requested cancellation of a still-pending quote. */\n CANCEL_PENDING = 2,\n /** The pending quote was cancelled before opening. */\n CANCELED = 3,\n /** Opened into a live position. */\n OPENED = 4,\n /** PartyA requested a (full or partial) close of the open position. */\n CLOSE_PENDING = 5,\n /** PartyA requested cancellation of a pending close. */\n CANCEL_CLOSE_PENDING = 6,\n /** The position was fully closed. */\n CLOSED = 7,\n /** The position was liquidated. */\n LIQUIDATED = 8,\n /** The pending quote expired before being opened. */\n EXPIRED = 9,\n /** Liquidation is in progress for the position. */\n LIQUIDATED_PENDING = 10,\n}\n\n/**\n * Margin amounts locked against a {@link Quote}, in the collateral token's\n * smallest unit (raw `uint256`).\n *\n * Field shapes and ordering mirror the on-chain `struct LockedValues` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly, so the object decodes directly\n * from the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface LockedValues {\n /** Credit Valuation Adjustment locked by partyA. */\n cva: bigint;\n /** Liquidation Fee locked by partyA. */\n lf: bigint;\n /** PartyA maintenance margin. */\n partyAmm: bigint;\n /** PartyB maintenance margin. */\n partyBmm: bigint;\n}\n\n/**\n * A full trading quote or open position as stored on the SYMMIO core, returned\n * by the quote read views ({@link \"getQuote\"}, {@link \"getPartyAOpenPositions\"}).\n *\n * Field shapes and ordering mirror the on-chain `struct Quote` in\n * `QuoteStorage.sol` (perps-core v0.8.6) exactly — every `uint256`/`int256` is a\n * raw `bigint` (no decimal scaling applied) and the `uint8` enum fields are\n * surfaced as the {@link PositionType}, {@link OrderType}, and {@link QuoteStatus}\n * enums rather than raw numbers. Prices and amounts are 18-decimal fixed point.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.6/contracts/core/storages/QuoteStorage.sol}\n */\nexport interface Quote {\n /** Sequential quote id (starts at 1; `0n` is the not-found sentinel). */\n id: bigint;\n /** PartyB addresses allowed to fill this quote (empty means any). */\n partyBsWhiteList: readonly Address[];\n /** Market identifier (`symbolId`) the quote trades. */\n symbolId: bigint;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order. */\n orderType: OrderType;\n /** Price partyB actually opened at (0 until opened). */\n openedPrice: bigint;\n /** Price partyA originally requested to open at. */\n initialOpenedPrice: bigint;\n /** Current requested open price (may differ from `initialOpenedPrice` after edits). */\n requestedOpenPrice: bigint;\n /** Market price snapshot recorded on the quote at its last state change. */\n marketPrice: bigint;\n /** Total quantity partyA requested. */\n quantity: bigint;\n /** Quantity already closed. */\n closedAmount: bigint;\n /** Margin locked at open time (basis for leverage). */\n initialLockedValues: LockedValues;\n /** Margin currently locked. */\n lockedValues: LockedValues;\n /** Maximum funding rate partyA accepts. */\n maxFundingRate: bigint;\n /** Owner of the quote — the virtual account (lowcap). */\n partyA: Address;\n /** The partyB (hedger/solver) that locked/opened the quote, or the zero address. */\n partyB: Address;\n /** Current lifecycle status. */\n quoteStatus: QuoteStatus;\n /** Average price across executed closes. */\n avgClosedPrice: bigint;\n /** Requested limit price for a pending close. */\n requestedClosePrice: bigint;\n /** Quantity of a pending close request. */\n quantityToClose: bigint;\n /** Parent quote id for a partially-opened child, or `0n`. */\n parentId: bigint;\n /** Block timestamp the quote was created. */\n createTimestamp: bigint;\n /** Block timestamp of the last status change (sort key). */\n statusModifyTimestamp: bigint;\n /** Block timestamp funding was last applied. */\n lastFundingPaymentTimestamp: bigint;\n /** Quote deadline (expiry) timestamp. */\n deadline: bigint;\n /** Trading fee charged on the quote. */\n tradingFee: bigint;\n /** Affiliate address attributed to the quote, or the zero address. */\n affiliate: Address;\n /**\n * Cumulative funding-**rate index** already settled on this quote (`int256`,\n * 18-decimal fixed point) — the position's funding rate multiplied by the\n * epochs elapsed since the funding fee started. **Not a currency amount**:\n * the settled fee is only obtained as\n * `openAmount × (currentFee − accumulatedPaidFunding) / 1e18`, so summing this\n * field across quotes is meaningless. For real settled funding amounts use\n * {@link getQuoteFunding} / {@link aggregateGroupFunding}.\n */\n accumulatedPaidFunding: bigint;\n /** Fee charged on close. */\n closeFee: bigint;\n /** Opaque per-quote data, or `0x`. */\n data: Hex;\n}\n"],"mappings":";AAyFA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,oBAAA,KAAA,qBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,mBAAA,KAAA,oBAEA,EAAA,EAAA,YAAA,KAAA,aAEA,EAAA,EAAA,YAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAuFY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,OAAA,KAAA,QAEA,EAAA,EAAA,QAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAYY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,QAAA,KAAA,SAEA,EAAA,EAAA,SAAA,KAAA;AACF,EAAA,CAAA,CAAA,GAgBY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,iBAAA,KAAA,kBAEA,EAAA,EAAA,WAAA,KAAA,YAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,gBAAA,KAAA,iBAEA,EAAA,EAAA,uBAAA,KAAA,wBAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,aAAA,KAAA,cAEA,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,qBAAA,MAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { decimalPriceToWei as e } from "../../shared/utils/price.js";
|
|
2
|
+
import { mulWei as t } from "../../shared/utils/wei.js";
|
|
3
3
|
//#region src/tpsl/grouping/notional.ts
|
|
4
|
-
function n(
|
|
5
|
-
return e
|
|
4
|
+
function n(e) {
|
|
5
|
+
return t(e.openQuantity, e.openPrice);
|
|
6
6
|
}
|
|
7
|
-
function r(
|
|
8
|
-
return t
|
|
7
|
+
function r(t) {
|
|
8
|
+
return e(t) ?? 0n;
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
11
|
export { n as childNotional, r as triggerPriceToWei };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-tpsl-frame.js","names":[],"sources":["../../../src/websocket/tpsl/parse-tpsl-frame.ts"],"sourcesContent":["import type { RawTpSlNotification, TpSlNotification } from \"./types\";\n\n/**\n * Parse a raw enigma frame into a {@link TpSlNotification}, or `null` when\n * the frame isn't a `report` (control frames, malformed JSON, missing payload,\n * wrong shape).\n *\n * Wire shape (single-wrapped — the `data` field IS the payload, not a nested\n * envelope):\n *\n * ```jsonc\n * {\n * \"app_name\": \"
|
|
1
|
+
{"version":3,"file":"parse-tpsl-frame.js","names":[],"sources":["../../../src/websocket/tpsl/parse-tpsl-frame.ts"],"sourcesContent":["import type { RawTpSlNotification, TpSlNotification } from \"./types\";\n\n/**\n * Parse a raw enigma frame into a {@link TpSlNotification}, or `null` when\n * the frame isn't a `report` (control frames, malformed JSON, missing payload,\n * wrong shape).\n *\n * Wire shape (single-wrapped — the `data` field IS the payload, not a nested\n * envelope):\n *\n * ```jsonc\n * {\n * \"app_name\": \"Arbitrum_COH_Production\",\n * \"primary_identifier\": 9565,\n * \"secondary_identifier\": 0,\n * \"address\": \"0xaE96…\",\n * \"type\": \"report\",\n * \"timestamp\": 1782821982,\n * \"data\": { coh_quote_id, conditional_order_type, state, details, successful }\n * }\n * ```\n */\nexport function parseTpSlFrame(data: unknown): TpSlNotification | null {\n const envelope = normalizeEnvelope(data);\n if (!envelope) return null;\n if (envelope.type && envelope.type !== \"report\") return null;\n\n const payload = envelope.data;\n if (!payload) return null;\n\n const primary = Number(envelope.primary_identifier ?? 0);\n const secondary = Number(envelope.secondary_identifier ?? 0);\n const quoteId = primary !== 0 ? primary : secondary;\n\n const base = {\n quoteId,\n primaryIdentifier: primary,\n secondaryIdentifier: secondary,\n account: envelope.address ?? null,\n conditionalOrderType: payload.conditional_order_type ?? null,\n state: payload.state,\n cohQuoteId: payload.coh_quote_id,\n timestamp: typeof envelope.timestamp === \"number\" ? envelope.timestamp : undefined,\n raw: envelope,\n } as const;\n\n if (payload.successful) {\n return { ...base, successful: true, details: payload.details };\n }\n return {\n ...base,\n successful: false,\n errorCode: payload.error_code,\n errorMessage: payload.error_message,\n };\n}\n\n/**\n * Narrow arbitrary input (raw ws `event.data`, JSON string, or already-parsed\n * object) into a typed {@link RawTpSlNotification}, or `null` if it can't be\n * safely treated as one.\n *\n * The runtime is best-effort — the WS server owns the shape and we only trust\n * the outer envelope; the payload is walked through the union type\n * ({@link RawTpSlNotification.data}) after.\n */\nfunction normalizeEnvelope(data: unknown): RawTpSlNotification | null {\n if (typeof data === \"string\") {\n try {\n const parsed: unknown = JSON.parse(data);\n return isEnvelope(parsed) ? parsed : null;\n } catch {\n return null;\n }\n }\n return isEnvelope(data) ? data : null;\n}\n\nfunction isEnvelope(value: unknown): value is RawTpSlNotification {\n return typeof value === \"object\" && value !== null;\n}\n"],"mappings":";AAsBA,SAAgB,EAAe,GAAwC;CACrE,IAAM,IAAW,EAAkB,CAAI;CAEvC,IADI,CAAC,KACD,EAAS,QAAQ,EAAS,SAAS,UAAU,OAAO;CAExD,IAAM,IAAU,EAAS;CACzB,IAAI,CAAC,GAAS,OAAO;CAErB,IAAM,IAAU,OAAO,EAAS,sBAAsB,CAAC,GACjD,IAAY,OAAO,EAAS,wBAAwB,CAAC,GAGrD,IAAO;EACX,SAHc,MAAY,IAAc,IAAV;EAI9B,mBAAmB;EACnB,qBAAqB;EACrB,SAAS,EAAS,WAAW;EAC7B,sBAAsB,EAAQ,0BAA0B;EACxD,OAAO,EAAQ;EACf,YAAY,EAAQ;EACpB,WAAW,OAAO,EAAS,aAAc,WAAW,EAAS,YAAY,KAAA;EACzE,KAAK;CACP;CAKA,OAHI,EAAQ,aACH;EAAE,GAAG;EAAM,YAAY;EAAM,SAAS,EAAQ;CAAQ,IAExD;EACL,GAAG;EACH,YAAY;EACZ,WAAW,EAAQ;EACnB,cAAc,EAAQ;CACxB;AACF;AAWA,SAAS,EAAkB,GAA2C;CACpE,IAAI,OAAO,KAAS,UAClB,IAAI;EACF,IAAM,IAAkB,KAAK,MAAM,CAAI;EACvC,OAAO,EAAW,CAAM,IAAI,IAAS;CACvC,QAAQ;EACN,OAAO;CACT;CAEF,OAAO,EAAW,CAAI,IAAI,IAAO;AACnC;AAEA,SAAS,EAAW,GAA8C;CAChE,OAAO,OAAO,KAAU,cAAY;AACtC"}
|
|
@@ -25,7 +25,7 @@ export interface WatchTpSlNotificationsParameters {
|
|
|
25
25
|
* enigma-protocol subscribe-frame builder and the SDK's socket pool, so
|
|
26
26
|
* many watchers across the app share one underlying connection per
|
|
27
27
|
* `(wsUrl, appName, account)` triple. Scoped by `tpsl.appName` (e.g.
|
|
28
|
-
* `
|
|
28
|
+
* `Arbitrum_COH_Production`), distinct from the quote-state
|
|
29
29
|
* notifications stream.
|
|
30
30
|
*
|
|
31
31
|
* @throws {SymmError} synchronously when the chain has no `tpsl` config or no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-tpsl-notifications.js","names":[],"sources":["../../../src/websocket/tpsl/watch-tpsl-notifications.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport { resolveTpSlConfig } from \"../../tpsl/internal/resolve-tpsl-config\";\nimport { buildSubscribeMessage } from \"../notifications/adapters/enigma-notifications\";\nimport { createReconnectingSocket } from \"../socket/create-reconnecting-socket\";\nimport { getSocketPool } from \"../socket/get-socket-pool\";\nimport type { SocketStatus } from \"../socket/socket-status\";\nimport { parseTpSlFrame } from \"./parse-tpsl-frame\";\nimport type { TpSlNotification } from \"./types\";\n\n/** Idempotent disposer returned by {@link watchTpSlNotifications}. */\nexport type UnwatchTpSl = () => void;\n\n/**\n * Parameters for {@link watchTpSlNotifications}.\n */\nexport interface WatchTpSlNotificationsParameters {\n /** SubAccount address to subscribe for. */\n account: Address;\n /** Target chain id. Defaults to the config's `defaultChainId`. */\n chainId?: number;\n /** Called for every normalized TP/SL report. */\n onNotification: (notification: TpSlNotification) => void;\n /** Connection status changes. */\n onStatusChange?: (status: SocketStatus) => void;\n /** Transport / parse errors; does not stop the subscription. */\n onError?: (error: SymmError) => void;\n}\n\nfunction toTpSlError(event: unknown): SymmError {\n if (event instanceof SymmError) return event;\n const cause = event instanceof Error ? event : undefined;\n return new SymmError(\"api\", \"TPSL_SOCKET_ERROR\", `TP/SL socket error${cause ? `: ${cause.message}` : \".\"}`, {\n cause,\n });\n}\n\n/**\n * Subscribe to live TP/SL notifications for an account. Reuses the\n * enigma-protocol subscribe-frame builder and the SDK's socket pool, so\n * many watchers across the app share one underlying connection per\n * `(wsUrl, appName, account)` triple. Scoped by `tpsl.appName` (e.g.\n * `
|
|
1
|
+
{"version":3,"file":"watch-tpsl-notifications.js","names":[],"sources":["../../../src/websocket/tpsl/watch-tpsl-notifications.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport { resolveTpSlConfig } from \"../../tpsl/internal/resolve-tpsl-config\";\nimport { buildSubscribeMessage } from \"../notifications/adapters/enigma-notifications\";\nimport { createReconnectingSocket } from \"../socket/create-reconnecting-socket\";\nimport { getSocketPool } from \"../socket/get-socket-pool\";\nimport type { SocketStatus } from \"../socket/socket-status\";\nimport { parseTpSlFrame } from \"./parse-tpsl-frame\";\nimport type { TpSlNotification } from \"./types\";\n\n/** Idempotent disposer returned by {@link watchTpSlNotifications}. */\nexport type UnwatchTpSl = () => void;\n\n/**\n * Parameters for {@link watchTpSlNotifications}.\n */\nexport interface WatchTpSlNotificationsParameters {\n /** SubAccount address to subscribe for. */\n account: Address;\n /** Target chain id. Defaults to the config's `defaultChainId`. */\n chainId?: number;\n /** Called for every normalized TP/SL report. */\n onNotification: (notification: TpSlNotification) => void;\n /** Connection status changes. */\n onStatusChange?: (status: SocketStatus) => void;\n /** Transport / parse errors; does not stop the subscription. */\n onError?: (error: SymmError) => void;\n}\n\nfunction toTpSlError(event: unknown): SymmError {\n if (event instanceof SymmError) return event;\n const cause = event instanceof Error ? event : undefined;\n return new SymmError(\"api\", \"TPSL_SOCKET_ERROR\", `TP/SL socket error${cause ? `: ${cause.message}` : \".\"}`, {\n cause,\n });\n}\n\n/**\n * Subscribe to live TP/SL notifications for an account. Reuses the\n * enigma-protocol subscribe-frame builder and the SDK's socket pool, so\n * many watchers across the app share one underlying connection per\n * `(wsUrl, appName, account)` triple. Scoped by `tpsl.appName` (e.g.\n * `Arbitrum_COH_Production`), distinct from the quote-state\n * notifications stream.\n *\n * @throws {SymmError} synchronously when the chain has no `tpsl` config or no\n * WebSocket implementation is available.\n */\nexport function watchTpSlNotifications(config: Config, parameters: WatchTpSlNotificationsParameters): UnwatchTpSl {\n const { account, chainId, onNotification, onStatusChange, onError } = parameters;\n const tpsl = resolveTpSlConfig(config, chainId);\n const webSocketConstructor = config.getWebSocketConstructor();\n\n // Enigma protocol with the TP/SL appName as the channel.\n const subscribeMessage = buildSubscribeMessage({ account, channel: tpsl.appName, protocol: \"enigma\" });\n\n const key = `${tpsl.wsUrl}|${tpsl.appName}|${account.toLowerCase()}`;\n\n return getSocketPool(config).acquire(\n key,\n (handlers) =>\n createReconnectingSocket({\n url: tpsl.wsUrl,\n webSocketConstructor,\n getOpenMessages: () => [subscribeMessage],\n onMessage: handlers.onMessage,\n onStatusChange: handlers.onStatusChange,\n onError: handlers.onError,\n }),\n {\n onMessage: (data) => {\n try {\n const parsed = parseTpSlFrame(data);\n if (!parsed) return;\n onNotification(parsed);\n } catch (err) {\n onError?.(toTpSlError(err));\n }\n },\n onStatusChange,\n onError: (event) => onError?.(toTpSlError(event)),\n },\n );\n}\n"],"mappings":";;;;;;;AA8BA,SAAS,EAAY,GAA2B;CAC9C,IAAI,aAAiB,GAAW,OAAO;CACvC,IAAM,IAAQ,aAAiB,QAAQ,IAAQ,KAAA;CAC/C,OAAO,IAAI,EAAU,OAAO,qBAAqB,qBAAqB,IAAQ,KAAK,EAAM,YAAY,OAAO,EAC1G,SACF,CAAC;AACH;AAaA,SAAgB,EAAuB,GAAgB,GAA2D;CAChH,IAAM,EAAE,YAAS,YAAS,mBAAgB,mBAAgB,eAAY,GAChE,IAAO,EAAkB,GAAQ,CAAO,GACxC,IAAuB,EAAO,wBAAwB,GAGtD,IAAmB,EAAsB;EAAE;EAAS,SAAS,EAAK;EAAS,UAAU;CAAS,CAAC,GAE/F,IAAM,GAAG,EAAK,MAAM,GAAG,EAAK,QAAQ,GAAG,EAAQ,YAAY;CAEjE,OAAO,EAAc,CAAM,EAAE,QAC3B,IACC,MACC,EAAyB;EACvB,KAAK,EAAK;EACV;EACA,uBAAuB,CAAC,CAAgB;EACxC,WAAW,EAAS;EACpB,gBAAgB,EAAS;EACzB,SAAS,EAAS;CACpB,CAAC,GACH;EACE,YAAY,MAAS;GACnB,IAAI;IACF,IAAM,IAAS,EAAe,CAAI;IAClC,IAAI,CAAC,GAAQ;IACb,EAAe,CAAM;GACvB,SAAS,GAAK;IACZ,IAAU,EAAY,CAAG,CAAC;GAC5B;EACF;EACA;EACA,UAAU,MAAU,IAAU,EAAY,CAAK,CAAC;CAClD,CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symmio/trading-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Framework-agnostic SYMMIO SDK. Contract calls, calculations, and transformations with no framework assumptions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/SYMM-IO/Trading-SDK/tree/main/packages/trading-core#readme",
|