@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateAddMargin as n } from "./simulate-add-margin.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/add-margin.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-margin.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/add-margin.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"add-margin.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/add-margin.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { simulateAddMargin } from \"./simulate-add-margin\";\n\n/**\n * Parameters for {@link addMargin}.\n */\nexport type AddMarginParameters = Compute<\n WriteContractParameter & {\n /**\n * The virtual account (VA) to add margin to. The connected wallet must be\n * the VA's on-chain owner; the contract reverts (`onlyAccountOwner`) otherwise.\n */\n virtualAccount: Address;\n /**\n * Amount to add, in **18 decimals** (the internal allocated-balance unit,\n * not the collateral token's decimals). Moved from the parent subaccount's\n * already-deposited balance into the VA; reverts with `ZeroAmount` when `0`.\n */\n amount: bigint;\n }\n>;\n\n/** Return type of {@link addMargin}: the submitted transaction hash. */\nexport type AddMarginReturnType = Hash;\n\n/**\n * Add margin to a virtual account (VA) by moving collateral from the parent\n * subaccount's available balance into the VA, on the AccountLayer.\n *\n * Calls `AccountLayer.addMargin(virtualAccount, amount)`, which internally\n * transfers `amount` from the parent subaccount into the VA. This increases the\n * VA's margin (and lowers its liquidation risk). No signature is required.\n *\n * Dry-runs the call with {@link simulateAddMargin} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Virtual account address, amount (18 decimals), optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await addMargin(config, { virtualAccount: \"0xva…\", amount: 50_000000000000000000n });\n * ```\n */\nexport async function addMargin(config: Config, parameters: AddMarginParameters): Promise<AddMarginReturnType> {\n const { chainId, virtualAccount, amount, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateAddMargin(config, { chainId, virtualAccount, amount, from: walletClient.account.address });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"addMargin\",\n args: [virtualAccount, amount],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AAmDA,eAAsB,EAAU,GAAgB,GAA+D;CAC7G,IAAM,EAAE,YAAS,mBAAgB,WAAQ,YAAS,GAE5C,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAMnE,OAJI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAAkB,GAAQ;EAAE;EAAS;EAAgB;EAAQ,MAAM,EAAa,QAAQ;CAAQ,CAAC,GAGlG,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GAAgB,CAAM;EAC7B,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateCancelRegistration as n } from "./simulate-cancel-registration.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/cancel-registration.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-registration.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/cancel-registration.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"cancel-registration.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/cancel-registration.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { simulateCancelRegistration } from \"./simulate-cancel-registration\";\n\n/**\n * Parameters for {@link cancelRegistration}.\n */\nexport type CancelRegistrationParameters = Compute<\n WriteContractParameter & {\n /**\n * The pending affiliate (AccountManager) address to cancel. The bound wallet\n * must be that affiliate's registered `admin`; the contract reverts otherwise.\n */\n affiliate: Address;\n }\n>;\n\n/** Return type of {@link cancelRegistration}: the submitted transaction hash. */\nexport type CancelRegistrationReturnType = Hash;\n\n/**\n * Send the on-chain transaction that cancels a still-`PENDING` affiliate\n * registration, clearing it back to `NONE`.\n *\n * Resolves the bound wallet client and `AccountLayer` address from `config`. The\n * bound EOA must be the affiliate's registered `admin`.\n *\n * Dry-runs the call with {@link simulateCancelRegistration} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Affiliate address, optional chain id / simulate opt-out.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await cancelRegistration(config, { affiliate: \"0xaff…\" });\n * ```\n */\nexport async function cancelRegistration(\n config: Config,\n parameters: CancelRegistrationParameters,\n): Promise<CancelRegistrationReturnType> {\n const { chainId, affiliate, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateCancelRegistration(config, { chainId, affiliate, from: walletClient.account.address });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"cancelRegistration\",\n args: [affiliate],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AA4CA,eAAsB,EACpB,GACA,GACuC;CACvC,IAAM,EAAE,YAAS,cAAW,YAAS,GAE/B,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAMnE,OAJI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAA2B,GAAQ;EAAE;EAAS;EAAW,MAAM,EAAa,QAAQ;CAAQ,CAAC,GAG9F,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAS;EAChB,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateCreateSubAccounts as n } from "./simulate-create-sub-accounts.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/create-sub-accounts.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-sub-accounts.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/create-sub-accounts.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"create-sub-accounts.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/create-sub-accounts.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport type { SubAccountCreationData } from \"../types\";\nimport { simulateCreateSubAccounts } from \"./simulate-create-sub-accounts\";\n\n/**\n * Parameters for {@link createSubAccounts}.\n */\nexport type CreateSubAccountsParameters = Compute<\n WriteContractParameter & {\n /**\n * Affiliate that custodies the new subaccounts. Must be `ACTIVE` on-chain,\n * and each entry's `symmioCore` must be whitelisted and registered for it.\n */\n affiliate: Address;\n /**\n * One entry per subaccount to create. The returned addresses are in this\n * same order.\n */\n accountsData: readonly SubAccountCreationData[];\n }\n>;\n\n/**\n * Return type of {@link createSubAccounts}: the submitted transaction hash.\n *\n * @remarks\n * The contract call returns the created subaccount addresses, but those are only\n * available once the transaction is mined - read them from the `SubAccountCreated`\n * events on the receipt. This action returns the hash so the caller controls how\n * it waits.\n */\nexport type CreateSubAccountsReturnType = Hash;\n\n/**\n * Send the on-chain transaction that creates one or more SYMMIO subaccounts under\n * an affiliate. The bound wallet's account becomes the `owner` of every created\n * subaccount.\n *\n * Resolves the bound wallet client and `AccountLayer` address from `config`.\n *\n * Dry-runs the call with {@link simulateCreateSubAccounts} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Affiliate, per-subaccount creation data, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await createSubAccounts(config, {\n * affiliate: \"0xaff…\",\n * accountsData: [\n * {\n * name: \"Main\",\n * metadata: \"0x\",\n * symmioCore: \"0xcore…\",\n * isolationType: SubAccountIsolationType.MARKET,\n * singleVAMode: true,\n * },\n * ],\n * });\n * ```\n */\nexport async function createSubAccounts(\n config: Config,\n parameters: CreateSubAccountsParameters,\n): Promise<CreateSubAccountsReturnType> {\n const { chainId, affiliate, accountsData, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateCreateSubAccounts(config, { chainId, affiliate, accountsData, from: walletClient.account.address });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"createSubAccounts\",\n args: [affiliate, accountsData],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AAqEA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,YAAS,cAAW,iBAAc,YAAS,GAE7C,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAMnE,OAJI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAA0B,GAAQ;EAAE;EAAS;EAAW;EAAc,MAAM,EAAa,QAAQ;CAAQ,CAAC,GAG3G,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GAAW,CAAY;EAC9B,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateDeleteSubAccount as n } from "./simulate-delete-sub-account.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/delete-sub-account.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-sub-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/delete-sub-account.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"delete-sub-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/delete-sub-account.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { simulateDeleteSubAccount } from \"./simulate-delete-sub-account\";\n\n/**\n * Parameters for {@link deleteSubAccount}.\n */\nexport type DeleteSubAccountParameters = Compute<\n WriteContractParameter & {\n /**\n * The subaccount to delete. The bound wallet's signing account must be the\n * subaccount's on-chain `owner`; the contract reverts (`onlyAccountOwner`)\n * otherwise.\n */\n subAccount: Address;\n }\n>;\n\n/** Return type of {@link deleteSubAccount}: the submitted transaction hash. */\nexport type DeleteSubAccountReturnType = Hash;\n\n/**\n * Send the on-chain transaction that deletes a SYMMIO subaccount on the\n * AccountLayer. Calls `AccountLayer.deleteSubAccount(subAccount)`.\n *\n * Resolves the bound wallet client and `AccountLayer` address from `config`. The\n * bound EOA must equal the subaccount's on-chain `owner`.\n *\n * @remarks\n * Deletion is irreversible and the contract only allows it once the subaccount is\n * fully wound down. It reverts when the subaccount still has any virtual accounts\n * (`HasActiveVirtualAccounts`), a non-zero free or allocated balance\n * (`SubAccountNotEmpty`), open positions (`OpenPositionsExist`), or pending quotes\n * (`PendingQuotesExist`) — and when it does not exist (`AccountDoesNotExist`) or\n * the caller is not its owner. Clear those first. On success it emits\n * `SubAccountDeleted(subAccount, owner, affiliate)`.\n *\n * Dry-runs the call with {@link simulateDeleteSubAccount} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount address, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await deleteSubAccount(config, { subAccount: \"0xsub…\" });\n * ```\n */\nexport async function deleteSubAccount(\n config: Config,\n parameters: DeleteSubAccountParameters,\n): Promise<DeleteSubAccountReturnType> {\n const { chainId, subAccount, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateDeleteSubAccount(config, { chainId, subAccount, from: walletClient.account.address });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"deleteSubAccount\",\n args: [subAccount],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AAsDA,eAAsB,EACpB,GACA,GACqC;CACrC,IAAM,EAAE,YAAS,eAAY,YAAS,GAEhC,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAMnE,OAJI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAAyB,GAAQ;EAAE;EAAS;EAAY,MAAM,EAAa,QAAQ;CAAQ,CAAC,GAG7F,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAU;EACjB,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateDepositAndAllocateForAccount as n } from "./simulate-deposit-and-allocate-for-account.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit-and-allocate-for-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"deposit-and-allocate-for-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { simulateDepositAndAllocateForAccount } from \"./simulate-deposit-and-allocate-for-account\";\n\n/**\n * Parameters for {@link depositAndAllocateForAccount}.\n */\nexport type DepositAndAllocateForAccountParameters = Compute<\n WriteContractParameter & {\n /**\n * The subaccount (or virtual account) to credit and allocate for. The wallet's\n * signing account must be the subaccount's on-chain `owner`; the contract\n * reverts otherwise.\n */\n account: Address;\n /**\n * Amount of collateral to deposit and allocate, in the collateral token's\n * smallest unit (e.g. `1_000000n` for 1 USDC at 6 decimals). The user must have\n * approved at least this much collateral to the SYMMIO core first — see\n * {@link approveCollateral}.\n */\n amount: bigint;\n }\n>;\n\n/** Return type of {@link depositAndAllocateForAccount}: the submitted transaction hash. */\nexport type DepositAndAllocateForAccountReturnType = Hash;\n\n/**\n * Deposit collateral into a subaccount **and allocate it into trading margin** in\n * a single transaction.\n *\n * Calls `AccountLayer.depositAndAllocateForAccount`. Equivalent to\n * {@link depositForAccount} followed by an allocate, but atomic. The funds land\n * in the classic-pool allocated balance — instant trading spends the available\n * balance instead, so for the instant flow fund with {@link depositForAccount}\n * alone (funds allocated here are not what an instant open consumes).\n *\n * Dry-runs the call with {@link simulateDepositAndAllocateForAccount} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @remarks\n * Requires a prior ERC20 approval of the collateral token to the **SYMMIO core**\n * (`symmioAddress`), which is the contract that pulls the funds. See\n * {@link approveCollateral} / {@link getCollateralAllowance}.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount address, amount (collateral units), optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await depositAndAllocateForAccount(config, { account: \"0xsub…\", amount: 1_000000n });\n * ```\n */\nexport async function depositAndAllocateForAccount(\n config: Config,\n parameters: DepositAndAllocateForAccountParameters,\n): Promise<DepositAndAllocateForAccountReturnType> {\n const { chainId, account, amount, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateDepositAndAllocateForAccount(config, {\n chainId,\n account,\n amount,\n from: walletClient.account.address,\n });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"depositAndAllocateForAccount\",\n args: [account, amount],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AA4DA,eAAsB,EACpB,GACA,GACiD;CACjD,IAAM,EAAE,YAAS,YAAS,WAAQ,YAAS,GAErC,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAWnE,OATI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAAqC,GAAQ;EACjD;EACA;EACA;EACA,MAAM,EAAa,QAAQ;CAC7B,CAAC,GAGI,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GAAS,CAAM;EACtB,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateDepositForAccount as n } from "./simulate-deposit-for-account.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/deposit-for-account.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit-for-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/deposit-for-account.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"deposit-for-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/deposit-for-account.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { simulateDepositForAccount } from \"./simulate-deposit-for-account\";\n\n/**\n * Parameters for {@link depositForAccount}.\n */\nexport type DepositForAccountParameters = Compute<\n WriteContractParameter & {\n /**\n * The subaccount (or virtual account) to credit. The wallet's signing account\n * must be the subaccount's on-chain `owner`; the contract reverts otherwise.\n */\n account: Address;\n /**\n * Amount of collateral to deposit, in the collateral token's smallest unit\n * (e.g. `1_000000n` for 1 USDC at 6 decimals). The user must have approved at\n * least this much collateral to the SYMMIO core first — see {@link approveCollateral}.\n */\n amount: bigint;\n }\n>;\n\n/** Return type of {@link depositForAccount}: the submitted transaction hash. */\nexport type DepositForAccountReturnType = Hash;\n\n/**\n * Deposit collateral into a subaccount's **available balance** on the SYMMIO core.\n *\n * Calls `AccountLayer.depositForAccount`, which pulls the collateral from the\n * connected wallet into the core and credits the subaccount's available\n * balance — the balance instant trading spends and withdrawals draw from, so\n * for the instant flow this is the whole funding step (no allocate afterwards).\n * Only the classic-pool flow allocates — see {@link depositAndAllocateForAccount}.\n *\n * Dry-runs the call with {@link simulateDepositForAccount} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @remarks\n * Requires a prior ERC20 approval of the collateral token to the **SYMMIO core**\n * (`symmioAddress`), which is the contract that pulls the funds. See\n * {@link approveCollateral} / {@link getCollateralAllowance}.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount address, amount (collateral units), optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await depositForAccount(config, { account: \"0xsub…\", amount: 1_000000n });\n * ```\n */\nexport async function depositForAccount(\n config: Config,\n parameters: DepositForAccountParameters,\n): Promise<DepositForAccountReturnType> {\n const { chainId, account, amount, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateDepositForAccount(config, { chainId, account, amount, from: walletClient.account.address });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"depositForAccount\",\n args: [account, amount],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AAyDA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,YAAS,YAAS,WAAQ,YAAS,GAErC,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAMnE,OAJI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAA0B,GAAQ;EAAE;EAAS;EAAS;EAAQ,MAAM,EAAa,QAAQ;CAAQ,CAAC,GAGnG,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GAAS,CAAM;EACtB,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateEditAccountName as n } from "./simulate-edit-account-name.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/edit-account-name.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-account-name.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/edit-account-name.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"edit-account-name.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/edit-account-name.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { simulateEditAccountName } from \"./simulate-edit-account-name\";\n\n/**\n * Parameters for {@link editAccountName}.\n */\nexport type EditAccountNameParameters = Compute<\n WriteContractParameter & {\n /**\n * The SYMMIO subaccount address being renamed. The wallet's signing account\n * must be the subaccount's on-chain `owner`; the contract reverts otherwise.\n */\n account: Address;\n /** New display name. */\n name: string;\n }\n>;\n\n/** Return type of {@link editAccountName}: the submitted transaction hash. */\nexport type EditAccountNameReturnType = Hash;\n\n/**\n * Send the on-chain transaction that renames a SYMMIO subaccount.\n *\n * Resolves the bound wallet client and `AccountLayer` address from `config`. The\n * bound EOA must equal the subaccount's on-chain `owner`.\n *\n * Dry-runs the call with {@link simulateEditAccountName} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Subaccount address, new name, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const hash = await editAccountName(config, { account: \"0xsub…\", name: \"Main\" });\n * ```\n */\nexport async function editAccountName(\n config: Config,\n parameters: EditAccountNameParameters,\n): Promise<EditAccountNameReturnType> {\n const { chainId, account, name, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateEditAccountName(config, { chainId, account, name, from: walletClient.account.address });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"editAccountName\",\n args: [account, name],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AA6CA,eAAsB,EACpB,GACA,GACoC;CACpC,IAAM,EAAE,YAAS,YAAS,SAAM,YAAS,GAEnC,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAMnE,OAJI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAAwB,GAAQ;EAAE;EAAS;EAAS;EAAM,MAAM,EAAa,QAAQ;CAAQ,CAAC,GAG/F,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GAAS,CAAI;EACpB,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/generate-account-manager-address.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, registrant: i, name: a } = n, { addresses: o } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-account-manager-address.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/generate-account-manager-address.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"generate-account-manager-address.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/generate-account-manager-address.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link generateAccountManagerAddress}.\n */\nexport type GenerateAccountManagerAddressParameters = Compute<\n ChainIdParameter & {\n /** The address that would submit the registration (`msg.sender` of the request). */\n registrant: Address;\n /** The affiliate name that would be registered. Part of the address salt. */\n name: string;\n }\n>;\n\n/** Return type of {@link generateAccountManagerAddress}: the predicted affiliate address. */\nexport type GenerateAccountManagerAddressReturnType = Address;\n\n/**\n * Predict the deterministic affiliate (`AccountManager`) address for a\n * `(registrant, name)` pair — the same CREATE2 address\n * {@link requestToRegisterAffiliate} would assign.\n *\n * Pure view call; usable **before** registering to show the future affiliate\n * address, and after, since the value is deterministic. Resolves the viem client\n * and `AccountLayer` address from `config`.\n *\n * @param config - The SDK config.\n * @param parameters - Prospective registrant, affiliate name, optional chain id.\n * @returns The deterministic affiliate address for that registrant + name.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const predicted = await generateAccountManagerAddress(config, {\n * registrant: \"0xme…\",\n * name: \"Acme\",\n * });\n * ```\n */\nexport async function generateAccountManagerAddress(\n config: Config,\n parameters: GenerateAccountManagerAddressParameters,\n): Promise<GenerateAccountManagerAddressReturnType> {\n const { chainId, registrant, name } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const result = await client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"generateAccountManagerAddress\",\n args: [registrant, name],\n });\n\n return result;\n}\n"],"mappings":";;AA2CA,eAAsB,EACpB,GACA,GACkD;CAClD,IAAM,EAAE,YAAS,eAAY,YAAS,GAEhC,EAAE,iBAAc,EAAO,eAAe,CAAO;CAUnD,OAAO,MATQ,EAAO,UAAU,EAAE,WAAQ,CAErB,EAAO,aAAa;EACvC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,GAAY,CAAI;CACzB,CAAC;AAGH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { symmioAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-account-balance-info.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, account: i } = n, { addresses: a } = t.getChainConfig(r), o = await t.getClient({ chainId: r }).readContract({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-account-balance-info.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-account-balance-info.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-account-balance-info.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-account-balance-info.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport type { AccountBalanceInfo } from \"../types\";\n\n/**\n * Parameters for {@link getAccountBalanceInfo}.\n */\nexport type GetAccountBalanceInfoParameters = Compute<\n ChainIdParameter & {\n /** Account address passed as `partyA` to `balanceInfoOfPartyA`. */\n account: Address;\n }\n>;\n\n/** Return type of {@link getAccountBalanceInfo}. */\nexport type GetAccountBalanceInfoReturnType = AccountBalanceInfo;\n\n/**\n * Read raw balance info for a SYMMIO account from `balanceInfoOfPartyA`.\n *\n * Resolves the viem client and default SYMMIO core/diamond address from\n * `config`.\n *\n * @param config - The SDK config.\n * @param parameters - Account address and optional chain id.\n * @returns Raw allocated/locked/pending balance fields in collateral token units.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const info = await getAccountBalanceInfo(config, { account });\n * console.log(info.allocatedBalance);\n * ```\n */\nexport async function getAccountBalanceInfo(\n config: Config,\n parameters: GetAccountBalanceInfoParameters,\n): Promise<GetAccountBalanceInfoReturnType> {\n const { chainId, account } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const result = await client.readContract({\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"balanceInfoOfPartyA\",\n args: [account],\n });\n\n return {\n allocatedBalance: result[0],\n lockedCVA: result[1],\n lockedLF: result[2],\n lockedPartyAMM: result[3],\n lockedPartyBMM: result[4],\n pendingLockedCVA: result[5],\n pendingLockedLF: result[6],\n pendingLockedPartyAMM: result[7],\n pendingLockedPartyBMM: result[8],\n };\n}\n"],"mappings":";;AAqCA,eAAsB,EACpB,GACA,GAC0C;CAC1C,IAAM,EAAE,YAAS,eAAY,GAEvB,EAAE,iBAAc,EAAO,eAAe,CAAO,GAG7C,IAAS,MAFA,EAAO,UAAU,EAAE,WAAQ,CAErB,EAAO,aAAa;EACvC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAO;CAChB,CAAC;CAED,OAAO;EACL,kBAAkB,EAAO;EACzB,WAAW,EAAO;EAClB,UAAU,EAAO;EACjB,gBAAgB,EAAO;EACvB,gBAAgB,EAAO;EACvB,kBAAkB,EAAO;EACzB,iBAAiB,EAAO;EACxB,uBAAuB,EAAO;EAC9B,uBAAuB,EAAO;CAChC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { symmioAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-account-balance-of.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, account: i } = n, { addresses: a } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-account-balance-of.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-account-balance-of.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-account-balance-of.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-account-balance-of.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\n\n/**\n * Parameters for {@link getAccountBalanceOf}.\n */\nexport type GetAccountBalanceOfParameters = Compute<\n ChainIdParameter & {\n /** Account address passed to `balanceOf`. */\n account: Address;\n }\n>;\n\n/** Return type of {@link getAccountBalanceOf}: raw collateral token units. */\nexport type GetAccountBalanceOfReturnType = bigint;\n\n/**\n * Read a SYMMIO account's raw deposited balance from `balanceOf`.\n *\n * Resolves the viem client and default SYMMIO core/diamond address from\n * `config`.\n *\n * @param config - The SDK config.\n * @param parameters - Account address and optional chain id.\n * @returns The raw `balanceOf(account)` value in collateral token units.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const balance = await getAccountBalanceOf(config, { account });\n * ```\n */\nexport async function getAccountBalanceOf(\n config: Config,\n parameters: GetAccountBalanceOfParameters,\n): Promise<GetAccountBalanceOfReturnType> {\n const { chainId, account } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"balanceOf\",\n args: [account],\n });\n}\n"],"mappings":";;AAmCA,eAAsB,EACpB,GACA,GACwC;CACxC,IAAM,EAAE,YAAS,eAAY,GAEvB,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAO;CAChB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-affiliate-state.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, affiliate: i } = n, { addresses: a } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-affiliate-state.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-affiliate-state.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-affiliate-state.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-affiliate-state.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport { AffiliateState } from \"../types\";\n\n/**\n * Parameters for {@link getAffiliateState}.\n */\nexport type GetAffiliateStateParameters = Compute<\n ChainIdParameter & {\n /** The affiliate (AccountManager) address to read the lifecycle state of. */\n affiliate: Address;\n }\n>;\n\n/** Return type of {@link getAffiliateState}. */\nexport type GetAffiliateStateReturnType = AffiliateState;\n\n/**\n * Read an affiliate's current lifecycle state on the `AccountLayer`.\n *\n * Resolves the viem client and `AccountLayer` address from `config` for the\n * given chain (or the config's default chain when `chainId` is omitted). Use\n * this to poll after {@link requestToRegisterAffiliate}: the state advances from\n * `PENDING` to `ACTIVE` once an approver approves the registration.\n *\n * @param config - The SDK config.\n * @param parameters - Affiliate address, optional chain id.\n * @returns The affiliate's {@link AffiliateState} (`NONE` for an unknown address).\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const state = await getAffiliateState(config, { affiliate: \"0xaff…\" });\n * if (state === AffiliateState.ACTIVE) { }\n * ```\n */\nexport async function getAffiliateState(\n config: Config,\n parameters: GetAffiliateStateParameters,\n): Promise<GetAffiliateStateReturnType> {\n const { chainId, affiliate } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const result = await client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getAffiliateState\",\n args: [affiliate],\n });\n\n return result as AffiliateState;\n}\n"],"mappings":";;AAuCA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,YAAS,iBAAc,GAEzB,EAAE,iBAAc,EAAO,eAAe,CAAO;CAUnD,OAAO,MATQ,EAAO,UAAU,EAAE,WAAQ,CAErB,EAAO,aAAa;EACvC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAS;CAClB,CAAC;AAGH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, subAccount: i } = n, { addresses: a } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sub-account-virtual-nonce.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-sub-account-virtual-nonce.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link getSubAccountVirtualNonce}.\n */\nexport type GetSubAccountVirtualNonceParameters = Compute<\n ChainIdParameter & {\n /** The subaccount address whose Virtual Account nonce to read. */\n subAccount: Address;\n }\n>;\n\n/** Return type of {@link getSubAccountVirtualNonce}: the subaccount's VA creation nonce. */\nexport type GetSubAccountVirtualNonceReturnType = bigint;\n\n/**\n * Read a subaccount's Virtual Account (VA) nonce - the per-subaccount counter\n * that seeds deterministic VA address derivation (used by\n * `predictNextVirtualAccountAddress`).\n *\n * Resolves the viem client and `AccountLayer` address from `config` for the\n * given chain (or the config's default chain when `chainId` is omitted).\n *\n * @param config - The SDK config.\n * @param parameters - Subaccount address, optional chain id.\n * @returns The subaccount's current VA nonce.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const nonce = await getSubAccountVirtualNonce(config, { subAccount: \"0xsub…\" });\n * ```\n */\nexport async function getSubAccountVirtualNonce(\n config: Config,\n parameters: GetSubAccountVirtualNonceParameters,\n): Promise<GetSubAccountVirtualNonceReturnType> {\n const { chainId, subAccount } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getSubAccountVirtualNonce\",\n args: [subAccount],\n });\n}\n"],"mappings":";;AAqCA,eAAsB,EACpB,GACA,GAC8C;CAC9C,IAAM,EAAE,YAAS,kBAAe,GAE1B,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAU;CACnB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-sub-account.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, account: i } = n, { addresses: a } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sub-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-sub-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-sub-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-sub-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport type { SubAccountDetail } from \"../types\";\n\n/**\n * Parameters for {@link getSubAccount}.\n */\nexport type GetSubAccountParameters = Compute<\n ChainIdParameter & {\n /** The subaccount address to read. */\n account: Address;\n }\n>;\n\n/** Return type of {@link getSubAccount}. */\nexport type GetSubAccountReturnType = SubAccountDetail;\n\n/**\n * Read a single SYMMIO subaccount by its address.\n *\n * Resolves the viem client and `AccountLayer` address from `config` for the\n * given chain (or the config's default chain when `chainId` is omitted).\n *\n * @param config - The SDK config.\n * @param parameters - Subaccount address, optional chain id.\n * @returns The subaccount's on-chain detail. `isExists` is `false` for an unknown\n * or deleted subaccount.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const sub = await getSubAccount(config, { account: \"0xsub…\" });\n * ```\n */\nexport async function getSubAccount(\n config: Config,\n parameters: GetSubAccountParameters,\n): Promise<GetSubAccountReturnType> {\n const { chainId, account } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const result = await client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getSubAccount\",\n args: [account],\n });\n\n return result;\n}\n"],"mappings":";;AAqCA,eAAsB,EACpB,GACA,GACkC;CAClC,IAAM,EAAE,YAAS,eAAY,GAEvB,EAAE,iBAAc,EAAO,eAAe,CAAO;CAUnD,OAAO,MATQ,EAAO,UAAU,EAAE,WAAQ,CAErB,EAAO,aAAa;EACvC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAO;CAChB,CAAC;AAGH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, user: i } = n, { addresses: a } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sub-accounts-count-of-user.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-sub-accounts-count-of-user.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link getSubAccountsCountOfUser}.\n */\nexport type GetSubAccountsCountOfUserParameters = Compute<\n ChainIdParameter & {\n /** EOA whose subaccount count to read. */\n user: Address;\n }\n>;\n\n/** Return type of {@link getSubAccountsCountOfUser}: the number of subaccounts the user owns. */\nexport type GetSubAccountsCountOfUserReturnType = bigint;\n\n/**\n * Read how many SYMMIO subaccounts `user` owns. Useful for paginating\n * {@link getUserSubAccounts} / {@link getUserSubAccountsAddresses}.\n *\n * Resolves the viem client and `AccountLayer` address from `config` for the\n * given chain (or the config's default chain when `chainId` is omitted).\n *\n * @param config - The SDK config.\n * @param parameters - User address, optional chain id.\n * @returns The subaccount count.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const count = await getSubAccountsCountOfUser(config, { user: \"0xabc…\" });\n * ```\n */\nexport async function getSubAccountsCountOfUser(\n config: Config,\n parameters: GetSubAccountsCountOfUserParameters,\n): Promise<GetSubAccountsCountOfUserReturnType> {\n const { chainId, user } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getSubAccountsCountOfUser\",\n args: [user],\n });\n}\n"],"mappings":";;AAoCA,eAAsB,EACpB,GACA,GAC8C;CAC9C,IAAM,EAAE,YAAS,YAAS,GAEpB,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAI;CACb,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, user: i, offset: a = 0n, limit: o = 200n } = n, { addresses: s } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-sub-accounts-addresses.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-user-sub-accounts-addresses.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link getUserSubAccountsAddresses}.\n */\nexport type GetUserSubAccountsAddressesParameters = Compute<\n ChainIdParameter & {\n /** EOA whose subaccount addresses to list. */\n user: Address;\n /**\n * Pagination offset, in subaccounts.\n * @default 0n\n */\n offset?: bigint;\n /**\n * Pagination limit, in subaccounts. The default matches the value the SYMMIO\n * Explorer Inspector page uses.\n * @default 200n\n */\n limit?: bigint;\n }\n>;\n\n/** Return type of {@link getUserSubAccountsAddresses}. */\nexport type GetUserSubAccountsAddressesReturnType = readonly Address[];\n\n/**\n * Read the addresses of all SYMMIO subaccounts owned by `user`. A lighter\n * alternative to {@link getUserSubAccounts} when only the addresses are needed.\n *\n * Resolves the viem client and `AccountLayer` address from `config` for the\n * given chain (or the config's default chain when `chainId` is omitted).\n *\n * @param config - The SDK config.\n * @param parameters - User address, optional pagination, optional chain id.\n * @returns The user's subaccount addresses.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const addresses = await getUserSubAccountsAddresses(config, { user: \"0xabc…\", limit: 100n });\n * ```\n */\nexport async function getUserSubAccountsAddresses(\n config: Config,\n parameters: GetUserSubAccountsAddressesParameters,\n): Promise<GetUserSubAccountsAddressesReturnType> {\n const { chainId, user, offset = 0n, limit = 200n } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getUserSubAccountsAddresses\",\n args: [user, offset, limit],\n });\n}\n"],"mappings":";;AA+CA,eAAsB,EACpB,GACA,GACgD;CAChD,IAAM,EAAE,YAAS,SAAM,YAAS,IAAI,WAAQ,SAAS,GAE/C,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAM;GAAQ;EAAK;CAC5B,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-user-sub-accounts.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, user: i, offset: a = 0n, limit: o = 200n } = n, { addresses: s } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-sub-accounts.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-user-sub-accounts.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-user-sub-accounts.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-user-sub-accounts.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport type { SubAccountDetail } from \"../types\";\n\n/**\n * Parameters for {@link getUserSubAccounts}.\n */\nexport type GetUserSubAccountsParameters = Compute<\n ChainIdParameter & {\n /** EOA whose subaccounts to list. */\n user: Address;\n /**\n * Pagination offset, in subaccounts.\n * @default 0n\n */\n offset?: bigint;\n /**\n * Pagination limit, in subaccounts. The default matches the value the SYMMIO\n * Explorer Inspector page uses.\n * @default 200n\n */\n limit?: bigint;\n }\n>;\n\n/** Return type of {@link getUserSubAccounts}. */\nexport type GetUserSubAccountsReturnType = readonly SubAccountDetail[];\n\n/**\n * Read all SYMMIO subaccounts owned by `user`.\n *\n * Resolves the viem client and `AccountLayer` address from `config` for the\n * given chain (or the config's default chain when `chainId` is omitted).\n *\n * @param config - The SDK config.\n * @param parameters - User address, optional pagination, optional chain id.\n * @returns The user's subaccounts.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const subs = await getUserSubAccounts(config, { user: \"0xabc…\", limit: 100n });\n * ```\n */\nexport async function getUserSubAccounts(\n config: Config,\n parameters: GetUserSubAccountsParameters,\n): Promise<GetUserSubAccountsReturnType> {\n const { chainId, user, offset = 0n, limit = 200n } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const result = await client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getUserSubAccounts\",\n args: [user, offset, limit],\n });\n\n return result;\n}\n"],"mappings":";;AA+CA,eAAsB,EACpB,GACA,GACuC;CACvC,IAAM,EAAE,YAAS,SAAM,YAAS,IAAI,WAAQ,SAAS,GAE/C,EAAE,iBAAc,EAAO,eAAe,CAAO;CAUnD,OAAO,MATQ,EAAO,UAAU,EAAE,WAAQ,CAErB,EAAO,aAAa;EACvC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAM;GAAQ;EAAK;CAC5B,CAAC;AAGH"}
|
|
@@ -13,7 +13,7 @@ export type GetVirtualAccountParameters = Compute<ChainIdParameter & {
|
|
|
13
13
|
* Decoded result of {@link getVirtualAccount}.
|
|
14
14
|
*
|
|
15
15
|
* Field shapes and ordering mirror the on-chain `VirtualAccountDetail` struct
|
|
16
|
-
* (perps-core v0.8.
|
|
16
|
+
* (perps-core v0.8.6) exactly. `isolationType` is surfaced as the
|
|
17
17
|
* {@link VirtualAccountIsolationType} numeric union (matches the
|
|
18
18
|
* `VIRTUAL_ACCOUNT_ISOLATION_TYPE` constant).
|
|
19
19
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-virtual-account.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, account: i } = n, { addresses: a } = t.getChainConfig(r), o = await t.getClient({ chainId: r }).readContract({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-virtual-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-virtual-account.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport type { VirtualAccountIsolationType } from \"../../../solvers/instant-open/shared/types\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-virtual-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-virtual-account.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport type { VirtualAccountIsolationType } from \"../../../solvers/instant-open/shared/types\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link getVirtualAccount}.\n */\nexport type GetVirtualAccountParameters = Compute<\n ChainIdParameter & {\n /** The Virtual Account address to look up. */\n account: Address;\n }\n>;\n\n/**\n * Decoded result of {@link getVirtualAccount}.\n *\n * Field shapes and ordering mirror the on-chain `VirtualAccountDetail` struct\n * (perps-core v0.8.6) exactly. `isolationType` is surfaced as the\n * {@link VirtualAccountIsolationType} numeric union (matches the\n * `VIRTUAL_ACCOUNT_ISOLATION_TYPE` constant).\n */\nexport interface VirtualAccountDetail {\n /** The VA's own address. */\n accountAddress: Address;\n /** The subaccount that created this VA. */\n parentAccount: Address;\n /** Market identifier (`symbolId`) the VA trades. */\n symbolId: bigint;\n /** `true` once the VA has been created on-chain. */\n isExists: boolean;\n /** Opaque per-VA metadata blob, or `0x`. */\n metadata: Hex;\n /** Isolation mode the VA was created with — encodes side for `MARKET_LONG` / `MARKET_SHORT`. */\n isolationType: VirtualAccountIsolationType;\n}\n\n/** Return type of {@link getVirtualAccount}. */\nexport type GetVirtualAccountReturnType = VirtualAccountDetail;\n\n/**\n * Read a Virtual Account's on-chain detail struct.\n *\n * The struct carries enough to derive `(market, side)` for the VA without a\n * second call: `symbolId` is the market; `isolationType === MARKET_LONG`\n * (resp. `MARKET_SHORT`) pins the side. `MARKET` isolation means both sides\n * share the VA; `POSITION` isolation means the VA is bound to a single quote.\n *\n * The mapping is fixed at VA creation time and never changes, so the result\n * is safe to cache indefinitely (`staleTime: Infinity`).\n *\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const detail = await getVirtualAccount(config, { account: vaAddress });\n * // detail.symbolId, detail.isolationType\n * ```\n */\nexport async function getVirtualAccount(\n config: Config,\n parameters: GetVirtualAccountParameters,\n): Promise<GetVirtualAccountReturnType> {\n const { chainId, account } = parameters;\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n const raw = await client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getVirtualAccount\",\n args: [account],\n });\n\n return {\n accountAddress: raw.accountAddress,\n parentAccount: raw.parentAccount,\n symbolId: raw.symbolId,\n isExists: raw.isExists,\n metadata: raw.metadata,\n isolationType: raw.isolationType as VirtualAccountIsolationType,\n };\n}\n"],"mappings":";;AA8DA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,EAAE,YAAS,eAAY,GACvB,EAAE,iBAAc,EAAO,eAAe,CAAO,GAG7C,IAAM,MAFG,EAAO,UAAU,EAAE,WAAQ,CAExB,EAAO,aAAa;EACpC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAO;CAChB,CAAC;CAED,OAAO;EACL,gBAAgB,EAAI;EACpB,eAAe,EAAI;EACnB,UAAU,EAAI;EACd,UAAU,EAAI;EACd,UAAU,EAAI;EACd,eAAe,EAAI;CACrB;AACF"}
|
package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, subAccount: i, offset: a = 0n, limit: o = 200n } = n, { addresses: s } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-virtual-accounts-addresses-of-sub-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"get-virtual-accounts-addresses-of-sub-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link getVirtualAccountsAddressesOfSubAccount}.\n */\nexport type GetVirtualAccountsAddressesOfSubAccountParameters = Compute<\n ChainIdParameter & {\n /** The subaccount whose Virtual Account (VA) addresses to list. */\n subAccount: Address;\n /**\n * Pagination offset into the subaccount's VA list.\n * @default 0n\n */\n offset?: bigint;\n /**\n * Maximum number of VA addresses to return from `offset`. Clamped on-chain to\n * the number remaining.\n * @default 200n\n */\n limit?: bigint;\n }\n>;\n\n/** Return type of {@link getVirtualAccountsAddressesOfSubAccount}: the VA addresses in range. */\nexport type GetVirtualAccountsAddressesOfSubAccountReturnType = readonly Address[];\n\n/**\n * List the Virtual Account (VA) addresses owned by a subaccount, within a\n * paginated range.\n *\n * In lowcap trading each isolated position lives under a distinct VA, and the VA\n * — not the subaccount — is the on-chain `partyA` for quote reads. Use this to\n * enumerate the VAs to pass to {@link \"getPartyAOpenPositions\"} /\n * {@link \"getPartyAPendingQuotes\"}.\n *\n * @remarks\n * Unlike the SYMMIO core paginators, the AccountLayer clamps gracefully: an\n * `offset` at or beyond the total returns an empty array (it does not revert),\n * and `limit` is clamped to the number remaining. The list is backed by an\n * `EnumerableSet`, so ordering is insertion order only until a removal occurs.\n *\n * @param config - The SDK config.\n * @param parameters - Subaccount, optional pagination (`offset`/`limit`), optional chain id.\n * @returns The subaccount's VA addresses found in the scanned range.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const vas = await getVirtualAccountsAddressesOfSubAccount(config, { subAccount: \"0xsub…\" });\n * ```\n */\nexport async function getVirtualAccountsAddressesOfSubAccount(\n config: Config,\n parameters: GetVirtualAccountsAddressesOfSubAccountParameters,\n): Promise<GetVirtualAccountsAddressesOfSubAccountReturnType> {\n const { chainId, subAccount, offset = 0n, limit = 200n } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"getVirtualAccountsAddressesOfSubAccount\",\n args: [subAccount, offset, limit],\n });\n}\n"],"mappings":";;AAuDA,eAAsB,EACpB,GACA,GAC4D;CAC5D,IAAM,EAAE,YAAS,eAAY,YAAS,IAAI,WAAQ,SAAS,GAErD,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAY;GAAQ;EAAK;CAClC,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
//#region src/symmio-contracts/account-layer/actions/predict-next-virtual-account.ts
|
|
3
3
|
async function t(t, n) {
|
|
4
4
|
let { chainId: r, subAccount: i, isolationType: a, symbolId: o } = n, { addresses: s } = t.getChainConfig(r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict-next-virtual-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/predict-next-virtual-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport type { VirtualAccountIsolationType } from \"../../../solvers/instant-open/shared/types\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"predict-next-virtual-account.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/predict-next-virtual-account.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport type { VirtualAccountIsolationType } from \"../../../solvers/instant-open/shared/types\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\n\n/**\n * Parameters for {@link getPredictedNextVirtualAccount}.\n */\nexport type GetPredictedNextVirtualAccountParameters = Compute<\n ChainIdParameter & {\n /** The subaccount that will own the next Virtual Account (VA). */\n subAccount: Address;\n /** Isolation mode the next VA will be created with — encodes side for `MARKET_LONG` / `MARKET_SHORT`. */\n isolationType: VirtualAccountIsolationType;\n /** Market identifier (`symbolId`) the next VA will trade. */\n symbolId: bigint;\n }\n>;\n\n/** Return type of {@link getPredictedNextVirtualAccount}: the predicted VA address. */\nexport type GetPredictedNextVirtualAccountReturnType = Address;\n\n/**\n * Predict the deterministic address of the next Virtual Account (VA) a\n * subaccount would create for a given `(isolationType, symbolId)`.\n *\n * In lowcap, an instant-open isolates its position into a VA that does not exist\n * on-chain until the trade lands; the AccountLayer computes that VA's address up\n * front from `(subAccount, isolationType, symbolId)` and the subaccount's current\n * virtual nonce. Use this to surface a brand-new position's VA — e.g. as the\n * `partyA` for quote reads — before it is created.\n *\n * @remarks\n * The prediction is stable for a given `(subAccount, isolationType, symbolId)`\n * **only until the subaccount's virtual nonce advances** (i.e. until the next VA\n * is actually created). Treat the result as short-lived rather than fixed.\n *\n * @param config - The SDK config.\n * @param parameters - Subaccount, isolation type, market id, optional chain id.\n * @returns The predicted next VA address.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * const va = await getPredictedNextVirtualAccount(config, {\n * subAccount: \"0xsub…\",\n * isolationType: VIRTUAL_ACCOUNT_ISOLATION_TYPE.MARKET_LONG,\n * symbolId: 1n,\n * });\n * ```\n */\nexport async function getPredictedNextVirtualAccount(\n config: Config,\n parameters: GetPredictedNextVirtualAccountParameters,\n): Promise<GetPredictedNextVirtualAccountReturnType> {\n const { chainId, subAccount, isolationType, symbolId } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"predictNextVirtualAccountAddress\",\n args: [subAccount, isolationType, symbolId],\n });\n}\n"],"mappings":";;AAqDA,eAAsB,EACpB,GACA,GACmD;CACnD,IAAM,EAAE,YAAS,eAAY,kBAAe,gBAAa,GAEnD,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAY;GAAe;EAAQ;CAC5C,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateRemoveMargin as n } from "./simulate-remove-margin.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/remove-margin.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-margin.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/remove-margin.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.
|
|
1
|
+
{"version":3,"file":"remove-margin.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/actions/remove-margin.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { Compute, WriteContractParameter } from \"../../../shared/types/properties\";\nimport { shouldSimulateBeforeWrite } from \"../../../shared/utils/simulate-before-write\";\nimport { accountLayerAbi } from \"../../abi/v0.8.6/account-layer\";\nimport type { SingleUpnlSig } from \"../types\";\nimport { simulateRemoveMargin } from \"./simulate-remove-margin\";\n\n/**\n * Parameters for {@link removeMargin}.\n */\nexport type RemoveMarginParameters = Compute<\n WriteContractParameter & {\n /**\n * The virtual account (VA) to remove margin from. The connected wallet must\n * be the VA's on-chain owner; the contract reverts (`onlyAccountOwner`) otherwise.\n */\n virtualAccount: Address;\n /**\n * Amount to remove, in **18 decimals** (the internal allocated-balance unit,\n * not the collateral token's decimals). Moved from the VA back into the\n * parent subaccount's available balance; reverts with `ZeroAmount` when `0`.\n */\n amount: bigint;\n /**\n * A fresh Muon uPnL attestation for `virtualAccount`. The contract verifies\n * it to prove the VA stays solvent after the deallocation. Fetch one right\n * before submitting (it is timestamped and short-lived) — see\n * {@link getDeallocateUpnlSig}.\n */\n upnlSig: SingleUpnlSig;\n }\n>;\n\n/** Return type of {@link removeMargin}: the submitted transaction hash. */\nexport type RemoveMarginReturnType = Hash;\n\n/**\n * Remove margin from a virtual account (VA) — a deallocate — moving collateral\n * from the VA back into the parent subaccount's available balance, on the\n * AccountLayer.\n *\n * Calls `AccountLayer.removeMargin(virtualAccount, amount, upnlSig)`, which\n * deallocates `amount` from the VA after the contract verifies the Muon uPnL\n * signature keeps the VA solvent.\n *\n * @remarks\n * Subject to the on-chain **deallocate debounce**: calling too soon after a prior\n * deallocate reverts (\"Too many deallocate in a short window\"). This is distinct\n * from the withdraw cooldown that later gates moving the freed collateral to the\n * wallet. The `upnlSig` must be freshly fetched — a stale attestation reverts.\n *\n * Dry-runs the call with {@link simulateRemoveMargin} first unless\n * `simulateBeforeWrite` is `false` (per-call, falling back to the config default).\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @param parameters - Virtual account, amount (18 decimals), Muon `upnlSig`, optional chain id.\n * @returns The submitted transaction hash. The caller waits on the receipt.\n * @throws {SymmError} when the chain is unsupported or no wallet is available.\n * @throws Viem's write errors (`ContractFunctionExecutionError`, ...).\n *\n * @example\n * ```ts\n * const upnlSig = await getDeallocateUpnlSig(config, { virtualAccount: \"0xva…\" });\n * const hash = await removeMargin(config, { virtualAccount: \"0xva…\", amount: 50_000000000000000000n, upnlSig });\n * ```\n */\nexport async function removeMargin(\n config: Config,\n parameters: RemoveMarginParameters,\n): Promise<RemoveMarginReturnType> {\n const { chainId, virtualAccount, amount, upnlSig, from } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const walletClient = await config.getWalletClient({ chainId, from });\n\n if (shouldSimulateBeforeWrite(config, parameters)) {\n await simulateRemoveMargin(config, {\n chainId,\n virtualAccount,\n amount,\n upnlSig,\n from: walletClient.account.address,\n });\n }\n\n return walletClient.writeContract({\n address: addresses.accountLayerAddress,\n abi: accountLayerAbi,\n functionName: \"removeMargin\",\n args: [virtualAccount, amount, upnlSig],\n account: walletClient.account,\n chain: walletClient.chain,\n });\n}\n"],"mappings":";;;;AAmEA,eAAsB,EACpB,GACA,GACiC;CACjC,IAAM,EAAE,YAAS,mBAAgB,WAAQ,YAAS,YAAS,GAErD,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAe,MAAM,EAAO,gBAAgB;EAAE;EAAS;CAAK,CAAC;CAYnE,OAVI,EAA0B,GAAQ,CAAU,KAC9C,MAAM,EAAqB,GAAQ;EACjC;EACA;EACA;EACA;EACA,MAAM,EAAa,QAAQ;CAC7B,CAAC,GAGI,EAAa,cAAc;EAChC,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM;GAAC;GAAgB;GAAQ;EAAO;EACtC,SAAS,EAAa;EACtB,OAAO,EAAa;CACtB,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accountLayerAbi as e } from "../../abi/v0.8.
|
|
1
|
+
import { accountLayerAbi as e } from "../../abi/v0.8.6/account-layer.js";
|
|
2
2
|
import { shouldSimulateBeforeWrite as t } from "../../../shared/utils/simulate-before-write.js";
|
|
3
3
|
import { simulateRequestToRegisterAffiliate as n } from "./simulate-request-to-register-affiliate.js";
|
|
4
4
|
//#region src/symmio-contracts/account-layer/actions/request-to-register-affiliate.ts
|