@pear-protocol/symmio-client 0.3.17 → 0.3.18
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 +479 -14
- package/dist/index.d.ts +479 -14
- package/dist/index.js +345 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +341 -37
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +146 -11
- package/dist/react/index.d.ts +146 -11
- package/dist/react/index.js +467 -36
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +465 -38
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.mts
CHANGED
|
@@ -8437,20 +8437,155 @@ declare function useSymmDepositAndAllocateMutation(params?: UseSymmDepositParams
|
|
|
8437
8437
|
}, unknown>;
|
|
8438
8438
|
|
|
8439
8439
|
/**
|
|
8440
|
-
*
|
|
8440
|
+
* One destination of a (possibly split) withdraw request.
|
|
8441
|
+
*
|
|
8442
|
+
* `chainId` is `int256` on-chain — non-EVM destinations may use negative IDs.
|
|
8443
|
+
* `receiver` is raw bytes; for EVM destinations pass the 20-byte address as
|
|
8444
|
+
* hex (e.g. via `viem.toHex(address)` or `padHex(address, { size: 20 })`).
|
|
8445
|
+
*
|
|
8446
|
+
* Provider semantics:
|
|
8447
|
+
* - both zero → Classic: standard cooldown, same chain
|
|
8448
|
+
* - only `expressProvider` → Pure Express: instant same chain
|
|
8449
|
+
* - only `virtualProvider` → Pure Virtual: standard cooldown, cross-chain
|
|
8450
|
+
* - both set (different) → Virtual Express: instant cross-chain
|
|
8451
|
+
*
|
|
8452
|
+
* A single provider address must NOT be set as both express and virtual.
|
|
8453
|
+
*/
|
|
8454
|
+
type WithdrawReceiverPart = {
|
|
8455
|
+
id: bigint;
|
|
8456
|
+
amount: bigint;
|
|
8457
|
+
chainId: bigint;
|
|
8458
|
+
receiver: Hex;
|
|
8459
|
+
virtualProvider: Address;
|
|
8460
|
+
expressProvider: Address;
|
|
8461
|
+
};
|
|
8462
|
+
type InitiateWithdrawParams = {
|
|
8463
|
+
parts: WithdrawReceiverPart[];
|
|
8464
|
+
/**
|
|
8465
|
+
* Whitelisted-user shortened-cooldown flag. Independent from the express
|
|
8466
|
+
* (instant) path — callers who are not on the speed-up whitelist should
|
|
8467
|
+
* leave this `false`.
|
|
8468
|
+
*/
|
|
8469
|
+
speedUp: boolean;
|
|
8470
|
+
/** Opaque payload forwarded to provider callbacks. Use `0x` if unused. */
|
|
8471
|
+
providerData: Hex;
|
|
8472
|
+
};
|
|
8473
|
+
type FinalizeWithdrawParams = {
|
|
8474
|
+
/** The user (sub-account) whose request is being finalized. */
|
|
8475
|
+
user: Address;
|
|
8476
|
+
requestId: bigint;
|
|
8477
|
+
};
|
|
8478
|
+
type RequestCancelWithdrawParams = {
|
|
8479
|
+
requestId: bigint;
|
|
8480
|
+
};
|
|
8481
|
+
/**
|
|
8482
|
+
* Lifecycle states for the orchestrated `useSymmInstantWithdraw` hook.
|
|
8483
|
+
* The FE just renders on `status`.
|
|
8441
8484
|
*/
|
|
8442
|
-
declare
|
|
8485
|
+
declare enum InstantWithdrawStatus {
|
|
8486
|
+
IDLE = "idle",
|
|
8487
|
+
/** Initiate tx submitted, waiting for it to mine. */
|
|
8488
|
+
INITIATING = "initiating",
|
|
8489
|
+
/** Initiate mined, waiting for the express provider to accept. */
|
|
8490
|
+
AWAITING_PROVIDER = "awaitingProvider",
|
|
8491
|
+
/** Provider accepted, waiting for `cooldownEndTime`. */
|
|
8492
|
+
AWAITING_COOLDOWN = "awaitingCooldown",
|
|
8493
|
+
/** Finalize tx submitted, waiting for it to mine. */
|
|
8494
|
+
FINALIZING = "finalizing",
|
|
8495
|
+
COMPLETED = "completed",
|
|
8496
|
+
FAILED = "failed"
|
|
8497
|
+
}
|
|
8498
|
+
type InstantWithdrawTxHashes = {
|
|
8499
|
+
initiate?: Hex;
|
|
8500
|
+
finalize?: Hex;
|
|
8501
|
+
};
|
|
8502
|
+
|
|
8503
|
+
type UseSymmWithdrawParams = {
|
|
8443
8504
|
publicClient?: PublicClient;
|
|
8444
8505
|
walletClient?: WalletClient;
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8506
|
+
subAccount?: Address;
|
|
8507
|
+
};
|
|
8508
|
+
type InitiateVars = InitiateWithdrawParams & {
|
|
8509
|
+
subAccount?: Address;
|
|
8510
|
+
};
|
|
8511
|
+
type FinalizeVars = FinalizeWithdrawParams & {
|
|
8512
|
+
subAccount?: Address;
|
|
8513
|
+
};
|
|
8514
|
+
type CancelVars = RequestCancelWithdrawParams & {
|
|
8515
|
+
subAccount?: Address;
|
|
8516
|
+
};
|
|
8517
|
+
/**
|
|
8518
|
+
* v0.8.5 withdraw — kicks off a request. Funds are debited immediately and
|
|
8519
|
+
* a cooldown begins; call `useSymmFinalizeWithdraw` once the cooldown ends.
|
|
8520
|
+
*/
|
|
8521
|
+
declare function useSymmInitiateWithdraw(params?: UseSymmWithdrawParams, options?: {
|
|
8522
|
+
mutation?: SymmMutationConfig<Hex, Error, InitiateVars>;
|
|
8523
|
+
}): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, InitiateVars, unknown>;
|
|
8524
|
+
/**
|
|
8525
|
+
* v0.8.5 withdraw — finalizes a request once its cooldown has elapsed.
|
|
8526
|
+
* Anyone can call this; the typical caller is the request's owner.
|
|
8527
|
+
*/
|
|
8528
|
+
declare function useSymmFinalizeWithdraw(params?: UseSymmWithdrawParams, options?: {
|
|
8529
|
+
mutation?: SymmMutationConfig<Hex, Error, FinalizeVars>;
|
|
8530
|
+
}): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, FinalizeVars, unknown>;
|
|
8531
|
+
/**
|
|
8532
|
+
* v0.8.5 withdraw — requests cancellation. Resolves immediately for classic
|
|
8533
|
+
* / pure-virtual outside the blackout window; otherwise transitions to
|
|
8534
|
+
* `CANCEL_REQUESTED` and awaits provider approval.
|
|
8535
|
+
*/
|
|
8536
|
+
declare function useSymmRequestCancelWithdraw(params?: UseSymmWithdrawParams, options?: {
|
|
8537
|
+
mutation?: SymmMutationConfig<Hex, Error, CancelVars>;
|
|
8538
|
+
}): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, CancelVars, unknown>;
|
|
8539
|
+
declare function useSymmWithdraw(params?: UseSymmWithdrawParams): {
|
|
8540
|
+
initiate: _tanstack_react_query.UseMutationResult<`0x${string}`, Error, InitiateVars, unknown>;
|
|
8541
|
+
finalize: _tanstack_react_query.UseMutationResult<`0x${string}`, Error, FinalizeVars, unknown>;
|
|
8542
|
+
requestCancel: _tanstack_react_query.UseMutationResult<`0x${string}`, Error, CancelVars, unknown>;
|
|
8543
|
+
};
|
|
8544
|
+
type InstantWithdrawVars = {
|
|
8452
8545
|
amount: bigint;
|
|
8453
|
-
|
|
8546
|
+
/** Destination chain (same-chain express). */
|
|
8547
|
+
chainId: bigint;
|
|
8548
|
+
/** Receiver as 32-byte hex (use `padHex(addr, { size: 20 })` for EVM). */
|
|
8549
|
+
receiver: Hex;
|
|
8550
|
+
/** Registered express provider that will front the funds. */
|
|
8551
|
+
expressProvider: Address;
|
|
8552
|
+
partId?: bigint;
|
|
8553
|
+
/** Whitelisted-user shortened-cooldown flag. Defaults to `false`. */
|
|
8554
|
+
speedUp?: boolean;
|
|
8555
|
+
/** Opaque payload forwarded to provider callbacks. Defaults to `0x`. */
|
|
8556
|
+
providerData?: Hex;
|
|
8557
|
+
subAccount?: Address;
|
|
8558
|
+
};
|
|
8559
|
+
type InstantWithdrawResult = {
|
|
8560
|
+
requestId: bigint;
|
|
8561
|
+
initiateHash: Hex;
|
|
8562
|
+
finalizeHash: Hex;
|
|
8563
|
+
};
|
|
8564
|
+
type UseSymmInstantWithdrawParams = UseSymmWithdrawParams & {
|
|
8565
|
+
/** Diamond address that emits WithdrawFacet events. Falls back to context / defaults. */
|
|
8566
|
+
diamond?: Address;
|
|
8567
|
+
/** Max ms to wait for `WithdrawAccepted` from the express provider. Defaults to 60_000. */
|
|
8568
|
+
providerAcceptanceTimeoutMs?: number;
|
|
8569
|
+
/** How often to poll for the acceptance event. Defaults to 3_000. */
|
|
8570
|
+
pollIntervalMs?: number;
|
|
8571
|
+
};
|
|
8572
|
+
/**
|
|
8573
|
+
* Single-call instant withdraw. Orchestrates initiate → wait for express
|
|
8574
|
+
* provider acceptance → wait for cooldown → finalize, exposing a `status`
|
|
8575
|
+
* field the FE can render against. Two wallet signatures are required (the
|
|
8576
|
+
* initiate and finalize transactions); status updates flow between them.
|
|
8577
|
+
*
|
|
8578
|
+
* For the standard 12-hour path or advanced multi-part / virtual flows, use
|
|
8579
|
+
* the granular `useSymmInitiateWithdraw` / `useSymmFinalizeWithdraw` hooks.
|
|
8580
|
+
*/
|
|
8581
|
+
declare function useSymmInstantWithdraw(params?: UseSymmInstantWithdrawParams): {
|
|
8582
|
+
withdraw: (vars: InstantWithdrawVars) => Promise<InstantWithdrawResult>;
|
|
8583
|
+
status: InstantWithdrawStatus;
|
|
8584
|
+
requestId: bigint | undefined;
|
|
8585
|
+
txHashes: InstantWithdrawTxHashes;
|
|
8586
|
+
error: Error | undefined;
|
|
8587
|
+
reset: () => void;
|
|
8588
|
+
};
|
|
8454
8589
|
|
|
8455
8590
|
type InternalTransferParams = {
|
|
8456
8591
|
recipient: Address;
|
|
@@ -9561,4 +9696,4 @@ type BinanceMarkPriceState = {
|
|
|
9561
9696
|
};
|
|
9562
9697
|
declare const useBinanceMarkPriceStore: zustand.UseBoundStore<zustand.StoreApi<BinanceMarkPriceState>>;
|
|
9563
9698
|
|
|
9564
|
-
export { type SymmAccountBalanceInfoLike, type SymmAccountDataLike, type SymmAccountNumericValue, type SymmAccountOverview, type SymmAccountOverviewInput, type SymmAccountOverviewQueryData, type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationMutationVariables, type SymmDelegationState, type SymmDepositWithdrawalTotals, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmMarkPrices, type SymmMarketPositioningResponse, type SymmMutationConfig, type SymmPerformanceOverlay, type SymmPnlAssetLegLike, type SymmPnlNumericValue, type SymmPnlPositionLike, type SymmPositionPnlResult, type SymmQueryConfig, type SymmTokenMetadata, type SymmTokenSelectionMarket, type SymmUpnlWebSocketMessage, type SymmUpnlWebSocketStatus, type UseSymmAccountCurrentPnlParams, type UseSymmAccountCurrentPnlReturn, type UseSymmAccountOverviewParams, type UseSymmAuthParams, type UseSymmChartCandlesReturn, type UseSymmDelegationMutationParams, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmMarketPositioningParams, type UseSymmMarketPositioningReturn, type UseSymmMarketsParams, type UseSymmMarketsReturn, type UseSymmTokenMarkPriceReturn, type UseSymmTokenSelectionMarketsReturn, type UseSymmTokenSelectionMetadataReturn, type UseSymmTpslOrdersParams, type UseSymmUpnlWebSocketParams, type UseSymmUpnlWebSocketReturn, computeSymmAccountOverview, computeSymmAccountOverviewFromData, computeSymmNetDeposited, computeSymmPositionUpnl, computeSymmPositionsUpnl, getSymmAccountBalanceInfo, getSymmAccountData, getSymmErrorMessage, normalizeSymmUpnlWebSocketMessage, symmKeys, useBinanceMarkPriceStore, useSymmAccountCurrentPnl, useSymmAccountData, useSymmAccountOverview, useSymmAccountSummary, useSymmAccountsApi, useSymmAccountsLength, useSymmAccountsQuery, useSymmAccountsWithPositions, useSymmAllocateCollateralMutation, useSymmApprovalQuery, useSymmApproveMutation, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmCancelClose, useSymmCancelOpenMutation, useSymmCancelTpslMutation, useSymmCancelTwapOrderMutation, useSymmChartCandles, useSymmChartSelection, useSymmClearTriggerConfigMutation, useSymmCloseAllPositionsMutation, useSymmCloseOrder, useSymmClosePositionMutation, useSymmContext, useSymmCoreClient, useSymmCreateAccountMutation, useSymmDeallocateCollateralMutation, useSymmDelegateAccessMutation, useSymmDelegation, useSymmDepositAndAllocateMutation, useSymmDepositMutation, useSymmEditAccountNameMutation, useSymmFunding, useSymmFundingHistory, useSymmFundingPayments, useSymmHedgerMarketById, useSymmHedgerMarketBySymbol, useSymmHedgerMarkets, useSymmInstantTradeEnsureReadyMutation, useSymmInstantTradeExecuteMutation, useSymmInternalTransferCollateralMutation, useSymmLockedParams, useSymmMarkReadNotificationMutation, useSymmMarketPositioning, useSymmMarkets, useSymmNotificationsQuery, useSymmOpenBasketMutation, useSymmOpenOrders, useSymmPendingIds, useSymmPendingInstantOpens, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmProposeRevokeDelegationMutation, useSymmRevokeDelegationMutation, useSymmSetTpslMutation, useSymmSetTriggerConfigMutation, useSymmSignTermsMutation, useSymmSignatureQuery, useSymmTokenMarkPrice, useSymmTokenSelectionMarkets, useSymmTokenSelectionMetadata, useSymmTpslOrders, useSymmTradeHistory, useSymmTriggerConfigQuery, useSymmTriggerOrders, useSymmTwapOrder, useSymmTwapOrdersQuery, useSymmUnreadCountQuery, useSymmUpdatePositionMutation, useSymmUpnlWebSocket, useSymmWithdraw, useSymmWsStore };
|
|
9699
|
+
export { type InstantWithdrawResult, type InstantWithdrawVars, type SymmAccountBalanceInfoLike, type SymmAccountDataLike, type SymmAccountNumericValue, type SymmAccountOverview, type SymmAccountOverviewInput, type SymmAccountOverviewQueryData, type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationMutationVariables, type SymmDelegationState, type SymmDepositWithdrawalTotals, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmMarkPrices, type SymmMarketPositioningResponse, type SymmMutationConfig, type SymmPerformanceOverlay, type SymmPnlAssetLegLike, type SymmPnlNumericValue, type SymmPnlPositionLike, type SymmPositionPnlResult, type SymmQueryConfig, type SymmTokenMetadata, type SymmTokenSelectionMarket, type SymmUpnlWebSocketMessage, type SymmUpnlWebSocketStatus, type UseSymmAccountCurrentPnlParams, type UseSymmAccountCurrentPnlReturn, type UseSymmAccountOverviewParams, type UseSymmAuthParams, type UseSymmChartCandlesReturn, type UseSymmDelegationMutationParams, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmInstantWithdrawParams, type UseSymmMarketPositioningParams, type UseSymmMarketPositioningReturn, type UseSymmMarketsParams, type UseSymmMarketsReturn, type UseSymmTokenMarkPriceReturn, type UseSymmTokenSelectionMarketsReturn, type UseSymmTokenSelectionMetadataReturn, type UseSymmTpslOrdersParams, type UseSymmUpnlWebSocketParams, type UseSymmUpnlWebSocketReturn, computeSymmAccountOverview, computeSymmAccountOverviewFromData, computeSymmNetDeposited, computeSymmPositionUpnl, computeSymmPositionsUpnl, getSymmAccountBalanceInfo, getSymmAccountData, getSymmErrorMessage, normalizeSymmUpnlWebSocketMessage, symmKeys, useBinanceMarkPriceStore, useSymmAccountCurrentPnl, useSymmAccountData, useSymmAccountOverview, useSymmAccountSummary, useSymmAccountsApi, useSymmAccountsLength, useSymmAccountsQuery, useSymmAccountsWithPositions, useSymmAllocateCollateralMutation, useSymmApprovalQuery, useSymmApproveMutation, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmCancelClose, useSymmCancelOpenMutation, useSymmCancelTpslMutation, useSymmCancelTwapOrderMutation, useSymmChartCandles, useSymmChartSelection, useSymmClearTriggerConfigMutation, useSymmCloseAllPositionsMutation, useSymmCloseOrder, useSymmClosePositionMutation, useSymmContext, useSymmCoreClient, useSymmCreateAccountMutation, useSymmDeallocateCollateralMutation, useSymmDelegateAccessMutation, useSymmDelegation, useSymmDepositAndAllocateMutation, useSymmDepositMutation, useSymmEditAccountNameMutation, useSymmFinalizeWithdraw, useSymmFunding, useSymmFundingHistory, useSymmFundingPayments, useSymmHedgerMarketById, useSymmHedgerMarketBySymbol, useSymmHedgerMarkets, useSymmInitiateWithdraw, useSymmInstantTradeEnsureReadyMutation, useSymmInstantTradeExecuteMutation, useSymmInstantWithdraw, useSymmInternalTransferCollateralMutation, useSymmLockedParams, useSymmMarkReadNotificationMutation, useSymmMarketPositioning, useSymmMarkets, useSymmNotificationsQuery, useSymmOpenBasketMutation, useSymmOpenOrders, useSymmPendingIds, useSymmPendingInstantOpens, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmProposeRevokeDelegationMutation, useSymmRequestCancelWithdraw, useSymmRevokeDelegationMutation, useSymmSetTpslMutation, useSymmSetTriggerConfigMutation, useSymmSignTermsMutation, useSymmSignatureQuery, useSymmTokenMarkPrice, useSymmTokenSelectionMarkets, useSymmTokenSelectionMetadata, useSymmTpslOrders, useSymmTradeHistory, useSymmTriggerConfigQuery, useSymmTriggerOrders, useSymmTwapOrder, useSymmTwapOrdersQuery, useSymmUnreadCountQuery, useSymmUpdatePositionMutation, useSymmUpnlWebSocket, useSymmWithdraw, useSymmWsStore };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -8437,20 +8437,155 @@ declare function useSymmDepositAndAllocateMutation(params?: UseSymmDepositParams
|
|
|
8437
8437
|
}, unknown>;
|
|
8438
8438
|
|
|
8439
8439
|
/**
|
|
8440
|
-
*
|
|
8440
|
+
* One destination of a (possibly split) withdraw request.
|
|
8441
|
+
*
|
|
8442
|
+
* `chainId` is `int256` on-chain — non-EVM destinations may use negative IDs.
|
|
8443
|
+
* `receiver` is raw bytes; for EVM destinations pass the 20-byte address as
|
|
8444
|
+
* hex (e.g. via `viem.toHex(address)` or `padHex(address, { size: 20 })`).
|
|
8445
|
+
*
|
|
8446
|
+
* Provider semantics:
|
|
8447
|
+
* - both zero → Classic: standard cooldown, same chain
|
|
8448
|
+
* - only `expressProvider` → Pure Express: instant same chain
|
|
8449
|
+
* - only `virtualProvider` → Pure Virtual: standard cooldown, cross-chain
|
|
8450
|
+
* - both set (different) → Virtual Express: instant cross-chain
|
|
8451
|
+
*
|
|
8452
|
+
* A single provider address must NOT be set as both express and virtual.
|
|
8453
|
+
*/
|
|
8454
|
+
type WithdrawReceiverPart = {
|
|
8455
|
+
id: bigint;
|
|
8456
|
+
amount: bigint;
|
|
8457
|
+
chainId: bigint;
|
|
8458
|
+
receiver: Hex;
|
|
8459
|
+
virtualProvider: Address;
|
|
8460
|
+
expressProvider: Address;
|
|
8461
|
+
};
|
|
8462
|
+
type InitiateWithdrawParams = {
|
|
8463
|
+
parts: WithdrawReceiverPart[];
|
|
8464
|
+
/**
|
|
8465
|
+
* Whitelisted-user shortened-cooldown flag. Independent from the express
|
|
8466
|
+
* (instant) path — callers who are not on the speed-up whitelist should
|
|
8467
|
+
* leave this `false`.
|
|
8468
|
+
*/
|
|
8469
|
+
speedUp: boolean;
|
|
8470
|
+
/** Opaque payload forwarded to provider callbacks. Use `0x` if unused. */
|
|
8471
|
+
providerData: Hex;
|
|
8472
|
+
};
|
|
8473
|
+
type FinalizeWithdrawParams = {
|
|
8474
|
+
/** The user (sub-account) whose request is being finalized. */
|
|
8475
|
+
user: Address;
|
|
8476
|
+
requestId: bigint;
|
|
8477
|
+
};
|
|
8478
|
+
type RequestCancelWithdrawParams = {
|
|
8479
|
+
requestId: bigint;
|
|
8480
|
+
};
|
|
8481
|
+
/**
|
|
8482
|
+
* Lifecycle states for the orchestrated `useSymmInstantWithdraw` hook.
|
|
8483
|
+
* The FE just renders on `status`.
|
|
8441
8484
|
*/
|
|
8442
|
-
declare
|
|
8485
|
+
declare enum InstantWithdrawStatus {
|
|
8486
|
+
IDLE = "idle",
|
|
8487
|
+
/** Initiate tx submitted, waiting for it to mine. */
|
|
8488
|
+
INITIATING = "initiating",
|
|
8489
|
+
/** Initiate mined, waiting for the express provider to accept. */
|
|
8490
|
+
AWAITING_PROVIDER = "awaitingProvider",
|
|
8491
|
+
/** Provider accepted, waiting for `cooldownEndTime`. */
|
|
8492
|
+
AWAITING_COOLDOWN = "awaitingCooldown",
|
|
8493
|
+
/** Finalize tx submitted, waiting for it to mine. */
|
|
8494
|
+
FINALIZING = "finalizing",
|
|
8495
|
+
COMPLETED = "completed",
|
|
8496
|
+
FAILED = "failed"
|
|
8497
|
+
}
|
|
8498
|
+
type InstantWithdrawTxHashes = {
|
|
8499
|
+
initiate?: Hex;
|
|
8500
|
+
finalize?: Hex;
|
|
8501
|
+
};
|
|
8502
|
+
|
|
8503
|
+
type UseSymmWithdrawParams = {
|
|
8443
8504
|
publicClient?: PublicClient;
|
|
8444
8505
|
walletClient?: WalletClient;
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8506
|
+
subAccount?: Address;
|
|
8507
|
+
};
|
|
8508
|
+
type InitiateVars = InitiateWithdrawParams & {
|
|
8509
|
+
subAccount?: Address;
|
|
8510
|
+
};
|
|
8511
|
+
type FinalizeVars = FinalizeWithdrawParams & {
|
|
8512
|
+
subAccount?: Address;
|
|
8513
|
+
};
|
|
8514
|
+
type CancelVars = RequestCancelWithdrawParams & {
|
|
8515
|
+
subAccount?: Address;
|
|
8516
|
+
};
|
|
8517
|
+
/**
|
|
8518
|
+
* v0.8.5 withdraw — kicks off a request. Funds are debited immediately and
|
|
8519
|
+
* a cooldown begins; call `useSymmFinalizeWithdraw` once the cooldown ends.
|
|
8520
|
+
*/
|
|
8521
|
+
declare function useSymmInitiateWithdraw(params?: UseSymmWithdrawParams, options?: {
|
|
8522
|
+
mutation?: SymmMutationConfig<Hex, Error, InitiateVars>;
|
|
8523
|
+
}): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, InitiateVars, unknown>;
|
|
8524
|
+
/**
|
|
8525
|
+
* v0.8.5 withdraw — finalizes a request once its cooldown has elapsed.
|
|
8526
|
+
* Anyone can call this; the typical caller is the request's owner.
|
|
8527
|
+
*/
|
|
8528
|
+
declare function useSymmFinalizeWithdraw(params?: UseSymmWithdrawParams, options?: {
|
|
8529
|
+
mutation?: SymmMutationConfig<Hex, Error, FinalizeVars>;
|
|
8530
|
+
}): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, FinalizeVars, unknown>;
|
|
8531
|
+
/**
|
|
8532
|
+
* v0.8.5 withdraw — requests cancellation. Resolves immediately for classic
|
|
8533
|
+
* / pure-virtual outside the blackout window; otherwise transitions to
|
|
8534
|
+
* `CANCEL_REQUESTED` and awaits provider approval.
|
|
8535
|
+
*/
|
|
8536
|
+
declare function useSymmRequestCancelWithdraw(params?: UseSymmWithdrawParams, options?: {
|
|
8537
|
+
mutation?: SymmMutationConfig<Hex, Error, CancelVars>;
|
|
8538
|
+
}): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, CancelVars, unknown>;
|
|
8539
|
+
declare function useSymmWithdraw(params?: UseSymmWithdrawParams): {
|
|
8540
|
+
initiate: _tanstack_react_query.UseMutationResult<`0x${string}`, Error, InitiateVars, unknown>;
|
|
8541
|
+
finalize: _tanstack_react_query.UseMutationResult<`0x${string}`, Error, FinalizeVars, unknown>;
|
|
8542
|
+
requestCancel: _tanstack_react_query.UseMutationResult<`0x${string}`, Error, CancelVars, unknown>;
|
|
8543
|
+
};
|
|
8544
|
+
type InstantWithdrawVars = {
|
|
8452
8545
|
amount: bigint;
|
|
8453
|
-
|
|
8546
|
+
/** Destination chain (same-chain express). */
|
|
8547
|
+
chainId: bigint;
|
|
8548
|
+
/** Receiver as 32-byte hex (use `padHex(addr, { size: 20 })` for EVM). */
|
|
8549
|
+
receiver: Hex;
|
|
8550
|
+
/** Registered express provider that will front the funds. */
|
|
8551
|
+
expressProvider: Address;
|
|
8552
|
+
partId?: bigint;
|
|
8553
|
+
/** Whitelisted-user shortened-cooldown flag. Defaults to `false`. */
|
|
8554
|
+
speedUp?: boolean;
|
|
8555
|
+
/** Opaque payload forwarded to provider callbacks. Defaults to `0x`. */
|
|
8556
|
+
providerData?: Hex;
|
|
8557
|
+
subAccount?: Address;
|
|
8558
|
+
};
|
|
8559
|
+
type InstantWithdrawResult = {
|
|
8560
|
+
requestId: bigint;
|
|
8561
|
+
initiateHash: Hex;
|
|
8562
|
+
finalizeHash: Hex;
|
|
8563
|
+
};
|
|
8564
|
+
type UseSymmInstantWithdrawParams = UseSymmWithdrawParams & {
|
|
8565
|
+
/** Diamond address that emits WithdrawFacet events. Falls back to context / defaults. */
|
|
8566
|
+
diamond?: Address;
|
|
8567
|
+
/** Max ms to wait for `WithdrawAccepted` from the express provider. Defaults to 60_000. */
|
|
8568
|
+
providerAcceptanceTimeoutMs?: number;
|
|
8569
|
+
/** How often to poll for the acceptance event. Defaults to 3_000. */
|
|
8570
|
+
pollIntervalMs?: number;
|
|
8571
|
+
};
|
|
8572
|
+
/**
|
|
8573
|
+
* Single-call instant withdraw. Orchestrates initiate → wait for express
|
|
8574
|
+
* provider acceptance → wait for cooldown → finalize, exposing a `status`
|
|
8575
|
+
* field the FE can render against. Two wallet signatures are required (the
|
|
8576
|
+
* initiate and finalize transactions); status updates flow between them.
|
|
8577
|
+
*
|
|
8578
|
+
* For the standard 12-hour path or advanced multi-part / virtual flows, use
|
|
8579
|
+
* the granular `useSymmInitiateWithdraw` / `useSymmFinalizeWithdraw` hooks.
|
|
8580
|
+
*/
|
|
8581
|
+
declare function useSymmInstantWithdraw(params?: UseSymmInstantWithdrawParams): {
|
|
8582
|
+
withdraw: (vars: InstantWithdrawVars) => Promise<InstantWithdrawResult>;
|
|
8583
|
+
status: InstantWithdrawStatus;
|
|
8584
|
+
requestId: bigint | undefined;
|
|
8585
|
+
txHashes: InstantWithdrawTxHashes;
|
|
8586
|
+
error: Error | undefined;
|
|
8587
|
+
reset: () => void;
|
|
8588
|
+
};
|
|
8454
8589
|
|
|
8455
8590
|
type InternalTransferParams = {
|
|
8456
8591
|
recipient: Address;
|
|
@@ -9561,4 +9696,4 @@ type BinanceMarkPriceState = {
|
|
|
9561
9696
|
};
|
|
9562
9697
|
declare const useBinanceMarkPriceStore: zustand.UseBoundStore<zustand.StoreApi<BinanceMarkPriceState>>;
|
|
9563
9698
|
|
|
9564
|
-
export { type SymmAccountBalanceInfoLike, type SymmAccountDataLike, type SymmAccountNumericValue, type SymmAccountOverview, type SymmAccountOverviewInput, type SymmAccountOverviewQueryData, type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationMutationVariables, type SymmDelegationState, type SymmDepositWithdrawalTotals, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmMarkPrices, type SymmMarketPositioningResponse, type SymmMutationConfig, type SymmPerformanceOverlay, type SymmPnlAssetLegLike, type SymmPnlNumericValue, type SymmPnlPositionLike, type SymmPositionPnlResult, type SymmQueryConfig, type SymmTokenMetadata, type SymmTokenSelectionMarket, type SymmUpnlWebSocketMessage, type SymmUpnlWebSocketStatus, type UseSymmAccountCurrentPnlParams, type UseSymmAccountCurrentPnlReturn, type UseSymmAccountOverviewParams, type UseSymmAuthParams, type UseSymmChartCandlesReturn, type UseSymmDelegationMutationParams, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmMarketPositioningParams, type UseSymmMarketPositioningReturn, type UseSymmMarketsParams, type UseSymmMarketsReturn, type UseSymmTokenMarkPriceReturn, type UseSymmTokenSelectionMarketsReturn, type UseSymmTokenSelectionMetadataReturn, type UseSymmTpslOrdersParams, type UseSymmUpnlWebSocketParams, type UseSymmUpnlWebSocketReturn, computeSymmAccountOverview, computeSymmAccountOverviewFromData, computeSymmNetDeposited, computeSymmPositionUpnl, computeSymmPositionsUpnl, getSymmAccountBalanceInfo, getSymmAccountData, getSymmErrorMessage, normalizeSymmUpnlWebSocketMessage, symmKeys, useBinanceMarkPriceStore, useSymmAccountCurrentPnl, useSymmAccountData, useSymmAccountOverview, useSymmAccountSummary, useSymmAccountsApi, useSymmAccountsLength, useSymmAccountsQuery, useSymmAccountsWithPositions, useSymmAllocateCollateralMutation, useSymmApprovalQuery, useSymmApproveMutation, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmCancelClose, useSymmCancelOpenMutation, useSymmCancelTpslMutation, useSymmCancelTwapOrderMutation, useSymmChartCandles, useSymmChartSelection, useSymmClearTriggerConfigMutation, useSymmCloseAllPositionsMutation, useSymmCloseOrder, useSymmClosePositionMutation, useSymmContext, useSymmCoreClient, useSymmCreateAccountMutation, useSymmDeallocateCollateralMutation, useSymmDelegateAccessMutation, useSymmDelegation, useSymmDepositAndAllocateMutation, useSymmDepositMutation, useSymmEditAccountNameMutation, useSymmFunding, useSymmFundingHistory, useSymmFundingPayments, useSymmHedgerMarketById, useSymmHedgerMarketBySymbol, useSymmHedgerMarkets, useSymmInstantTradeEnsureReadyMutation, useSymmInstantTradeExecuteMutation, useSymmInternalTransferCollateralMutation, useSymmLockedParams, useSymmMarkReadNotificationMutation, useSymmMarketPositioning, useSymmMarkets, useSymmNotificationsQuery, useSymmOpenBasketMutation, useSymmOpenOrders, useSymmPendingIds, useSymmPendingInstantOpens, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmProposeRevokeDelegationMutation, useSymmRevokeDelegationMutation, useSymmSetTpslMutation, useSymmSetTriggerConfigMutation, useSymmSignTermsMutation, useSymmSignatureQuery, useSymmTokenMarkPrice, useSymmTokenSelectionMarkets, useSymmTokenSelectionMetadata, useSymmTpslOrders, useSymmTradeHistory, useSymmTriggerConfigQuery, useSymmTriggerOrders, useSymmTwapOrder, useSymmTwapOrdersQuery, useSymmUnreadCountQuery, useSymmUpdatePositionMutation, useSymmUpnlWebSocket, useSymmWithdraw, useSymmWsStore };
|
|
9699
|
+
export { type InstantWithdrawResult, type InstantWithdrawVars, type SymmAccountBalanceInfoLike, type SymmAccountDataLike, type SymmAccountNumericValue, type SymmAccountOverview, type SymmAccountOverviewInput, type SymmAccountOverviewQueryData, type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationMutationVariables, type SymmDelegationState, type SymmDepositWithdrawalTotals, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmMarkPrices, type SymmMarketPositioningResponse, type SymmMutationConfig, type SymmPerformanceOverlay, type SymmPnlAssetLegLike, type SymmPnlNumericValue, type SymmPnlPositionLike, type SymmPositionPnlResult, type SymmQueryConfig, type SymmTokenMetadata, type SymmTokenSelectionMarket, type SymmUpnlWebSocketMessage, type SymmUpnlWebSocketStatus, type UseSymmAccountCurrentPnlParams, type UseSymmAccountCurrentPnlReturn, type UseSymmAccountOverviewParams, type UseSymmAuthParams, type UseSymmChartCandlesReturn, type UseSymmDelegationMutationParams, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmInstantWithdrawParams, type UseSymmMarketPositioningParams, type UseSymmMarketPositioningReturn, type UseSymmMarketsParams, type UseSymmMarketsReturn, type UseSymmTokenMarkPriceReturn, type UseSymmTokenSelectionMarketsReturn, type UseSymmTokenSelectionMetadataReturn, type UseSymmTpslOrdersParams, type UseSymmUpnlWebSocketParams, type UseSymmUpnlWebSocketReturn, computeSymmAccountOverview, computeSymmAccountOverviewFromData, computeSymmNetDeposited, computeSymmPositionUpnl, computeSymmPositionsUpnl, getSymmAccountBalanceInfo, getSymmAccountData, getSymmErrorMessage, normalizeSymmUpnlWebSocketMessage, symmKeys, useBinanceMarkPriceStore, useSymmAccountCurrentPnl, useSymmAccountData, useSymmAccountOverview, useSymmAccountSummary, useSymmAccountsApi, useSymmAccountsLength, useSymmAccountsQuery, useSymmAccountsWithPositions, useSymmAllocateCollateralMutation, useSymmApprovalQuery, useSymmApproveMutation, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmCancelClose, useSymmCancelOpenMutation, useSymmCancelTpslMutation, useSymmCancelTwapOrderMutation, useSymmChartCandles, useSymmChartSelection, useSymmClearTriggerConfigMutation, useSymmCloseAllPositionsMutation, useSymmCloseOrder, useSymmClosePositionMutation, useSymmContext, useSymmCoreClient, useSymmCreateAccountMutation, useSymmDeallocateCollateralMutation, useSymmDelegateAccessMutation, useSymmDelegation, useSymmDepositAndAllocateMutation, useSymmDepositMutation, useSymmEditAccountNameMutation, useSymmFinalizeWithdraw, useSymmFunding, useSymmFundingHistory, useSymmFundingPayments, useSymmHedgerMarketById, useSymmHedgerMarketBySymbol, useSymmHedgerMarkets, useSymmInitiateWithdraw, useSymmInstantTradeEnsureReadyMutation, useSymmInstantTradeExecuteMutation, useSymmInstantWithdraw, useSymmInternalTransferCollateralMutation, useSymmLockedParams, useSymmMarkReadNotificationMutation, useSymmMarketPositioning, useSymmMarkets, useSymmNotificationsQuery, useSymmOpenBasketMutation, useSymmOpenOrders, useSymmPendingIds, useSymmPendingInstantOpens, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmProposeRevokeDelegationMutation, useSymmRequestCancelWithdraw, useSymmRevokeDelegationMutation, useSymmSetTpslMutation, useSymmSetTriggerConfigMutation, useSymmSignTermsMutation, useSymmSignatureQuery, useSymmTokenMarkPrice, useSymmTokenSelectionMarkets, useSymmTokenSelectionMetadata, useSymmTpslOrders, useSymmTradeHistory, useSymmTriggerConfigQuery, useSymmTriggerOrders, useSymmTwapOrder, useSymmTwapOrdersQuery, useSymmUnreadCountQuery, useSymmUpdatePositionMutation, useSymmUpnlWebSocket, useSymmWithdraw, useSymmWsStore };
|