@symmio/trading-react 0.1.1 → 0.2.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/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 +1 -1
- package/dist/account-layer/use-account-balance-of.d.ts +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 +2 -2
- 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/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 +40 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -69
- 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 +56 -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/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/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 +125 -122
- 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/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 +7 -5
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, InstantOpenReturnType, PrepareInstantOpenParameters } 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 useInstantOpenAuto}.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetInstantOpenQuoteIdOptions, GetInstantOpenQuoteIdReturnType } 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 useInstantOpenQuoteId}: the core query options
|
|
6
6
|
* (tempQuoteId, optional hedger `baseUrl`, chain id, TanStack `query`
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ConfigParameter, InstantOpenReturnType, PrepareInstantOpenParameters, SetQuoteTpSlParameters, SetQuoteTpSlReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useInstantOpenWithTpSl}: the standard instant-open
|
|
6
|
+
* inputs, plus an optional `tpsl` block that mirrors {@link SetQuoteTpSlParameters}
|
|
7
|
+
* minus `quoteId` (derived from the hedger response) and `chainId` (defaulted).
|
|
8
|
+
*
|
|
9
|
+
* When `tpsl` is omitted (or both `tp` and `sl` are empty), the hook behaves
|
|
10
|
+
* exactly like {@link useInstantOpenAuto}. When present, the SDK dispatches
|
|
11
|
+
* `setQuoteTpSl` immediately after the hedger returns a `tempQuoteId` — the
|
|
12
|
+
* message is signed against the (predicted) VA the caller supplies, so no
|
|
13
|
+
* on-chain reconciliation wait is needed. Confirmation still comes through the
|
|
14
|
+
* TP/SL WebSocket picked up by {@link useQuoteTpSl}.
|
|
15
|
+
*/
|
|
16
|
+
export interface UseInstantOpenWithTpSlVariables extends PrepareInstantOpenParameters {
|
|
17
|
+
tpsl?: Omit<SetQuoteTpSlParameters, "quoteId" | "chainId">;
|
|
18
|
+
}
|
|
19
|
+
/** Aggregated success payload from {@link useInstantOpenWithTpSl}. */
|
|
20
|
+
export interface UseInstantOpenWithTpSlData {
|
|
21
|
+
instantOpen: InstantOpenReturnType;
|
|
22
|
+
/** Set when the TP/SL leg was attempted and succeeded. */
|
|
23
|
+
tpsl?: SetQuoteTpSlReturnType;
|
|
24
|
+
/** Set when the TP/SL leg was attempted and failed — instant open still landed. */
|
|
25
|
+
tpslError?: SymmioRequestError;
|
|
26
|
+
}
|
|
27
|
+
/** Which leg the orchestrator is currently on. */
|
|
28
|
+
export type UseInstantOpenWithTpSlPhase = "idle" | "opening" | "attaching-tpsl" | "success" | "error";
|
|
29
|
+
/** Parameters for {@link useInstantOpenWithTpSl}. */
|
|
30
|
+
export type UseInstantOpenWithTpSlParameters = ConfigParameter;
|
|
31
|
+
/** Return type of {@link useInstantOpenWithTpSl}. */
|
|
32
|
+
export type UseInstantOpenWithTpSlReturnType = UseMutationResult<UseInstantOpenWithTpSlData, SymmioRequestError, UseInstantOpenWithTpSlVariables> & {
|
|
33
|
+
/** Current orchestration phase. Handy for phased status UI. */
|
|
34
|
+
phase: UseInstantOpenWithTpSlPhase;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* One-shot orchestrator: post an instant open and — if the caller pre-filled
|
|
38
|
+
* a TP/SL block — immediately submit `setQuoteTpSl` using the hedger's returned
|
|
39
|
+
* `tempQuoteId`. Web layer just wires inputs; all mutation logic (both legs +
|
|
40
|
+
* cache invalidation + confirming-slot write) lives in the SDK.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const open = useInstantOpenWithTpSl();
|
|
45
|
+
* open.mutate({
|
|
46
|
+
* ...instantOpenParams,
|
|
47
|
+
* tpsl: hasTpOrSl
|
|
48
|
+
* ? { from: sessionKey, virtualAccount: predictedVa, subAccount,
|
|
49
|
+
* symbolId, positionType, quantity, pricePrecision, tp, sl }
|
|
50
|
+
* : undefined,
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function useInstantOpenWithTpSl(parameters?: UseInstantOpenWithTpSlParameters): UseInstantOpenWithTpSlReturnType;
|
|
55
|
+
//# sourceMappingURL=use-instant-open-with-tpsl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-instant-open-with-tpsl.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-instant-open-with-tpsl.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAMzE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,+BAAgC,SAAQ,4BAA4B;IACnF,IAAI,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;CAC5D;AAED,sEAAsE;AACtE,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,qBAAqB,CAAC;IACnC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,mFAAmF;IACnF,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC;AAED,kDAAkD;AAClD,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtG,qDAAqD;AACrD,MAAM,MAAM,gCAAgC,GAAG,eAAe,CAAC;AAE/D,qDAAqD;AACrD,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAC9D,0BAA0B,EAC1B,kBAAkB,EAClB,+BAA+B,CAChC,GAAG;IACF,+DAA+D;IAC/D,KAAK,EAAE,2BAA2B,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,GAAE,gCAAqC,GAChD,gCAAgC,CAiElC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { predicateMatch as r } from "../utils/predicate-match.js";
|
|
6
|
+
import { useTpSlStore as i } from "../tpsl/tpsl-store.js";
|
|
7
|
+
import { getInstantOpensQueryKey as a, instantOpenAutoMutationOptions as o, setQuoteTpSlMutationOptions as s } from "@symmio/trading-core";
|
|
8
|
+
import { useState as c } from "react";
|
|
9
|
+
import { useMutation as l, useQueryClient as u } from "@tanstack/react-query";
|
|
10
|
+
//#region src/instant-layer/use-instant-open-with-tpsl.ts
|
|
11
|
+
function d(d = {}) {
|
|
12
|
+
let f = t(d), p = e(), m = u(), h = o(f), g = s(f), _ = i((e) => e.markConfirming), [v, y] = c("idle"), b = l({
|
|
13
|
+
mutationKey: ["useInstantOpenWithTpSl"],
|
|
14
|
+
mutationFn: async (e) => {
|
|
15
|
+
let t = e.chainId ?? p;
|
|
16
|
+
y("opening");
|
|
17
|
+
let i;
|
|
18
|
+
try {
|
|
19
|
+
i = await h.mutationFn({
|
|
20
|
+
...e,
|
|
21
|
+
chainId: t
|
|
22
|
+
});
|
|
23
|
+
} catch (e) {
|
|
24
|
+
throw y("error"), n(e);
|
|
25
|
+
}
|
|
26
|
+
let o = f.getChainConfigKey(t);
|
|
27
|
+
if (m.invalidateQueries({ predicate: r(a, { configKey: o }) }), !(e.tpsl && (e.tpsl.tp || e.tpsl.sl)) || !i.tempQuoteId) return y("success"), { instantOpen: i };
|
|
28
|
+
let s = Number(i.tempQuoteId);
|
|
29
|
+
if (!Number.isFinite(s)) return y("success"), { instantOpen: i };
|
|
30
|
+
y("attaching-tpsl");
|
|
31
|
+
let c = BigInt(s);
|
|
32
|
+
try {
|
|
33
|
+
let n = await g.mutationFn({
|
|
34
|
+
...e.tpsl,
|
|
35
|
+
chainId: t,
|
|
36
|
+
quoteId: c
|
|
37
|
+
});
|
|
38
|
+
return e.tpsl.tp && _(c, "tp"), e.tpsl.sl && _(c, "sl"), y("success"), {
|
|
39
|
+
instantOpen: i,
|
|
40
|
+
tpsl: n
|
|
41
|
+
};
|
|
42
|
+
} catch (e) {
|
|
43
|
+
return y("success"), {
|
|
44
|
+
instantOpen: i,
|
|
45
|
+
tpslError: n(e)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
onError: () => y("error")
|
|
50
|
+
});
|
|
51
|
+
return Object.assign(b, { phase: v });
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { d as useInstantOpenWithTpSl };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=use-instant-open-with-tpsl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-instant-open-with-tpsl.js","names":[],"sources":["../../src/instant-layer/use-instant-open-with-tpsl.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantOpensQueryKey,\n instantOpenAutoMutationOptions,\n setQuoteTpSlMutationOptions,\n type ConfigParameter,\n type InstantOpenReturnType,\n type PrepareInstantOpenParameters,\n type SetQuoteTpSlParameters,\n type SetQuoteTpSlReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useState } from \"react\";\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 { useTpSlStore } from \"../tpsl/tpsl-store\";\nimport { predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useInstantOpenWithTpSl}: the standard instant-open\n * inputs, plus an optional `tpsl` block that mirrors {@link SetQuoteTpSlParameters}\n * minus `quoteId` (derived from the hedger response) and `chainId` (defaulted).\n *\n * When `tpsl` is omitted (or both `tp` and `sl` are empty), the hook behaves\n * exactly like {@link useInstantOpenAuto}. When present, the SDK dispatches\n * `setQuoteTpSl` immediately after the hedger returns a `tempQuoteId` — the\n * message is signed against the (predicted) VA the caller supplies, so no\n * on-chain reconciliation wait is needed. Confirmation still comes through the\n * TP/SL WebSocket picked up by {@link useQuoteTpSl}.\n */\nexport interface UseInstantOpenWithTpSlVariables extends PrepareInstantOpenParameters {\n tpsl?: Omit<SetQuoteTpSlParameters, \"quoteId\" | \"chainId\">;\n}\n\n/** Aggregated success payload from {@link useInstantOpenWithTpSl}. */\nexport interface UseInstantOpenWithTpSlData {\n instantOpen: InstantOpenReturnType;\n /** Set when the TP/SL leg was attempted and succeeded. */\n tpsl?: SetQuoteTpSlReturnType;\n /** Set when the TP/SL leg was attempted and failed — instant open still landed. */\n tpslError?: SymmioRequestError;\n}\n\n/** Which leg the orchestrator is currently on. */\nexport type UseInstantOpenWithTpSlPhase = \"idle\" | \"opening\" | \"attaching-tpsl\" | \"success\" | \"error\";\n\n/** Parameters for {@link useInstantOpenWithTpSl}. */\nexport type UseInstantOpenWithTpSlParameters = ConfigParameter;\n\n/** Return type of {@link useInstantOpenWithTpSl}. */\nexport type UseInstantOpenWithTpSlReturnType = UseMutationResult<\n UseInstantOpenWithTpSlData,\n SymmioRequestError,\n UseInstantOpenWithTpSlVariables\n> & {\n /** Current orchestration phase. Handy for phased status UI. */\n phase: UseInstantOpenWithTpSlPhase;\n};\n\n/**\n * One-shot orchestrator: post an instant open and — if the caller pre-filled\n * a TP/SL block — immediately submit `setQuoteTpSl` using the hedger's returned\n * `tempQuoteId`. Web layer just wires inputs; all mutation logic (both legs +\n * cache invalidation + confirming-slot write) lives in the SDK.\n *\n * @example\n * ```tsx\n * const open = useInstantOpenWithTpSl();\n * open.mutate({\n * ...instantOpenParams,\n * tpsl: hasTpOrSl\n * ? { from: sessionKey, virtualAccount: predictedVa, subAccount,\n * symbolId, positionType, quantity, pricePrecision, tp, sl }\n * : undefined,\n * });\n * ```\n */\nexport function useInstantOpenWithTpSl(\n parameters: UseInstantOpenWithTpSlParameters = {},\n): UseInstantOpenWithTpSlReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const openBase = instantOpenAutoMutationOptions(config);\n const tpslBase = setQuoteTpSlMutationOptions(config);\n const markConfirming = useTpSlStore((state) => state.markConfirming);\n\n const [phase, setPhase] = useState<UseInstantOpenWithTpSlPhase>(\"idle\");\n\n const mutation = useMutation<UseInstantOpenWithTpSlData, SymmioRequestError, UseInstantOpenWithTpSlVariables>({\n mutationKey: [\"useInstantOpenWithTpSl\"] as const,\n mutationFn: async (variables) => {\n const resolvedChainId = variables.chainId ?? chainId;\n setPhase(\"opening\");\n let openResult: InstantOpenReturnType;\n try {\n openResult = await openBase.mutationFn({ ...variables, chainId: resolvedChainId });\n } catch (err) {\n setPhase(\"error\");\n throw normalizeSymmError(err);\n }\n\n // Refresh the instant-opens feed the moment the hedger accepts.\n const configKey = config.getChainConfigKey(resolvedChainId);\n void queryClient.invalidateQueries({ predicate: predicateMatch(getInstantOpensQueryKey, { configKey }) });\n\n const wantsTpSl = Boolean(variables.tpsl && (variables.tpsl.tp || variables.tpsl.sl));\n if (!wantsTpSl || !openResult.tempQuoteId) {\n setPhase(\"success\");\n return { instantOpen: openResult };\n }\n\n const tempIdNumber = Number(openResult.tempQuoteId);\n if (!Number.isFinite(tempIdNumber)) {\n setPhase(\"success\");\n return { instantOpen: openResult };\n }\n\n setPhase(\"attaching-tpsl\");\n const quoteId = BigInt(tempIdNumber);\n try {\n const tpslResult = await tpslBase.mutationFn({\n ...(variables.tpsl as Omit<SetQuoteTpSlParameters, \"quoteId\" | \"chainId\">),\n chainId: resolvedChainId,\n quoteId,\n });\n // Mirror useSetQuoteTpSl.onSuccess: mark confirming for the sides we\n // submitted so useQuoteTpSl overlays \"Processing…\" until the WS report.\n if (variables.tpsl!.tp) markConfirming(quoteId, \"tp\");\n if (variables.tpsl!.sl) markConfirming(quoteId, \"sl\");\n setPhase(\"success\");\n return { instantOpen: openResult, tpsl: tpslResult };\n } catch (err) {\n // Instant open landed; only the TP/SL leg failed. Surface it on the\n // return payload rather than throwing, so callers can render a partial\n // success state without losing the trade.\n setPhase(\"success\");\n return { instantOpen: openResult, tpslError: normalizeSymmError(err) };\n }\n },\n onError: () => setPhase(\"error\"),\n }) as UseMutationResult<UseInstantOpenWithTpSlData, SymmioRequestError, UseInstantOpenWithTpSlVariables>;\n\n return Object.assign(mutation, { phase });\n}\n"],"mappings":";;;;;;;;;;AAgFA,SAAgB,EACd,IAA+C,CAAC,GACd;CAClC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAW,EAA+B,CAAM,GAChD,IAAW,EAA4B,CAAM,GAC7C,IAAiB,GAAc,MAAU,EAAM,cAAc,GAE7D,CAAC,GAAO,KAAY,EAAsC,MAAM,GAEhE,IAAW,EAA6F;EAC5G,aAAa,CAAC,wBAAwB;EACtC,YAAY,OAAO,MAAc;GAC/B,IAAM,IAAkB,EAAU,WAAW;GAC7C,EAAS,SAAS;GAClB,IAAI;GACJ,IAAI;IACF,IAAa,MAAM,EAAS,WAAW;KAAE,GAAG;KAAW,SAAS;IAAgB,CAAC;GACnF,SAAS,GAAK;IAEZ,MADA,EAAS,OAAO,GACV,EAAmB,CAAG;GAC9B;GAGA,IAAM,IAAY,EAAO,kBAAkB,CAAe;GAI1D,IAHA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAyB,EAAE,aAAU,CAAC,EAAE,CAAC,GAGpG,EADsB,EAAU,SAAS,EAAU,KAAK,MAAM,EAAU,KAAK,QAC/D,CAAC,EAAW,aAE5B,OADA,EAAS,SAAS,GACX,EAAE,aAAa,EAAW;GAGnC,IAAM,IAAe,OAAO,EAAW,WAAW;GAClD,IAAI,CAAC,OAAO,SAAS,CAAY,GAE/B,OADA,EAAS,SAAS,GACX,EAAE,aAAa,EAAW;GAGnC,EAAS,gBAAgB;GACzB,IAAM,IAAU,OAAO,CAAY;GACnC,IAAI;IACF,IAAM,IAAa,MAAM,EAAS,WAAW;KAC3C,GAAI,EAAU;KACd,SAAS;KACT;IACF,CAAC;IAMD,OAHI,EAAU,KAAM,MAAI,EAAe,GAAS,IAAI,GAChD,EAAU,KAAM,MAAI,EAAe,GAAS,IAAI,GACpD,EAAS,SAAS,GACX;KAAE,aAAa;KAAY,MAAM;IAAW;GACrD,SAAS,GAAK;IAKZ,OADA,EAAS,SAAS,GACX;KAAE,aAAa;KAAY,WAAW,EAAmB,CAAG;IAAE;GACvE;EACF;EACA,eAAe,EAAS,OAAO;CACjC,CAAC;CAED,OAAO,OAAO,OAAO,GAAU,EAAE,SAAM,CAAC;AAC1C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, InstantOpenParameters, InstantOpenReturnType } 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 useInstantOpen}.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetInstantOpensOptions, GetInstantOpensReturnType } 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 useInstantOpens}: the core query options (partyA,
|
|
6
6
|
* optional hedger `baseUrl`, chain id, TanStack `query` overrides incl.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetIsDelegationActiveOptions, GetIsDelegationActiveReturnType } 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 useIsDelegationActive}: the core query options
|
|
6
6
|
* (account, delegate, selector, chain id, TanStack `query` overrides) plus an
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SimulateGrantDelegationParameters, SimulateGrantDelegationReturnType } 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 useSimulateGrantDelegation}: an optional `config` override. The dry-run's
|
|
6
6
|
* inputs are passed as the mutation `variables`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './use-locked-params';
|
|
1
|
+
export * from './use-locked-params.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetLockedParamsOptions, GetLockedParamsReturnType } 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 useLockedParams}: the core query options (symbol,
|
|
6
6
|
* leverage, chain id, TanStack `query` overrides) plus an optional `config`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/market-info/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConfigParameter, GetMarketInfoOptions, GetMarketInfoReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link useMarketInfo}: the core query options plus an optional
|
|
6
|
+
* `config`.
|
|
7
|
+
*/
|
|
8
|
+
export type UseMarketInfoParameters = GetMarketInfoOptions & ConfigParameter;
|
|
9
|
+
/** Return type of {@link useMarketInfo}. */
|
|
10
|
+
export type UseMarketInfoReturnType = UseQueryResult<GetMarketInfoReturnType, SymmioRequestError>;
|
|
11
|
+
/**
|
|
12
|
+
* Read per-market 24h volume from the active chain's solver in one call.
|
|
13
|
+
* Surfaces the rolling 24-hour trading volume and cumulative lifetime value for
|
|
14
|
+
* every market, plus the aggregate totals across all markets.
|
|
15
|
+
*
|
|
16
|
+
* Does not poll by default; pass `query.refetchInterval` to opt into polling.
|
|
17
|
+
* Errors are normalized to {@link SymmioRequestError} so `error.kind` is always
|
|
18
|
+
* a documented value.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { data } = useMarketInfo();
|
|
23
|
+
* const btc = data?.markets.find((m) => m.symbol === "BTCUSDT");
|
|
24
|
+
* console.log(btc?.tradingVolume, data?.totalValue24h);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useMarketInfo(parameters?: UseMarketInfoParameters): UseMarketInfoReturnType;
|
|
28
|
+
//# sourceMappingURL=use-market-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-market-info.d.ts","sourceRoot":"","sources":["../../src/market-info/use-market-info.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;;;;;;;;;;;;;;;GAeG;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 { getMarketInfoQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/market-info/use-market-info.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 useMarketInfo };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=use-market-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-market-info.js","names":[],"sources":["../../src/market-info/use-market-info.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getMarketInfoQueryOptions,\n type ConfigParameter,\n type GetMarketInfoOptions,\n type GetMarketInfoReturnType,\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 useMarketInfo}: the core query options plus an optional\n * `config`.\n */\nexport type UseMarketInfoParameters = GetMarketInfoOptions & ConfigParameter;\n\n/** Return type of {@link useMarketInfo}. */\nexport type UseMarketInfoReturnType = UseQueryResult<GetMarketInfoReturnType, SymmioRequestError>;\n\n/**\n * Read per-market 24h volume from the active chain's solver in one call.\n * Surfaces the rolling 24-hour trading volume and cumulative lifetime value for\n * every market, plus the aggregate totals across all markets.\n *\n * Does not poll by default; pass `query.refetchInterval` to opt into polling.\n * Errors are normalized to {@link SymmioRequestError} so `error.kind` is always\n * a documented value.\n *\n * @example\n * ```tsx\n * const { data } = useMarketInfo();\n * const btc = data?.markets.find((m) => m.symbol === \"BTCUSDT\");\n * console.log(btc?.tradingVolume, data?.totalValue24h);\n * ```\n */\nexport function useMarketInfo(parameters: UseMarketInfoParameters = {}): UseMarketInfoReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getMarketInfoQueryOptions(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 UseMarketInfoReturnType;\n}\n"],"mappings":";;;;;;;AAuCA,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"}
|
package/dist/markets/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './use-markets';
|
|
2
|
-
export * from './use-onchain-contract-markets';
|
|
1
|
+
export * from './use-markets.js';
|
|
2
|
+
export * from './use-onchain-contract-markets.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMarketsOptions, SymbolContractSymbol } 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 useMarkets}: the core query options (chain id, TanStack
|
|
6
6
|
* `query` overrides) plus an optional `config`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetOnchainContractMarketsOptions, GetOnchainContractMarketsReturnType } 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 useOnchainContractMarkets}: the core query options
|
|
6
6
|
* (start, size, chain id, TanStack `query` overrides) plus an optional `config`.
|
package/dist/muon/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from './use-deallocate-upnl-sig';
|
|
2
|
-
export * from './use-muon-party-a-overview';
|
|
3
|
-
export * from './use-muon-price';
|
|
4
|
-
export * from './use-muon-price-range';
|
|
5
|
-
export * from './use-muon-settle-upnl';
|
|
6
|
-
export * from './use-muon-upnl';
|
|
7
|
-
export * from './use-muon-upnl-a';
|
|
8
|
-
export * from './use-muon-upnl-a-with-symbol-price';
|
|
9
|
-
export * from './use-muon-upnl-b';
|
|
10
|
-
export * from './use-muon-upnl-with-symbol-price';
|
|
1
|
+
export * from './use-deallocate-upnl-sig.js';
|
|
2
|
+
export * from './use-muon-party-a-overview.js';
|
|
3
|
+
export * from './use-muon-price.js';
|
|
4
|
+
export * from './use-muon-price-range.js';
|
|
5
|
+
export * from './use-muon-settle-upnl.js';
|
|
6
|
+
export * from './use-muon-upnl.js';
|
|
7
|
+
export * from './use-muon-upnl-a.js';
|
|
8
|
+
export * from './use-muon-upnl-a-with-symbol-price.js';
|
|
9
|
+
export * from './use-muon-upnl-b.js';
|
|
10
|
+
export * from './use-muon-upnl-with-symbol-price.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetDeallocateUpnlSigParameters, GetDeallocateUpnlSigReturnType } 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 useDeallocateUpnlSig}: an optional `config` override. The
|
|
6
6
|
* virtual account is passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonPartyAOverviewParameters, GetMuonPartyAOverviewReturnType } 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 useMuonPartyAOverview}: an optional `config` override. The
|
|
6
6
|
* partyA is passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonPriceRangeParameters, GetMuonPriceRangeReturnType } 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 useMuonPriceRange}: an optional `config` override. The
|
|
6
6
|
* window, parties, and symbol id are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonPriceParameters, GetMuonPriceReturnType } 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 useMuonPrice}: an optional `config` override. The quote
|
|
6
6
|
* ids are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonSettleUpnlParameters, GetMuonSettleUpnlReturnType } 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 useMuonSettleUpnl}: an optional `config` override. The
|
|
6
6
|
* partyA and quote ids are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonUpnlAWithSymbolPriceParameters, GetMuonUpnlAWithSymbolPriceReturnType } 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 useMuonUpnlAWithSymbolPrice}: an optional `config` override.
|
|
6
6
|
* The partyA and symbolId are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonUpnlAParameters, GetMuonUpnlAReturnType } 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 useMuonUpnlA}: an optional `config` override. The partyA
|
|
6
6
|
* is passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonUpnlBParameters, GetMuonUpnlBReturnType } 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 useMuonUpnlB}: an optional `config` override. The partyB
|
|
6
6
|
* and partyA are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonUpnlWithSymbolPriceParameters, GetMuonUpnlWithSymbolPriceReturnType } 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 useMuonUpnlWithSymbolPrice}: an optional `config` override.
|
|
6
6
|
* The partyB, partyA, and symbolId are passed as the mutation `variables`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetMuonUpnlParameters, GetMuonUpnlReturnType } 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 useMuonUpnl}: an optional `config` override. The partyB
|
|
6
6
|
* and partyA are passed as the mutation `variables`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useSearchNotifications, type UseSearchNotificationsParameters, type UseSearchNotificationsReturnType, } from './use-search-notifications';
|
|
1
|
+
export { useSearchNotifications, type UseSearchNotificationsParameters, type UseSearchNotificationsReturnType, } from './use-search-notifications.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, SearchNotificationsOptions, SearchNotificationsReturnType } 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 useSearchNotifications}: the core search options
|
|
6
6
|
* (`filter`, `size`, `start`, chain id, TanStack `query` overrides) plus an
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './use-notional-cap-all';
|
|
2
|
-
export * from './use-notional-cap-by-symbol-id';
|
|
3
|
-
export * from './use-open-interest-by-symbol-id';
|
|
1
|
+
export * from './use-notional-cap-all.js';
|
|
2
|
+
export * from './use-notional-cap-by-symbol-id.js';
|
|
3
|
+
export * from './use-open-interest-by-symbol-id.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetNotionalCapAllOptions, GetNotionalCapAllReturnType } 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 useNotionalCapAll}: the core query options plus an
|
|
6
6
|
* optional `config` and a `pollingInterval` knob layered on top of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetNotionalCapBySymbolIdOptions, GetNotionalCapBySymbolIdReturnType } 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
|
/** Default polling cadence — 15 s, matching how often the solver re-publishes caps. */
|
|
5
5
|
export declare const DEFAULT_NOTIONAL_CAP_POLLING_MS = 15000;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetOpenInterestBySymbolIdOptions, GetOpenInterestBySymbolIdReturnType } 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 useOpenInterestBySymbolId}: the core query options plus
|
|
6
6
|
* an optional `config` and a `pollingInterval` knob layered on top of
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './use-enigma-price-by-market-id';
|
|
2
|
-
export * from './use-enigma-price-by-name';
|
|
3
|
-
export * from './use-enigma-price-service-health';
|
|
4
|
-
export * from './use-enigma-price-service-metadata';
|
|
5
|
-
export * from './use-enigma-price-service-prices-by-addresses';
|
|
6
|
-
export * from './use-enigma-price-service-prices-by-names';
|
|
7
|
-
export * from './use-enigma-price-service-symbols-info';
|
|
8
|
-
export * from './use-enigma-prices';
|
|
1
|
+
export * from './use-enigma-price-by-market-id.js';
|
|
2
|
+
export * from './use-enigma-price-by-name.js';
|
|
3
|
+
export * from './use-enigma-price-service-health.js';
|
|
4
|
+
export * from './use-enigma-price-service-metadata.js';
|
|
5
|
+
export * from './use-enigma-price-service-prices-by-addresses.js';
|
|
6
|
+
export * from './use-enigma-price-service-prices-by-names.js';
|
|
7
|
+
export * from './use-enigma-price-service-symbols-info.js';
|
|
8
|
+
export * from './use-enigma-prices.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useEnigmaPriceByName as e } from "./use-enigma-price-by-name.js";
|
|
2
|
+
import { useEnigmaPriceByMarketId as t } from "./use-enigma-price-by-market-id.js";
|
|
3
|
+
import { useEnigmaPriceServiceHealth as n } from "./use-enigma-price-service-health.js";
|
|
4
|
+
import { useEnigmaPriceServiceMetadata as r } from "./use-enigma-price-service-metadata.js";
|
|
5
|
+
import { useEnigmaPriceServicePricesByAddresses as i } from "./use-enigma-price-service-prices-by-addresses.js";
|
|
6
|
+
import { useEnigmaPriceServicePricesByNames as a } from "./use-enigma-price-service-prices-by-names.js";
|
|
7
|
+
import { useEnigmaPriceServiceSymbolsInfo as o } from "./use-enigma-price-service-symbols-info.js";
|
|
8
|
+
import { useEnigmaPrices as s } from "./use-enigma-prices.js";
|
|
9
|
+
export { t as useEnigmaPriceByMarketId, e as useEnigmaPriceByName, n as useEnigmaPriceServiceHealth, r as useEnigmaPriceServiceMetadata, i as useEnigmaPriceServicePricesByAddresses, a as useEnigmaPriceServicePricesByNames, o as useEnigmaPriceServiceSymbolsInfo, s as useEnigmaPrices };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigParameter, SocketStatus } from '@symmio/trading-core';
|
|
2
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
2
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parameters for {@link useEnigmaPriceByMarketId}.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigParameter, SocketStatus } from '@symmio/trading-core';
|
|
2
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
2
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parameters for {@link useEnigmaPriceByName}.
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetEnigmaPriceServiceHealthOptions, GetEnigmaPriceServiceHealthReturnType } 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 useEnigmaPriceServiceHealth}: chain id, TanStack
|
|
6
6
|
* `query` overrides, plus an optional `config`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetEnigmaPriceServiceMetadataOptions, GetEnigmaPriceServiceMetadataReturnType } 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 useEnigmaPriceServiceMetadata}: symbol address array,
|
|
6
6
|
* chain id, TanStack `query` overrides, plus an optional `config`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetEnigmaPriceServicePricesByAddressesOptions, GetEnigmaPriceServicePricesByAddressesReturnType } 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 useEnigmaPriceServicePricesByAddresses}: symbol addresses,
|
|
6
6
|
* chain id, TanStack `query` overrides, plus an optional `config`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetEnigmaPriceServicePricesByNamesOptions, GetEnigmaPriceServicePricesByNamesReturnType } 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 useEnigmaPriceServicePricesByNames}: market names, chain
|
|
6
6
|
* id, TanStack `query` overrides, plus an optional `config`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigParameter, GetEnigmaPriceServiceSymbolsInfoOptions, GetEnigmaPriceServiceSymbolsInfoReturnType } 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 useEnigmaPriceServiceSymbolsInfo}: chain id, TanStack
|
|
6
6
|
* `query` overrides, plus an optional `config`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigParameter, EnigmaPriceTick, SocketStatus } from '@symmio/trading-core';
|
|
2
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
2
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parameters for {@link useEnigmaPrices}.
|
|
5
5
|
*/
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SymmioProvider, type SymmioProviderProps } from './symmio-provider';
|
|
2
|
-
export { useSymmioChainId } from './use-symmio-chain-id';
|
|
3
|
-
export { useSymmioConfig, type UseSymmioConfigParameters } from './use-symmio-config';
|
|
1
|
+
export { SymmioProvider, type SymmioProviderProps } from './symmio-provider.js';
|
|
2
|
+
export { useSymmioChainId } from './use-symmio-chain-id.js';
|
|
3
|
+
export { useSymmioConfig, type UseSymmioConfigParameters } from './use-symmio-config.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|