@symmio/trading-react 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/account-layer/index.d.ts +28 -28
- package/dist/account-layer/index.js +29 -0
- package/dist/account-layer/use-account-balance-info.d.ts +16 -5
- package/dist/account-layer/use-account-balance-info.d.ts.map +1 -1
- package/dist/account-layer/use-account-balance-info.js +21 -9
- package/dist/account-layer/use-account-balance-info.js.map +1 -1
- package/dist/account-layer/use-account-balance-of.d.ts +16 -5
- package/dist/account-layer/use-account-balance-of.d.ts.map +1 -1
- package/dist/account-layer/use-account-balance-of.js +20 -9
- package/dist/account-layer/use-account-balance-of.js.map +1 -1
- package/dist/account-layer/use-add-margin.d.ts +2 -2
- package/dist/account-layer/use-allocate.d.ts +2 -2
- package/dist/account-layer/use-create-sub-accounts.d.ts +2 -2
- package/dist/account-layer/use-deallocate.d.ts +2 -2
- package/dist/account-layer/use-delete-sub-account.d.ts +2 -2
- package/dist/account-layer/use-deposit-and-allocate.d.ts +2 -2
- package/dist/account-layer/use-deposit.d.ts +5 -3
- package/dist/account-layer/use-deposit.d.ts.map +1 -1
- package/dist/account-layer/use-deposit.js +17 -15
- package/dist/account-layer/use-deposit.js.map +1 -1
- package/dist/account-layer/use-edit-account-name.d.ts +2 -2
- package/dist/account-layer/use-predicted-next-virtual-account.d.ts +1 -1
- package/dist/account-layer/use-remove-margin.d.ts +2 -2
- package/dist/account-layer/use-simulate-add-margin.d.ts +1 -1
- package/dist/account-layer/use-simulate-allocate.d.ts +1 -1
- package/dist/account-layer/use-simulate-create-sub-accounts.d.ts +1 -1
- package/dist/account-layer/use-simulate-deallocate.d.ts +1 -1
- package/dist/account-layer/use-simulate-delete-sub-account.d.ts +1 -1
- package/dist/account-layer/use-simulate-deposit-and-allocate.d.ts +1 -1
- package/dist/account-layer/use-simulate-deposit.d.ts +1 -1
- package/dist/account-layer/use-simulate-edit-account-name.d.ts +1 -1
- package/dist/account-layer/use-simulate-remove-margin.d.ts +1 -1
- package/dist/account-layer/use-sub-account-virtual-nonce.d.ts +1 -1
- package/dist/account-layer/use-sub-account.d.ts +1 -1
- package/dist/account-layer/use-sub-accounts-count-of-user.d.ts +1 -1
- package/dist/account-layer/use-user-sub-accounts-addresses.d.ts +1 -1
- package/dist/account-layer/use-user-sub-accounts.d.ts +1 -1
- package/dist/account-layer/use-virtual-account.d.ts +1 -1
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts +1 -1
- package/dist/balance-history/index.d.ts +3 -3
- package/dist/balance-history/use-balance-history.d.ts +1 -1
- package/dist/balance-history/use-deposit-history.d.ts +1 -1
- package/dist/balance-history/use-withdraw-history.d.ts +1 -1
- package/dist/collateral/index.d.ts +4 -4
- package/dist/collateral/use-approve-collateral.d.ts +2 -2
- package/dist/collateral/use-collateral-allowance.d.ts +1 -1
- package/dist/collateral/use-collateral-balance.d.ts +1 -1
- package/dist/collateral/use-simulate-approve-collateral.d.ts +1 -1
- package/dist/error-codes/index.d.ts +2 -2
- package/dist/error-codes/use-solver-error-codes.d.ts +1 -1
- package/dist/error-codes/use-solver-error-message.d.ts +1 -1
- package/dist/errors/index.d.ts +3 -3
- package/dist/errors/index.js +3 -0
- package/dist/errors/normalize-symm-error.d.ts +1 -1
- package/dist/errors/symmio-request-error.d.ts +1 -1
- package/dist/estimated-price/index.d.ts +2 -0
- package/dist/estimated-price/index.d.ts.map +1 -0
- package/dist/estimated-price/use-debounced-value.d.ts +9 -0
- package/dist/estimated-price/use-debounced-value.d.ts.map +1 -0
- package/dist/estimated-price/use-debounced-value.js +18 -0
- package/dist/estimated-price/use-debounced-value.js.map +1 -0
- package/dist/estimated-price/use-estimated-price.d.ts +46 -0
- package/dist/estimated-price/use-estimated-price.d.ts.map +1 -0
- package/dist/estimated-price/use-estimated-price.js +31 -0
- package/dist/estimated-price/use-estimated-price.js.map +1 -0
- package/dist/fees/index.d.ts +1 -1
- package/dist/fees/index.js +2 -0
- package/dist/fees/use-fee-for-user.d.ts +1 -1
- package/dist/funding-info/index.d.ts +2 -0
- package/dist/funding-info/index.d.ts.map +1 -0
- package/dist/funding-info/use-funding-info.d.ts +25 -0
- package/dist/funding-info/use-funding-info.d.ts.map +1 -0
- package/dist/funding-info/use-funding-info.js +27 -0
- package/dist/funding-info/use-funding-info.js.map +1 -0
- package/dist/index.d.ts +45 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -113
- package/dist/instant-layer/index.d.ts +14 -13
- package/dist/instant-layer/index.d.ts.map +1 -1
- package/dist/instant-layer/index.js +15 -0
- package/dist/instant-layer/use-delegation-expiry.d.ts +1 -1
- package/dist/instant-layer/use-grant-delegation.d.ts +2 -2
- package/dist/instant-layer/use-instant-close-auto.d.ts +1 -1
- package/dist/instant-layer/use-instant-close-bulk-auto.d.ts +1 -1
- package/dist/instant-layer/use-instant-close-bulk.d.ts +1 -1
- package/dist/instant-layer/use-instant-close.d.ts +1 -1
- package/dist/instant-layer/use-instant-closes.d.ts +1 -1
- package/dist/instant-layer/use-instant-open-auto.d.ts +1 -1
- package/dist/instant-layer/use-instant-open-quote-id.d.ts +1 -1
- package/dist/instant-layer/use-instant-open-with-tpsl.d.ts +55 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.js +64 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.js.map +1 -0
- package/dist/instant-layer/use-instant-open.d.ts +1 -1
- package/dist/instant-layer/use-instant-opens.d.ts +1 -1
- package/dist/instant-layer/use-is-delegation-active.d.ts +1 -1
- package/dist/instant-layer/use-simulate-grant-delegation.d.ts +1 -1
- package/dist/locked-params/index.d.ts +1 -1
- package/dist/locked-params/use-locked-params.d.ts +1 -1
- package/dist/margin/index.d.ts +2 -0
- package/dist/margin/index.d.ts.map +1 -0
- package/dist/margin/use-available-instant-open-margin.d.ts +51 -0
- package/dist/margin/use-available-instant-open-margin.d.ts.map +1 -0
- package/dist/margin/use-available-instant-open-margin.js +66 -0
- package/dist/margin/use-available-instant-open-margin.js.map +1 -0
- package/dist/market-info/index.d.ts +2 -0
- package/dist/market-info/index.d.ts.map +1 -0
- package/dist/market-info/use-market-info.d.ts +28 -0
- package/dist/market-info/use-market-info.d.ts.map +1 -0
- package/dist/market-info/use-market-info.js +27 -0
- package/dist/market-info/use-market-info.js.map +1 -0
- package/dist/markets/index.d.ts +2 -2
- package/dist/markets/index.js +3 -0
- package/dist/markets/use-markets.d.ts +1 -1
- package/dist/markets/use-onchain-contract-markets.d.ts +1 -1
- package/dist/muon/index.d.ts +10 -10
- package/dist/muon/use-deallocate-upnl-sig.d.ts +1 -1
- package/dist/muon/use-muon-party-a-overview.d.ts +1 -1
- package/dist/muon/use-muon-price-range.d.ts +1 -1
- package/dist/muon/use-muon-price.d.ts +1 -1
- package/dist/muon/use-muon-settle-upnl.d.ts +1 -1
- package/dist/muon/use-muon-upnl-a-with-symbol-price.d.ts +1 -1
- package/dist/muon/use-muon-upnl-a.d.ts +1 -1
- package/dist/muon/use-muon-upnl-b.d.ts +1 -1
- package/dist/muon/use-muon-upnl-with-symbol-price.d.ts +1 -1
- package/dist/muon/use-muon-upnl.d.ts +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/use-search-notifications.d.ts +1 -1
- package/dist/notional-cap/index.d.ts +3 -3
- package/dist/notional-cap/use-notional-cap-all.d.ts +1 -1
- package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts +1 -1
- package/dist/notional-cap/use-open-interest-by-symbol-id.d.ts +1 -1
- package/dist/price-service/index.d.ts +8 -8
- package/dist/price-service/index.js +9 -0
- package/dist/price-service/use-enigma-price-by-market-id.d.ts +1 -1
- package/dist/price-service/use-enigma-price-by-name.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-health.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-metadata.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-prices-by-addresses.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-prices-by-names.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-symbols-info.d.ts +1 -1
- package/dist/price-service/use-enigma-prices.d.ts +1 -1
- package/dist/provider/index.d.ts +3 -3
- package/dist/provider/index.js +4 -0
- package/dist/provider/symmio-provider.d.ts +14 -5
- package/dist/provider/symmio-provider.d.ts.map +1 -1
- package/dist/provider/symmio-provider.js +2 -2
- package/dist/provider/symmio-provider.js.map +1 -1
- package/dist/quotes/index.d.ts +15 -15
- package/dist/quotes/use-account-liquidation-price.d.ts +4 -7
- package/dist/quotes/use-account-liquidation-price.d.ts.map +1 -1
- package/dist/quotes/use-account-liquidation-price.js.map +1 -1
- package/dist/quotes/use-grouped-quotes.d.ts +1 -1
- package/dist/quotes/use-managed-quotes.d.ts +1 -1
- package/dist/quotes/use-managed-quotes.d.ts.map +1 -1
- package/dist/quotes/use-managed-quotes.js +131 -128
- package/dist/quotes/use-managed-quotes.js.map +1 -1
- package/dist/quotes/use-party-a-open-positions.d.ts +4 -4
- package/dist/quotes/use-party-a-open-positions.js.map +1 -1
- package/dist/quotes/use-party-a-pending-quotes.d.ts +1 -1
- package/dist/quotes/use-quote-events-by-type.d.ts +1 -1
- package/dist/quotes/use-quote-funding.d.ts +1 -1
- package/dist/quotes/use-quote-history.d.ts +1 -1
- package/dist/quotes/use-quote-price-history.d.ts +1 -1
- package/dist/quotes/use-quote.d.ts +1 -1
- package/dist/quotes/use-quotes-funding.d.ts +1 -1
- package/dist/quotes/use-subgraph-query.d.ts +1 -1
- package/dist/tpsl/index.d.ts +8 -7
- package/dist/tpsl/index.d.ts.map +1 -1
- package/dist/tpsl/tpsl-store.d.ts +84 -0
- package/dist/tpsl/tpsl-store.d.ts.map +1 -0
- package/dist/tpsl/tpsl-store.js +154 -0
- package/dist/tpsl/tpsl-store.js.map +1 -0
- package/dist/tpsl/use-delete-quote-tpsl.d.ts +15 -0
- package/dist/tpsl/use-delete-quote-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-delete-quote-tpsl.js +31 -0
- package/dist/tpsl/use-delete-quote-tpsl.js.map +1 -0
- package/dist/tpsl/use-quote-tpsl.d.ts +19 -20
- package/dist/tpsl/use-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-quote-tpsl.js +24 -53
- package/dist/tpsl/use-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-set-quote-tpsl.d.ts +11 -10
- package/dist/tpsl/use-set-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-set-quote-tpsl.js +18 -22
- package/dist/tpsl/use-set-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-tpsl-config.d.ts +1 -1
- package/dist/tpsl/use-tpsl-signing-spec.d.ts +1 -1
- package/dist/tpsl/use-watch-tpsl-notifications.d.ts +1 -1
- package/dist/transactions/index.d.ts +3 -3
- package/dist/transactions/index.js +3 -0
- package/dist/transactions/resolve-write-result.d.ts +1 -1
- package/dist/transfers/index.d.ts +1 -1
- package/dist/transfers/use-transfer-history.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/wallet/index.d.ts +4 -4
- package/dist/wallet/index.js +5 -0
- package/dist/wallet/use-connect-wallet.d.ts +1 -1
- package/dist/wallet/use-switch-to-symmio-chain.d.ts +1 -1
- package/dist/websocket/index.d.ts +1 -1
- package/dist/websocket/is-settle-notification.d.ts +15 -0
- package/dist/websocket/is-settle-notification.d.ts.map +1 -0
- package/dist/websocket/is-settle-notification.js +15 -0
- package/dist/websocket/is-settle-notification.js.map +1 -0
- package/dist/websocket/use-notifications.d.ts +1 -1
- package/dist/withdraw/index.d.ts +10 -10
- package/dist/withdraw/use-finalize-withdraw-request.d.ts +2 -2
- package/dist/withdraw/use-initiate-withdraw.d.ts +2 -2
- package/dist/withdraw/use-last-withdraw-request-id.d.ts +1 -1
- package/dist/withdraw/use-pending-withdraw-requests.d.ts +1 -1
- package/dist/withdraw/use-request-cancel-withdraw.d.ts +2 -2
- package/dist/withdraw/use-simulate-finalize-withdraw-request.d.ts +1 -1
- package/dist/withdraw/use-simulate-initiate-withdraw.d.ts +1 -1
- package/dist/withdraw/use-simulate-request-cancel-withdraw.d.ts +1 -1
- package/dist/withdraw/use-withdraw-requests.d.ts +1 -1
- package/dist/withdraw/use-withdrawable-time.d.ts +1 -1
- package/package.json +11 -10
- package/dist/tpsl/tpsl-confirming.d.ts +0 -36
- package/dist/tpsl/tpsl-confirming.d.ts.map +0 -1
- package/dist/tpsl/tpsl-confirming.js +0 -28
- package/dist/tpsl/tpsl-confirming.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
`@symmio/trading-react` is the React layer of the SYMMIO SDK. It wraps the framework-agnostic `@symmio/trading-core` in hooks and a provider, bridging the SDK to your app's wagmi and TanStack Query setup so you can read positions, quotes, balances, and prices and run trading flows without wiring contract calls yourself.
|
|
6
6
|
|
|
7
|
-
**[Documentation](https://
|
|
7
|
+
**[Documentation](https://doc.trading-sdk.symm.io/react) · [Live SDK console](https://console.trading-sdk.symm.io/)**
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -40,7 +40,7 @@ function Account() {
|
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
For the full list of hooks and providers, see the [API reference](https://
|
|
43
|
+
For the full list of hooks and providers, see the [API reference](https://doc.trading-sdk.symm.io/react).
|
|
44
44
|
|
|
45
45
|
## License
|
|
46
46
|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export * from './use-account-balance-info';
|
|
2
|
-
export * from './use-account-balance-of';
|
|
3
|
-
export * from './use-add-margin';
|
|
4
|
-
export * from './use-allocate';
|
|
5
|
-
export * from './use-create-sub-accounts';
|
|
6
|
-
export * from './use-deallocate';
|
|
7
|
-
export * from './use-delete-sub-account';
|
|
8
|
-
export * from './use-deposit';
|
|
9
|
-
export * from './use-deposit-and-allocate';
|
|
10
|
-
export * from './use-edit-account-name';
|
|
11
|
-
export * from './use-predicted-next-virtual-account';
|
|
12
|
-
export * from './use-remove-margin';
|
|
13
|
-
export * from './use-simulate-add-margin';
|
|
14
|
-
export * from './use-simulate-allocate';
|
|
15
|
-
export * from './use-simulate-create-sub-accounts';
|
|
16
|
-
export * from './use-simulate-deallocate';
|
|
17
|
-
export * from './use-simulate-delete-sub-account';
|
|
18
|
-
export * from './use-simulate-deposit';
|
|
19
|
-
export * from './use-simulate-deposit-and-allocate';
|
|
20
|
-
export * from './use-simulate-edit-account-name';
|
|
21
|
-
export * from './use-simulate-remove-margin';
|
|
22
|
-
export * from './use-sub-account';
|
|
23
|
-
export * from './use-sub-account-virtual-nonce';
|
|
24
|
-
export * from './use-sub-accounts-count-of-user';
|
|
25
|
-
export * from './use-user-sub-accounts';
|
|
26
|
-
export * from './use-user-sub-accounts-addresses';
|
|
27
|
-
export * from './use-virtual-account';
|
|
28
|
-
export * from './use-virtual-accounts-addresses-of-sub-account';
|
|
1
|
+
export * from './use-account-balance-info.js';
|
|
2
|
+
export * from './use-account-balance-of.js';
|
|
3
|
+
export * from './use-add-margin.js';
|
|
4
|
+
export * from './use-allocate.js';
|
|
5
|
+
export * from './use-create-sub-accounts.js';
|
|
6
|
+
export * from './use-deallocate.js';
|
|
7
|
+
export * from './use-delete-sub-account.js';
|
|
8
|
+
export * from './use-deposit.js';
|
|
9
|
+
export * from './use-deposit-and-allocate.js';
|
|
10
|
+
export * from './use-edit-account-name.js';
|
|
11
|
+
export * from './use-predicted-next-virtual-account.js';
|
|
12
|
+
export * from './use-remove-margin.js';
|
|
13
|
+
export * from './use-simulate-add-margin.js';
|
|
14
|
+
export * from './use-simulate-allocate.js';
|
|
15
|
+
export * from './use-simulate-create-sub-accounts.js';
|
|
16
|
+
export * from './use-simulate-deallocate.js';
|
|
17
|
+
export * from './use-simulate-delete-sub-account.js';
|
|
18
|
+
export * from './use-simulate-deposit.js';
|
|
19
|
+
export * from './use-simulate-deposit-and-allocate.js';
|
|
20
|
+
export * from './use-simulate-edit-account-name.js';
|
|
21
|
+
export * from './use-simulate-remove-margin.js';
|
|
22
|
+
export * from './use-sub-account.js';
|
|
23
|
+
export * from './use-sub-account-virtual-nonce.js';
|
|
24
|
+
export * from './use-sub-accounts-count-of-user.js';
|
|
25
|
+
export * from './use-user-sub-accounts.js';
|
|
26
|
+
export * from './use-user-sub-accounts-addresses.js';
|
|
27
|
+
export * from './use-virtual-account.js';
|
|
28
|
+
export * from './use-virtual-accounts-addresses-of-sub-account.js';
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useAccountBalanceInfo as e } from "./use-account-balance-info.js";
|
|
2
|
+
import { useAccountBalanceOf as t } from "./use-account-balance-of.js";
|
|
3
|
+
import { useAddMargin as n } from "./use-add-margin.js";
|
|
4
|
+
import { useAllocate as r } from "./use-allocate.js";
|
|
5
|
+
import { useCreateSubAccounts as i } from "./use-create-sub-accounts.js";
|
|
6
|
+
import { useDeallocate as a } from "./use-deallocate.js";
|
|
7
|
+
import { useDeleteSubAccount as o } from "./use-delete-sub-account.js";
|
|
8
|
+
import { useDeposit as s } from "./use-deposit.js";
|
|
9
|
+
import { useDepositAndAllocate as c } from "./use-deposit-and-allocate.js";
|
|
10
|
+
import { useEditAccountName as l } from "./use-edit-account-name.js";
|
|
11
|
+
import { usePredictedNextVirtualAccount as u } from "./use-predicted-next-virtual-account.js";
|
|
12
|
+
import { useRemoveMargin as d } from "./use-remove-margin.js";
|
|
13
|
+
import { useSimulateAddMargin as f } from "./use-simulate-add-margin.js";
|
|
14
|
+
import { useSimulateAllocate as p } from "./use-simulate-allocate.js";
|
|
15
|
+
import { useSimulateCreateSubAccounts as m } from "./use-simulate-create-sub-accounts.js";
|
|
16
|
+
import { useSimulateDeallocate as h } from "./use-simulate-deallocate.js";
|
|
17
|
+
import { useSimulateDeleteSubAccount as g } from "./use-simulate-delete-sub-account.js";
|
|
18
|
+
import { useSimulateDeposit as _ } from "./use-simulate-deposit.js";
|
|
19
|
+
import { useSimulateDepositAndAllocate as v } from "./use-simulate-deposit-and-allocate.js";
|
|
20
|
+
import { useSimulateEditAccountName as y } from "./use-simulate-edit-account-name.js";
|
|
21
|
+
import { useSimulateRemoveMargin as b } from "./use-simulate-remove-margin.js";
|
|
22
|
+
import { useSubAccount as x } from "./use-sub-account.js";
|
|
23
|
+
import { useSubAccountVirtualNonce as S } from "./use-sub-account-virtual-nonce.js";
|
|
24
|
+
import { useSubAccountsCountOfUser as C } from "./use-sub-accounts-count-of-user.js";
|
|
25
|
+
import { useUserSubAccounts as w } from "./use-user-sub-accounts.js";
|
|
26
|
+
import { useUserSubAccountsAddresses as T } from "./use-user-sub-accounts-addresses.js";
|
|
27
|
+
import { useVirtualAccount as E } from "./use-virtual-account.js";
|
|
28
|
+
import { useVirtualAccountsAddressesOfSubAccount as D } from "./use-virtual-accounts-addresses-of-sub-account.js";
|
|
29
|
+
export { e as useAccountBalanceInfo, t as useAccountBalanceOf, n as useAddMargin, r as useAllocate, i as useCreateSubAccounts, a as useDeallocate, o as useDeleteSubAccount, s as useDeposit, c as useDepositAndAllocate, l as useEditAccountName, u as usePredictedNextVirtualAccount, d as useRemoveMargin, f as useSimulateAddMargin, p as useSimulateAllocate, m as useSimulateCreateSubAccounts, h as useSimulateDeallocate, g as useSimulateDeleteSubAccount, _ as useSimulateDeposit, v as useSimulateDepositAndAllocate, y as useSimulateEditAccountName, b as useSimulateRemoveMargin, x as useSubAccount, S as useSubAccountVirtualNonce, C as useSubAccountsCountOfUser, w as useUserSubAccounts, T as useUserSubAccountsAddresses, E as useVirtualAccount, D as useVirtualAccountsAddressesOfSubAccount };
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { ConfigParameter, GetAccountBalanceInfoOptions, GetAccountBalanceInfoReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useAccountBalanceInfo}: the core query options
|
|
6
|
-
* (account, chain id, TanStack `query` overrides) plus an optional `config
|
|
6
|
+
* (account, chain id, TanStack `query` overrides) plus an optional `config` and
|
|
7
|
+
* a `live` flag.
|
|
7
8
|
*/
|
|
8
|
-
export type UseAccountBalanceInfoParameters = GetAccountBalanceInfoOptions & ConfigParameter
|
|
9
|
+
export type UseAccountBalanceInfoParameters = GetAccountBalanceInfoOptions & ConfigParameter & {
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to the account's on-chain settle notifications and refetch on
|
|
12
|
+
* each open-anchor / close-fill (a shared WebSocket; requires the provider
|
|
13
|
+
* tree). Turn this on wherever the balance must reflect a just-settled trade
|
|
14
|
+
* without a manual refresh.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
live?: boolean;
|
|
18
|
+
};
|
|
9
19
|
/** Return type of {@link useAccountBalanceInfo}. */
|
|
10
20
|
export type UseAccountBalanceInfoReturnType = UseQueryResult<GetAccountBalanceInfoReturnType, SymmioRequestError>;
|
|
11
21
|
/**
|
|
12
22
|
* Read raw `balanceInfoOfPartyA` fields for a SYMMIO account. The query is
|
|
13
23
|
* disabled until `account` is set. Omitted `chainId` resolves through the SDK
|
|
14
|
-
* config. Errors are normalized to {@link SymmioRequestError}.
|
|
24
|
+
* config. Errors are normalized to {@link SymmioRequestError}. Pass `live: true`
|
|
25
|
+
* to auto-refetch when an open/close settles on-chain.
|
|
15
26
|
*
|
|
16
27
|
* @example
|
|
17
28
|
* ```tsx
|
|
18
|
-
* const { data, isLoading } = useAccountBalanceInfo({ account });
|
|
29
|
+
* const { data, isLoading } = useAccountBalanceInfo({ account, live: true });
|
|
19
30
|
* ```
|
|
20
31
|
*/
|
|
21
32
|
export declare function useAccountBalanceInfo(parameters?: UseAccountBalanceInfoParameters): UseAccountBalanceInfoReturnType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-balance-info.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-account-balance-info.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,
|
|
1
|
+
{"version":3,"file":"use-account-balance-info.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-account-balance-info.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EAErC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKzE;;;;GAIG;AACH,MAAM,MAAM,+BAA+B,GAAG,4BAA4B,GACxE,eAAe,GAAG;IAChB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEJ,oDAAoD;AACpD,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAC;AAElH;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,GAAE,+BAAoC,GAC/C,+BAA+B,CAwCjC"}
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useSymmioConfig as e } from "../provider/use-symmio-config.js";
|
|
3
3
|
import { normalizeSymmError as t } from "../errors/normalize-symm-error.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { SETTLE_REFETCH_DELAYS_MS as n, isSettleNotification as r } from "../websocket/is-settle-notification.js";
|
|
5
|
+
import { useNotifications as i } from "../websocket/use-notifications.js";
|
|
6
|
+
import { getAccountBalanceInfoQueryOptions as a } from "@symmio/trading-core";
|
|
7
|
+
import { useCallback as o } from "react";
|
|
8
|
+
import { useQuery as s } from "@tanstack/react-query";
|
|
6
9
|
//#region src/account-layer/use-account-balance-info.ts
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
...a,
|
|
10
|
+
function c(c = {}) {
|
|
11
|
+
let { live: l, ...u } = c, d = e(u), f = a(d, u), p = s({
|
|
12
|
+
...f,
|
|
11
13
|
queryFn: async () => {
|
|
12
14
|
try {
|
|
13
|
-
return await
|
|
15
|
+
return await f.queryFn();
|
|
14
16
|
} catch (e) {
|
|
15
17
|
throw t(e);
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
|
-
});
|
|
20
|
+
}), { refetch: m } = p, h = u.account;
|
|
21
|
+
return i({
|
|
22
|
+
account: h,
|
|
23
|
+
chainId: u.chainId ?? d.defaultChainId,
|
|
24
|
+
config: u.config,
|
|
25
|
+
enabled: !!(l && h) && u.query?.enabled !== !1,
|
|
26
|
+
onNotification: o((e) => {
|
|
27
|
+
let t = h !== void 0 && e.vaAddress?.toLowerCase() === h.toLowerCase();
|
|
28
|
+
if (!(!r(e) && !t)) for (let e of n) setTimeout(() => void m(), e);
|
|
29
|
+
}, [m, h])
|
|
30
|
+
}), p;
|
|
19
31
|
}
|
|
20
32
|
//#endregion
|
|
21
|
-
export {
|
|
33
|
+
export { c as useAccountBalanceInfo };
|
|
22
34
|
|
|
23
35
|
//# sourceMappingURL=use-account-balance-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-balance-info.js","names":[],"sources":["../../src/account-layer/use-account-balance-info.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getAccountBalanceInfoQueryOptions,\n type ConfigParameter,\n type GetAccountBalanceInfoOptions,\n type GetAccountBalanceInfoReturnType,\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 { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useAccountBalanceInfo}: the core query options\n * (account, chain id, TanStack `query` overrides) plus an optional `config
|
|
1
|
+
{"version":3,"file":"use-account-balance-info.js","names":[],"sources":["../../src/account-layer/use-account-balance-info.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getAccountBalanceInfoQueryOptions,\n type ConfigParameter,\n type GetAccountBalanceInfoOptions,\n type GetAccountBalanceInfoReturnType,\n type Notification,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useCallback } from \"react\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { isSettleNotification, SETTLE_REFETCH_DELAYS_MS } from \"../websocket/is-settle-notification\";\nimport { useNotifications } from \"../websocket/use-notifications\";\n\n/**\n * Parameters for {@link useAccountBalanceInfo}: the core query options\n * (account, chain id, TanStack `query` overrides) plus an optional `config` and\n * a `live` flag.\n */\nexport type UseAccountBalanceInfoParameters = GetAccountBalanceInfoOptions &\n ConfigParameter & {\n /**\n * Subscribe to the account's on-chain settle notifications and refetch on\n * each open-anchor / close-fill (a shared WebSocket; requires the provider\n * tree). Turn this on wherever the balance must reflect a just-settled trade\n * without a manual refresh.\n * @default false\n */\n live?: boolean;\n };\n\n/** Return type of {@link useAccountBalanceInfo}. */\nexport type UseAccountBalanceInfoReturnType = UseQueryResult<GetAccountBalanceInfoReturnType, SymmioRequestError>;\n\n/**\n * Read raw `balanceInfoOfPartyA` fields for a SYMMIO account. The query is\n * disabled until `account` is set. Omitted `chainId` resolves through the SDK\n * config. Errors are normalized to {@link SymmioRequestError}. Pass `live: true`\n * to auto-refetch when an open/close settles on-chain.\n *\n * @example\n * ```tsx\n * const { data, isLoading } = useAccountBalanceInfo({ account, live: true });\n * ```\n */\nexport function useAccountBalanceInfo(\n parameters: UseAccountBalanceInfoParameters = {},\n): UseAccountBalanceInfoReturnType {\n const { live, ...queryParameters } = parameters;\n const config = useSymmioConfig(queryParameters);\n const options = getAccountBalanceInfoQueryOptions(config, queryParameters);\n\n const query = useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseAccountBalanceInfoReturnType;\n\n const { refetch } = query;\n const account = queryParameters.account;\n useNotifications({\n account,\n // Watch the same chain the balance is read from (the query falls back to the\n // config default when chainId is omitted).\n chainId: queryParameters.chainId ?? config.defaultChainId,\n config: queryParameters.config,\n enabled: Boolean(live && account) && queryParameters.query?.enabled !== false,\n onNotification: useCallback(\n (notification: Notification) => {\n // Refetch on a balance-moving settle, or on any frame whose `vaAddress`\n // is the exact account being read (its Virtual Account just settled).\n const matchesVa = account !== undefined && notification.vaAddress?.toLowerCase() === account.toLowerCase();\n if (!isSettleNotification(notification) && !matchesVa) return;\n // The on-chain read lags the anchor block, so refetch in a short burst\n // until the post-settle balance lands.\n for (const ms of SETTLE_REFETCH_DELAYS_MS) setTimeout(() => void refetch(), ms);\n },\n [refetch, account],\n ),\n });\n\n return query;\n}\n"],"mappings":";;;;;;;;;AAgDA,SAAgB,EACd,IAA8C,CAAC,GACd;CACjC,IAAM,EAAE,SAAM,GAAG,MAAoB,GAC/B,IAAS,EAAgB,CAAe,GACxC,IAAU,EAAkC,GAAQ,CAAe,GAEnE,IAAQ,EAAS;EACrB,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC,GAEK,EAAE,eAAY,GACd,IAAU,EAAgB;CAsBhC,OArBA,EAAiB;EACf;EAGA,SAAS,EAAgB,WAAW,EAAO;EAC3C,QAAQ,EAAgB;EACxB,SAAS,GAAQ,KAAQ,MAAY,EAAgB,OAAO,YAAY;EACxE,gBAAgB,GACb,MAA+B;GAG9B,IAAM,IAAY,MAAY,KAAA,KAAa,EAAa,WAAW,YAAY,MAAM,EAAQ,YAAY;GACrG,OAAC,EAAqB,CAAY,KAAK,CAAC,IAG5C,KAAK,IAAM,KAAM,GAA0B,iBAAiB,KAAK,EAAQ,GAAG,CAAE;EAChF,GACA,CAAC,GAAS,CAAO,CACnB;CACF,CAAC,GAEM;AACT"}
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { ConfigParameter, GetAccountBalanceOfOptions, GetAccountBalanceOfReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useAccountBalanceOf}: the core query options
|
|
6
|
-
* (account, chain id, TanStack `query` overrides) plus an optional `config
|
|
6
|
+
* (account, chain id, TanStack `query` overrides) plus an optional `config` and
|
|
7
|
+
* a `live` flag.
|
|
7
8
|
*/
|
|
8
|
-
export type UseAccountBalanceOfParameters = GetAccountBalanceOfOptions & ConfigParameter
|
|
9
|
+
export type UseAccountBalanceOfParameters = GetAccountBalanceOfOptions & ConfigParameter & {
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to the account's on-chain settle notifications and refetch on
|
|
12
|
+
* each open-anchor / close-fill (a shared WebSocket; requires the provider
|
|
13
|
+
* tree). Turn this on wherever the balance must reflect a just-settled trade
|
|
14
|
+
* without a manual refresh.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
live?: boolean;
|
|
18
|
+
};
|
|
9
19
|
/** Return type of {@link useAccountBalanceOf}. */
|
|
10
20
|
export type UseAccountBalanceOfReturnType = UseQueryResult<GetAccountBalanceOfReturnType, SymmioRequestError>;
|
|
11
21
|
/**
|
|
12
22
|
* Read raw `balanceOf` for a SYMMIO account. The query is disabled until
|
|
13
23
|
* `account` is set. Omitted `chainId` resolves through the SDK config. Errors are
|
|
14
|
-
* normalized to {@link SymmioRequestError}.
|
|
24
|
+
* normalized to {@link SymmioRequestError}. Pass `live: true` to auto-refetch
|
|
25
|
+
* when an open/close settles on-chain.
|
|
15
26
|
*
|
|
16
27
|
* @example
|
|
17
28
|
* ```tsx
|
|
18
|
-
* const { data } = useAccountBalanceOf({ account });
|
|
29
|
+
* const { data } = useAccountBalanceOf({ account, live: true });
|
|
19
30
|
* ```
|
|
20
31
|
*/
|
|
21
32
|
export declare function useAccountBalanceOf(parameters?: UseAccountBalanceOfParameters): UseAccountBalanceOfReturnType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-balance-of.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-account-balance-of.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,
|
|
1
|
+
{"version":3,"file":"use-account-balance-of.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-account-balance-of.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAEnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKzE;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,0BAA0B,GACpE,eAAe,GAAG;IAChB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEJ,kDAAkD;AAClD,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;AAE9G;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,6BAAkC,GAAG,6BAA6B,CAoCjH"}
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useSymmioConfig as e } from "../provider/use-symmio-config.js";
|
|
3
3
|
import { normalizeSymmError as t } from "../errors/normalize-symm-error.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { SETTLE_REFETCH_DELAYS_MS as n, isSettleNotification as r } from "../websocket/is-settle-notification.js";
|
|
5
|
+
import { useNotifications as i } from "../websocket/use-notifications.js";
|
|
6
|
+
import { getAccountBalanceOfQueryOptions as a } from "@symmio/trading-core";
|
|
7
|
+
import { useCallback as o } from "react";
|
|
8
|
+
import { useQuery as s } from "@tanstack/react-query";
|
|
6
9
|
//#region src/account-layer/use-account-balance-of.ts
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
...a,
|
|
10
|
+
function c(c = {}) {
|
|
11
|
+
let { live: l, ...u } = c, d = e(u), f = a(d, u), p = s({
|
|
12
|
+
...f,
|
|
11
13
|
queryFn: async () => {
|
|
12
14
|
try {
|
|
13
|
-
return await
|
|
15
|
+
return await f.queryFn();
|
|
14
16
|
} catch (e) {
|
|
15
17
|
throw t(e);
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
|
-
});
|
|
20
|
+
}), { refetch: m } = p;
|
|
21
|
+
return i({
|
|
22
|
+
account: u.account,
|
|
23
|
+
chainId: u.chainId ?? d.defaultChainId,
|
|
24
|
+
config: u.config,
|
|
25
|
+
enabled: !!(l && u.account) && u.query?.enabled !== !1,
|
|
26
|
+
onNotification: o((e) => {
|
|
27
|
+
if (r(e)) for (let e of n) setTimeout(() => void m(), e);
|
|
28
|
+
}, [m])
|
|
29
|
+
}), p;
|
|
19
30
|
}
|
|
20
31
|
//#endregion
|
|
21
|
-
export {
|
|
32
|
+
export { c as useAccountBalanceOf };
|
|
22
33
|
|
|
23
34
|
//# sourceMappingURL=use-account-balance-of.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-balance-of.js","names":[],"sources":["../../src/account-layer/use-account-balance-of.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getAccountBalanceOfQueryOptions,\n type ConfigParameter,\n type GetAccountBalanceOfOptions,\n type GetAccountBalanceOfReturnType,\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 { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/**\n * Parameters for {@link useAccountBalanceOf}: the core query options\n * (account, chain id, TanStack `query` overrides) plus an optional `config
|
|
1
|
+
{"version":3,"file":"use-account-balance-of.js","names":[],"sources":["../../src/account-layer/use-account-balance-of.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getAccountBalanceOfQueryOptions,\n type ConfigParameter,\n type GetAccountBalanceOfOptions,\n type GetAccountBalanceOfReturnType,\n type Notification,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useCallback } from \"react\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { isSettleNotification, SETTLE_REFETCH_DELAYS_MS } from \"../websocket/is-settle-notification\";\nimport { useNotifications } from \"../websocket/use-notifications\";\n\n/**\n * Parameters for {@link useAccountBalanceOf}: the core query options\n * (account, chain id, TanStack `query` overrides) plus an optional `config` and\n * a `live` flag.\n */\nexport type UseAccountBalanceOfParameters = GetAccountBalanceOfOptions &\n ConfigParameter & {\n /**\n * Subscribe to the account's on-chain settle notifications and refetch on\n * each open-anchor / close-fill (a shared WebSocket; requires the provider\n * tree). Turn this on wherever the balance must reflect a just-settled trade\n * without a manual refresh.\n * @default false\n */\n live?: boolean;\n };\n\n/** Return type of {@link useAccountBalanceOf}. */\nexport type UseAccountBalanceOfReturnType = UseQueryResult<GetAccountBalanceOfReturnType, SymmioRequestError>;\n\n/**\n * Read raw `balanceOf` for a SYMMIO account. The query is disabled until\n * `account` is set. Omitted `chainId` resolves through the SDK config. Errors are\n * normalized to {@link SymmioRequestError}. Pass `live: true` to auto-refetch\n * when an open/close settles on-chain.\n *\n * @example\n * ```tsx\n * const { data } = useAccountBalanceOf({ account, live: true });\n * ```\n */\nexport function useAccountBalanceOf(parameters: UseAccountBalanceOfParameters = {}): UseAccountBalanceOfReturnType {\n const { live, ...queryParameters } = parameters;\n const config = useSymmioConfig(queryParameters);\n const options = getAccountBalanceOfQueryOptions(config, queryParameters);\n\n const query = useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseAccountBalanceOfReturnType;\n\n const { refetch } = query;\n useNotifications({\n account: queryParameters.account,\n // Watch the same chain the balance is read from (the query falls back to the\n // config default when chainId is omitted).\n chainId: queryParameters.chainId ?? config.defaultChainId,\n config: queryParameters.config,\n enabled: Boolean(live && queryParameters.account) && queryParameters.query?.enabled !== false,\n onNotification: useCallback(\n (notification: Notification) => {\n if (!isSettleNotification(notification)) return;\n // The on-chain read lags the anchor block, so refetch in a short burst\n // until the post-settle balance lands.\n for (const ms of SETTLE_REFETCH_DELAYS_MS) setTimeout(() => void refetch(), ms);\n },\n [refetch],\n ),\n });\n\n return query;\n}\n"],"mappings":";;;;;;;;;AAgDA,SAAgB,EAAoB,IAA4C,CAAC,GAAkC;CACjH,IAAM,EAAE,SAAM,GAAG,MAAoB,GAC/B,IAAS,EAAgB,CAAe,GACxC,IAAU,EAAgC,GAAQ,CAAe,GAEjE,IAAQ,EAAS;EACrB,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC,GAEK,EAAE,eAAY;CAmBpB,OAlBA,EAAiB;EACf,SAAS,EAAgB;EAGzB,SAAS,EAAgB,WAAW,EAAO;EAC3C,QAAQ,EAAgB;EACxB,SAAS,GAAQ,KAAQ,EAAgB,YAAY,EAAgB,OAAO,YAAY;EACxF,gBAAgB,GACb,MAA+B;GACzB,MAAqB,CAAY,GAGtC,KAAK,IAAM,KAAM,GAA0B,iBAAiB,KAAK,EAAQ,GAAG,CAAE;EAChF,GACA,CAAC,CAAO,CACV;CACF,CAAC,GAEM;AACT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AddMarginParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useAddMargin}.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AllocateParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useAllocate}.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateSubAccountsParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useCreateSubAccounts}.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeallocateParameters, SingleUpnlSig } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useDeallocate}.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeleteSubAccountParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useDeleteSubAccount}.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DepositAndAllocateForAccountParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useDepositAndAllocate}.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DepositForAccountParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useDeposit}.
|
|
7
7
|
*/
|
|
@@ -15,7 +15,9 @@ export type UseDepositReturnType = UseMutationResult<DepositResult, SymmioReques
|
|
|
15
15
|
* subaccount's available balance. The connected wallet must own the subaccount,
|
|
16
16
|
* and must have approved the collateral to the SYMMIO core first (see
|
|
17
17
|
* `useApproveCollateral`). On success, the connected wallet's collateral
|
|
18
|
-
* allowance and balance queries
|
|
18
|
+
* allowance and balance queries **and the credited subaccount's available
|
|
19
|
+
* balance** are invalidated, so mounted reads — including the trade form's
|
|
20
|
+
* available instant-open margin (`Max`) — refetch immediately.
|
|
19
21
|
*
|
|
20
22
|
* @example
|
|
21
23
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-deposit.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-deposit.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-deposit.d.ts","sourceRoot":"","sources":["../../src/account-layer/use-deposit.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,2BAA2B,EACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG7F;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AAExC,yCAAyC;AACzC,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,aAAa,EAAE,kBAAkB,EAAE,2BAA2B,CAAC,CAAC;AAErH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,UAAU,GAAE,oBAAyB,GAAG,oBAAoB,CAyCtF"}
|
|
@@ -4,38 +4,40 @@ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
|
4
4
|
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
5
|
import { resolveWriteResult as r } from "../transactions/resolve-write-result.js";
|
|
6
6
|
import { predicateMatch as i } from "../utils/predicate-match.js";
|
|
7
|
-
import { depositForAccountMutationOptions as a,
|
|
8
|
-
import { useConnection as
|
|
9
|
-
import { useMutation as
|
|
7
|
+
import { depositForAccountMutationOptions as a, getAccountBalanceInfoQueryKey as o, getAccountBalanceOfQueryKey as s, getCollateralAllowanceQueryKey as c, getCollateralBalanceQueryKey as l } from "@symmio/trading-core";
|
|
8
|
+
import { useConnection as u } from "wagmi";
|
|
9
|
+
import { useMutation as d, useQueryClient as f } from "@tanstack/react-query";
|
|
10
10
|
//#region src/account-layer/use-deposit.ts
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
return
|
|
14
|
-
mutationKey:
|
|
11
|
+
function p(p = {}) {
|
|
12
|
+
let m = t(p), h = e(), { address: g } = u(), _ = f(), v = a(m);
|
|
13
|
+
return d({
|
|
14
|
+
mutationKey: v.mutationKey,
|
|
15
15
|
mutationFn: async (e) => {
|
|
16
16
|
try {
|
|
17
|
-
let t = e.chainId ??
|
|
18
|
-
return r(
|
|
17
|
+
let t = e.chainId ?? h;
|
|
18
|
+
return r(m, await v.mutationFn({
|
|
19
19
|
account: e.account,
|
|
20
20
|
amount: e.amount,
|
|
21
21
|
simulateBeforeWrite: e.simulateBeforeWrite,
|
|
22
22
|
chainId: t
|
|
23
23
|
}), {
|
|
24
24
|
chainId: t,
|
|
25
|
-
waitForReceipt:
|
|
26
|
-
confirmations:
|
|
25
|
+
waitForReceipt: p.waitForReceipt,
|
|
26
|
+
confirmations: p.confirmations
|
|
27
27
|
});
|
|
28
28
|
} catch (e) {
|
|
29
29
|
throw n(e);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
onSuccess: () => {
|
|
33
|
-
let
|
|
34
|
-
|
|
32
|
+
onSuccess: (e, t) => {
|
|
33
|
+
let n = g ? { owner: g } : void 0;
|
|
34
|
+
_.invalidateQueries({ predicate: i(c, n) }), _.invalidateQueries({ predicate: i(l, n) });
|
|
35
|
+
let r = { account: t.account };
|
|
36
|
+
_.invalidateQueries({ predicate: i(o, r) }), _.invalidateQueries({ predicate: i(s, r) });
|
|
35
37
|
}
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
//#endregion
|
|
39
|
-
export {
|
|
41
|
+
export { p as useDeposit };
|
|
40
42
|
|
|
41
43
|
//# sourceMappingURL=use-deposit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-deposit.js","names":[],"sources":["../../src/account-layer/use-deposit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n depositForAccountMutationOptions,\n getCollateralAllowanceQueryKey,\n getCollateralBalanceQueryKey,\n type DepositForAccountParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, 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\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useDeposit}.\n */\nexport type UseDepositParameters = WriteParameters;\n\n/** Result returned by the {@link useDeposit} mutation. */\nexport type DepositResult = WriteResult;\n\n/** Return type of {@link useDeposit}. */\nexport type UseDepositReturnType = UseMutationResult<DepositResult, SymmioRequestError, DepositForAccountParameters>;\n\n/**\n * Submit a `depositForAccount` transaction, crediting collateral to a\n * subaccount's available balance. The connected wallet must own the subaccount,\n * and must have approved the collateral to the SYMMIO core first (see\n * `useApproveCollateral`). On success, the connected wallet's collateral\n * allowance and balance queries are invalidated so mounted reads refetch.\n *\n * @example\n * ```tsx\n * const { mutate, status, error } = useDeposit();\n * mutate({ account: \"0xsub…\", amount: 1_000000n });\n * ```\n */\nexport function useDeposit(parameters: UseDepositParameters = {}): UseDepositReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const queryClient = useQueryClient();\n\n const base = depositForAccountMutationOptions(config);\n\n return useMutation<DepositResult, SymmioRequestError, DepositForAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const hash = await base.mutationFn({\n account: variables.account,\n amount: variables.amount,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n const partial = address ? { owner: address } : undefined;\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralAllowanceQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, partial) });\n },\n });\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-deposit.js","names":[],"sources":["../../src/account-layer/use-deposit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n depositForAccountMutationOptions,\n getAccountBalanceInfoQueryKey,\n getAccountBalanceOfQueryKey,\n getCollateralAllowanceQueryKey,\n getCollateralBalanceQueryKey,\n type DepositForAccountParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, 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\";\nimport { resolveWriteResult, type WriteParameters, type WriteResult } from \"../transactions\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useDeposit}.\n */\nexport type UseDepositParameters = WriteParameters;\n\n/** Result returned by the {@link useDeposit} mutation. */\nexport type DepositResult = WriteResult;\n\n/** Return type of {@link useDeposit}. */\nexport type UseDepositReturnType = UseMutationResult<DepositResult, SymmioRequestError, DepositForAccountParameters>;\n\n/**\n * Submit a `depositForAccount` transaction, crediting collateral to a\n * subaccount's available balance. The connected wallet must own the subaccount,\n * and must have approved the collateral to the SYMMIO core first (see\n * `useApproveCollateral`). On success, the connected wallet's collateral\n * allowance and balance queries **and the credited subaccount's available\n * balance** are invalidated, so mounted reads — including the trade form's\n * available instant-open margin (`Max`) — refetch immediately.\n *\n * @example\n * ```tsx\n * const { mutate, status, error } = useDeposit();\n * mutate({ account: \"0xsub…\", amount: 1_000000n });\n * ```\n */\nexport function useDeposit(parameters: UseDepositParameters = {}): UseDepositReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const { address } = useConnection();\n const queryClient = useQueryClient();\n\n const base = depositForAccountMutationOptions(config);\n\n return useMutation<DepositResult, SymmioRequestError, DepositForAccountParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n const hash = await base.mutationFn({\n account: variables.account,\n amount: variables.amount,\n simulateBeforeWrite: variables.simulateBeforeWrite,\n chainId: resolvedChainId,\n });\n return resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: (_result, variables) => {\n const partial = address ? { owner: address } : undefined;\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralAllowanceQueryKey, partial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, partial) });\n // The deposit credits the subaccount's available balance — refetch it so\n // the trade form's available margin / `Max` reflect the new funds. A\n // deposit is not a trade settle, so `live` balance reads don't otherwise\n // refetch on their own.\n const accountPartial = { account: variables.account };\n void queryClient.invalidateQueries({ predicate: predicateMatch(getAccountBalanceInfoQueryKey, accountPartial) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getAccountBalanceOfQueryKey, accountPartial) });\n },\n });\n}\n"],"mappings":";;;;;;;;;;AA6CA,SAAgB,EAAW,IAAmC,CAAC,GAAyB;CACtF,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,EAAE,eAAY,EAAc,GAC5B,IAAc,EAAe,GAE7B,IAAO,EAAiC,CAAM;CAEpD,OAAO,EAA4E;EACjF,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW;IAO7C,OAAO,EAAmB,GAAQ,MANf,EAAK,WAAW;KACjC,SAAS,EAAU;KACnB,QAAQ,EAAU;KAClB,qBAAqB,EAAU;KAC/B,SAAS;IACX,CAAC,GACuC;KACtC,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,YAAY,GAAS,MAAc;GACjC,IAAM,IAAU,IAAU,EAAE,OAAO,EAAQ,IAAI,KAAA;GAE/C,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAgC,CAAO,EAAE,CAAC,GACzG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA8B,CAAO,EAAE,CAAC;GAKvG,IAAM,IAAiB,EAAE,SAAS,EAAU,QAAQ;GAEpD,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA+B,CAAc,EAAE,CAAC,GAC/G,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA6B,CAAc,EAAE,CAAC;EAC/G;CACF,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditAccountNameParameters } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useEditAccountName}.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetPredictedNextVirtualAccountOptions, GetPredictedNextVirtualAccountReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link usePredictedNextVirtualAccount}: the core query options
|
|
6
6
|
* (`subAccount`, `isolationType`, `symbolId`, chain id, TanStack `query`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RemoveMarginParameters, SingleUpnlSig } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
4
|
-
import { WriteParameters, WriteResult } from '../transactions';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { WriteParameters, WriteResult } from '../transactions/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parameters for {@link useRemoveMargin}.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateAddMarginParameters, SimulateAddMarginReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateAddMargin}: an optional `config` override. The
|
|
6
6
|
* dry-run's inputs are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateAllocateParameters, SimulateAllocateReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateAllocate}: an optional `config` override. The
|
|
6
6
|
* dry-run's inputs are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateCreateSubAccountsParameters, SimulateCreateSubAccountsReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateCreateSubAccounts}: an optional `config` override. The dry-run's
|
|
6
6
|
* inputs are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateDeallocateParameters, SimulateDeallocateReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateDeallocate}: an optional `config` override. The
|
|
6
6
|
* dry-run's inputs (including a `upnlSig`) are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateDeleteSubAccountParameters, SimulateDeleteSubAccountReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateDeleteSubAccount}: an optional `config` override. The dry-run's
|
|
6
6
|
* inputs are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateDepositAndAllocateForAccountParameters, SimulateDepositAndAllocateForAccountReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateDepositAndAllocate}: an optional `config` override. The dry-run's
|
|
6
6
|
* inputs are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateDepositForAccountParameters, SimulateDepositForAccountReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for {@link useSimulateDeposit}: an optional `config` override. The dry-run's
|
|
6
6
|
* inputs are passed as the mutation `variables`.
|