@symmio/trading-react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/account-layer/index.d.ts +29 -0
- package/dist/account-layer/index.d.ts.map +1 -0
- package/dist/account-layer/use-account-balance-info.d.ts +22 -0
- package/dist/account-layer/use-account-balance-info.d.ts.map +1 -0
- package/dist/account-layer/use-account-balance-info.js +23 -0
- package/dist/account-layer/use-account-balance-info.js.map +1 -0
- package/dist/account-layer/use-account-balance-of.d.ts +22 -0
- package/dist/account-layer/use-account-balance-of.d.ts.map +1 -0
- package/dist/account-layer/use-account-balance-of.js +23 -0
- package/dist/account-layer/use-account-balance-of.js.map +1 -0
- package/dist/account-layer/use-add-margin.d.ts +26 -0
- package/dist/account-layer/use-add-margin.d.ts.map +1 -0
- package/dist/account-layer/use-add-margin.js +40 -0
- package/dist/account-layer/use-add-margin.js.map +1 -0
- package/dist/account-layer/use-allocate.d.ts +25 -0
- package/dist/account-layer/use-allocate.d.ts.map +1 -0
- package/dist/account-layer/use-allocate.js +40 -0
- package/dist/account-layer/use-allocate.js.map +1 -0
- package/dist/account-layer/use-create-sub-accounts.d.ts +36 -0
- package/dist/account-layer/use-create-sub-accounts.d.ts.map +1 -0
- package/dist/account-layer/use-create-sub-accounts.js +41 -0
- package/dist/account-layer/use-create-sub-accounts.js.map +1 -0
- package/dist/account-layer/use-deallocate.d.ts +44 -0
- package/dist/account-layer/use-deallocate.d.ts.map +1 -0
- package/dist/account-layer/use-deallocate.js +44 -0
- package/dist/account-layer/use-deallocate.js.map +1 -0
- package/dist/account-layer/use-delete-sub-account.d.ts +30 -0
- package/dist/account-layer/use-delete-sub-account.d.ts.map +1 -0
- package/dist/account-layer/use-delete-sub-account.js +40 -0
- package/dist/account-layer/use-delete-sub-account.js.map +1 -0
- package/dist/account-layer/use-deposit-and-allocate.d.ts +27 -0
- package/dist/account-layer/use-deposit-and-allocate.d.ts.map +1 -0
- package/dist/account-layer/use-deposit-and-allocate.js +41 -0
- package/dist/account-layer/use-deposit-and-allocate.js.map +1 -0
- package/dist/account-layer/use-deposit.d.ts +27 -0
- package/dist/account-layer/use-deposit.d.ts.map +1 -0
- package/dist/account-layer/use-deposit.js +41 -0
- package/dist/account-layer/use-deposit.js.map +1 -0
- package/dist/account-layer/use-edit-account-name.d.ts +27 -0
- package/dist/account-layer/use-edit-account-name.d.ts.map +1 -0
- package/dist/account-layer/use-edit-account-name.js +40 -0
- package/dist/account-layer/use-edit-account-name.js.map +1 -0
- package/dist/account-layer/use-predicted-next-virtual-account.d.ts +38 -0
- package/dist/account-layer/use-predicted-next-virtual-account.d.ts.map +1 -0
- package/dist/account-layer/use-predicted-next-virtual-account.js +27 -0
- package/dist/account-layer/use-predicted-next-virtual-account.js.map +1 -0
- package/dist/account-layer/use-remove-margin.d.ts +43 -0
- package/dist/account-layer/use-remove-margin.d.ts.map +1 -0
- package/dist/account-layer/use-remove-margin.js +44 -0
- package/dist/account-layer/use-remove-margin.js.map +1 -0
- package/dist/account-layer/use-simulate-add-margin.d.ts +24 -0
- package/dist/account-layer/use-simulate-add-margin.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-add-margin.js +29 -0
- package/dist/account-layer/use-simulate-add-margin.js.map +1 -0
- package/dist/account-layer/use-simulate-allocate.d.ts +25 -0
- package/dist/account-layer/use-simulate-allocate.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-allocate.js +29 -0
- package/dist/account-layer/use-simulate-allocate.js.map +1 -0
- package/dist/account-layer/use-simulate-create-sub-accounts.d.ts +25 -0
- package/dist/account-layer/use-simulate-create-sub-accounts.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-create-sub-accounts.js +29 -0
- package/dist/account-layer/use-simulate-create-sub-accounts.js.map +1 -0
- package/dist/account-layer/use-simulate-deallocate.d.ts +29 -0
- package/dist/account-layer/use-simulate-deallocate.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-deallocate.js +29 -0
- package/dist/account-layer/use-simulate-deallocate.js.map +1 -0
- package/dist/account-layer/use-simulate-delete-sub-account.d.ts +25 -0
- package/dist/account-layer/use-simulate-delete-sub-account.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-delete-sub-account.js +29 -0
- package/dist/account-layer/use-simulate-delete-sub-account.js.map +1 -0
- package/dist/account-layer/use-simulate-deposit-and-allocate.d.ts +25 -0
- package/dist/account-layer/use-simulate-deposit-and-allocate.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-deposit-and-allocate.js +29 -0
- package/dist/account-layer/use-simulate-deposit-and-allocate.js.map +1 -0
- package/dist/account-layer/use-simulate-deposit.d.ts +25 -0
- package/dist/account-layer/use-simulate-deposit.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-deposit.js +29 -0
- package/dist/account-layer/use-simulate-deposit.js.map +1 -0
- package/dist/account-layer/use-simulate-edit-account-name.d.ts +25 -0
- package/dist/account-layer/use-simulate-edit-account-name.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-edit-account-name.js +29 -0
- package/dist/account-layer/use-simulate-edit-account-name.js.map +1 -0
- package/dist/account-layer/use-simulate-remove-margin.d.ts +30 -0
- package/dist/account-layer/use-simulate-remove-margin.d.ts.map +1 -0
- package/dist/account-layer/use-simulate-remove-margin.js +29 -0
- package/dist/account-layer/use-simulate-remove-margin.js.map +1 -0
- package/dist/account-layer/use-sub-account-virtual-nonce.d.ts +23 -0
- package/dist/account-layer/use-sub-account-virtual-nonce.d.ts.map +1 -0
- package/dist/account-layer/use-sub-account-virtual-nonce.js +27 -0
- package/dist/account-layer/use-sub-account-virtual-nonce.js.map +1 -0
- package/dist/account-layer/use-sub-account.d.ts +22 -0
- package/dist/account-layer/use-sub-account.d.ts.map +1 -0
- package/dist/account-layer/use-sub-account.js +27 -0
- package/dist/account-layer/use-sub-account.js.map +1 -0
- package/dist/account-layer/use-sub-accounts-count-of-user.d.ts +22 -0
- package/dist/account-layer/use-sub-accounts-count-of-user.d.ts.map +1 -0
- package/dist/account-layer/use-sub-accounts-count-of-user.js +27 -0
- package/dist/account-layer/use-sub-accounts-count-of-user.js.map +1 -0
- package/dist/account-layer/use-user-sub-accounts-addresses.d.ts +24 -0
- package/dist/account-layer/use-user-sub-accounts-addresses.d.ts.map +1 -0
- package/dist/account-layer/use-user-sub-accounts-addresses.js +27 -0
- package/dist/account-layer/use-user-sub-accounts-addresses.js.map +1 -0
- package/dist/account-layer/use-user-sub-accounts.d.ts +28 -0
- package/dist/account-layer/use-user-sub-accounts.d.ts.map +1 -0
- package/dist/account-layer/use-user-sub-accounts.js +27 -0
- package/dist/account-layer/use-user-sub-accounts.js.map +1 -0
- package/dist/account-layer/use-virtual-account.d.ts +35 -0
- package/dist/account-layer/use-virtual-account.d.ts.map +1 -0
- package/dist/account-layer/use-virtual-account.js +32 -0
- package/dist/account-layer/use-virtual-account.js.map +1 -0
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts +25 -0
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts.map +1 -0
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.js +27 -0
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.js.map +1 -0
- package/dist/balance-history/index.d.ts +4 -0
- package/dist/balance-history/index.d.ts.map +1 -0
- package/dist/balance-history/use-balance-history.d.ts +26 -0
- package/dist/balance-history/use-balance-history.d.ts.map +1 -0
- package/dist/balance-history/use-balance-history.js +27 -0
- package/dist/balance-history/use-balance-history.js.map +1 -0
- package/dist/balance-history/use-deposit-history.d.ts +19 -0
- package/dist/balance-history/use-deposit-history.d.ts.map +1 -0
- package/dist/balance-history/use-deposit-history.js +14 -0
- package/dist/balance-history/use-deposit-history.js.map +1 -0
- package/dist/balance-history/use-withdraw-history.d.ts +20 -0
- package/dist/balance-history/use-withdraw-history.d.ts.map +1 -0
- package/dist/balance-history/use-withdraw-history.js +14 -0
- package/dist/balance-history/use-withdraw-history.js.map +1 -0
- package/dist/collateral/index.d.ts +5 -0
- package/dist/collateral/index.d.ts.map +1 -0
- package/dist/collateral/use-approve-collateral.d.ts +27 -0
- package/dist/collateral/use-approve-collateral.d.ts.map +1 -0
- package/dist/collateral/use-approve-collateral.js +40 -0
- package/dist/collateral/use-approve-collateral.js.map +1 -0
- package/dist/collateral/use-collateral-allowance.d.ts +24 -0
- package/dist/collateral/use-collateral-allowance.d.ts.map +1 -0
- package/dist/collateral/use-collateral-allowance.js +27 -0
- package/dist/collateral/use-collateral-allowance.js.map +1 -0
- package/dist/collateral/use-collateral-balance.d.ts +22 -0
- package/dist/collateral/use-collateral-balance.d.ts.map +1 -0
- package/dist/collateral/use-collateral-balance.js +27 -0
- package/dist/collateral/use-collateral-balance.js.map +1 -0
- package/dist/collateral/use-simulate-approve-collateral.d.ts +26 -0
- package/dist/collateral/use-simulate-approve-collateral.d.ts.map +1 -0
- package/dist/collateral/use-simulate-approve-collateral.js +29 -0
- package/dist/collateral/use-simulate-approve-collateral.js.map +1 -0
- package/dist/error-codes/index.d.ts +3 -0
- package/dist/error-codes/index.d.ts.map +1 -0
- package/dist/error-codes/use-solver-error-codes.d.ts +27 -0
- package/dist/error-codes/use-solver-error-codes.d.ts.map +1 -0
- package/dist/error-codes/use-solver-error-codes.js +27 -0
- package/dist/error-codes/use-solver-error-codes.js.map +1 -0
- package/dist/error-codes/use-solver-error-message.d.ts +23 -0
- package/dist/error-codes/use-solver-error-message.d.ts.map +1 -0
- package/dist/error-codes/use-solver-error-message.js +11 -0
- package/dist/error-codes/use-solver-error-message.js.map +1 -0
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/normalize-symm-error.d.ts +14 -0
- package/dist/errors/normalize-symm-error.d.ts.map +1 -0
- package/dist/errors/normalize-symm-error.js +86 -0
- package/dist/errors/normalize-symm-error.js.map +1 -0
- package/dist/errors/symmio-request-error.d.ts +54 -0
- package/dist/errors/symmio-request-error.d.ts.map +1 -0
- package/dist/errors/symmio-request-error.js +17 -0
- package/dist/errors/symmio-request-error.js.map +1 -0
- package/dist/errors/types.d.ts +21 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/fees/index.d.ts +2 -0
- package/dist/fees/index.d.ts.map +1 -0
- package/dist/fees/use-fee-for-user.d.ts +25 -0
- package/dist/fees/use-fee-for-user.d.ts.map +1 -0
- package/dist/fees/use-fee-for-user.js +27 -0
- package/dist/fees/use-fee-for-user.js.map +1 -0
- package/dist/index.d.ts +184 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/instant-layer/index.d.ts +14 -0
- package/dist/instant-layer/index.d.ts.map +1 -0
- package/dist/instant-layer/use-delegation-expiry.d.ts +22 -0
- package/dist/instant-layer/use-delegation-expiry.d.ts.map +1 -0
- package/dist/instant-layer/use-delegation-expiry.js +23 -0
- package/dist/instant-layer/use-delegation-expiry.js.map +1 -0
- package/dist/instant-layer/use-grant-delegation.d.ts +26 -0
- package/dist/instant-layer/use-grant-delegation.d.ts.map +1 -0
- package/dist/instant-layer/use-grant-delegation.js +38 -0
- package/dist/instant-layer/use-grant-delegation.js.map +1 -0
- package/dist/instant-layer/use-instant-close-auto.d.ts +29 -0
- package/dist/instant-layer/use-instant-close-auto.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-close-auto.js +32 -0
- package/dist/instant-layer/use-instant-close-auto.js.map +1 -0
- package/dist/instant-layer/use-instant-close-bulk-auto.d.ts +26 -0
- package/dist/instant-layer/use-instant-close-bulk-auto.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-close-bulk-auto.js +32 -0
- package/dist/instant-layer/use-instant-close-bulk-auto.js.map +1 -0
- package/dist/instant-layer/use-instant-close-bulk.d.ts +24 -0
- package/dist/instant-layer/use-instant-close-bulk.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-close-bulk.js +32 -0
- package/dist/instant-layer/use-instant-close-bulk.js.map +1 -0
- package/dist/instant-layer/use-instant-close.d.ts +29 -0
- package/dist/instant-layer/use-instant-close.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-close.js +32 -0
- package/dist/instant-layer/use-instant-close.js.map +1 -0
- package/dist/instant-layer/use-instant-closes.d.ts +25 -0
- package/dist/instant-layer/use-instant-closes.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-closes.js +27 -0
- package/dist/instant-layer/use-instant-closes.js.map +1 -0
- package/dist/instant-layer/use-instant-open-auto.d.ts +31 -0
- package/dist/instant-layer/use-instant-open-auto.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-open-auto.js +32 -0
- package/dist/instant-layer/use-instant-open-auto.js.map +1 -0
- package/dist/instant-layer/use-instant-open-quote-id.d.ts +28 -0
- package/dist/instant-layer/use-instant-open-quote-id.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-open-quote-id.js +27 -0
- package/dist/instant-layer/use-instant-open-quote-id.js.map +1 -0
- package/dist/instant-layer/use-instant-open.d.ts +33 -0
- package/dist/instant-layer/use-instant-open.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-open.js +32 -0
- package/dist/instant-layer/use-instant-open.js.map +1 -0
- package/dist/instant-layer/use-instant-opens.d.ts +25 -0
- package/dist/instant-layer/use-instant-opens.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-opens.js +27 -0
- package/dist/instant-layer/use-instant-opens.js.map +1 -0
- package/dist/instant-layer/use-is-delegation-active.d.ts +22 -0
- package/dist/instant-layer/use-is-delegation-active.d.ts.map +1 -0
- package/dist/instant-layer/use-is-delegation-active.js +23 -0
- package/dist/instant-layer/use-is-delegation-active.js.map +1 -0
- package/dist/instant-layer/use-simulate-grant-delegation.d.ts +25 -0
- package/dist/instant-layer/use-simulate-grant-delegation.d.ts.map +1 -0
- package/dist/instant-layer/use-simulate-grant-delegation.js +29 -0
- package/dist/instant-layer/use-simulate-grant-delegation.js.map +1 -0
- package/dist/locked-params/index.d.ts +2 -0
- package/dist/locked-params/index.d.ts.map +1 -0
- package/dist/locked-params/use-locked-params.d.ts +23 -0
- package/dist/locked-params/use-locked-params.d.ts.map +1 -0
- package/dist/locked-params/use-locked-params.js +27 -0
- package/dist/locked-params/use-locked-params.js.map +1 -0
- package/dist/markets/index.d.ts +3 -0
- package/dist/markets/index.d.ts.map +1 -0
- package/dist/markets/use-markets.d.ts +26 -0
- package/dist/markets/use-markets.d.ts.map +1 -0
- package/dist/markets/use-markets.js +27 -0
- package/dist/markets/use-markets.js.map +1 -0
- package/dist/markets/use-onchain-contract-markets.d.ts +24 -0
- package/dist/markets/use-onchain-contract-markets.d.ts.map +1 -0
- package/dist/markets/use-onchain-contract-markets.js +27 -0
- package/dist/markets/use-onchain-contract-markets.js.map +1 -0
- package/dist/muon/index.d.ts +11 -0
- package/dist/muon/index.d.ts.map +1 -0
- package/dist/muon/use-deallocate-upnl-sig.d.ts +28 -0
- package/dist/muon/use-deallocate-upnl-sig.d.ts.map +1 -0
- package/dist/muon/use-deallocate-upnl-sig.js +27 -0
- package/dist/muon/use-deallocate-upnl-sig.js.map +1 -0
- package/dist/muon/use-muon-party-a-overview.d.ts +29 -0
- package/dist/muon/use-muon-party-a-overview.d.ts.map +1 -0
- package/dist/muon/use-muon-party-a-overview.js +27 -0
- package/dist/muon/use-muon-party-a-overview.js.map +1 -0
- package/dist/muon/use-muon-price-range.d.ts +35 -0
- package/dist/muon/use-muon-price-range.d.ts.map +1 -0
- package/dist/muon/use-muon-price-range.js +31 -0
- package/dist/muon/use-muon-price-range.js.map +1 -0
- package/dist/muon/use-muon-price.d.ts +28 -0
- package/dist/muon/use-muon-price.d.ts.map +1 -0
- package/dist/muon/use-muon-price.js +27 -0
- package/dist/muon/use-muon-price.js.map +1 -0
- package/dist/muon/use-muon-settle-upnl.d.ts +29 -0
- package/dist/muon/use-muon-settle-upnl.d.ts.map +1 -0
- package/dist/muon/use-muon-settle-upnl.js +28 -0
- package/dist/muon/use-muon-settle-upnl.js.map +1 -0
- package/dist/muon/use-muon-upnl-a-with-symbol-price.d.ts +29 -0
- package/dist/muon/use-muon-upnl-a-with-symbol-price.d.ts.map +1 -0
- package/dist/muon/use-muon-upnl-a-with-symbol-price.js +28 -0
- package/dist/muon/use-muon-upnl-a-with-symbol-price.js.map +1 -0
- package/dist/muon/use-muon-upnl-a.d.ts +28 -0
- package/dist/muon/use-muon-upnl-a.d.ts.map +1 -0
- package/dist/muon/use-muon-upnl-a.js +27 -0
- package/dist/muon/use-muon-upnl-a.js.map +1 -0
- package/dist/muon/use-muon-upnl-b.d.ts +29 -0
- package/dist/muon/use-muon-upnl-b.d.ts.map +1 -0
- package/dist/muon/use-muon-upnl-b.js +28 -0
- package/dist/muon/use-muon-upnl-b.js.map +1 -0
- package/dist/muon/use-muon-upnl-with-symbol-price.d.ts +28 -0
- package/dist/muon/use-muon-upnl-with-symbol-price.d.ts.map +1 -0
- package/dist/muon/use-muon-upnl-with-symbol-price.js +29 -0
- package/dist/muon/use-muon-upnl-with-symbol-price.js.map +1 -0
- package/dist/muon/use-muon-upnl.d.ts +28 -0
- package/dist/muon/use-muon-upnl.d.ts.map +1 -0
- package/dist/muon/use-muon-upnl.js +28 -0
- package/dist/muon/use-muon-upnl.js.map +1 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/use-search-notifications.d.ts +29 -0
- package/dist/notifications/use-search-notifications.d.ts.map +1 -0
- package/dist/notifications/use-search-notifications.js +27 -0
- package/dist/notifications/use-search-notifications.js.map +1 -0
- package/dist/notional-cap/index.d.ts +4 -0
- package/dist/notional-cap/index.d.ts.map +1 -0
- package/dist/notional-cap/use-notional-cap-all.d.ts +32 -0
- package/dist/notional-cap/use-notional-cap-all.d.ts.map +1 -0
- package/dist/notional-cap/use-notional-cap-all.js +32 -0
- package/dist/notional-cap/use-notional-cap-all.js.map +1 -0
- package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts +36 -0
- package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts.map +1 -0
- package/dist/notional-cap/use-notional-cap-by-symbol-id.js +32 -0
- package/dist/notional-cap/use-notional-cap-by-symbol-id.js.map +1 -0
- package/dist/notional-cap/use-open-interest-by-symbol-id.d.ts +34 -0
- package/dist/notional-cap/use-open-interest-by-symbol-id.d.ts.map +1 -0
- package/dist/notional-cap/use-open-interest-by-symbol-id.js +32 -0
- package/dist/notional-cap/use-open-interest-by-symbol-id.js.map +1 -0
- package/dist/price-service/index.d.ts +9 -0
- package/dist/price-service/index.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-by-market-id.d.ts +42 -0
- package/dist/price-service/use-enigma-price-by-market-id.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-by-market-id.js +30 -0
- package/dist/price-service/use-enigma-price-by-market-id.js.map +1 -0
- package/dist/price-service/use-enigma-price-by-name.d.ts +41 -0
- package/dist/price-service/use-enigma-price-by-name.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-by-name.js +45 -0
- package/dist/price-service/use-enigma-price-by-name.js.map +1 -0
- package/dist/price-service/use-enigma-price-service-health.d.ts +20 -0
- package/dist/price-service/use-enigma-price-service-health.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-service-health.js +27 -0
- package/dist/price-service/use-enigma-price-service-health.js.map +1 -0
- package/dist/price-service/use-enigma-price-service-metadata.d.ts +20 -0
- package/dist/price-service/use-enigma-price-service-metadata.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-service-metadata.js +27 -0
- package/dist/price-service/use-enigma-price-service-metadata.js.map +1 -0
- package/dist/price-service/use-enigma-price-service-prices-by-addresses.d.ts +20 -0
- package/dist/price-service/use-enigma-price-service-prices-by-addresses.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-service-prices-by-addresses.js +27 -0
- package/dist/price-service/use-enigma-price-service-prices-by-addresses.js.map +1 -0
- package/dist/price-service/use-enigma-price-service-prices-by-names.d.ts +20 -0
- package/dist/price-service/use-enigma-price-service-prices-by-names.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-service-prices-by-names.js +27 -0
- package/dist/price-service/use-enigma-price-service-prices-by-names.js.map +1 -0
- package/dist/price-service/use-enigma-price-service-symbols-info.d.ts +20 -0
- package/dist/price-service/use-enigma-price-service-symbols-info.d.ts.map +1 -0
- package/dist/price-service/use-enigma-price-service-symbols-info.js +27 -0
- package/dist/price-service/use-enigma-price-service-symbols-info.js.map +1 -0
- package/dist/price-service/use-enigma-prices.d.ts +40 -0
- package/dist/price-service/use-enigma-prices.d.ts.map +1 -0
- package/dist/price-service/use-enigma-prices.js +47 -0
- package/dist/price-service/use-enigma-prices.js.map +1 -0
- package/dist/provider/index.d.ts +4 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/symmio-config-context.d.ts +9 -0
- package/dist/provider/symmio-config-context.d.ts.map +1 -0
- package/dist/provider/symmio-config-context.js +8 -0
- package/dist/provider/symmio-config-context.js.map +1 -0
- package/dist/provider/symmio-provider.d.ts +49 -0
- package/dist/provider/symmio-provider.d.ts.map +1 -0
- package/dist/provider/symmio-provider.js +39 -0
- package/dist/provider/symmio-provider.js.map +1 -0
- package/dist/provider/use-symmio-chain-id.d.ts +14 -0
- package/dist/provider/use-symmio-chain-id.d.ts.map +1 -0
- package/dist/provider/use-symmio-chain-id.js +10 -0
- package/dist/provider/use-symmio-chain-id.js.map +1 -0
- package/dist/provider/use-symmio-config.d.ts +24 -0
- package/dist/provider/use-symmio-config.d.ts.map +1 -0
- package/dist/provider/use-symmio-config.js +13 -0
- package/dist/provider/use-symmio-config.js.map +1 -0
- package/dist/quotes/index.d.ts +16 -0
- package/dist/quotes/index.d.ts.map +1 -0
- package/dist/quotes/optimistic-quotes-store.d.ts +47 -0
- package/dist/quotes/optimistic-quotes-store.d.ts.map +1 -0
- package/dist/quotes/optimistic-quotes-store.js +27 -0
- package/dist/quotes/optimistic-quotes-store.js.map +1 -0
- package/dist/quotes/use-account-liquidation-price.d.ts +39 -0
- package/dist/quotes/use-account-liquidation-price.d.ts.map +1 -0
- package/dist/quotes/use-account-liquidation-price.js +57 -0
- package/dist/quotes/use-account-liquidation-price.js.map +1 -0
- package/dist/quotes/use-grouped-quotes.d.ts +55 -0
- package/dist/quotes/use-grouped-quotes.d.ts.map +1 -0
- package/dist/quotes/use-grouped-quotes.js +21 -0
- package/dist/quotes/use-grouped-quotes.js.map +1 -0
- package/dist/quotes/use-managed-quotes.d.ts +108 -0
- package/dist/quotes/use-managed-quotes.d.ts.map +1 -0
- package/dist/quotes/use-managed-quotes.js +314 -0
- package/dist/quotes/use-managed-quotes.js.map +1 -0
- package/dist/quotes/use-party-a-open-positions.d.ts +23 -0
- package/dist/quotes/use-party-a-open-positions.d.ts.map +1 -0
- package/dist/quotes/use-party-a-open-positions.js +27 -0
- package/dist/quotes/use-party-a-open-positions.js.map +1 -0
- package/dist/quotes/use-party-a-pending-quotes.d.ts +23 -0
- package/dist/quotes/use-party-a-pending-quotes.d.ts.map +1 -0
- package/dist/quotes/use-party-a-pending-quotes.js +27 -0
- package/dist/quotes/use-party-a-pending-quotes.js.map +1 -0
- package/dist/quotes/use-quote-events-by-type.d.ts +26 -0
- package/dist/quotes/use-quote-events-by-type.d.ts.map +1 -0
- package/dist/quotes/use-quote-events-by-type.js +27 -0
- package/dist/quotes/use-quote-events-by-type.js.map +1 -0
- package/dist/quotes/use-quote-funding.d.ts +35 -0
- package/dist/quotes/use-quote-funding.d.ts.map +1 -0
- package/dist/quotes/use-quote-funding.js +21 -0
- package/dist/quotes/use-quote-funding.js.map +1 -0
- package/dist/quotes/use-quote-history.d.ts +26 -0
- package/dist/quotes/use-quote-history.d.ts.map +1 -0
- package/dist/quotes/use-quote-history.js +27 -0
- package/dist/quotes/use-quote-history.js.map +1 -0
- package/dist/quotes/use-quote-platform-fee.d.ts +31 -0
- package/dist/quotes/use-quote-platform-fee.d.ts.map +1 -0
- package/dist/quotes/use-quote-platform-fee.js +31 -0
- package/dist/quotes/use-quote-platform-fee.js.map +1 -0
- package/dist/quotes/use-quote-price-history.d.ts +24 -0
- package/dist/quotes/use-quote-price-history.d.ts.map +1 -0
- package/dist/quotes/use-quote-price-history.js +14 -0
- package/dist/quotes/use-quote-price-history.js.map +1 -0
- package/dist/quotes/use-quote-upnl-and-pnl.d.ts +34 -0
- package/dist/quotes/use-quote-upnl-and-pnl.d.ts.map +1 -0
- package/dist/quotes/use-quote-upnl-and-pnl.js +61 -0
- package/dist/quotes/use-quote-upnl-and-pnl.js.map +1 -0
- package/dist/quotes/use-quote.d.ts +23 -0
- package/dist/quotes/use-quote.d.ts.map +1 -0
- package/dist/quotes/use-quote.js +27 -0
- package/dist/quotes/use-quote.js.map +1 -0
- package/dist/quotes/use-quotes-funding.d.ts +52 -0
- package/dist/quotes/use-quotes-funding.d.ts.map +1 -0
- package/dist/quotes/use-quotes-funding.js +80 -0
- package/dist/quotes/use-quotes-funding.js.map +1 -0
- package/dist/quotes/use-subgraph-query.d.ts +25 -0
- package/dist/quotes/use-subgraph-query.d.ts.map +1 -0
- package/dist/quotes/use-subgraph-query.js +27 -0
- package/dist/quotes/use-subgraph-query.js.map +1 -0
- package/dist/tpsl/index.d.ts +8 -0
- package/dist/tpsl/index.d.ts.map +1 -0
- package/dist/tpsl/to-quote-tpsl.d.ts +19 -0
- package/dist/tpsl/to-quote-tpsl.d.ts.map +1 -0
- package/dist/tpsl/to-quote-tpsl.js +46 -0
- package/dist/tpsl/to-quote-tpsl.js.map +1 -0
- package/dist/tpsl/tpsl-confirming.d.ts +36 -0
- package/dist/tpsl/tpsl-confirming.d.ts.map +1 -0
- package/dist/tpsl/tpsl-confirming.js +28 -0
- package/dist/tpsl/tpsl-confirming.js.map +1 -0
- package/dist/tpsl/use-quote-tpsl.d.ts +34 -0
- package/dist/tpsl/use-quote-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-quote-tpsl.js +73 -0
- package/dist/tpsl/use-quote-tpsl.js.map +1 -0
- package/dist/tpsl/use-set-quote-tpsl.d.ts +22 -0
- package/dist/tpsl/use-set-quote-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-set-quote-tpsl.js +43 -0
- package/dist/tpsl/use-set-quote-tpsl.js.map +1 -0
- package/dist/tpsl/use-tpsl-config.d.ts +14 -0
- package/dist/tpsl/use-tpsl-config.d.ts.map +1 -0
- package/dist/tpsl/use-tpsl-config.js +31 -0
- package/dist/tpsl/use-tpsl-config.js.map +1 -0
- package/dist/tpsl/use-tpsl-signing-spec.d.ts +13 -0
- package/dist/tpsl/use-tpsl-signing-spec.d.ts.map +1 -0
- package/dist/tpsl/use-tpsl-signing-spec.js +31 -0
- package/dist/tpsl/use-tpsl-signing-spec.js.map +1 -0
- package/dist/tpsl/use-watch-tpsl-notifications.d.ts +30 -0
- package/dist/tpsl/use-watch-tpsl-notifications.d.ts.map +1 -0
- package/dist/tpsl/use-watch-tpsl-notifications.js +44 -0
- package/dist/tpsl/use-watch-tpsl-notifications.js.map +1 -0
- package/dist/transactions/index.d.ts +4 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/resolve-write-result.d.ts +40 -0
- package/dist/transactions/resolve-write-result.d.ts.map +1 -0
- package/dist/transactions/resolve-write-result.js +15 -0
- package/dist/transactions/resolve-write-result.js.map +1 -0
- package/dist/transactions/use-transactions-store.d.ts +52 -0
- package/dist/transactions/use-transactions-store.d.ts.map +1 -0
- package/dist/transactions/use-transactions-store.js +24 -0
- package/dist/transactions/use-transactions-store.js.map +1 -0
- package/dist/transactions/write-types.d.ts +28 -0
- package/dist/transactions/write-types.d.ts.map +1 -0
- package/dist/transfers/index.d.ts +2 -0
- package/dist/transfers/index.d.ts.map +1 -0
- package/dist/transfers/use-transfer-history.d.ts +26 -0
- package/dist/transfers/use-transfer-history.d.ts.map +1 -0
- package/dist/transfers/use-transfer-history.js +27 -0
- package/dist/transfers/use-transfer-history.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/predicate-match.d.ts +27 -0
- package/dist/utils/predicate-match.d.ts.map +1 -0
- package/dist/utils/predicate-match.js +18 -0
- package/dist/utils/predicate-match.js.map +1 -0
- package/dist/wallet/index.d.ts +5 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/use-connect-wallet.d.ts +34 -0
- package/dist/wallet/use-connect-wallet.d.ts.map +1 -0
- package/dist/wallet/use-connect-wallet.js +24 -0
- package/dist/wallet/use-connect-wallet.js.map +1 -0
- package/dist/wallet/use-disconnect-wallet.d.ts +20 -0
- package/dist/wallet/use-disconnect-wallet.d.ts.map +1 -0
- package/dist/wallet/use-disconnect-wallet.js +21 -0
- package/dist/wallet/use-disconnect-wallet.js.map +1 -0
- package/dist/wallet/use-switch-to-symmio-chain.d.ts +29 -0
- package/dist/wallet/use-switch-to-symmio-chain.d.ts.map +1 -0
- package/dist/wallet/use-switch-to-symmio-chain.js +24 -0
- package/dist/wallet/use-switch-to-symmio-chain.js.map +1 -0
- package/dist/wallet/use-wallet-account.d.ts +32 -0
- package/dist/wallet/use-wallet-account.d.ts.map +1 -0
- package/dist/wallet/use-wallet-account.js +18 -0
- package/dist/wallet/use-wallet-account.js.map +1 -0
- package/dist/websocket/index.d.ts +2 -0
- package/dist/websocket/index.d.ts.map +1 -0
- package/dist/websocket/use-notifications.d.ts +48 -0
- package/dist/websocket/use-notifications.d.ts.map +1 -0
- package/dist/websocket/use-notifications.js +51 -0
- package/dist/websocket/use-notifications.js.map +1 -0
- package/dist/withdraw/index.d.ts +11 -0
- package/dist/withdraw/index.d.ts.map +1 -0
- package/dist/withdraw/use-finalize-withdraw-request.d.ts +26 -0
- package/dist/withdraw/use-finalize-withdraw-request.d.ts.map +1 -0
- package/dist/withdraw/use-finalize-withdraw-request.js +40 -0
- package/dist/withdraw/use-finalize-withdraw-request.js.map +1 -0
- package/dist/withdraw/use-initiate-withdraw.d.ts +28 -0
- package/dist/withdraw/use-initiate-withdraw.d.ts.map +1 -0
- package/dist/withdraw/use-initiate-withdraw.js +42 -0
- package/dist/withdraw/use-initiate-withdraw.js.map +1 -0
- package/dist/withdraw/use-last-withdraw-request-id.d.ts +22 -0
- package/dist/withdraw/use-last-withdraw-request-id.d.ts.map +1 -0
- package/dist/withdraw/use-last-withdraw-request-id.js +27 -0
- package/dist/withdraw/use-last-withdraw-request-id.js.map +1 -0
- package/dist/withdraw/use-pending-withdraw-requests.d.ts +21 -0
- package/dist/withdraw/use-pending-withdraw-requests.d.ts.map +1 -0
- package/dist/withdraw/use-pending-withdraw-requests.js +27 -0
- package/dist/withdraw/use-pending-withdraw-requests.js.map +1 -0
- package/dist/withdraw/use-request-cancel-withdraw.d.ts +25 -0
- package/dist/withdraw/use-request-cancel-withdraw.d.ts.map +1 -0
- package/dist/withdraw/use-request-cancel-withdraw.js +40 -0
- package/dist/withdraw/use-request-cancel-withdraw.js.map +1 -0
- package/dist/withdraw/use-simulate-finalize-withdraw-request.d.ts +25 -0
- package/dist/withdraw/use-simulate-finalize-withdraw-request.d.ts.map +1 -0
- package/dist/withdraw/use-simulate-finalize-withdraw-request.js +29 -0
- package/dist/withdraw/use-simulate-finalize-withdraw-request.js.map +1 -0
- package/dist/withdraw/use-simulate-initiate-withdraw.d.ts +26 -0
- package/dist/withdraw/use-simulate-initiate-withdraw.d.ts.map +1 -0
- package/dist/withdraw/use-simulate-initiate-withdraw.js +29 -0
- package/dist/withdraw/use-simulate-initiate-withdraw.js.map +1 -0
- package/dist/withdraw/use-simulate-request-cancel-withdraw.d.ts +25 -0
- package/dist/withdraw/use-simulate-request-cancel-withdraw.d.ts.map +1 -0
- package/dist/withdraw/use-simulate-request-cancel-withdraw.js +29 -0
- package/dist/withdraw/use-simulate-request-cancel-withdraw.js.map +1 -0
- package/dist/withdraw/use-withdraw-requests.d.ts +21 -0
- package/dist/withdraw/use-withdraw-requests.d.ts.map +1 -0
- package/dist/withdraw/use-withdraw-requests.js +27 -0
- package/dist/withdraw/use-withdraw-requests.js.map +1 -0
- package/dist/withdraw/use-withdrawable-time.d.ts +22 -0
- package/dist/withdraw/use-withdrawable-time.d.ts.map +1 -0
- package/dist/withdraw/use-withdrawable-time.js +27 -0
- package/dist/withdraw/use-withdrawable-time.js.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateCreateSubAccountsMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-create-sub-accounts.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateCreateSubAccounts };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-create-sub-accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-create-sub-accounts.js","names":[],"sources":["../../src/account-layer/use-simulate-create-sub-accounts.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateCreateSubAccountsMutationOptions,\n type ConfigParameter,\n type SimulateCreateSubAccountsParameters,\n type SimulateCreateSubAccountsReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateCreateSubAccounts}: an optional `config` override. The dry-run's\n * inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateCreateSubAccountsParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateCreateSubAccounts}. */\nexport type UseSimulateCreateSubAccountsReturnType = UseMutationResult<\n SimulateCreateSubAccountsReturnType,\n SymmioRequestError,\n SimulateCreateSubAccountsParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `createSubAccounts`. Call `mutate(args)`\n * to run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces\n * as a normalized {@link SymmioRequestError}). `from` defaults to the connected\n * wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateCreateSubAccounts();\n * sim.mutate({ ...args });\n * // sim.data?.result, sim.isPending, sim.error\n * ```\n */\nexport function useSimulateCreateSubAccounts(\n parameters: UseSimulateCreateSubAccountsParameters = {},\n): UseSimulateCreateSubAccountsReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateCreateSubAccountsMutationOptions(config);\n\n return useMutation<SimulateCreateSubAccountsReturnType, SymmioRequestError, SimulateCreateSubAccountsParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAyCA,SAAgB,EACd,IAAqD,CAAC,GACd;CACxC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAyC,CAAM;CAE5D,OAAO,EAA0G;EAC/G,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ConfigParameter, SimulateDeallocateParameters, SimulateDeallocateReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSimulateDeallocate}: an optional `config` override. The
|
|
6
|
+
* dry-run's inputs (including a `upnlSig`) are passed as the mutation `variables`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSimulateDeallocateParameters = ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSimulateDeallocate}. */
|
|
10
|
+
export type UseSimulateDeallocateReturnType = UseMutationResult<SimulateDeallocateReturnType, SymmioRequestError, SimulateDeallocateParameters>;
|
|
11
|
+
/**
|
|
12
|
+
* On-demand dry-run (`simulateContract`) of `deallocate`. Call `mutate(args)` to
|
|
13
|
+
* run it; `data` holds viem's `{ request, result }`. A would-be revert (the
|
|
14
|
+
* deallocate debounce, an insolvent result, or a stale `upnlSig`) surfaces as a
|
|
15
|
+
* normalized {@link SymmioRequestError}. `from` defaults to the connected wallet
|
|
16
|
+
* and `chainId` to the connected chain.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* The `upnlSig` is still required here — fetch it (e.g. with `useDeallocateUpnlSig`)
|
|
20
|
+
* before simulating.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const sim = useSimulateDeallocate();
|
|
25
|
+
* sim.mutate({ account: "0xsub…", amount: 1_000000000000000000n, upnlSig });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function useSimulateDeallocate(parameters?: UseSimulateDeallocateParameters): UseSimulateDeallocateReturnType;
|
|
29
|
+
//# sourceMappingURL=use-simulate-deallocate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-deallocate.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-deallocate.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG,eAAe,CAAC;AAE9D,oDAAoD;AACpD,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAC7D,4BAA4B,EAC5B,kBAAkB,EAClB,4BAA4B,CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,GAAE,+BAAoC,GAC/C,+BAA+B,CAoBjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateDeallocateMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-deallocate.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateDeallocate };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-deallocate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-deallocate.js","names":[],"sources":["../../src/account-layer/use-simulate-deallocate.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateDeallocateMutationOptions,\n type ConfigParameter,\n type SimulateDeallocateParameters,\n type SimulateDeallocateReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateDeallocate}: an optional `config` override. The\n * dry-run's inputs (including a `upnlSig`) are passed as the mutation `variables`.\n */\nexport type UseSimulateDeallocateParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateDeallocate}. */\nexport type UseSimulateDeallocateReturnType = UseMutationResult<\n SimulateDeallocateReturnType,\n SymmioRequestError,\n SimulateDeallocateParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `deallocate`. Call `mutate(args)` to\n * run it; `data` holds viem's `{ request, result }`. A would-be revert (the\n * deallocate debounce, an insolvent result, or a stale `upnlSig`) surfaces as a\n * normalized {@link SymmioRequestError}. `from` defaults to the connected wallet\n * and `chainId` to the connected chain.\n *\n * @remarks\n * The `upnlSig` is still required here — fetch it (e.g. with `useDeallocateUpnlSig`)\n * before simulating.\n *\n * @example\n * ```tsx\n * const sim = useSimulateDeallocate();\n * sim.mutate({ account: \"0xsub…\", amount: 1_000000000000000000n, upnlSig });\n * ```\n */\nexport function useSimulateDeallocate(\n parameters: UseSimulateDeallocateParameters = {},\n): UseSimulateDeallocateReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateDeallocateMutationOptions(config);\n\n return useMutation<SimulateDeallocateReturnType, SymmioRequestError, SimulateDeallocateParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AA6CA,SAAgB,EACd,IAA8C,CAAC,GACd;CACjC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAkC,CAAM;CAErD,OAAO,EAA4F;EACjG,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConfigParameter, SimulateDeleteSubAccountParameters, SimulateDeleteSubAccountReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSimulateDeleteSubAccount}: an optional `config` override. The dry-run's
|
|
6
|
+
* inputs are passed as the mutation `variables`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSimulateDeleteSubAccountParameters = ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSimulateDeleteSubAccount}. */
|
|
10
|
+
export type UseSimulateDeleteSubAccountReturnType = UseMutationResult<SimulateDeleteSubAccountReturnType, SymmioRequestError, SimulateDeleteSubAccountParameters>;
|
|
11
|
+
/**
|
|
12
|
+
* On-demand dry-run (`simulateContract`) of `deleteSubAccount`. Call `mutate(args)`
|
|
13
|
+
* to run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces
|
|
14
|
+
* as a normalized {@link SymmioRequestError}). `from` defaults to the connected
|
|
15
|
+
* wallet and `chainId` to the connected chain.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const sim = useSimulateDeleteSubAccount();
|
|
20
|
+
* sim.mutate({ subAccount: "0xsub…" });
|
|
21
|
+
* // sim.isSuccess, sim.isPending, sim.error
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSimulateDeleteSubAccount(parameters?: UseSimulateDeleteSubAccountParameters): UseSimulateDeleteSubAccountReturnType;
|
|
25
|
+
//# sourceMappingURL=use-simulate-delete-sub-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-delete-sub-account.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-delete-sub-account.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACxC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG,eAAe,CAAC;AAEpE,0DAA0D;AAC1D,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,CACnE,kCAAkC,EAClC,kBAAkB,EAClB,kCAAkC,CACnC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,GAAE,qCAA0C,GACrD,qCAAqC,CAoBvC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateDeleteSubAccountMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-delete-sub-account.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateDeleteSubAccount };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-delete-sub-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-delete-sub-account.js","names":[],"sources":["../../src/account-layer/use-simulate-delete-sub-account.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateDeleteSubAccountMutationOptions,\n type ConfigParameter,\n type SimulateDeleteSubAccountParameters,\n type SimulateDeleteSubAccountReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateDeleteSubAccount}: an optional `config` override. The dry-run's\n * inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateDeleteSubAccountParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateDeleteSubAccount}. */\nexport type UseSimulateDeleteSubAccountReturnType = UseMutationResult<\n SimulateDeleteSubAccountReturnType,\n SymmioRequestError,\n SimulateDeleteSubAccountParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `deleteSubAccount`. Call `mutate(args)`\n * to run it; `data` holds viem's `{ request, result }` (a would-be revert surfaces\n * as a normalized {@link SymmioRequestError}). `from` defaults to the connected\n * wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateDeleteSubAccount();\n * sim.mutate({ subAccount: \"0xsub…\" });\n * // sim.isSuccess, sim.isPending, sim.error\n * ```\n */\nexport function useSimulateDeleteSubAccount(\n parameters: UseSimulateDeleteSubAccountParameters = {},\n): UseSimulateDeleteSubAccountReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateDeleteSubAccountMutationOptions(config);\n\n return useMutation<SimulateDeleteSubAccountReturnType, SymmioRequestError, SimulateDeleteSubAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAyCA,SAAgB,EACd,IAAoD,CAAC,GACd;CACvC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAwC,CAAM;CAE3D,OAAO,EAAwG;EAC7G,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConfigParameter, SimulateDepositAndAllocateForAccountParameters, SimulateDepositAndAllocateForAccountReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSimulateDepositAndAllocate}: an optional `config` override. The dry-run's
|
|
6
|
+
* inputs are passed as the mutation `variables`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSimulateDepositAndAllocateParameters = ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSimulateDepositAndAllocate}. */
|
|
10
|
+
export type UseSimulateDepositAndAllocateReturnType = UseMutationResult<SimulateDepositAndAllocateForAccountReturnType, SymmioRequestError, SimulateDepositAndAllocateForAccountParameters>;
|
|
11
|
+
/**
|
|
12
|
+
* On-demand dry-run (`simulateContract`) of `depositAndAllocateForAccount`. Call
|
|
13
|
+
* `mutate(args)` to run it; `data` holds viem's `{ request, result }` (a would-be
|
|
14
|
+
* revert surfaces as a normalized {@link SymmioRequestError}). `from` defaults to
|
|
15
|
+
* the connected wallet and `chainId` to the connected chain.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const sim = useSimulateDepositAndAllocate();
|
|
20
|
+
* sim.mutate({ ...args });
|
|
21
|
+
* // sim.data?.result, sim.isPending, sim.error
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSimulateDepositAndAllocate(parameters?: UseSimulateDepositAndAllocateParameters): UseSimulateDepositAndAllocateReturnType;
|
|
25
|
+
//# sourceMappingURL=use-simulate-deposit-and-allocate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-deposit-and-allocate.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-deposit-and-allocate.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,8CAA8C,EACnD,KAAK,8CAA8C,EACpD,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,uCAAuC,GAAG,eAAe,CAAC;AAEtE,4DAA4D;AAC5D,MAAM,MAAM,uCAAuC,GAAG,iBAAiB,CACrE,8CAA8C,EAC9C,kBAAkB,EAClB,8CAA8C,CAC/C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,GAAE,uCAA4C,GACvD,uCAAuC,CAwBzC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateDepositAndAllocateForAccountMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-deposit-and-allocate.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateDepositAndAllocate };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-deposit-and-allocate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-deposit-and-allocate.js","names":[],"sources":["../../src/account-layer/use-simulate-deposit-and-allocate.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateDepositAndAllocateForAccountMutationOptions,\n type ConfigParameter,\n type SimulateDepositAndAllocateForAccountParameters,\n type SimulateDepositAndAllocateForAccountReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateDepositAndAllocate}: an optional `config` override. The dry-run's\n * inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateDepositAndAllocateParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateDepositAndAllocate}. */\nexport type UseSimulateDepositAndAllocateReturnType = UseMutationResult<\n SimulateDepositAndAllocateForAccountReturnType,\n SymmioRequestError,\n SimulateDepositAndAllocateForAccountParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `depositAndAllocateForAccount`. Call\n * `mutate(args)` to run it; `data` holds viem's `{ request, result }` (a would-be\n * revert surfaces as a normalized {@link SymmioRequestError}). `from` defaults to\n * the connected wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateDepositAndAllocate();\n * sim.mutate({ ...args });\n * // sim.data?.result, sim.isPending, sim.error\n * ```\n */\nexport function useSimulateDepositAndAllocate(\n parameters: UseSimulateDepositAndAllocateParameters = {},\n): UseSimulateDepositAndAllocateReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateDepositAndAllocateForAccountMutationOptions(config);\n\n return useMutation<\n SimulateDepositAndAllocateForAccountReturnType,\n SymmioRequestError,\n SimulateDepositAndAllocateForAccountParameters\n >({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAyCA,SAAgB,EACd,IAAsD,CAAC,GACd;CACzC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAoD,CAAM;CAEvE,OAAO,EAIL;EACA,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConfigParameter, SimulateDepositForAccountParameters, SimulateDepositForAccountReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSimulateDeposit}: an optional `config` override. The dry-run's
|
|
6
|
+
* inputs are passed as the mutation `variables`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSimulateDepositParameters = ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSimulateDeposit}. */
|
|
10
|
+
export type UseSimulateDepositReturnType = UseMutationResult<SimulateDepositForAccountReturnType, SymmioRequestError, SimulateDepositForAccountParameters>;
|
|
11
|
+
/**
|
|
12
|
+
* On-demand dry-run (`simulateContract`) of `depositForAccount`. Call
|
|
13
|
+
* `mutate(args)` to run it; `data` holds viem's `{ request, result }` (a would-be
|
|
14
|
+
* revert surfaces as a normalized {@link SymmioRequestError}). `from` defaults to
|
|
15
|
+
* the connected wallet and `chainId` to the connected chain.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const sim = useSimulateDeposit();
|
|
20
|
+
* sim.mutate({ ...args });
|
|
21
|
+
* // sim.data?.result, sim.isPending, sim.error
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSimulateDeposit(parameters?: UseSimulateDepositParameters): UseSimulateDepositReturnType;
|
|
25
|
+
//# sourceMappingURL=use-simulate-deposit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-deposit.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-deposit.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,EACzC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE3D,iDAAiD;AACjD,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAC1D,mCAAmC,EACnC,kBAAkB,EAClB,mCAAmC,CACpC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,4BAAiC,GAAG,4BAA4B,CAoB9G"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateDepositForAccountMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-deposit.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateDeposit };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-deposit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-deposit.js","names":[],"sources":["../../src/account-layer/use-simulate-deposit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateDepositForAccountMutationOptions,\n type ConfigParameter,\n type SimulateDepositForAccountParameters,\n type SimulateDepositForAccountReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateDeposit}: an optional `config` override. The dry-run's\n * inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateDepositParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateDeposit}. */\nexport type UseSimulateDepositReturnType = UseMutationResult<\n SimulateDepositForAccountReturnType,\n SymmioRequestError,\n SimulateDepositForAccountParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `depositForAccount`. Call\n * `mutate(args)` to run it; `data` holds viem's `{ request, result }` (a would-be\n * revert surfaces as a normalized {@link SymmioRequestError}). `from` defaults to\n * the connected wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateDeposit();\n * sim.mutate({ ...args });\n * // sim.data?.result, sim.isPending, sim.error\n * ```\n */\nexport function useSimulateDeposit(parameters: UseSimulateDepositParameters = {}): UseSimulateDepositReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateDepositForAccountMutationOptions(config);\n\n return useMutation<SimulateDepositForAccountReturnType, SymmioRequestError, SimulateDepositForAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAyCA,SAAgB,EAAmB,IAA2C,CAAC,GAAiC;CAC9G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAyC,CAAM;CAE5D,OAAO,EAA0G;EAC/G,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConfigParameter, SimulateEditAccountNameParameters, SimulateEditAccountNameReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSimulateEditAccountName}: an optional `config` override. The dry-run's
|
|
6
|
+
* inputs are passed as the mutation `variables`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSimulateEditAccountNameParameters = ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSimulateEditAccountName}. */
|
|
10
|
+
export type UseSimulateEditAccountNameReturnType = UseMutationResult<SimulateEditAccountNameReturnType, SymmioRequestError, SimulateEditAccountNameParameters>;
|
|
11
|
+
/**
|
|
12
|
+
* On-demand dry-run (`simulateContract`) of `editAccountName`. Call
|
|
13
|
+
* `mutate(args)` to run it; `data` holds viem's `{ request, result }` (a would-be
|
|
14
|
+
* revert surfaces as a normalized {@link SymmioRequestError}). `from` defaults to
|
|
15
|
+
* the connected wallet and `chainId` to the connected chain.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const sim = useSimulateEditAccountName();
|
|
20
|
+
* sim.mutate({ ...args });
|
|
21
|
+
* // sim.data?.result, sim.isPending, sim.error
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSimulateEditAccountName(parameters?: UseSimulateEditAccountNameParameters): UseSimulateEditAccountNameReturnType;
|
|
25
|
+
//# sourceMappingURL=use-simulate-edit-account-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-edit-account-name.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-edit-account-name.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACvC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,oCAAoC,GAAG,eAAe,CAAC;AAEnE,yDAAyD;AACzD,MAAM,MAAM,oCAAoC,GAAG,iBAAiB,CAClE,iCAAiC,EACjC,kBAAkB,EAClB,iCAAiC,CAClC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,GAAE,oCAAyC,GACpD,oCAAoC,CAoBtC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateEditAccountNameMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-edit-account-name.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateEditAccountName };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-edit-account-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-edit-account-name.js","names":[],"sources":["../../src/account-layer/use-simulate-edit-account-name.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateEditAccountNameMutationOptions,\n type ConfigParameter,\n type SimulateEditAccountNameParameters,\n type SimulateEditAccountNameReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateEditAccountName}: an optional `config` override. The dry-run's\n * inputs are passed as the mutation `variables`.\n */\nexport type UseSimulateEditAccountNameParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateEditAccountName}. */\nexport type UseSimulateEditAccountNameReturnType = UseMutationResult<\n SimulateEditAccountNameReturnType,\n SymmioRequestError,\n SimulateEditAccountNameParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `editAccountName`. Call\n * `mutate(args)` to run it; `data` holds viem's `{ request, result }` (a would-be\n * revert surfaces as a normalized {@link SymmioRequestError}). `from` defaults to\n * the connected wallet and `chainId` to the connected chain.\n *\n * @example\n * ```tsx\n * const sim = useSimulateEditAccountName();\n * sim.mutate({ ...args });\n * // sim.data?.result, sim.isPending, sim.error\n * ```\n */\nexport function useSimulateEditAccountName(\n parameters: UseSimulateEditAccountNameParameters = {},\n): UseSimulateEditAccountNameReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateEditAccountNameMutationOptions(config);\n\n return useMutation<SimulateEditAccountNameReturnType, SymmioRequestError, SimulateEditAccountNameParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AAyCA,SAAgB,EACd,IAAmD,CAAC,GACd;CACtC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAuC,CAAM;CAE1D,OAAO,EAAsG;EAC3G,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ConfigParameter, SimulateRemoveMarginParameters, SimulateRemoveMarginReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSimulateRemoveMargin}: an optional `config` override.
|
|
6
|
+
* The dry-run's inputs (including a `upnlSig`) are passed as the mutation
|
|
7
|
+
* `variables`.
|
|
8
|
+
*/
|
|
9
|
+
export type UseSimulateRemoveMarginParameters = ConfigParameter;
|
|
10
|
+
/** Return type of {@link useSimulateRemoveMargin}. */
|
|
11
|
+
export type UseSimulateRemoveMarginReturnType = UseMutationResult<SimulateRemoveMarginReturnType, SymmioRequestError, SimulateRemoveMarginParameters>;
|
|
12
|
+
/**
|
|
13
|
+
* On-demand dry-run (`simulateContract`) of `removeMargin`. Call `mutate(args)`
|
|
14
|
+
* to run it; `data` holds viem's `{ request, result }`. A would-be revert (the
|
|
15
|
+
* deallocate debounce, an insolvent result, or a stale `upnlSig`) surfaces as a
|
|
16
|
+
* normalized {@link SymmioRequestError}. `from` defaults to the connected wallet
|
|
17
|
+
* and `chainId` to the connected chain.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The `upnlSig` is still required here — fetch it (e.g. with `useDeallocateUpnlSig`)
|
|
21
|
+
* before simulating.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const sim = useSimulateRemoveMargin();
|
|
26
|
+
* sim.mutate({ virtualAccount: "0xva…", amount: 50_000000000000000000n, upnlSig });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function useSimulateRemoveMargin(parameters?: UseSimulateRemoveMarginParameters): UseSimulateRemoveMarginReturnType;
|
|
30
|
+
//# sourceMappingURL=use-simulate-remove-margin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-remove-margin.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-simulate-remove-margin.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;;GAIG;AACH,MAAM,MAAM,iCAAiC,GAAG,eAAe,CAAC;AAEhE,sDAAsD;AACtD,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAC/D,8BAA8B,EAC9B,kBAAkB,EAClB,8BAA8B,CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,GAAE,iCAAsC,GACjD,iCAAiC,CAoBnC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { simulateRemoveMarginMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useConnection as i } from "wagmi";
|
|
7
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
8
|
+
//#region src/account-layer/use-simulate-remove-margin.ts
|
|
9
|
+
function o(o = {}) {
|
|
10
|
+
let s = t(o), c = e(), { address: l } = i(), u = r(s);
|
|
11
|
+
return a({
|
|
12
|
+
mutationKey: u.mutationKey,
|
|
13
|
+
mutationFn: async (e) => {
|
|
14
|
+
try {
|
|
15
|
+
return await u.mutationFn({
|
|
16
|
+
...e,
|
|
17
|
+
chainId: e.chainId ?? c,
|
|
18
|
+
from: e.from ?? l
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw n(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as useSimulateRemoveMargin };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=use-simulate-remove-margin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-simulate-remove-margin.js","names":[],"sources":["../../src/account-layer/use-simulate-remove-margin.ts"],"sourcesContent":["\"use client\";\n\nimport {\n simulateRemoveMarginMutationOptions,\n type ConfigParameter,\n type SimulateRemoveMarginParameters,\n type SimulateRemoveMarginReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useConnection } from \"wagmi\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSimulateRemoveMargin}: an optional `config` override.\n * The dry-run's inputs (including a `upnlSig`) are passed as the mutation\n * `variables`.\n */\nexport type UseSimulateRemoveMarginParameters = ConfigParameter;\n\n/** Return type of {@link useSimulateRemoveMargin}. */\nexport type UseSimulateRemoveMarginReturnType = UseMutationResult<\n SimulateRemoveMarginReturnType,\n SymmioRequestError,\n SimulateRemoveMarginParameters\n>;\n\n/**\n * On-demand dry-run (`simulateContract`) of `removeMargin`. Call `mutate(args)`\n * to run it; `data` holds viem's `{ request, result }`. A would-be revert (the\n * deallocate debounce, an insolvent result, or a stale `upnlSig`) surfaces as a\n * normalized {@link SymmioRequestError}. `from` defaults to the connected wallet\n * and `chainId` to the connected chain.\n *\n * @remarks\n * The `upnlSig` is still required here — fetch it (e.g. with `useDeallocateUpnlSig`)\n * before simulating.\n *\n * @example\n * ```tsx\n * const sim = useSimulateRemoveMargin();\n * sim.mutate({ virtualAccount: \"0xva…\", amount: 50_000000000000000000n, upnlSig });\n * ```\n */\nexport function useSimulateRemoveMargin(\n parameters: UseSimulateRemoveMarginParameters = {},\n): UseSimulateRemoveMarginReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const base = simulateRemoveMarginMutationOptions(config);\n\n return useMutation<SimulateRemoveMarginReturnType, SymmioRequestError, SimulateRemoveMarginParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({\n ...variables,\n chainId: variables.chainId ?? chainId,\n from: variables.from ?? address,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;AA8CA,SAAgB,EACd,IAAgD,CAAC,GACd;CACnC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAO,EAAoC,CAAM;CAEvD,OAAO,EAAgG;EACrG,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAC3B,GAAG;KACH,SAAS,EAAU,WAAW;KAC9B,MAAM,EAAU,QAAQ;IAC1B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ConfigParameter, GetSubAccountVirtualNonceOptions, GetSubAccountVirtualNonceReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSubAccountVirtualNonce}: the core query options
|
|
6
|
+
* (subAccount, chain id, TanStack `query` overrides) plus an optional `config`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSubAccountVirtualNonceParameters = GetSubAccountVirtualNonceOptions & ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSubAccountVirtualNonce}. */
|
|
10
|
+
export type UseSubAccountVirtualNonceReturnType = UseQueryResult<GetSubAccountVirtualNonceReturnType, SymmioRequestError>;
|
|
11
|
+
/**
|
|
12
|
+
* Read a subaccount's Virtual Account (VA) nonce — the per-subaccount counter
|
|
13
|
+
* seeding deterministic VA address derivation. The query is disabled until
|
|
14
|
+
* `subAccount` is set. `chainId` defaults to the connected chain. Errors are
|
|
15
|
+
* normalized to {@link SymmioRequestError}.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { data: nonce } = useSubAccountVirtualNonce({ subAccount: "0xsub…" });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSubAccountVirtualNonce(parameters?: UseSubAccountVirtualNonceParameters): UseSubAccountVirtualNonceReturnType;
|
|
23
|
+
//# sourceMappingURL=use-sub-account-virtual-nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sub-account-virtual-nonce.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-sub-account-virtual-nonce.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,mCAAmC,EACzC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,mCAAmC,GAAG,gCAAgC,GAAG,eAAe,CAAC;AAErG,wDAAwD;AACxD,MAAM,MAAM,mCAAmC,GAAG,cAAc,CAC9D,mCAAmC,EACnC,kBAAkB,CACnB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,GAAE,mCAAwC,GACnD,mCAAmC,CAkBrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getSubAccountVirtualNonceQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/account-layer/use-sub-account-virtual-nonce.ts
|
|
8
|
+
function a(a = {}) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
queryFn: async () => {
|
|
16
|
+
try {
|
|
17
|
+
return await c.queryFn();
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw n(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as useSubAccountVirtualNonce };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=use-sub-account-virtual-nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sub-account-virtual-nonce.js","names":[],"sources":["../../src/account-layer/use-sub-account-virtual-nonce.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getSubAccountVirtualNonceQueryOptions,\n type ConfigParameter,\n type GetSubAccountVirtualNonceOptions,\n type GetSubAccountVirtualNonceReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSubAccountVirtualNonce}: the core query options\n * (subAccount, chain id, TanStack `query` overrides) plus an optional `config`.\n */\nexport type UseSubAccountVirtualNonceParameters = GetSubAccountVirtualNonceOptions & ConfigParameter;\n\n/** Return type of {@link useSubAccountVirtualNonce}. */\nexport type UseSubAccountVirtualNonceReturnType = UseQueryResult<\n GetSubAccountVirtualNonceReturnType,\n SymmioRequestError\n>;\n\n/**\n * Read a subaccount's Virtual Account (VA) nonce — the per-subaccount counter\n * seeding deterministic VA address derivation. The query is disabled until\n * `subAccount` is set. `chainId` defaults to the connected chain. Errors are\n * normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { data: nonce } = useSubAccountVirtualNonce({ subAccount: \"0xsub…\" });\n * ```\n */\nexport function useSubAccountVirtualNonce(\n parameters: UseSubAccountVirtualNonceParameters = {},\n): UseSubAccountVirtualNonceReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getSubAccountVirtualNonceQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseSubAccountVirtualNonceReturnType;\n}\n"],"mappings":";;;;;;;AAqCA,SAAgB,EACd,IAAkD,CAAC,GACd;CACrC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAAsC,GAAQ;EAC5D,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfigParameter, GetSubAccountOptions, GetSubAccountReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSubAccount}: the core query options (account, chain
|
|
6
|
+
* id, TanStack `query` overrides) plus an optional `config`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSubAccountParameters = GetSubAccountOptions & ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSubAccount}. */
|
|
10
|
+
export type UseSubAccountReturnType = UseQueryResult<GetSubAccountReturnType, SymmioRequestError>;
|
|
11
|
+
/**
|
|
12
|
+
* Read a single SYMMIO subaccount by its address. The query is disabled until
|
|
13
|
+
* `account` is set. `chainId` defaults to the connected chain. Errors are
|
|
14
|
+
* normalized to {@link SymmioRequestError}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { data: sub, isLoading, error } = useSubAccount({ account: "0xsub…" });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useSubAccount(parameters?: UseSubAccountParameters): UseSubAccountReturnType;
|
|
22
|
+
//# sourceMappingURL=use-sub-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sub-account.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-sub-account.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAE7E,4CAA4C;AAC5C,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAElG;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,UAAU,GAAE,uBAA4B,GAAG,uBAAuB,CAkB/F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getSubAccountQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/account-layer/use-sub-account.ts
|
|
8
|
+
function a(a = {}) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
queryFn: async () => {
|
|
16
|
+
try {
|
|
17
|
+
return await c.queryFn();
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw n(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as useSubAccount };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=use-sub-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sub-account.js","names":[],"sources":["../../src/account-layer/use-sub-account.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getSubAccountQueryOptions,\n type ConfigParameter,\n type GetSubAccountOptions,\n type GetSubAccountReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useSubAccount}: the core query options (account, chain\n * id, TanStack `query` overrides) plus an optional `config`.\n */\nexport type UseSubAccountParameters = GetSubAccountOptions & ConfigParameter;\n\n/** Return type of {@link useSubAccount}. */\nexport type UseSubAccountReturnType = UseQueryResult<GetSubAccountReturnType, SymmioRequestError>;\n\n/**\n * Read a single SYMMIO subaccount by its address. The query is disabled until\n * `account` is set. `chainId` defaults to the connected chain. Errors are\n * normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { data: sub, isLoading, error } = useSubAccount({ account: \"0xsub…\" });\n * ```\n */\nexport function useSubAccount(parameters: UseSubAccountParameters = {}): UseSubAccountReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getSubAccountQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseSubAccountReturnType;\n}\n"],"mappings":";;;;;;;AAiCA,SAAgB,EAAc,IAAsC,CAAC,GAA4B;CAC/F,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA0B,GAAQ;EAChD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfigParameter, GetSubAccountsCountOfUserOptions, GetSubAccountsCountOfUserReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useSubAccountsCountOfUser}: the core query options (user,
|
|
6
|
+
* chain id, TanStack `query` overrides) plus an optional `config`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseSubAccountsCountOfUserParameters = GetSubAccountsCountOfUserOptions & ConfigParameter;
|
|
9
|
+
/** Return type of {@link useSubAccountsCountOfUser}. */
|
|
10
|
+
export type UseSubAccountsCountOfUserReturnType = UseQueryResult<GetSubAccountsCountOfUserReturnType, SymmioRequestError>;
|
|
11
|
+
/**
|
|
12
|
+
* Read how many subaccounts `parameters.user` owns. The query is disabled until
|
|
13
|
+
* `user` is set. `chainId` defaults to the connected chain. Errors are normalized
|
|
14
|
+
* to {@link SymmioRequestError}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { data: count } = useSubAccountsCountOfUser({ user: address });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useSubAccountsCountOfUser(parameters?: UseSubAccountsCountOfUserParameters): UseSubAccountsCountOfUserReturnType;
|
|
22
|
+
//# sourceMappingURL=use-sub-accounts-count-of-user.d.ts.map
|