@agg-build/hooks 1.0.0 → 1.0.1
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 +1 -1
- package/dist/{chunk-CDPQERUC.mjs → chunk-BWXNOWAS.mjs} +99 -36
- package/dist/chunk-PALQVBAQ.mjs +31 -0
- package/dist/chunk-QXBQRWFF.mjs +389 -0
- package/dist/deposit.d.mts +2 -1
- package/dist/deposit.d.ts +2 -1
- package/dist/deposit.js +57 -2
- package/dist/deposit.mjs +5 -3
- package/dist/index.d.mts +71 -193
- package/dist/index.d.ts +71 -193
- package/dist/index.js +663 -167
- package/dist/index.mjs +78 -37
- package/dist/{use-sync-balances-D1Jdkck9.d.mts → use-deposit-addresses-B9ICS-3U.d.mts} +1 -11
- package/dist/{use-sync-balances-D1Jdkck9.d.ts → use-deposit-addresses-B9ICS-3U.d.ts} +1 -11
- package/dist/use-sync-balances-B1_8tBKw.d.mts +14 -0
- package/dist/use-sync-balances-B1_8tBKw.d.ts +14 -0
- package/dist/withdraw.d.mts +293 -0
- package/dist/withdraw.d.ts +293 -0
- package/dist/withdraw.js +1402 -0
- package/dist/withdraw.mjs +16 -0
- package/package.json +15 -2
package/dist/deposit.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { U as UseDepositAddressesOptions,
|
|
1
|
+
export { U as UseDepositAddressesOptions, u as useDepositAddresses } from './use-deposit-addresses-B9ICS-3U.mjs';
|
|
2
|
+
export { U as UseSyncBalancesOptions, u as useSyncBalances } from './use-sync-balances-B1_8tBKw.mjs';
|
|
2
3
|
import '@tanstack/react-query';
|
|
3
4
|
import '@agg-build/sdk';
|
|
4
5
|
|
package/dist/deposit.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { U as UseDepositAddressesOptions,
|
|
1
|
+
export { U as UseDepositAddressesOptions, u as useDepositAddresses } from './use-deposit-addresses-B9ICS-3U.js';
|
|
2
|
+
export { U as UseSyncBalancesOptions, u as useSyncBalances } from './use-sync-balances-B1_8tBKw.js';
|
|
2
3
|
import '@tanstack/react-query';
|
|
3
4
|
import '@agg-build/sdk';
|
|
4
5
|
|
package/dist/deposit.js
CHANGED
|
@@ -226,6 +226,8 @@ var enUsLabels = {
|
|
|
226
226
|
successDescription: "Your USDC has been successfully added to your balance.",
|
|
227
227
|
pendingTitle: (provider) => `Complete your payment on ${provider}`,
|
|
228
228
|
pendingDescription: "Once your transaction is finished, your balance may take a few minutes to update. The deposit will appear in your activity once it's successful.",
|
|
229
|
+
pendingWalletAddressHelp: "Some providers may ask for a wallet address during checkout, use this one to receive your deposit:",
|
|
230
|
+
pendingCopyAddress: "Copy deposit address",
|
|
229
231
|
viewActivity: "View Activity",
|
|
230
232
|
chooseAnotherProvider: "Choose another provider",
|
|
231
233
|
summary: {
|
|
@@ -262,9 +264,55 @@ var enUsLabels = {
|
|
|
262
264
|
done: "Done",
|
|
263
265
|
balancePrefix: "Balance:",
|
|
264
266
|
methods: {
|
|
267
|
+
walletTitle: "Withdraw to wallet",
|
|
268
|
+
walletDescription: "Withdraw funds instantly to your crypto wallet",
|
|
265
269
|
cardTitle: "Withdraw with card",
|
|
266
270
|
cardDescription: "Withdraw funds to your card"
|
|
267
271
|
},
|
|
272
|
+
walletFlow: {
|
|
273
|
+
title: "Withdraw to wallet",
|
|
274
|
+
recipientAddressLabel: "Recipient address",
|
|
275
|
+
amountLabel: "Amount",
|
|
276
|
+
max: "Max",
|
|
277
|
+
tokenLabel: "Receive token",
|
|
278
|
+
networkLabel: "Receive network",
|
|
279
|
+
confirm: "Confirm withdrawal",
|
|
280
|
+
successTitle: "Withdrawal submitted",
|
|
281
|
+
successDescription: (tokenSymbol) => `Your ${tokenSymbol} withdrawal is being processed and will arrive shortly.`,
|
|
282
|
+
// Terminal-state copy. The success step swaps `successTitle` /
|
|
283
|
+
// `successDescription` for these once the lifecycle has reached a
|
|
284
|
+
// terminal status — otherwise a finished withdrawal would keep showing
|
|
285
|
+
// "submitted / processing" forever and force the user to hard-refresh.
|
|
286
|
+
successTitleCompleted: "Withdrawal complete",
|
|
287
|
+
successDescriptionCompleted: (tokenSymbol) => `Your ${tokenSymbol} withdrawal has been delivered.`,
|
|
288
|
+
successTitlePartial: "Withdrawal partially completed",
|
|
289
|
+
successDescriptionPartial: (tokenSymbol) => `Some legs of your ${tokenSymbol} withdrawal completed; see details below.`,
|
|
290
|
+
successTitleFailed: "Withdrawal failed",
|
|
291
|
+
successDescriptionFailed: (tokenSymbol) => `Your ${tokenSymbol} withdrawal could not be completed.`,
|
|
292
|
+
summary: {
|
|
293
|
+
// The response is `pricingStatus: "unquoted"` — we don't know net
|
|
294
|
+
// output until on-chain settlement. Calling this "Amount received"
|
|
295
|
+
// would imply receipt before the lifecycle has confirmed. Keep it
|
|
296
|
+
// honest as the submitted amount until the multi-stable quote
|
|
297
|
+
// layer (PR-E) populates `expected.outputRaw`.
|
|
298
|
+
amountReceived: "Amount",
|
|
299
|
+
network: "Network",
|
|
300
|
+
toWallet: "To wallet",
|
|
301
|
+
fees: "Fees"
|
|
302
|
+
},
|
|
303
|
+
lifecycle: {
|
|
304
|
+
pending: "Submitted \u2014 preparing your withdrawal\u2026",
|
|
305
|
+
bridging: "Bridging funds across chains\u2026",
|
|
306
|
+
transferring: "Transferring to your wallet\u2026",
|
|
307
|
+
completed: "Withdrawal complete.",
|
|
308
|
+
partial: "Withdrawal partially completed \u2014 see details below.",
|
|
309
|
+
failed: "Withdrawal failed.",
|
|
310
|
+
steps: {
|
|
311
|
+
bridge: (sourceChainName, destChainName) => `Bridging from ${sourceChainName} to ${destChainName}`,
|
|
312
|
+
transfer: (destChainName) => `Transferring on ${destChainName}`
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
268
316
|
cardFlow: {
|
|
269
317
|
title: "Sell crypto",
|
|
270
318
|
amountLabel: "Amount",
|
|
@@ -288,7 +336,10 @@ var enUsLabels = {
|
|
|
288
336
|
}
|
|
289
337
|
},
|
|
290
338
|
summary: {
|
|
291
|
-
|
|
339
|
+
// Lifecycle-honest: until quoting is live (PR-E) the response is
|
|
340
|
+
// `pricingStatus: "unquoted"` so this is the submitted amount, not
|
|
341
|
+
// a guaranteed net output.
|
|
342
|
+
amountReceived: "Amount",
|
|
292
343
|
network: "Network"
|
|
293
344
|
}
|
|
294
345
|
},
|
|
@@ -305,12 +356,16 @@ var enUsLabels = {
|
|
|
305
356
|
userProfile: {
|
|
306
357
|
activity: {
|
|
307
358
|
depositType: "Deposit",
|
|
308
|
-
withdrawalType: "
|
|
359
|
+
withdrawalType: "Withdrawal",
|
|
309
360
|
depositTitles: {
|
|
310
361
|
connectedWallet: "Deposit from connected wallet",
|
|
311
362
|
externalWallet: "Deposit from external wallet",
|
|
312
363
|
card: "Deposit with card"
|
|
313
364
|
},
|
|
365
|
+
// Activity-row title for any withdrawal regardless of lifecycle
|
|
366
|
+
// state (pending / completed / failed) — render the asset rather
|
|
367
|
+
// than implying success. The ActivityRow renders a separate status
|
|
368
|
+
// chip when the row is failed.
|
|
314
369
|
withdrawalTitle: (tokenSymbol) => `Withdraw ${tokenSymbol}`
|
|
315
370
|
},
|
|
316
371
|
positions: {
|
package/dist/deposit.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRampQuotes,
|
|
3
|
+
useRampSession
|
|
4
|
+
} from "./chunk-PALQVBAQ.mjs";
|
|
1
5
|
import {
|
|
2
6
|
__async,
|
|
3
7
|
getWalletAddressFromUserProfile,
|
|
@@ -5,10 +9,8 @@ import {
|
|
|
5
9
|
useAggBalanceState,
|
|
6
10
|
useAggUiConfig,
|
|
7
11
|
useDepositAddresses,
|
|
8
|
-
useRampQuotes,
|
|
9
|
-
useRampSession,
|
|
10
12
|
useSyncBalances
|
|
11
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BWXNOWAS.mjs";
|
|
12
14
|
|
|
13
15
|
// src/deposit/normalize-wallet-error.ts
|
|
14
16
|
function normalizeWalletError(error, supportedChains) {
|
package/dist/index.d.mts
CHANGED
|
@@ -2,10 +2,12 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
2
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
3
3
|
export { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import * as _agg_build_sdk from '@agg-build/sdk';
|
|
5
|
-
import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest,
|
|
5
|
+
import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, QuoteManagedResponse, QuoteManagedParams, ExecuteManagedResponse, ExecuteManagedParams, GetPositionsParams, WsOrderSubmitted, WsBalanceUpdate, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, UserActivityQuery, UserActivityItem, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, SmartRouteResponse, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
6
6
|
export { TurnstileChallengeError } from '@agg-build/sdk';
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
|
-
export {
|
|
8
|
+
export { UseManagedBalancesOptions, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawalLifecycleResult, WithdrawalLifecycleState, useManagedBalances, useWithdrawFlow, useWithdrawManaged, useWithdrawalLifecycle } from './withdraw.mjs';
|
|
9
|
+
export { U as UseDepositAddressesOptions, g as getDepositAddress, u as useDepositAddresses } from './use-deposit-addresses-B9ICS-3U.mjs';
|
|
10
|
+
export { U as UseSyncBalancesOptions, u as useSyncBalances } from './use-sync-balances-B1_8tBKw.mjs';
|
|
9
11
|
|
|
10
12
|
/** Use these constants instead of hardcoding "kalshi" or "polymarket". */
|
|
11
13
|
declare enum Venue {
|
|
@@ -454,6 +456,8 @@ interface AggUiLabels {
|
|
|
454
456
|
successDescription: string;
|
|
455
457
|
pendingTitle: (provider: string) => string;
|
|
456
458
|
pendingDescription: string;
|
|
459
|
+
pendingWalletAddressHelp: string;
|
|
460
|
+
pendingCopyAddress: string;
|
|
457
461
|
viewActivity: string;
|
|
458
462
|
chooseAnotherProvider: string;
|
|
459
463
|
summary: {
|
|
@@ -490,9 +494,56 @@ interface AggUiLabels {
|
|
|
490
494
|
done: string;
|
|
491
495
|
balancePrefix: string;
|
|
492
496
|
methods: {
|
|
497
|
+
walletTitle: string;
|
|
498
|
+
walletDescription: string;
|
|
493
499
|
cardTitle: string;
|
|
494
500
|
cardDescription: string;
|
|
495
501
|
};
|
|
502
|
+
walletFlow: {
|
|
503
|
+
title: string;
|
|
504
|
+
recipientAddressLabel: string;
|
|
505
|
+
amountLabel: string;
|
|
506
|
+
max: string;
|
|
507
|
+
tokenLabel: string;
|
|
508
|
+
networkLabel: string;
|
|
509
|
+
confirm: string;
|
|
510
|
+
successTitle: string;
|
|
511
|
+
successDescription: (tokenSymbol: string) => string;
|
|
512
|
+
successTitleCompleted: string;
|
|
513
|
+
successDescriptionCompleted: (tokenSymbol: string) => string;
|
|
514
|
+
successTitlePartial: string;
|
|
515
|
+
successDescriptionPartial: (tokenSymbol: string) => string;
|
|
516
|
+
successTitleFailed: string;
|
|
517
|
+
successDescriptionFailed: (tokenSymbol: string) => string;
|
|
518
|
+
summary: {
|
|
519
|
+
amountReceived: string;
|
|
520
|
+
network: string;
|
|
521
|
+
toWallet: string;
|
|
522
|
+
fees: string;
|
|
523
|
+
};
|
|
524
|
+
/**
|
|
525
|
+
* Lifecycle copy used in the success step once the user has submitted
|
|
526
|
+
* the withdrawal — driven by `withdrawal_lifecycle` WS events. Each
|
|
527
|
+
* key matches a `WsWithdrawalLifecycleStatus` value.
|
|
528
|
+
*/
|
|
529
|
+
lifecycle: {
|
|
530
|
+
pending: string;
|
|
531
|
+
bridging: string;
|
|
532
|
+
transferring: string;
|
|
533
|
+
completed: string;
|
|
534
|
+
partial: string;
|
|
535
|
+
failed: string;
|
|
536
|
+
/**
|
|
537
|
+
* Per-leg step labels rendered in the success step's execution
|
|
538
|
+
* timeline. `bridge` covers cross-chain hops, `transfer` covers
|
|
539
|
+
* same-chain disbursement to the user's wallet.
|
|
540
|
+
*/
|
|
541
|
+
steps: {
|
|
542
|
+
bridge: (sourceChainName: string, destChainName: string) => string;
|
|
543
|
+
transfer: (destChainName: string) => string;
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
};
|
|
496
547
|
cardFlow: {
|
|
497
548
|
title: string;
|
|
498
549
|
amountLabel: string;
|
|
@@ -1305,10 +1356,6 @@ declare function useRampQuotes(): _tanstack_react_query.UseMutationResult<RampQu
|
|
|
1305
1356
|
|
|
1306
1357
|
declare function useRampSession(): _tanstack_react_query.UseMutationResult<RampWidgetSession, Error, RampSessionRequest, unknown>;
|
|
1307
1358
|
|
|
1308
|
-
declare function useAggWebSocket(): AggWebSocket | null;
|
|
1309
|
-
declare function useOnOrderSubmitted(callback: ((msg: WsOrderSubmitted) => void) | null): void;
|
|
1310
|
-
declare function useOnBalanceUpdate(callback: ((msg: WsBalanceUpdate) => void) | null): void;
|
|
1311
|
-
|
|
1312
1359
|
declare const executionKeys: {
|
|
1313
1360
|
all: () => readonly ["execution"];
|
|
1314
1361
|
balances: () => readonly ["execution", "balances"];
|
|
@@ -1340,192 +1387,6 @@ interface UseExecuteManagedOptions {
|
|
|
1340
1387
|
*/
|
|
1341
1388
|
declare function useExecuteManaged(options?: UseExecuteManagedOptions): _tanstack_react_query.UseMutationResult<ExecuteManagedResponse, Error, ExecuteManagedParams, unknown>;
|
|
1342
1389
|
|
|
1343
|
-
interface UseWithdrawManagedOptions {
|
|
1344
|
-
onSuccess?: (data: WithdrawManagedResponse) => void;
|
|
1345
|
-
onError?: (error: Error) => void;
|
|
1346
|
-
}
|
|
1347
|
-
/**
|
|
1348
|
-
* Mutation hook for withdrawing funds from managed wallets.
|
|
1349
|
-
* On success, invalidates balances queries.
|
|
1350
|
-
*/
|
|
1351
|
-
declare function useWithdrawManaged(options?: UseWithdrawManagedOptions): _tanstack_react_query.UseMutationResult<WithdrawManagedResponse, Error, WithdrawManagedParams, unknown>;
|
|
1352
|
-
|
|
1353
|
-
interface UseManagedBalancesOptions {
|
|
1354
|
-
enabled?: boolean;
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* Query hook for fetching unified managed wallet balances across all chains.
|
|
1358
|
-
*/
|
|
1359
|
-
declare function useManagedBalances(options?: UseManagedBalancesOptions): {
|
|
1360
|
-
balances: _agg_build_sdk.UnifiedBalanceResponse | undefined;
|
|
1361
|
-
data: _agg_build_sdk.UnifiedBalanceResponse;
|
|
1362
|
-
error: Error;
|
|
1363
|
-
isError: true;
|
|
1364
|
-
isPending: false;
|
|
1365
|
-
isLoading: false;
|
|
1366
|
-
isLoadingError: false;
|
|
1367
|
-
isRefetchError: true;
|
|
1368
|
-
isSuccess: false;
|
|
1369
|
-
isPlaceholderData: false;
|
|
1370
|
-
status: "error";
|
|
1371
|
-
dataUpdatedAt: number;
|
|
1372
|
-
errorUpdatedAt: number;
|
|
1373
|
-
failureCount: number;
|
|
1374
|
-
failureReason: Error | null;
|
|
1375
|
-
errorUpdateCount: number;
|
|
1376
|
-
isFetched: boolean;
|
|
1377
|
-
isFetchedAfterMount: boolean;
|
|
1378
|
-
isFetching: boolean;
|
|
1379
|
-
isInitialLoading: boolean;
|
|
1380
|
-
isPaused: boolean;
|
|
1381
|
-
isRefetching: boolean;
|
|
1382
|
-
isStale: boolean;
|
|
1383
|
-
isEnabled: boolean;
|
|
1384
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_agg_build_sdk.UnifiedBalanceResponse, Error>>;
|
|
1385
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1386
|
-
promise: Promise<_agg_build_sdk.UnifiedBalanceResponse>;
|
|
1387
|
-
} | {
|
|
1388
|
-
balances: _agg_build_sdk.UnifiedBalanceResponse | undefined;
|
|
1389
|
-
data: _agg_build_sdk.UnifiedBalanceResponse;
|
|
1390
|
-
error: null;
|
|
1391
|
-
isError: false;
|
|
1392
|
-
isPending: false;
|
|
1393
|
-
isLoading: false;
|
|
1394
|
-
isLoadingError: false;
|
|
1395
|
-
isRefetchError: false;
|
|
1396
|
-
isSuccess: true;
|
|
1397
|
-
isPlaceholderData: false;
|
|
1398
|
-
status: "success";
|
|
1399
|
-
dataUpdatedAt: number;
|
|
1400
|
-
errorUpdatedAt: number;
|
|
1401
|
-
failureCount: number;
|
|
1402
|
-
failureReason: Error | null;
|
|
1403
|
-
errorUpdateCount: number;
|
|
1404
|
-
isFetched: boolean;
|
|
1405
|
-
isFetchedAfterMount: boolean;
|
|
1406
|
-
isFetching: boolean;
|
|
1407
|
-
isInitialLoading: boolean;
|
|
1408
|
-
isPaused: boolean;
|
|
1409
|
-
isRefetching: boolean;
|
|
1410
|
-
isStale: boolean;
|
|
1411
|
-
isEnabled: boolean;
|
|
1412
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_agg_build_sdk.UnifiedBalanceResponse, Error>>;
|
|
1413
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1414
|
-
promise: Promise<_agg_build_sdk.UnifiedBalanceResponse>;
|
|
1415
|
-
} | {
|
|
1416
|
-
balances: _agg_build_sdk.UnifiedBalanceResponse | undefined;
|
|
1417
|
-
data: undefined;
|
|
1418
|
-
error: Error;
|
|
1419
|
-
isError: true;
|
|
1420
|
-
isPending: false;
|
|
1421
|
-
isLoading: false;
|
|
1422
|
-
isLoadingError: true;
|
|
1423
|
-
isRefetchError: false;
|
|
1424
|
-
isSuccess: false;
|
|
1425
|
-
isPlaceholderData: false;
|
|
1426
|
-
status: "error";
|
|
1427
|
-
dataUpdatedAt: number;
|
|
1428
|
-
errorUpdatedAt: number;
|
|
1429
|
-
failureCount: number;
|
|
1430
|
-
failureReason: Error | null;
|
|
1431
|
-
errorUpdateCount: number;
|
|
1432
|
-
isFetched: boolean;
|
|
1433
|
-
isFetchedAfterMount: boolean;
|
|
1434
|
-
isFetching: boolean;
|
|
1435
|
-
isInitialLoading: boolean;
|
|
1436
|
-
isPaused: boolean;
|
|
1437
|
-
isRefetching: boolean;
|
|
1438
|
-
isStale: boolean;
|
|
1439
|
-
isEnabled: boolean;
|
|
1440
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_agg_build_sdk.UnifiedBalanceResponse, Error>>;
|
|
1441
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1442
|
-
promise: Promise<_agg_build_sdk.UnifiedBalanceResponse>;
|
|
1443
|
-
} | {
|
|
1444
|
-
balances: _agg_build_sdk.UnifiedBalanceResponse | undefined;
|
|
1445
|
-
data: undefined;
|
|
1446
|
-
error: null;
|
|
1447
|
-
isError: false;
|
|
1448
|
-
isPending: true;
|
|
1449
|
-
isLoading: true;
|
|
1450
|
-
isLoadingError: false;
|
|
1451
|
-
isRefetchError: false;
|
|
1452
|
-
isSuccess: false;
|
|
1453
|
-
isPlaceholderData: false;
|
|
1454
|
-
status: "pending";
|
|
1455
|
-
dataUpdatedAt: number;
|
|
1456
|
-
errorUpdatedAt: number;
|
|
1457
|
-
failureCount: number;
|
|
1458
|
-
failureReason: Error | null;
|
|
1459
|
-
errorUpdateCount: number;
|
|
1460
|
-
isFetched: boolean;
|
|
1461
|
-
isFetchedAfterMount: boolean;
|
|
1462
|
-
isFetching: boolean;
|
|
1463
|
-
isInitialLoading: boolean;
|
|
1464
|
-
isPaused: boolean;
|
|
1465
|
-
isRefetching: boolean;
|
|
1466
|
-
isStale: boolean;
|
|
1467
|
-
isEnabled: boolean;
|
|
1468
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_agg_build_sdk.UnifiedBalanceResponse, Error>>;
|
|
1469
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1470
|
-
promise: Promise<_agg_build_sdk.UnifiedBalanceResponse>;
|
|
1471
|
-
} | {
|
|
1472
|
-
balances: _agg_build_sdk.UnifiedBalanceResponse | undefined;
|
|
1473
|
-
data: undefined;
|
|
1474
|
-
error: null;
|
|
1475
|
-
isError: false;
|
|
1476
|
-
isPending: true;
|
|
1477
|
-
isLoadingError: false;
|
|
1478
|
-
isRefetchError: false;
|
|
1479
|
-
isSuccess: false;
|
|
1480
|
-
isPlaceholderData: false;
|
|
1481
|
-
status: "pending";
|
|
1482
|
-
dataUpdatedAt: number;
|
|
1483
|
-
errorUpdatedAt: number;
|
|
1484
|
-
failureCount: number;
|
|
1485
|
-
failureReason: Error | null;
|
|
1486
|
-
errorUpdateCount: number;
|
|
1487
|
-
isFetched: boolean;
|
|
1488
|
-
isFetchedAfterMount: boolean;
|
|
1489
|
-
isFetching: boolean;
|
|
1490
|
-
isLoading: boolean;
|
|
1491
|
-
isInitialLoading: boolean;
|
|
1492
|
-
isPaused: boolean;
|
|
1493
|
-
isRefetching: boolean;
|
|
1494
|
-
isStale: boolean;
|
|
1495
|
-
isEnabled: boolean;
|
|
1496
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_agg_build_sdk.UnifiedBalanceResponse, Error>>;
|
|
1497
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1498
|
-
promise: Promise<_agg_build_sdk.UnifiedBalanceResponse>;
|
|
1499
|
-
} | {
|
|
1500
|
-
balances: _agg_build_sdk.UnifiedBalanceResponse | undefined;
|
|
1501
|
-
data: _agg_build_sdk.UnifiedBalanceResponse;
|
|
1502
|
-
isError: false;
|
|
1503
|
-
error: null;
|
|
1504
|
-
isPending: false;
|
|
1505
|
-
isLoading: false;
|
|
1506
|
-
isLoadingError: false;
|
|
1507
|
-
isRefetchError: false;
|
|
1508
|
-
isSuccess: true;
|
|
1509
|
-
isPlaceholderData: true;
|
|
1510
|
-
status: "success";
|
|
1511
|
-
dataUpdatedAt: number;
|
|
1512
|
-
errorUpdatedAt: number;
|
|
1513
|
-
failureCount: number;
|
|
1514
|
-
failureReason: Error | null;
|
|
1515
|
-
errorUpdateCount: number;
|
|
1516
|
-
isFetched: boolean;
|
|
1517
|
-
isFetchedAfterMount: boolean;
|
|
1518
|
-
isFetching: boolean;
|
|
1519
|
-
isInitialLoading: boolean;
|
|
1520
|
-
isPaused: boolean;
|
|
1521
|
-
isRefetching: boolean;
|
|
1522
|
-
isStale: boolean;
|
|
1523
|
-
isEnabled: boolean;
|
|
1524
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_agg_build_sdk.UnifiedBalanceResponse, Error>>;
|
|
1525
|
-
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1526
|
-
promise: Promise<_agg_build_sdk.UnifiedBalanceResponse>;
|
|
1527
|
-
};
|
|
1528
|
-
|
|
1529
1390
|
interface UsePositionsOptions extends GetPositionsParams {
|
|
1530
1391
|
enabled?: boolean;
|
|
1531
1392
|
}
|
|
@@ -1764,6 +1625,11 @@ declare const useOnRedeemEvent: (listener: ((event: RedeemEvent) => void) | null
|
|
|
1764
1625
|
|
|
1765
1626
|
declare const useRedeemEligibleCount: () => number;
|
|
1766
1627
|
|
|
1628
|
+
declare function useAggWebSocket(): AggWebSocket | null;
|
|
1629
|
+
declare function useOnOrderSubmitted(callback: ((msg: WsOrderSubmitted) => void) | null): void;
|
|
1630
|
+
declare function useOnBalanceUpdate(callback: ((msg: WsBalanceUpdate) => void) | null): void;
|
|
1631
|
+
declare function useOnWithdrawalLifecycle(callback: ((msg: WsWithdrawalLifecycleEvent) => void) | null): void;
|
|
1632
|
+
|
|
1767
1633
|
interface MarketChartCandle {
|
|
1768
1634
|
time: number;
|
|
1769
1635
|
open: number;
|
|
@@ -2894,6 +2760,13 @@ declare function useLiveTrades(canonicalMarketId: string | null): WsTrade[];
|
|
|
2894
2760
|
interface UseMidpointsResult {
|
|
2895
2761
|
/** Map of outcomeId → price. Empty while loading. */
|
|
2896
2762
|
prices: Map<string, number>;
|
|
2763
|
+
/**
|
|
2764
|
+
* Map of outcomeId → venue name that provided the price in `prices`.
|
|
2765
|
+
* When a matched venue offers a lower YES price, this records that venue so
|
|
2766
|
+
* callers can show the correct venue logo alongside the best price.
|
|
2767
|
+
* Empty while loading or when the API response omits `venue` fields.
|
|
2768
|
+
*/
|
|
2769
|
+
venueByOutcomeId: Map<string, string>;
|
|
2897
2770
|
/** True while the midpoints fetch is in flight. */
|
|
2898
2771
|
isLoading: boolean;
|
|
2899
2772
|
}
|
|
@@ -4598,6 +4471,11 @@ declare function computePriceGaps(input: ComputePriceGapsInput): Map<string, num
|
|
|
4598
4471
|
*/
|
|
4599
4472
|
declare function useViewportMidpoints(visibleMarkets: VenueMarket[]): {
|
|
4600
4473
|
prices: Map<string, number>;
|
|
4474
|
+
/**
|
|
4475
|
+
* Map of outcomeId → venue name that provided the price in `prices`.
|
|
4476
|
+
* Populated when a matched venue offers a lower YES price than the primary.
|
|
4477
|
+
*/
|
|
4478
|
+
venueByOutcomeId: Map<string, string>;
|
|
4601
4479
|
};
|
|
4602
4480
|
|
|
4603
4481
|
interface UseVisibleIdsOptions {
|
|
@@ -4637,4 +4515,4 @@ interface UseAppConfigResult {
|
|
|
4637
4515
|
*/
|
|
4638
4516
|
declare function useAppConfig(): UseAppConfigResult;
|
|
4639
4517
|
|
|
4640
|
-
export { AUTH_CHOOSER_OPEN_EVENT, type AggAuthContextValue, type AggAuthSignInOptions, type AggBalanceContextValue, AggBalanceProvider, AggProvider, type AggProviderProps, AggProvider as AggSdkProvider, type AggProviderProps as AggSdkProviderProps, type AggUiConfig, type AggUiConfigInput, type AggUiLabels, type AggUiLabelsInput, AggUiProvider, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsInput, DEFAULT_AGG_ROOT_CLASS_NAME, type DagStepProgress, type EventListStateContextValue, EventListStateProvider, type EventListStateSnapshot, type EventTradingContextValue, type EventTradingState, type ExecutionProgressPhase, type ExecutionTerminalOrderEvent, type GeoBlockState, type GetOrdersQuery, type GetPositionsQuery, type LiveCandle, type MarketChartCandle, type MarketChartData, type MarketChartVenueData, type MarketOrderbookData, type MarketOrderbookIntegrity, MarketStatus, type MarketTradingState, MatchStatus, MatchType, type OrderEligibility, type OrderEligibilityReason, type OrderListItem, type OrderbookResult, type PositionGroup, type PriceGapMarket, type RedeemEvent, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type ThemeMode, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseCategoriesOptions, type UseEnrichedVenueEventOptions, type UseExecuteManagedOptions, type UseExecutionOrdersOptions, type UseExecutionPositionsOptions, type UseExecutionProgressOptions, type UseExecutionProgressResult, type UseExternalIdOptions, type UseExternalIdReturn, type UseLinkAccountReturn, type UseLiveCandleOverlayOptions, type UseLiveCandleOverlayResult, type UseLiveCandlesOptions, type UseLiveCandlesResult, type UseLiveMarketResult, type
|
|
4518
|
+
export { AUTH_CHOOSER_OPEN_EVENT, type AggAuthContextValue, type AggAuthSignInOptions, type AggBalanceContextValue, AggBalanceProvider, AggProvider, type AggProviderProps, AggProvider as AggSdkProvider, type AggProviderProps as AggSdkProviderProps, type AggUiConfig, type AggUiConfigInput, type AggUiLabels, type AggUiLabelsInput, AggUiProvider, CHART_TIME_RANGES, CONFIRMED_MATCH_STATUSES, type ChartTimeRange, type ClosedPositionTotals, type ComputePriceGapsInput, DEFAULT_AGG_ROOT_CLASS_NAME, type DagStepProgress, type EventListStateContextValue, EventListStateProvider, type EventListStateSnapshot, type EventTradingContextValue, type EventTradingState, type ExecutionProgressPhase, type ExecutionTerminalOrderEvent, type GeoBlockState, type GetOrdersQuery, type GetPositionsQuery, type LiveCandle, type MarketChartCandle, type MarketChartData, type MarketChartVenueData, type MarketOrderbookData, type MarketOrderbookIntegrity, MarketStatus, type MarketTradingState, MatchStatus, MatchType, type OrderEligibility, type OrderEligibilityReason, type OrderListItem, type OrderbookResult, type PositionGroup, type PriceGapMarket, type RedeemEvent, type ScaledCandlePoint, type SdkUiConfig, type SdkUiConfigInput, type SdkUiProviderProps, type ThemeMode, type TradingAction, type TradingState, type TradingStateBase, type TradingStateKind, type UseAggAuthOptions, type UseAggAuthReturn, type UseAppConfigResult, type UseCategoriesOptions, type UseEnrichedVenueEventOptions, type UseExecuteManagedOptions, type UseExecutionOrdersOptions, type UseExecutionPositionsOptions, type UseExecutionProgressOptions, type UseExecutionProgressResult, type UseExternalIdOptions, type UseExternalIdReturn, type UseLinkAccountReturn, type UseLiveCandleOverlayOptions, type UseLiveCandleOverlayResult, type UseLiveCandlesOptions, type UseLiveCandlesResult, type UseLiveMarketResult, type UseMarketChartOptions, type UseMarketChartResult, type UseMarketOrderbookOptions, type UseMarketOrderbookResult, type UseMarketOrderbookVenueOutcome, type UseOrderBookOptions, type UseOrderbookQuoteOptions, type UseOrderbookQuoteResult, type UseOrdersOptions, type UsePositionsOptions, type UseQuoteManagedOptions, type UseSearchOptions, type UseSmartRouteOptions, type UseSmartRouteResult, type UseUserActivityOptions, type UseUserHoldingsOptions, type UseVenueEventOptions, type UseVenueEventsOptions, type UseVenueMarketMidpointsOptions, type UseVenueMarketsOptions, type UseVisibleIdsOptions, type UseVisibleIdsResult, Venue, type VenueEvent, type VenueEventWithMarkets, type VenueMarket, type VenueMarketOutcome, type WalletActionSendTokenParams, type WalletActions, computeClosedPositionTotals, computePriceGaps, defaultAggUiConfig, defaultAggUiConfig as defaultSdkUiConfig, executionKeys, findLivePriceById, getBuilder, getOrCreateBuilder, getWalletAddressFromUserProfile, invalidateBalanceQueries, invalidatePositionQueries, optimizedImageUrl, parseEmail, parseEmailStrict, requestAggAuthChooserOpen, resolveAggUiLabels, resolveDefaultMarket as resolveDefaultTradingMarket, resolveEventTradingState, resolveMarketTradingState, resolveMarketWinningOutcome, resolveOrderEligibility, resolveTradingStateKind, sortVenues, timeRangeToInterval, tradingReducer, useAggAuth, useAggAuthContext, useAggAuthState, useAggBalance, useAggBalanceContext, useAggBalanceState, useAggClient, useAggLabels, useAggUiConfig, useAggWebSocket, useAppConfig, useCategories, useDebouncedValue, useEnrichedVenueEvent, useEventListState, useEventOrderbookData, useEventTradingContext, useExecuteManaged, useExecutionOrders, useExecutionPositions, useExecutionProgress, useExternalId, useGeoBlock, useLabels, useLinkAccount, useLiveCandleOverlay, useLiveCandles, useLiveMarket, useLiveMarketStores, useLiveOutcomePrices, useLiveTrades, useMarketChart, useMarketOrderbook, useMidpoints, useOnBalanceUpdate, useOnOrderSubmitted, useOnRedeemEvent, useOnWithdrawalLifecycle, useOrderBook, useOrderbookQuote, useOrders, usePositions, useQuoteManaged, useRampQuotes, useRampSession, useRedeem, useRedeemEligibleCount, useSdkLabels, useSdkUiConfig, useSearch, useSmartRoute, useUserActivity, useUserHoldings, useVenueEvent, useVenueEvents, useVenueMarketMidpoints, useVenueMarkets, useViewportMidpoints, useVisibleIds };
|