@agg-build/hooks 4.4.0 → 4.5.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/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ 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, ExecuteManagedResponse, ExecuteManagedParams, PlaceLimitOrderResponse, PlaceLimitOrderParams, CancelManagedExecutionResponse, GetPositionsParams, ExecutionStatusStep, WsOrderSubmitted, WsBalanceUpdate, ExecutionStatusOrder, CreateBalanceRefillPolicyParams, UpdateBalanceRefillPolicyParams, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, Venue as Venue$1, VenueKeyStatus, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurringCryptoDuration, RecurringCryptoVenueMarket, RecurringCryptoWindowMarket, RecurrenceFilter, SportsLiveResponse, SportsLiveState, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
5
|
+
import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, ExecuteManagedResponse, ExecuteManagedParams, PlaceLimitOrderResponse, PlaceLimitOrderParams, CancelManagedExecutionResponse, GetPositionsParams, ExecutionStatusStep, WsOrderSubmitted, WsBalanceUpdate, ExecutionStatusOrder, CreateBalanceRefillPolicyParams, UpdateBalanceRefillPolicyParams, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, Venue as Venue$1, VenueKeyStatus, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountWalletConfirmBody, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurringCryptoDuration, RecurringCryptoVenueMarket, RecurringCryptoWindowMarket, RecurrenceFilter, SportsLiveResponse, SportsLiveState, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
6
6
|
export { SportsGameStatus, SportsLiveParticipant, SportsLiveResponse, SportsLiveState, TurnstileChallengeError } from '@agg-build/sdk';
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
8
|
export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawPreviewParams, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawPreview, useWithdrawalLifecycle } from './withdraw.mjs';
|
|
@@ -2869,16 +2869,20 @@ declare function useAggAuth(options?: UseAggAuthOptions): UseAggAuthReturn;
|
|
|
2869
2869
|
|
|
2870
2870
|
interface UseLinkAccountReturn {
|
|
2871
2871
|
startLink: (body: AggLinkAccountBody) => Promise<AggLinkAccountResult>;
|
|
2872
|
-
confirmLink: (
|
|
2872
|
+
confirmLink: (input: string | AggLinkAccountWalletConfirmBody) => Promise<AggLinkAccountConfirmResult>;
|
|
2873
2873
|
isLoading: boolean;
|
|
2874
2874
|
error: Error | null;
|
|
2875
2875
|
}
|
|
2876
2876
|
/**
|
|
2877
|
-
* Hook for initiating and completing an account-link flow (OAuth / email).
|
|
2877
|
+
* Hook for initiating and completing an account-link flow (OAuth / email / wallet).
|
|
2878
2878
|
*
|
|
2879
|
-
* After
|
|
2880
|
-
* app's `redirectUrl` with a `link_confirm_token` query param. Read that
|
|
2881
|
-
* the redirect target route and pass it to `confirmLink`.
|
|
2879
|
+
* After an OAuth/email `startLink` call, the provider callback redirects the browser
|
|
2880
|
+
* back to the app's `redirectUrl` with a `link_confirm_token` query param. Read that
|
|
2881
|
+
* param on the redirect target route and pass it to `confirmLink`.
|
|
2882
|
+
*
|
|
2883
|
+
* Wallet providers (`siwe`/`siws`) instead return `{ type: "wallet_challenge", message }`
|
|
2884
|
+
* from `startLink`; sign that `message` verbatim and pass
|
|
2885
|
+
* `{ kind: "wallet_signature", message, signature }` to `confirmLink`.
|
|
2882
2886
|
*/
|
|
2883
2887
|
declare function useLinkAccount(): UseLinkAccountReturn;
|
|
2884
2888
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ 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, ExecuteManagedResponse, ExecuteManagedParams, PlaceLimitOrderResponse, PlaceLimitOrderParams, CancelManagedExecutionResponse, GetPositionsParams, ExecutionStatusStep, WsOrderSubmitted, WsBalanceUpdate, ExecutionStatusOrder, CreateBalanceRefillPolicyParams, UpdateBalanceRefillPolicyParams, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, Venue as Venue$1, VenueKeyStatus, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurringCryptoDuration, RecurringCryptoVenueMarket, RecurringCryptoWindowMarket, RecurrenceFilter, SportsLiveResponse, SportsLiveState, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
5
|
+
import { CandleBuilder, AggAuthStartBody, AggAuthStartResult, AggClientSessionInput, AggClient, RampQuote, RampQuoteRequest, RampWidgetSession, RampSessionRequest, ExecuteManagedResponse, ExecuteManagedParams, PlaceLimitOrderResponse, PlaceLimitOrderParams, CancelManagedExecutionResponse, GetPositionsParams, ExecutionStatusStep, WsOrderSubmitted, WsBalanceUpdate, ExecutionStatusOrder, CreateBalanceRefillPolicyParams, UpdateBalanceRefillPolicyParams, RedeemResponse, RedeemRequest, WsRedeemEvent, AggWebSocket, WsOrderEvent, WsWithdrawalLifecycleEvent, WsCandleInterval, WsTrade, AggregatedOrderbookResponse, Venue as Venue$1, VenueKeyStatus, AggLinkAccountBody, AggLinkAccountResult, AggLinkAccountWalletConfirmBody, AggLinkAccountConfirmResult, Category, UserActivityQuery, UserActivityItem, PaginatedResponse, CandleInterval, OrderbookState, OrderbookQuoteResponse, OrderListQuery, TradeExecutorOrder, SmartRouteSide, ExecutionMode, SmartRouteResponse, RecurringCryptoDuration, RecurringCryptoVenueMarket, RecurringCryptoWindowMarket, RecurrenceFilter, SportsLiveResponse, SportsLiveState, MidpointRow, BatchMidpointsResponse, AppClientConfigResponse } from '@agg-build/sdk';
|
|
6
6
|
export { SportsGameStatus, SportsLiveParticipant, SportsLiveResponse, SportsLiveState, TurnstileChallengeError } from '@agg-build/sdk';
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
8
|
export { UseManagedBalancesOptions, UseWithdrawEstimateParams, UseWithdrawFlowOptions, UseWithdrawFlowResult, UseWithdrawManagedOptions, UseWithdrawPreviewParams, UseWithdrawalLifecycleResult, WithdrawFeeEstimate, WithdrawalLifecycleState, useManagedBalances, useWithdrawEstimate, useWithdrawFlow, useWithdrawManaged, useWithdrawPreview, useWithdrawalLifecycle } from './withdraw.js';
|
|
@@ -2869,16 +2869,20 @@ declare function useAggAuth(options?: UseAggAuthOptions): UseAggAuthReturn;
|
|
|
2869
2869
|
|
|
2870
2870
|
interface UseLinkAccountReturn {
|
|
2871
2871
|
startLink: (body: AggLinkAccountBody) => Promise<AggLinkAccountResult>;
|
|
2872
|
-
confirmLink: (
|
|
2872
|
+
confirmLink: (input: string | AggLinkAccountWalletConfirmBody) => Promise<AggLinkAccountConfirmResult>;
|
|
2873
2873
|
isLoading: boolean;
|
|
2874
2874
|
error: Error | null;
|
|
2875
2875
|
}
|
|
2876
2876
|
/**
|
|
2877
|
-
* Hook for initiating and completing an account-link flow (OAuth / email).
|
|
2877
|
+
* Hook for initiating and completing an account-link flow (OAuth / email / wallet).
|
|
2878
2878
|
*
|
|
2879
|
-
* After
|
|
2880
|
-
* app's `redirectUrl` with a `link_confirm_token` query param. Read that
|
|
2881
|
-
* the redirect target route and pass it to `confirmLink`.
|
|
2879
|
+
* After an OAuth/email `startLink` call, the provider callback redirects the browser
|
|
2880
|
+
* back to the app's `redirectUrl` with a `link_confirm_token` query param. Read that
|
|
2881
|
+
* param on the redirect target route and pass it to `confirmLink`.
|
|
2882
|
+
*
|
|
2883
|
+
* Wallet providers (`siwe`/`siws`) instead return `{ type: "wallet_challenge", message }`
|
|
2884
|
+
* from `startLink`; sign that `message` verbatim and pass
|
|
2885
|
+
* `{ kind: "wallet_signature", message, signature }` to `confirmLink`.
|
|
2882
2886
|
*/
|
|
2883
2887
|
declare function useLinkAccount(): UseLinkAccountReturn;
|
|
2884
2888
|
|
package/dist/index.js
CHANGED
|
@@ -6048,7 +6048,7 @@ function useLinkAccount() {
|
|
|
6048
6048
|
[client]
|
|
6049
6049
|
);
|
|
6050
6050
|
const confirmLink = (0, import_react18.useCallback)(
|
|
6051
|
-
(
|
|
6051
|
+
(input) => run(() => client.linkAccountConfirm(input)),
|
|
6052
6052
|
[client]
|
|
6053
6053
|
);
|
|
6054
6054
|
return { startLink, confirmLink, isLoading, error };
|
package/dist/index.mjs
CHANGED
|
@@ -220,7 +220,7 @@ function useLinkAccount() {
|
|
|
220
220
|
[client]
|
|
221
221
|
);
|
|
222
222
|
const confirmLink = useCallback2(
|
|
223
|
-
(
|
|
223
|
+
(input) => run(() => client.linkAccountConfirm(input)),
|
|
224
224
|
[client]
|
|
225
225
|
);
|
|
226
226
|
return { startLink, confirmLink, isLoading, error };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/hooks",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react": "^18.0.0 || ^19.0.0",
|
|
84
84
|
"viem": "^2.0.0",
|
|
85
85
|
"wagmi": "^3.0.0 || ^2.0.0",
|
|
86
|
-
"@agg-build/sdk": "^4.
|
|
86
|
+
"@agg-build/sdk": "^4.5.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@solana/wallet-adapter-react": {
|