@funkit/connect 11.4.0 → 11.4.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/CHANGELOG.md +35 -0
- package/dist/clients/{chunk-XJTRLB7W.js → chunk-BB5FHA47.js} +5 -4
- package/dist/clients/chunk-MSLPLXR2.js +30 -0
- package/dist/clients/{chunk-EQFVPSR2.js → chunk-TYG42JRZ.js} +3 -3
- package/dist/clients/{chunk-3Y5EIONT.js → chunk-UMU5S2WF.js} +30 -39
- package/dist/clients/internal/nado/withdrawalCallback.js +2 -9
- package/dist/clients/internal/nado/withdrawalConfig.d.ts +1 -1
- package/dist/clients/internal/nado/withdrawalConfig.js +1 -2
- package/dist/clients/internal/nado/withdrawalErrors.d.ts +6 -10
- package/dist/clients/internal/nado/withdrawalErrors.js +1 -2
- package/dist/clients/internal/nado/withdrawalForm.css +44 -36
- package/dist/clients/internal/nado/withdrawalForm.d.ts +1 -1
- package/dist/clients/internal/nado/withdrawalForm.js +11 -19
- package/dist/clients/internal/nado/withdrawalStatus.js +4 -8
- package/dist/clients/lighter.css +44 -36
- package/dist/clients/lighter.js +5 -9
- package/dist/clients/nado.d.ts +1 -1
- package/dist/clients/nado.js +4 -12
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +47 -39
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +1 -1
- package/dist/clients/polymarket/index.css +47 -39
- package/dist/clients/polymarket/index.js +1 -1
- package/dist/components/Dropdown/BaseDropdown.css.d.ts +1 -0
- package/dist/components/Dropdown/BaseDropdown.d.ts +0 -1
- package/dist/hooks/track/analytics/events.d.ts +14 -3
- package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +1 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +11 -3
- package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +1 -0
- package/dist/hooks/useBluvo.d.ts +7 -2
- package/dist/index.css +44 -36
- package/dist/index.js +715 -838
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +5 -11
- package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -1
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +38 -38
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +6 -6
- package/dist/clients/chunk-2576N7PQ.js +0 -44
- package/dist/clients/chunk-3P2C436B.js +0 -20
- package/dist/clients/chunk-63XTVHO3.js +0 -19
- package/dist/clients/chunk-6T6URLBM.js +0 -33
- package/dist/clients/chunk-FM7SFGAV.js +0 -106
- package/dist/clients/chunk-JFDRLSYM.js +0 -42
- package/dist/clients/chunk-TZGKB6WY.js +0 -160
- package/dist/clients/chunk-VIAEAD75.js +0 -61
- package/dist/clients/chunk-WZRW6WUM.js +0 -112
- package/dist/clients/chunk-Z7HTQFEO.js +0 -69
- package/dist/clients/internal/nado/consts.d.ts +0 -22
- package/dist/clients/internal/nado/consts.js +0 -15
- package/dist/clients/internal/nado/encoding.d.ts +0 -25
- package/dist/clients/internal/nado/encoding.js +0 -11
- package/dist/clients/internal/nado/errors.d.ts +0 -68
- package/dist/clients/internal/nado/errors.js +0 -19
- package/dist/clients/internal/nado/fetch.d.ts +0 -15
- package/dist/clients/internal/nado/fetch.js +0 -9
- package/dist/clients/internal/nado/gateway.d.ts +0 -61
- package/dist/clients/internal/nado/gateway.js +0 -17
- package/dist/clients/internal/nado/hooks.d.ts +0 -208
- package/dist/clients/internal/nado/hooks.js +0 -21
- package/dist/clients/internal/nado/indexer.d.ts +0 -43
- package/dist/clients/internal/nado/indexer.js +0 -13
- package/dist/clients/internal/nado/typedData.d.ts +0 -80
- package/dist/clients/internal/nado/typedData.js +0 -10
- package/dist/clients/internal/nado/withdrawalTypes.d.ts +0 -49
- package/dist/clients/internal/nado/withdrawalTypes.js +0 -1
- package/dist/utils/safeBigInt.d.ts +0 -5
- package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VAPGUPHO.js → chunk-YQFGVZGR.js} +3 -3
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nado gateway/indexer error type and the codes the SDK branches on.
|
|
3
|
-
*
|
|
4
|
-
* @see {@link https://docs.nado.xyz/developer-resources/api/errors | Nado error codes (full table)}
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Codes are shared across all Nado executes and queries, not just
|
|
8
|
-
* withdrawals — keep this module flow-agnostic.
|
|
9
|
-
*/
|
|
10
|
-
export declare const NADO_ERROR_CODES: {
|
|
11
|
-
/** Amount would open a borrow with `spot_leverage: "false"`. */
|
|
12
|
-
readonly SPOT_EXECUTE_EXCEEDS_BORROW_LIMIT: 2017;
|
|
13
|
-
/** Gateway-level nonce rejection. A consumed `tx_nonce` reverts in the EVM
|
|
14
|
-
* instead — see `EVM_REVERT`. */
|
|
15
|
-
readonly INVALID_NONCE: 2022;
|
|
16
|
-
/** Subaccount has never deposited, so it doesn't exist on Nado yet. */
|
|
17
|
-
readonly NO_PRIOR_DEPOSIT: 2024;
|
|
18
|
-
/** Withdrawal tx not found at the given submission index. */
|
|
19
|
-
readonly INVALID_WITHDRAWAL_IDX: 3004;
|
|
20
|
-
/** Fast-withdrawal validator signatures not aggregated yet. */
|
|
21
|
-
readonly NOT_ENOUGH_FAST_WITHDRAWAL_SIGNATURES: 3005;
|
|
22
|
-
/** Protocol 24h withdrawal limit exceeded. */
|
|
23
|
-
readonly WITHDRAW_RISK: 4004;
|
|
24
|
-
/** Catch-all EVM revert — the reason lives in the message, not the code.
|
|
25
|
-
* A consumed `tx_nonce` lands here (see `parseNadoExpectedNonce`). */
|
|
26
|
-
readonly EVM_REVERT: 4003;
|
|
27
|
-
};
|
|
28
|
-
export type NadoErrorCode = (typeof NADO_ERROR_CODES)[keyof typeof NADO_ERROR_CODES];
|
|
29
|
-
/**
|
|
30
|
-
* Stamped at the throw site — retry logic must never infer the failure kind
|
|
31
|
-
* from which fields happen to be missing.
|
|
32
|
-
* - `api`: Nado answered `{status:'failure'}` (or a malformed success)
|
|
33
|
-
* - `http`: non-2xx response
|
|
34
|
-
* - `timeout`: our 30s backstop fired — the caller already waited
|
|
35
|
-
* - `transport`: request never completed (network drop, garbled body)
|
|
36
|
-
*/
|
|
37
|
-
export type NadoErrorKind = 'api' | 'http' | 'timeout' | 'transport';
|
|
38
|
-
/** A failed Nado gateway/indexer call, classified by `kind`. */
|
|
39
|
-
export declare class NadoGatewayError extends Error {
|
|
40
|
-
readonly kind: NadoErrorKind;
|
|
41
|
-
/** Nado's application error code — set only for `api`-kind failures. */
|
|
42
|
-
readonly errorCode: number | undefined;
|
|
43
|
-
/** HTTP status, kept for diagnostics (present on `http` and bad-JSON 2xx). */
|
|
44
|
-
readonly httpStatus: number | undefined;
|
|
45
|
-
constructor(message: string, options: {
|
|
46
|
-
kind: NadoErrorKind;
|
|
47
|
-
errorCode?: number;
|
|
48
|
-
httpStatus?: number;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* A submit went unanswered and its replay didn't settle the question — the
|
|
53
|
-
* withdrawal may or may not have landed. Distinct from a plain failure because
|
|
54
|
-
* the user must not be told to retry: a fresh nonce would withdraw twice.
|
|
55
|
-
*/
|
|
56
|
-
export declare class NadoWithdrawalUnconfirmedError extends Error {
|
|
57
|
-
constructor(message?: string);
|
|
58
|
-
}
|
|
59
|
-
/** Request never completed — safe to retry. Excludes timeouts: a retry after
|
|
60
|
-
* a 30s stall would hold the user another 30s. */
|
|
61
|
-
export declare function isNadoTransportError(error: unknown): boolean;
|
|
62
|
-
/** Maps a gateway/indexer failure response to a NadoGatewayError. */
|
|
63
|
-
export declare function createNadoGatewayError(response: {
|
|
64
|
-
error?: string;
|
|
65
|
-
error_code?: number;
|
|
66
|
-
}, fallbackMessage: string): NadoGatewayError;
|
|
67
|
-
export declare function isNadoErrorCode(error: unknown, code: NadoErrorCode): boolean;
|
|
68
|
-
export declare function parseNadoExpectedNonce(error: unknown): bigint | undefined;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
NADO_ERROR_CODES,
|
|
4
|
-
NadoGatewayError,
|
|
5
|
-
NadoWithdrawalUnconfirmedError,
|
|
6
|
-
createNadoGatewayError,
|
|
7
|
-
isNadoErrorCode,
|
|
8
|
-
isNadoTransportError,
|
|
9
|
-
parseNadoExpectedNonce
|
|
10
|
-
} from "../../chunk-Z7HTQFEO.js";
|
|
11
|
-
export {
|
|
12
|
-
NADO_ERROR_CODES,
|
|
13
|
-
NadoGatewayError,
|
|
14
|
-
NadoWithdrawalUnconfirmedError,
|
|
15
|
-
createNadoGatewayError,
|
|
16
|
-
isNadoErrorCode,
|
|
17
|
-
isNadoTransportError,
|
|
18
|
-
parseNadoExpectedNonce
|
|
19
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Native-fetch wrapper for Nado's gateway/indexer — outbound third-party
|
|
3
|
-
* calls that api-base's Fun-API-shaped `sendRequest` doesn't fit.
|
|
4
|
-
*/
|
|
5
|
-
export interface NadoFetchParams {
|
|
6
|
-
uri: string;
|
|
7
|
-
method: 'GET' | 'POST';
|
|
8
|
-
body?: object;
|
|
9
|
-
signal?: AbortSignal;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Returns the parsed JSON body of a 2xx response; every other outcome throws
|
|
13
|
-
* NadoGatewayError. Emits one bounded log event per call.
|
|
14
|
-
*/
|
|
15
|
-
export declare function nadoFetch<T>(params: NadoFetchParams): Promise<T>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nado gateway client: the queries and the withdraw execute used by the
|
|
3
|
-
* withdrawal flow.
|
|
4
|
-
*
|
|
5
|
-
* Flow composition: `max_withdrawable` / `fee_rates` feed the enter-amount
|
|
6
|
-
* screen → `nonces` immediately before signing → execute
|
|
7
|
-
* `withdraw_collateral_v2` with `sendTo` = the Fun deposit address → the
|
|
8
|
-
* indexer poll (indexer.ts) confirms sequencing, then checkout tracking takes
|
|
9
|
-
* over once funds arrive.
|
|
10
|
-
*
|
|
11
|
-
* @see {@link https://docs.nado.xyz/developer-resources/api/gateway | Nado gateway API}
|
|
12
|
-
*/
|
|
13
|
-
import type { Address, Hex } from 'viem';
|
|
14
|
-
/**
|
|
15
|
-
* Largest withdrawal (x18) the subaccount can make, measured against prod:
|
|
16
|
-
* `(spot_leverage ? initial_health : min(spot, initial_health)) − sequencer_fee`
|
|
17
|
-
*
|
|
18
|
-
* - Already net of the fee: `max + fee` is debited, `max` is what arrives — so
|
|
19
|
-
* the screen adds it back (`withdrawalForm.ts`).
|
|
20
|
-
* - Health-bound, so no sum of spot balances can replace it: an open perp cuts
|
|
21
|
-
* the max without moving any balance.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getNadoMaxWithdrawable(params: {
|
|
24
|
-
productId: number;
|
|
25
|
-
sender: Hex;
|
|
26
|
-
spotLeverage: boolean;
|
|
27
|
-
}, signal?: AbortSignal): Promise<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Current `tx_nonce` for the owner wallet — fetch immediately before signing.
|
|
30
|
-
* One manual retry on network failures only (imperative call site, no
|
|
31
|
-
* react-query retry layer above it).
|
|
32
|
-
*/
|
|
33
|
-
export declare function getNadoTxNonce(address: Address): Promise<bigint>;
|
|
34
|
-
export interface NadoFeeRates {
|
|
35
|
-
/** Withdraw sequencer fee per product (indexed by product_id), x18 token units. */
|
|
36
|
-
withdraw_sequencer_fees: string[];
|
|
37
|
-
}
|
|
38
|
-
export declare function getNadoFeeRates(sender: Hex, signal?: AbortSignal): Promise<NadoFeeRates>;
|
|
39
|
-
export interface ExecuteWithdrawCollateralV2Params {
|
|
40
|
-
/** Subaccount id per Nado's spec (see `buildNadoSubaccountId`). */
|
|
41
|
-
sender: Hex;
|
|
42
|
-
productId: number;
|
|
43
|
-
/** Raw base units in the token's native decimals — not x18. */
|
|
44
|
-
amount: bigint;
|
|
45
|
-
nonce: bigint;
|
|
46
|
-
sendTo: Address;
|
|
47
|
-
signature: Hex;
|
|
48
|
-
/** Required so callers can't enable borrowing by omission — `false` fails
|
|
49
|
-
* the withdrawal instead of opening a borrow (Nado defaults absent to true). */
|
|
50
|
-
spotLeverage: boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Submit a signed `withdraw_collateral_v2`; resolves on gateway acceptance,
|
|
54
|
-
* on-chain settlement follows asynchronously.
|
|
55
|
-
*
|
|
56
|
-
* A timeout means "no answer", not "didn't happen", so it replays the
|
|
57
|
-
* identical payload rather than surfacing an ambiguous failure. `tx_nonce` is
|
|
58
|
-
* a sequential counter, so the replay either fills the same slot or is
|
|
59
|
-
* rejected — it can never withdraw twice.
|
|
60
|
-
*/
|
|
61
|
-
export declare function executeNadoWithdrawCollateralV2(params: ExecuteWithdrawCollateralV2Params): Promise<void>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
executeNadoWithdrawCollateralV2,
|
|
4
|
-
getNadoFeeRates,
|
|
5
|
-
getNadoMaxWithdrawable,
|
|
6
|
-
getNadoTxNonce
|
|
7
|
-
} from "../../chunk-TZGKB6WY.js";
|
|
8
|
-
import "../../chunk-3P2C436B.js";
|
|
9
|
-
import "../../chunk-WZRW6WUM.js";
|
|
10
|
-
import "../../chunk-Z7HTQFEO.js";
|
|
11
|
-
import "../../chunk-AHYOV7AV.js";
|
|
12
|
-
export {
|
|
13
|
-
executeNadoWithdrawCollateralV2,
|
|
14
|
-
getNadoFeeRates,
|
|
15
|
-
getNadoMaxWithdrawable,
|
|
16
|
-
getNadoTxNonce
|
|
17
|
-
};
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React-query hooks over the Nado gateway/indexer. Poll cadences are budgeted
|
|
3
|
-
* against Nado's IP rate limit (2400 query-weight/min): an open modal spends
|
|
4
|
-
* ~10 weight/min on the selected product's max; the indexer poll runs only
|
|
5
|
-
* while a settlement is pending.
|
|
6
|
-
*
|
|
7
|
-
* @see {@link https://docs.nado.xyz/developer-resources/api/rate-limits | Nado rate limits}
|
|
8
|
-
*/
|
|
9
|
-
import type { Hex } from 'viem';
|
|
10
|
-
/**
|
|
11
|
-
* React-query owns retries (the fetch layer never retries) — up to 2 with
|
|
12
|
-
* backoff, except deterministic api failures, 429s (retrying hammers the
|
|
13
|
-
* limit we just tripped), and timeouts (the caller already waited 30s; the
|
|
14
|
-
* next scheduled poll is the retry).
|
|
15
|
-
*/
|
|
16
|
-
export declare function shouldRetryNadoQuery(failureCount: number, error: unknown): boolean;
|
|
17
|
-
export declare function useNadoMaxWithdrawable(params: {
|
|
18
|
-
productId: number | undefined;
|
|
19
|
-
sender: Hex | undefined;
|
|
20
|
-
spotLeverage: boolean;
|
|
21
|
-
}): import("@tanstack/react-query").UseQueryResult<string, unknown>;
|
|
22
|
-
/**
|
|
23
|
-
* Drops every cached max — prefix match, since each product and borrow state
|
|
24
|
-
* holds its own entry — so a follow-up withdrawal sees the debited balance
|
|
25
|
-
* rather than waiting out the refetch interval.
|
|
26
|
-
*/
|
|
27
|
-
export declare function useInvalidateNadoMaxWithdrawable(): () => void;
|
|
28
|
-
export declare function useNadoFeeRates(sender: Hex | undefined): import("@tanstack/react-query").UseQueryResult<import("./gateway").NadoFeeRates, unknown>;
|
|
29
|
-
export interface NadoSettlementStatus {
|
|
30
|
-
/** True once the sequencer has recorded the withdrawal we signed. */
|
|
31
|
-
isSequenced: boolean;
|
|
32
|
-
/** Unix seconds of the sequenced tx, when available. */
|
|
33
|
-
sequencedAt: number | undefined;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Poll the indexer for the withdrawal signed with `nonce` until it appears
|
|
37
|
-
* or the wall-clock timeout passes. `isTimedOut` flips after the cap — show
|
|
38
|
-
* a "still pending, check Nado" state.
|
|
39
|
-
*/
|
|
40
|
-
export declare function useNadoSettlementStatus(params: {
|
|
41
|
-
subaccount: Hex | undefined;
|
|
42
|
-
nonce: bigint | undefined;
|
|
43
|
-
/** When the withdrawal was submitted — anchors the timeout. */
|
|
44
|
-
submittedAtMs: number | undefined;
|
|
45
|
-
enabled: boolean;
|
|
46
|
-
}): {
|
|
47
|
-
isTimedOut: boolean;
|
|
48
|
-
data: NadoSettlementStatus;
|
|
49
|
-
error: Error;
|
|
50
|
-
isError: true;
|
|
51
|
-
isPending: false;
|
|
52
|
-
isLoading: false;
|
|
53
|
-
isLoadingError: false;
|
|
54
|
-
isRefetchError: true;
|
|
55
|
-
isSuccess: false;
|
|
56
|
-
isPlaceholderData: false;
|
|
57
|
-
status: "error";
|
|
58
|
-
dataUpdatedAt: number;
|
|
59
|
-
errorUpdatedAt: number;
|
|
60
|
-
failureCount: number;
|
|
61
|
-
failureReason: Error | null;
|
|
62
|
-
errorUpdateCount: number;
|
|
63
|
-
isFetched: boolean;
|
|
64
|
-
isFetchedAfterMount: boolean;
|
|
65
|
-
isFetching: boolean;
|
|
66
|
-
isInitialLoading: boolean;
|
|
67
|
-
isPaused: boolean;
|
|
68
|
-
isRefetching: boolean;
|
|
69
|
-
isStale: boolean;
|
|
70
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NadoSettlementStatus, Error>>;
|
|
71
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
72
|
-
promise: Promise<NadoSettlementStatus>;
|
|
73
|
-
} | {
|
|
74
|
-
isTimedOut: boolean;
|
|
75
|
-
data: NadoSettlementStatus;
|
|
76
|
-
error: null;
|
|
77
|
-
isError: false;
|
|
78
|
-
isPending: false;
|
|
79
|
-
isLoading: false;
|
|
80
|
-
isLoadingError: false;
|
|
81
|
-
isRefetchError: false;
|
|
82
|
-
isSuccess: true;
|
|
83
|
-
isPlaceholderData: false;
|
|
84
|
-
status: "success";
|
|
85
|
-
dataUpdatedAt: number;
|
|
86
|
-
errorUpdatedAt: number;
|
|
87
|
-
failureCount: number;
|
|
88
|
-
failureReason: Error | null;
|
|
89
|
-
errorUpdateCount: number;
|
|
90
|
-
isFetched: boolean;
|
|
91
|
-
isFetchedAfterMount: boolean;
|
|
92
|
-
isFetching: boolean;
|
|
93
|
-
isInitialLoading: boolean;
|
|
94
|
-
isPaused: boolean;
|
|
95
|
-
isRefetching: boolean;
|
|
96
|
-
isStale: boolean;
|
|
97
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NadoSettlementStatus, Error>>;
|
|
98
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
99
|
-
promise: Promise<NadoSettlementStatus>;
|
|
100
|
-
} | {
|
|
101
|
-
isTimedOut: boolean;
|
|
102
|
-
data: undefined;
|
|
103
|
-
error: Error;
|
|
104
|
-
isError: true;
|
|
105
|
-
isPending: false;
|
|
106
|
-
isLoading: false;
|
|
107
|
-
isLoadingError: true;
|
|
108
|
-
isRefetchError: false;
|
|
109
|
-
isSuccess: false;
|
|
110
|
-
isPlaceholderData: false;
|
|
111
|
-
status: "error";
|
|
112
|
-
dataUpdatedAt: number;
|
|
113
|
-
errorUpdatedAt: number;
|
|
114
|
-
failureCount: number;
|
|
115
|
-
failureReason: Error | null;
|
|
116
|
-
errorUpdateCount: number;
|
|
117
|
-
isFetched: boolean;
|
|
118
|
-
isFetchedAfterMount: boolean;
|
|
119
|
-
isFetching: boolean;
|
|
120
|
-
isInitialLoading: boolean;
|
|
121
|
-
isPaused: boolean;
|
|
122
|
-
isRefetching: boolean;
|
|
123
|
-
isStale: boolean;
|
|
124
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NadoSettlementStatus, Error>>;
|
|
125
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
126
|
-
promise: Promise<NadoSettlementStatus>;
|
|
127
|
-
} | {
|
|
128
|
-
isTimedOut: boolean;
|
|
129
|
-
data: undefined;
|
|
130
|
-
error: null;
|
|
131
|
-
isError: false;
|
|
132
|
-
isPending: true;
|
|
133
|
-
isLoading: true;
|
|
134
|
-
isLoadingError: false;
|
|
135
|
-
isRefetchError: false;
|
|
136
|
-
isSuccess: false;
|
|
137
|
-
isPlaceholderData: false;
|
|
138
|
-
status: "pending";
|
|
139
|
-
dataUpdatedAt: number;
|
|
140
|
-
errorUpdatedAt: number;
|
|
141
|
-
failureCount: number;
|
|
142
|
-
failureReason: Error | null;
|
|
143
|
-
errorUpdateCount: number;
|
|
144
|
-
isFetched: boolean;
|
|
145
|
-
isFetchedAfterMount: boolean;
|
|
146
|
-
isFetching: boolean;
|
|
147
|
-
isInitialLoading: boolean;
|
|
148
|
-
isPaused: boolean;
|
|
149
|
-
isRefetching: boolean;
|
|
150
|
-
isStale: boolean;
|
|
151
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NadoSettlementStatus, Error>>;
|
|
152
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
153
|
-
promise: Promise<NadoSettlementStatus>;
|
|
154
|
-
} | {
|
|
155
|
-
isTimedOut: boolean;
|
|
156
|
-
data: undefined;
|
|
157
|
-
error: null;
|
|
158
|
-
isError: false;
|
|
159
|
-
isPending: true;
|
|
160
|
-
isLoadingError: false;
|
|
161
|
-
isRefetchError: false;
|
|
162
|
-
isSuccess: false;
|
|
163
|
-
isPlaceholderData: false;
|
|
164
|
-
status: "pending";
|
|
165
|
-
dataUpdatedAt: number;
|
|
166
|
-
errorUpdatedAt: number;
|
|
167
|
-
failureCount: number;
|
|
168
|
-
failureReason: Error | null;
|
|
169
|
-
errorUpdateCount: number;
|
|
170
|
-
isFetched: boolean;
|
|
171
|
-
isFetchedAfterMount: boolean;
|
|
172
|
-
isFetching: boolean;
|
|
173
|
-
isLoading: boolean;
|
|
174
|
-
isInitialLoading: boolean;
|
|
175
|
-
isPaused: boolean;
|
|
176
|
-
isRefetching: boolean;
|
|
177
|
-
isStale: boolean;
|
|
178
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NadoSettlementStatus, Error>>;
|
|
179
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
180
|
-
promise: Promise<NadoSettlementStatus>;
|
|
181
|
-
} | {
|
|
182
|
-
isTimedOut: boolean;
|
|
183
|
-
data: NadoSettlementStatus;
|
|
184
|
-
isError: false;
|
|
185
|
-
error: null;
|
|
186
|
-
isPending: false;
|
|
187
|
-
isLoading: false;
|
|
188
|
-
isLoadingError: false;
|
|
189
|
-
isRefetchError: false;
|
|
190
|
-
isSuccess: true;
|
|
191
|
-
isPlaceholderData: true;
|
|
192
|
-
status: "success";
|
|
193
|
-
dataUpdatedAt: number;
|
|
194
|
-
errorUpdatedAt: number;
|
|
195
|
-
failureCount: number;
|
|
196
|
-
failureReason: Error | null;
|
|
197
|
-
errorUpdateCount: number;
|
|
198
|
-
isFetched: boolean;
|
|
199
|
-
isFetchedAfterMount: boolean;
|
|
200
|
-
isFetching: boolean;
|
|
201
|
-
isInitialLoading: boolean;
|
|
202
|
-
isPaused: boolean;
|
|
203
|
-
isRefetching: boolean;
|
|
204
|
-
isStale: boolean;
|
|
205
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<NadoSettlementStatus, Error>>;
|
|
206
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
207
|
-
promise: Promise<NadoSettlementStatus>;
|
|
208
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
shouldRetryNadoQuery,
|
|
4
|
-
useInvalidateNadoMaxWithdrawable,
|
|
5
|
-
useNadoFeeRates,
|
|
6
|
-
useNadoMaxWithdrawable,
|
|
7
|
-
useNadoSettlementStatus
|
|
8
|
-
} from "../../chunk-FM7SFGAV.js";
|
|
9
|
-
import "../../chunk-JFDRLSYM.js";
|
|
10
|
-
import "../../chunk-TZGKB6WY.js";
|
|
11
|
-
import "../../chunk-3P2C436B.js";
|
|
12
|
-
import "../../chunk-WZRW6WUM.js";
|
|
13
|
-
import "../../chunk-Z7HTQFEO.js";
|
|
14
|
-
import "../../chunk-AHYOV7AV.js";
|
|
15
|
-
export {
|
|
16
|
-
shouldRetryNadoQuery,
|
|
17
|
-
useInvalidateNadoMaxWithdrawable,
|
|
18
|
-
useNadoFeeRates,
|
|
19
|
-
useNadoMaxWithdrawable,
|
|
20
|
-
useNadoSettlementStatus
|
|
21
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nado archive/indexer queries — tracks a submitted withdrawal through
|
|
3
|
-
* sequencing so the UI can show settlement progress.
|
|
4
|
-
*
|
|
5
|
-
* @see {@link https://docs.nado.xyz/developer-resources/api/archive-indexer | Nado archive indexer API}
|
|
6
|
-
*/
|
|
7
|
-
import type { Hex } from 'viem';
|
|
8
|
-
interface NadoWithdrawalTxPayload {
|
|
9
|
-
sender: Hex;
|
|
10
|
-
product_id: number;
|
|
11
|
-
/** Raw base units (native decimals). */
|
|
12
|
-
amount: string;
|
|
13
|
-
nonce: number | string;
|
|
14
|
-
}
|
|
15
|
-
export interface NadoIndexerTx {
|
|
16
|
-
tx: {
|
|
17
|
-
withdraw_collateral?: NadoWithdrawalTxPayload;
|
|
18
|
-
withdraw_collateral_v2?: NadoWithdrawalTxPayload;
|
|
19
|
-
};
|
|
20
|
-
submission_idx: string;
|
|
21
|
-
/** Unix seconds. */
|
|
22
|
-
timestamp: string;
|
|
23
|
-
}
|
|
24
|
-
export interface NadoWithdrawalEventsResponse {
|
|
25
|
-
/** Present in the response; settlement matching only reads `txs`. */
|
|
26
|
-
events: unknown[];
|
|
27
|
-
txs: NadoIndexerTx[];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Sequenced withdraw-collateral (v1 + v2) events for a subaccount, newest
|
|
31
|
-
* first. Unlike the gateway, a successful indexer response returns the
|
|
32
|
-
* payload bare — only failures carry the `{status, error}` wrapper.
|
|
33
|
-
*/
|
|
34
|
-
export declare function getNadoWithdrawalEvents(params: {
|
|
35
|
-
subaccount: Hex;
|
|
36
|
-
limit?: number;
|
|
37
|
-
}, signal?: AbortSignal): Promise<NadoWithdrawalEventsResponse>;
|
|
38
|
-
/**
|
|
39
|
-
* Find the sequenced tx for a withdrawal we submitted, matched by the signed
|
|
40
|
-
* nonce. Presence means Nado's sequencer accepted it.
|
|
41
|
-
*/
|
|
42
|
-
export declare function findSettlementForNonce(txs: NadoIndexerTx[], nonce: bigint): NadoIndexerTx | undefined;
|
|
43
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
findSettlementForNonce,
|
|
4
|
-
getNadoWithdrawalEvents
|
|
5
|
-
} from "../../chunk-JFDRLSYM.js";
|
|
6
|
-
import "../../chunk-3P2C436B.js";
|
|
7
|
-
import "../../chunk-WZRW6WUM.js";
|
|
8
|
-
import "../../chunk-Z7HTQFEO.js";
|
|
9
|
-
import "../../chunk-AHYOV7AV.js";
|
|
10
|
-
export {
|
|
11
|
-
findSettlementForNonce,
|
|
12
|
-
getNadoWithdrawalEvents
|
|
13
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EIP-712 typed data for Nado's `withdraw_collateral_v2` execute.
|
|
3
|
-
*
|
|
4
|
-
* @see {@link https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral | Nado withdraw collateral execute}
|
|
5
|
-
*/
|
|
6
|
-
import type { Address, Hex } from 'viem';
|
|
7
|
-
export declare const WITHDRAW_COLLATERAL_V2_TYPES: {
|
|
8
|
-
readonly WithdrawCollateralV2: readonly [{
|
|
9
|
-
readonly name: "sender";
|
|
10
|
-
readonly type: "bytes32";
|
|
11
|
-
}, {
|
|
12
|
-
readonly name: "productId";
|
|
13
|
-
readonly type: "uint32";
|
|
14
|
-
}, {
|
|
15
|
-
readonly name: "amount";
|
|
16
|
-
readonly type: "uint128";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "nonce";
|
|
19
|
-
readonly type: "uint64";
|
|
20
|
-
}, {
|
|
21
|
-
readonly name: "sendTo";
|
|
22
|
-
readonly type: "address";
|
|
23
|
-
}, {
|
|
24
|
-
readonly name: "appendix";
|
|
25
|
-
readonly type: "uint128";
|
|
26
|
-
}];
|
|
27
|
-
};
|
|
28
|
-
export interface WithdrawCollateralV2Params {
|
|
29
|
-
/** Packed subaccount id (see `buildNadoSubaccountId`). */
|
|
30
|
-
sender: Hex;
|
|
31
|
-
productId: number;
|
|
32
|
-
/** Raw base units in the token's native decimals — not x18. */
|
|
33
|
-
amount: bigint;
|
|
34
|
-
/** `tx_nonce` from the nonces query, fetched immediately before signing. */
|
|
35
|
-
nonce: bigint;
|
|
36
|
-
/** Payout recipient. Non-zero forces owner-wallet signing on Nado's side. */
|
|
37
|
-
sendTo: Address;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Typed data for Nado's `withdraw_collateral_v2` execute. `appendix` is
|
|
41
|
-
* reserved by Nado and must be 0.
|
|
42
|
-
*/
|
|
43
|
-
export declare function buildWithdrawCollateralV2TypedData(params: WithdrawCollateralV2Params): {
|
|
44
|
-
readonly domain: {
|
|
45
|
-
readonly name: "Nado";
|
|
46
|
-
readonly version: "0.0.1";
|
|
47
|
-
readonly chainId: 57073;
|
|
48
|
-
readonly verifyingContract: `0x${string}`;
|
|
49
|
-
};
|
|
50
|
-
readonly types: {
|
|
51
|
-
readonly WithdrawCollateralV2: readonly [{
|
|
52
|
-
readonly name: "sender";
|
|
53
|
-
readonly type: "bytes32";
|
|
54
|
-
}, {
|
|
55
|
-
readonly name: "productId";
|
|
56
|
-
readonly type: "uint32";
|
|
57
|
-
}, {
|
|
58
|
-
readonly name: "amount";
|
|
59
|
-
readonly type: "uint128";
|
|
60
|
-
}, {
|
|
61
|
-
readonly name: "nonce";
|
|
62
|
-
readonly type: "uint64";
|
|
63
|
-
}, {
|
|
64
|
-
readonly name: "sendTo";
|
|
65
|
-
readonly type: "address";
|
|
66
|
-
}, {
|
|
67
|
-
readonly name: "appendix";
|
|
68
|
-
readonly type: "uint128";
|
|
69
|
-
}];
|
|
70
|
-
};
|
|
71
|
-
readonly primaryType: "WithdrawCollateralV2";
|
|
72
|
-
readonly message: {
|
|
73
|
-
readonly sender: `0x${string}`;
|
|
74
|
-
readonly productId: number;
|
|
75
|
-
readonly amount: bigint;
|
|
76
|
-
readonly nonce: bigint;
|
|
77
|
-
readonly sendTo: `0x${string}`;
|
|
78
|
-
readonly appendix: 0n;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nado-specific members of the shared withdrawal discriminated unions. Kept in
|
|
3
|
-
* `clients/internal/nado/` (customer-isolated) and imported by the shared
|
|
4
|
-
* `WithdrawalCustomerData` / `WithdrawalCustomerConfig` aliases in
|
|
5
|
-
* `providers/FunkitCheckoutContext`. viem-only imports — no provider deps — so
|
|
6
|
-
* the shared→customer reference stays cycle-free.
|
|
7
|
-
*/
|
|
8
|
-
import type { Address, Hex } from 'viem';
|
|
9
|
-
/**
|
|
10
|
-
* The dropdown pick, flattened out of the config's `sourceTokens`. Travels whole
|
|
11
|
-
* so identity, decimals, and product id can't be resolved from disagreeing
|
|
12
|
-
* sources — two lookups that disagree would sign against the wrong asset or off
|
|
13
|
-
* by a power of ten.
|
|
14
|
-
*/
|
|
15
|
-
export interface NadoWithdrawalSourceOption {
|
|
16
|
-
/** Nado's own key for the asset — every subaccount query is keyed on it. */
|
|
17
|
-
productId: number;
|
|
18
|
-
symbol: string;
|
|
19
|
-
decimals: number;
|
|
20
|
-
tokenAddress: Address;
|
|
21
|
-
tokenChainId: string;
|
|
22
|
-
iconSrc: string | undefined;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Nado per-submission form selections threaded to the withdrawal callback (the
|
|
26
|
-
* static config can't know them).
|
|
27
|
-
* - `spotLeverage` must be explicit — Nado treats an absent value as borrowing,
|
|
28
|
-
* so `false` fails instead of opening a borrow.
|
|
29
|
-
* - `sequencerFeeTokenAmount` pins the fee the screen displayed, so the callback
|
|
30
|
-
* signs the same net amount instead of re-reading a possibly-refreshed cache.
|
|
31
|
-
* - `selectedSourceToken` is the live dropdown pick. The shared form data carries
|
|
32
|
-
* the config's static `sourceTokenSymbol` instead, which is stale for a
|
|
33
|
-
* multi-source flow.
|
|
34
|
-
*/
|
|
35
|
-
export interface NadoWithdrawalCustomerData {
|
|
36
|
-
customerName: 'nado';
|
|
37
|
-
spotLeverage: boolean;
|
|
38
|
-
/** Sequencer fee in the product's token units, as shown at submit. */
|
|
39
|
-
sequencerFeeTokenAmount: number;
|
|
40
|
-
selectedSourceToken: NadoWithdrawalSourceOption;
|
|
41
|
-
}
|
|
42
|
-
/** Nado config-level identity, supplied by the integrator on the withdrawal config. */
|
|
43
|
-
export interface NadoWithdrawalCustomerConfig {
|
|
44
|
-
customerName: 'nado';
|
|
45
|
-
/** Connected wallet — must be the signer (Nado rejects linked signers). */
|
|
46
|
-
walletAddress: Address;
|
|
47
|
-
/** Packed id of the active subaccount (`buildNadoSubaccountId`); the EIP-712/execute `sender`. */
|
|
48
|
-
subaccount: Hex;
|
|
49
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getWalletConnectConnector
|
|
4
|
+
} from "./chunk-N4IJLYFY.js";
|
|
2
5
|
import {
|
|
3
6
|
getInjectedConnector,
|
|
4
7
|
hasInjectedProvider
|
|
5
8
|
} from "./chunk-OLZ7626J.js";
|
|
6
|
-
import {
|
|
7
|
-
getWalletConnectConnector
|
|
8
|
-
} from "./chunk-N4IJLYFY.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/coreWallet/coreWallet.ts
|
|
11
11
|
var coreWallet = ({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getWalletConnectConnector
|
|
4
|
+
} from "./chunk-N4IJLYFY.js";
|
|
2
5
|
import {
|
|
3
6
|
getInjectedConnector,
|
|
4
7
|
hasInjectedProvider
|
|
5
8
|
} from "./chunk-OLZ7626J.js";
|
|
6
|
-
import {
|
|
7
|
-
getWalletConnectConnector
|
|
8
|
-
} from "./chunk-N4IJLYFY.js";
|
|
9
9
|
|
|
10
10
|
// src/wallets/walletConnectors/frontierWallet/frontierWallet.ts
|
|
11
11
|
import { isAndroid } from "@funkit/utils";
|