@funkit/connect-rn 1.0.11 → 2.1.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/CHANGELOG.md +374 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1051 -289
- package/dist/index.js.map +4 -4
- package/dist/src/flow/FunkitFlowProvider.d.ts +3 -0
- package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
- package/dist/src/flow/withdrawalFlowConfig.d.ts +68 -0
- package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -0
- package/dist/src/hooks/useScreenSize.d.ts +4 -0
- package/dist/src/hooks/useScreenSize.d.ts.map +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -1
- package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
- package/dist/src/providers/FunkitStatsigProvider.d.ts +7 -0
- package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -1
- package/dist/src/providers/useFunkitCheckout.d.ts +9 -3
- package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts +2 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -1
- package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -1
- package/dist/src/screens/QrCodeScreen.d.ts +10 -10
- package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
- package/dist/src/screens/{AddMoneyScreen.d.ts → SelectMethodScreen.d.ts} +4 -4
- package/dist/src/screens/SelectMethodScreen.d.ts.map +1 -0
- package/dist/src/screens/WithdrawMethodScreen.d.ts +30 -0
- package/dist/src/screens/WithdrawMethodScreen.d.ts.map +1 -0
- package/dist/src/swapped/SwappedScreen.d.ts +6 -14
- package/dist/src/swapped/SwappedScreen.d.ts.map +1 -1
- package/dist/src/swapped/SwappedScreenShell.d.ts +24 -0
- package/dist/src/swapped/SwappedScreenShell.d.ts.map +1 -0
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
- package/dist/src/swapped/SwappedWithdrawScreen.d.ts +20 -0
- package/dist/src/swapped/SwappedWithdrawScreen.d.ts.map +1 -0
- package/dist/src/swapped/webViewSwappedTransport.d.ts +8 -7
- package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -1
- package/dist/src/transfer/fops.d.ts +8 -0
- package/dist/src/transfer/fops.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts +11 -0
- package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useWithdrawalFops.d.ts +39 -0
- package/dist/src/transfer/hooks/useWithdrawalFops.d.ts.map +1 -0
- package/dist/src/withdrawal/publicClient.d.ts +10 -0
- package/dist/src/withdrawal/publicClient.d.ts.map +1 -0
- package/dist/src/withdrawal/useWithdrawalExecution.d.ts +21 -0
- package/dist/src/withdrawal/useWithdrawalExecution.d.ts.map +1 -0
- package/package.json +11 -3
- package/dist/src/screens/AddMoneyScreen.d.ts.map +0 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ClipboardWriter } from '../transfer/clipboard';
|
|
3
3
|
import type { DepositFlowCallbacks, DepositFlowConfig } from './depositFlowConfig';
|
|
4
|
+
import type { WithdrawalFlowCallbacks, WithdrawalFlowConfig } from './withdrawalFlowConfig';
|
|
4
5
|
interface FunkitFlowContextValue {
|
|
5
6
|
/** Open the managed deposit flow at the Add money screen. */
|
|
6
7
|
beginDeposit: (config: DepositFlowConfig, callbacks?: DepositFlowCallbacks) => void;
|
|
8
|
+
/** Open the managed withdrawal flow at the payout-method screen. */
|
|
9
|
+
beginWithdrawal: (config: WithdrawalFlowConfig, callbacks?: WithdrawalFlowCallbacks) => void;
|
|
7
10
|
/** Close the flow. */
|
|
8
11
|
closeFlow: () => void;
|
|
9
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunkitFlowProvider.d.ts","sourceRoot":"","sources":["../../../src/flow/FunkitFlowProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FunkitFlowProvider.d.ts","sourceRoot":"","sources":["../../../src/flow/FunkitFlowProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAA;AA8Bd,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,uBAAuB,CAAA;AAa9B,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,wBAAwB,CAAA;AA2C/B,UAAU,sBAAsB;IAC9B,6DAA6D;IAC7D,YAAY,EAAE,CACZ,MAAM,EAAE,iBAAiB,EACzB,SAAS,CAAC,EAAE,oBAAoB,KAC7B,IAAI,CAAA;IACT,oEAAoE;IACpE,eAAe,EAAE,CACf,MAAM,EAAE,oBAAoB,EAC5B,SAAS,CAAC,EAAE,uBAAuB,KAChC,IAAI,CAAA;IACT,sBAAsB;IACtB,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB;AAYD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,eAAwC,GACzC,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,uEAAuE;IACvE,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC,+BAmKA;AAupBD,wBAAgB,aAAa,IAAI,sBAAsB,CAMtD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { SwappedSellOrderData, WithdrawalClient } from '@funkit/connect-core';
|
|
2
|
+
import type { Address } from 'viem';
|
|
3
|
+
/**
|
|
4
|
+
* A token in a withdrawal — the source the user sells, or the token Swapped
|
|
5
|
+
* accepts on-chain. `decimals` only matters for the accepted token (skips an
|
|
6
|
+
* on-chain read during execution).
|
|
7
|
+
*/
|
|
8
|
+
export interface WithdrawalToken {
|
|
9
|
+
/** Numeric chain id as a string (web-aligned, e.g. `'8453'`). */
|
|
10
|
+
chainId: string;
|
|
11
|
+
address: Address;
|
|
12
|
+
/** Recorded against the on-chain movement + logs. */
|
|
13
|
+
symbol: string;
|
|
14
|
+
/** Known token decimals — skips an on-chain read during execution. */
|
|
15
|
+
decimals?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Data the managed withdrawal (Swapped fiat offramp) flow renders and executes
|
|
19
|
+
* against. Mirrors the web `FunkitWithdrawalConfig` family where the concepts
|
|
20
|
+
* overlap; the RN flow is offramp-only (no send-to-address withdrawal).
|
|
21
|
+
*/
|
|
22
|
+
export interface WithdrawalFlowConfig {
|
|
23
|
+
/** Token being sold to fiat. */
|
|
24
|
+
sourceToken: WithdrawalToken;
|
|
25
|
+
/**
|
|
26
|
+
* The token Swapped accepts on-chain (the leg the quote delivers), when it
|
|
27
|
+
* differs from the source. Omit when Swapped accepts the source token; a
|
|
28
|
+
* matching Statsig `swappedwithdrawalsourceoverrides` rule takes precedence.
|
|
29
|
+
*/
|
|
30
|
+
swappedAcceptedToken?: WithdrawalToken;
|
|
31
|
+
/**
|
|
32
|
+
* Host-provided signer that executes the on-chain leg (the host app owns the
|
|
33
|
+
* keys — the SDK never touches key material). Implement the `WithdrawalClient`
|
|
34
|
+
* interface over your wallet stack (viem, wagmi, WalletConnect, …).
|
|
35
|
+
*/
|
|
36
|
+
withdrawalWallet: WithdrawalClient;
|
|
37
|
+
/** Sheet title; defaults to 'Withdraw'. */
|
|
38
|
+
title?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Spendable source balance in **USD**. The SDK caps the Swapped sell to it
|
|
41
|
+
* (USD→EUR via live rates) and blocks cash methods below Swapped's minimum.
|
|
42
|
+
* Pass a number or a callback resolved when the flow opens (e.g. an on-chain
|
|
43
|
+
* `balanceOf`) — the first request is held until it settles. Omit to leave
|
|
44
|
+
* the sell uncapped.
|
|
45
|
+
*/
|
|
46
|
+
sourceUsdBalance?: number | (() => number | Promise<number>);
|
|
47
|
+
}
|
|
48
|
+
/** Lifecycle callbacks passed to `useFunkitCheckout`. */
|
|
49
|
+
export interface WithdrawalFlowCallbacks {
|
|
50
|
+
onOpen?: () => void;
|
|
51
|
+
onClose?: () => void;
|
|
52
|
+
onCheckoutBlocked?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* The embed emitted a validated sell order (deposit address + exact amount
|
|
55
|
+
* of the accepted token). Fired before the SDK executes — observability /
|
|
56
|
+
* escape hatch for hosts that track orders themselves.
|
|
57
|
+
*/
|
|
58
|
+
onWithdrawalOrder?: (order: SwappedSellOrderData) => void;
|
|
59
|
+
/** The on-chain leg landed: provider order id ↔ transaction hash. */
|
|
60
|
+
onWithdrawalSubmitted?: (orderId: string, txHash: string) => void;
|
|
61
|
+
/** Swapped confirmed the fiat payout side (SWAPPED_WITHDRAWAL_SUCCESSFUL). */
|
|
62
|
+
onWithdrawalSuccess?: (data?: unknown) => void;
|
|
63
|
+
/** Unrecoverable execution failure (user rejections are not errors). */
|
|
64
|
+
onWithdrawalError?: (error: {
|
|
65
|
+
message: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=withdrawalFlowConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withdrawalFlowConfig.d.ts","sourceRoot":"","sources":["../../../src/flow/withdrawalFlowConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,WAAW,EAAE,eAAe,CAAA;IAC5B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAA;IACtC;;;;OAIG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;CAC7D;AAED,yDAAyD;AACzD,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACjE,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenSize.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScreenSize.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa;;EAO5B"}
|
|
@@ -15,5 +15,6 @@ export declare function FigmaChevronDownIcon({ size, color }: IconProps): import
|
|
|
15
15
|
export declare function FigmaCheckIcon({ size, color }: IconProps): import("react").JSX.Element;
|
|
16
16
|
export declare function FigmaInfoCircleIcon({ size, color }: IconProps): import("react").JSX.Element;
|
|
17
17
|
export declare function FigmaPlusIcon({ size, color }: IconProps): import("react").JSX.Element;
|
|
18
|
+
export declare function FigmaAlertCircleIcon({ size, color }: IconProps): import("react").JSX.Element;
|
|
18
19
|
export {};
|
|
19
20
|
//# sourceMappingURL=FigmaSystemIcons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FigmaSystemIcons.d.ts","sourceRoot":"","sources":["../../../src/icons/FigmaSystemIcons.tsx"],"names":[],"mappings":"AAIA,KAAK,SAAS,GAAG;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAqDD,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE7D;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE9D;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE5D;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE7D;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEpE;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEnE;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAErE;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEnE;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE7D;AAKD,wBAAgB,mBAAmB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAElE;AAUD,wBAAgB,aAAa,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE5D"}
|
|
1
|
+
{"version":3,"file":"FigmaSystemIcons.d.ts","sourceRoot":"","sources":["../../../src/icons/FigmaSystemIcons.tsx"],"names":[],"mappings":"AAIA,KAAK,SAAS,GAAG;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAqDD,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE7D;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE9D;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE5D;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE7D;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEpE;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEnE;AAED,wBAAgB,qBAAqB,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAErE;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEnE;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE7D;AAKD,wBAAgB,mBAAmB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAElE;AAUD,wBAAgB,aAAa,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAE5D;AAKD,wBAAgB,oBAAoB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,+BAEnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datadogHttpLogTransport.d.ts","sourceRoot":"","sources":["../../../src/logging/datadogHttpLogTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAE7B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,8BAA8B;IAC7C,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAiBD,qBAAa,uBAAwB,YAAW,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAQ;IAErC,OAAO,CAAC,GAAG,CAAoB;IAC/B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,UAAU,CAA6C;gBAEnD,OAAO,EAAE,8BAA8B;IAanD,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIjC,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IASlD,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,IAAI;IAmCtD,8EAA8E;IAC9E,KAAK,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"datadogHttpLogTransport.d.ts","sourceRoot":"","sources":["../../../src/logging/datadogHttpLogTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAE7B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,8BAA8B;IAC7C,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAA;IACnB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAiBD,qBAAa,uBAAwB,YAAW,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAQ;IAErC,OAAO,CAAC,GAAG,CAAoB;IAC/B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,UAAU,CAA6C;gBAEnD,OAAO,EAAE,8BAA8B;IAanD,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIjC,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IASlD,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,IAAI;IAmCtD,8EAA8E;IAC9E,KAAK,IAAI,IAAI;IA4Bb,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;CAMnB"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { type StatsigUser } from '@statsig/react-bindings';
|
|
1
2
|
import { type ReactNode } from 'react';
|
|
2
3
|
export declare const STATSIG_CLIENT_KEY: "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
|
|
4
|
+
export declare const STATSIG_SDK_TYPE: "react-native";
|
|
5
|
+
/**
|
|
6
|
+
* Statsig user for the RN SDK: `customIDs.apiKey` drives customer-gated configs;
|
|
7
|
+
* `custom.sdkType` scopes shared configs to this SDK (see {@link STATSIG_SDK_TYPE}).
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildFunkitStatsigUser(userId: string, apiKey: string): StatsigUser;
|
|
3
10
|
interface FunkitStatsigProviderProps {
|
|
4
11
|
children: ReactNode;
|
|
5
12
|
/** Customer apiKey — gates customer-scoped configs (e.g. `enableswappeddeposit`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunkitStatsigProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/FunkitStatsigProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FunkitStatsigProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/FunkitStatsigProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAA;AAW/C,eAAO,MAAM,kBAAkB,EAC7B,oDAA6D,CAAA;AAI/D,eAAO,MAAM,gBAAgB,EAAG,cAAuB,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,WAAW,CAMb;AAED,UAAU,0BAA0B;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAAqB,GACtB,EAAE,0BAA0B,+BAuB5B"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { DepositFlowCallbacks, DepositFlowConfig } from '../flow/depositFlowConfig';
|
|
2
|
+
import type { WithdrawalFlowCallbacks, WithdrawalFlowConfig } from '../flow/withdrawalFlowConfig';
|
|
3
|
+
/** Lifecycle callbacks for both managed flows (overlapping keys are identical). */
|
|
4
|
+
export type FunkitCheckoutCallbacks = DepositFlowCallbacks & WithdrawalFlowCallbacks;
|
|
2
5
|
/**
|
|
3
6
|
* The connect-rn entry hook, mirroring `@funkit/connect`'s `useFunkitCheckout`.
|
|
4
7
|
* Returns imperative `begin*` calls that open the SDK's managed modal flow — the
|
|
5
8
|
* host renders no screens itself.
|
|
6
9
|
*
|
|
7
10
|
* `beginDeposit(config)` opens the deposit flow (Add money → Transfer/UDA →
|
|
8
|
-
* Choose chain / Supported tokens / QR). `
|
|
9
|
-
*
|
|
11
|
+
* Choose chain / Supported tokens / QR). `beginWithdrawal(config)` opens the
|
|
12
|
+
* fiat-offramp withdrawal flow (payout methods → Swapped sell embed).
|
|
13
|
+
* `beginCheckout` will be added here as that flow lands, matching the web
|
|
14
|
+
* surface.
|
|
10
15
|
*/
|
|
11
|
-
export declare function useFunkitCheckout(callbacks?:
|
|
16
|
+
export declare function useFunkitCheckout(callbacks?: FunkitCheckoutCallbacks): {
|
|
12
17
|
beginDeposit: (config: DepositFlowConfig) => void;
|
|
18
|
+
beginWithdrawal: (config: WithdrawalFlowConfig) => void;
|
|
13
19
|
};
|
|
14
20
|
//# sourceMappingURL=useFunkitCheckout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFunkitCheckout.d.ts","sourceRoot":"","sources":["../../../src/providers/useFunkitCheckout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"useFunkitCheckout.d.ts","sourceRoot":"","sources":["../../../src/providers/useFunkitCheckout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAErC,mFAAmF;AACnF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GACxD,uBAAuB,CAAA;AAEzB;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,uBAA4B;2BAK5D,iBAAiB;8BAKjB,oBAAoB;EAKhC"}
|
|
@@ -25,9 +25,10 @@ export interface AvailableChainsScreenProps {
|
|
|
25
25
|
networkLabel: string;
|
|
26
26
|
chains: AvailableChain[];
|
|
27
27
|
title?: string;
|
|
28
|
+
gotItLabel?: string;
|
|
28
29
|
loading?: boolean;
|
|
29
30
|
skeletonCount?: number;
|
|
30
31
|
onClose?: () => void;
|
|
31
32
|
}
|
|
32
|
-
export declare function AvailableChainsScreen({ networkLabel, chains, title, loading, skeletonCount, onClose, }: AvailableChainsScreenProps): import("react").JSX.Element;
|
|
33
|
+
export declare function AvailableChainsScreen({ networkLabel, chains, title, gotItLabel, loading, skeletonCount, onClose, }: AvailableChainsScreenProps): import("react").JSX.Element;
|
|
33
34
|
//# sourceMappingURL=AvailableChainsScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvailableChainsScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/AvailableChainsScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvailableChainsScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/AvailableChainsScreen.tsx"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,YAAY,EACZ,MAAM,EACN,KAAmC,EACnC,UAAqB,EACrB,OAAe,EACf,aAAiB,EACjB,OAAO,GACR,EAAE,0BAA0B,+BA+E5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutBlockedScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/CheckoutBlockedScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutBlockedScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/CheckoutBlockedScreen.tsx"],"names":[],"mappings":"AAQA,wBAAgB,qBAAqB,gCAoDpC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* The deposit QR-code screen (Figma: Fun Mobile / qr-code-modal, node
|
|
4
|
-
* 11636:2663).
|
|
5
|
-
* framed QR with the selected network's chain
|
|
6
|
-
*
|
|
4
|
+
* 11636:2663). Presented as a nested bottom sheet: a centered "QR Code"
|
|
5
|
+
* title (no close button), the framed QR with the selected network's chain
|
|
6
|
+
* logos overlaid in its center, the full deposit address with a
|
|
7
|
+
* "Copy address" button, and a "Done" primary button that dismisses the sheet.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* nothing inside the flow's content-sized modal wrapper). The QR + address group
|
|
11
|
-
* center vertically in whatever height results.
|
|
9
|
+
* Vertical padding adapts to screen height via {@link useScreenSize} so the
|
|
10
|
+
* sheet doesn't overflow on compact devices (iPhone SE).
|
|
12
11
|
*
|
|
13
12
|
* The scannable QR itself is host-supplied (`qrCode`, e.g.
|
|
14
|
-
* `react-native-qrcode-svg`) so the package stays `react-native-svg`-free;
|
|
15
|
-
* screen renders the themed frame and the centered chain-logo overlay.
|
|
13
|
+
* `react-native-qrcode-svg`) so the package stays `react-native-svg`-free;
|
|
14
|
+
* this screen renders the themed frame and the centered chain-logo overlay.
|
|
16
15
|
*/
|
|
17
16
|
export interface QrCodeScreenProps {
|
|
18
17
|
/** The rendered QR code node (host-supplied). */
|
|
@@ -25,6 +24,7 @@ export interface QrCodeScreenProps {
|
|
|
25
24
|
/** The full deposit address shown (wrapping) below the QR. */
|
|
26
25
|
address?: string;
|
|
27
26
|
title?: string;
|
|
27
|
+
doneLabel?: string;
|
|
28
28
|
copyLabel?: string;
|
|
29
29
|
copiedLabel?: string;
|
|
30
30
|
/** How long the "Copied" confirmation stays on the Copy button (ms). */
|
|
@@ -38,5 +38,5 @@ export interface QrCodeScreenProps {
|
|
|
38
38
|
*/
|
|
39
39
|
onCopyAddress?: () => void | Promise<boolean>;
|
|
40
40
|
}
|
|
41
|
-
export declare function QrCodeScreen({ qrCode, centerIcon, address, title, copyLabel, copiedLabel, copiedFeedbackMs, onClose, onCopyAddress, }: QrCodeScreenProps): import("react").JSX.Element;
|
|
41
|
+
export declare function QrCodeScreen({ qrCode, centerIcon, address, title, doneLabel, copyLabel, copiedLabel, copiedFeedbackMs, onClose, onCopyAddress, }: QrCodeScreenProps): import("react").JSX.Element;
|
|
42
42
|
//# sourceMappingURL=QrCodeScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QrCodeScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/QrCodeScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"QrCodeScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/QrCodeScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAA;AAOnE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,MAAM,EAAE,SAAS,CAAA;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9C;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,UAAU,EACV,OAAO,EACP,KAAiB,EACjB,SAAkB,EAClB,SAA0B,EAC1B,WAAuB,EACvB,gBAAuB,EACvB,OAAO,EACP,aAAa,GACd,EAAE,iBAAiB,+BAuHnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* One selectable funding source in {@link
|
|
3
|
+
* One selectable funding source in {@link SelectMethodScreen}. Brand icons are
|
|
4
4
|
* host-supplied (`icon` / `trailing`) so the package stays asset- and
|
|
5
5
|
* `react-native-svg`-free; the screen renders a themed circular slot for each.
|
|
6
6
|
*/
|
|
@@ -26,7 +26,7 @@ export interface ReceiveTokenOption {
|
|
|
26
26
|
label: string;
|
|
27
27
|
icon?: ReactNode;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface SelectMethodScreenProps {
|
|
30
30
|
methods: PaymentMethodOption[];
|
|
31
31
|
onSelectMethod: (id: string) => void;
|
|
32
32
|
title?: string;
|
|
@@ -82,5 +82,5 @@ export interface AddMoneyScreenProps {
|
|
|
82
82
|
* NOT reflow the list) over a dimming scrim — matching web's
|
|
83
83
|
* `ReceiveTokenDropdown`.
|
|
84
84
|
*/
|
|
85
|
-
export declare function
|
|
86
|
-
//# sourceMappingURL=
|
|
85
|
+
export declare function SelectMethodScreen({ methods, onSelectMethod, title, loading, skeletonCount, error, onRetry, errorTitle, errorMessage, retryLabel, receiveTokens, selectedReceiveTokenId, onSelectReceiveToken, depositToLabel, payWithLabel, initialDropdownOpen, }: SelectMethodScreenProps): import("react").JSX.Element;
|
|
86
|
+
//# sourceMappingURL=SelectMethodScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectMethodScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/SelectMethodScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAA;AAyEnE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAA;IACpC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,cAAc,EACd,KAAmB,EACnB,OAAe,EACf,aAAa,EACb,KAAa,EACb,OAAO,EACP,UAAgC,EAChC,YAAoC,EACpC,UAAgC,EAChC,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,cAA6B,EAC7B,YAAyB,EACzB,mBAA2B,GAC5B,EAAE,uBAAuB,+BAiIzB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PaymentMethodOption } from './SelectMethodScreen';
|
|
2
|
+
export interface WithdrawMethodScreenProps {
|
|
3
|
+
/** Cash payout methods (Card / Bank Transfer / …). */
|
|
4
|
+
methods: PaymentMethodOption[];
|
|
5
|
+
onSelectMethod: (id: string) => void;
|
|
6
|
+
/** Sheet title; defaults to 'Withdraw'. */
|
|
7
|
+
title?: string;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
/** The payout-method fetch failed — shows the retryable error state. */
|
|
10
|
+
hasError?: boolean;
|
|
11
|
+
onRetry?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Withdrawals unavailable (Statsig gate off, or Swapped returned no methods
|
|
14
|
+
* for the user's region) — shows a terminal, non-retryable message.
|
|
15
|
+
*/
|
|
16
|
+
isEmpty?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The balance can't meet Swapped's minimum sell — shows a distinct terminal
|
|
19
|
+
* message instead of methods that would all reject.
|
|
20
|
+
*/
|
|
21
|
+
isBelowMinimum?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The withdrawal payout-method picker: the entry screen of `beginWithdrawal`,
|
|
25
|
+
* listing the Swapped `CRYPTO_TO_FIAT` methods. A thin composition over
|
|
26
|
+
* {@link SelectMethodScreen} (no receive-token dropdown → the bare-list layout),
|
|
27
|
+
* so the list/loading/error visuals stay in lockstep with the deposit flow.
|
|
28
|
+
*/
|
|
29
|
+
export declare function WithdrawMethodScreen({ methods, onSelectMethod, title, loading, hasError, onRetry, isEmpty, isBelowMinimum, }: WithdrawMethodScreenProps): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=WithdrawMethodScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawMethodScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/WithdrawMethodScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAqBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,cAAc,EACd,KAAkB,EAClB,OAAe,EACf,QAAgB,EAChB,OAAO,EACP,OAAe,EACf,cAAsB,GACvB,EAAE,yBAAyB,+BA0B3B"}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
url: string;
|
|
4
|
-
/** Close the whole flow (embed asked to exit, e.g. its own ✕). */
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
/** Go back to the Add money list (embed's own back, or a new deposit). */
|
|
7
|
-
onBack: () => void;
|
|
1
|
+
import { type SwappedScreenBaseProps } from './SwappedScreenShell';
|
|
2
|
+
export interface SwappedScreenProps extends SwappedScreenBaseProps {
|
|
8
3
|
/** Fired when the embed reports a successful transaction. */
|
|
9
4
|
onSuccess?: () => void;
|
|
10
5
|
}
|
|
11
6
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* flow navigation from the embed's messages, mirroring web's
|
|
17
|
-
* `SwappedIframeController`: back / new-deposit → {@link onBack}, close →
|
|
18
|
-
* {@link onClose}, transaction-successful → {@link onSuccess}. Others log only.
|
|
7
|
+
* Deposit-mode host for the Swapped embed (mirroring web's
|
|
8
|
+
* `SwappedIframeController`): back / new-deposit → {@link onBack},
|
|
9
|
+
* close → {@link onClose}, transaction-successful → {@link onSuccess}.
|
|
10
|
+
* Withdrawal lifecycle messages are ignored — see `SwappedWithdrawScreen`.
|
|
19
11
|
*/
|
|
20
12
|
export declare function SwappedScreen({ url, onClose, onBack, onSuccess, }: SwappedScreenProps): import("react").JSX.Element;
|
|
21
13
|
//# sourceMappingURL=SwappedScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwappedScreen.d.ts","sourceRoot":"","sources":["../../../src/swapped/SwappedScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwappedScreen.d.ts","sourceRoot":"","sources":["../../../src/swapped/SwappedScreen.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,OAAO,EACP,MAAM,EACN,SAAS,GACV,EAAE,kBAAkB,+BA0BpB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SwappedInboundMessage } from '@funkit/connect-core';
|
|
2
|
+
/** Props shared by both Swapped embed hosts (deposit and withdrawal). */
|
|
3
|
+
export interface SwappedScreenBaseProps {
|
|
4
|
+
/** The selected FOP's `embeddedFlowUrl` to load in the embed. */
|
|
5
|
+
url: string;
|
|
6
|
+
/** Close the whole flow (embed asked to exit, e.g. its own ✕). */
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
/** Go back to the method list (embed's own back). */
|
|
9
|
+
onBack: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface SwappedScreenShellProps {
|
|
12
|
+
url: string;
|
|
13
|
+
onMessage: (msg: SwappedInboundMessage) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Full-screen host frame for the Swapped embedded payment flow
|
|
17
|
+
* ({@link SwappedWebView}). The embed ships its own top bar, so we render no
|
|
18
|
+
* RN header. Mode-agnostic message handling (error logging) lives here;
|
|
19
|
+
* mode-specific dispatch lives in `SwappedScreen` (deposit) and
|
|
20
|
+
* `SwappedWithdrawScreen` (withdrawal).
|
|
21
|
+
*/
|
|
22
|
+
export declare function SwappedScreenShell({ url, onMessage, }: SwappedScreenShellProps): import("react").JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=SwappedScreenShell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwappedScreenShell.d.ts","sourceRoot":"","sources":["../../../src/swapped/SwappedScreenShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAQjE,yEAAyE;AACzE,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAA;IACX,kEAAkE;IAClE,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,qDAAqD;IACrD,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,UAAU,uBAAuB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAA;CAChD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,SAAS,GACV,EAAE,uBAAuB,+BAwBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwappedWebView.d.ts","sourceRoot":"","sources":["../../../src/swapped/SwappedWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAGjE,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"SwappedWebView.d.ts","sourceRoot":"","sources":["../../../src/swapped/SwappedWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAGjE,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAgBtE,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,SAAS,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,CAAA;IAC/C,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,mBAAmB,+BAiJ5E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SwappedSellOrderData } from '@funkit/connect-core';
|
|
2
|
+
import { type SwappedScreenBaseProps } from './SwappedScreenShell';
|
|
3
|
+
export interface SwappedWithdrawScreenProps extends SwappedScreenBaseProps {
|
|
4
|
+
/** "Make another withdrawal" — back to the method list. */
|
|
5
|
+
onNewWithdrawal?: () => void;
|
|
6
|
+
/** Swapped confirmed the fiat payout side. Payload is opaque. */
|
|
7
|
+
onWithdrawalSuccess?: (data?: unknown) => void;
|
|
8
|
+
/** Sell order (deposit address + accepted-token amount). Only validated payloads forward. */
|
|
9
|
+
onOrderData?: (order: SwappedSellOrderData) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Withdrawal-mode host for the Swapped embed (mirroring web's
|
|
13
|
+
* `WithdrawalSwappedIframeController`): back → {@link onBack},
|
|
14
|
+
* close → {@link onClose}, new-withdrawal → {@link onNewWithdrawal},
|
|
15
|
+
* withdrawal-successful → {@link onWithdrawalSuccess}, order-data →
|
|
16
|
+
* {@link onOrderData}. Deposit-only messages are ignored — see
|
|
17
|
+
* `SwappedScreen`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function SwappedWithdrawScreen({ url, onClose, onBack, onNewWithdrawal, onWithdrawalSuccess, onOrderData, }: SwappedWithdrawScreenProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=SwappedWithdrawScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwappedWithdrawScreen.d.ts","sourceRoot":"","sources":["../../../src/swapped/SwappedWithdrawScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,sBAAsB,CAAA;AAI7B,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACxE,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,6FAA6F;IAC7F,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,GAAG,EACH,OAAO,EACP,MAAM,EACN,eAAe,EACf,mBAAmB,EACnB,WAAW,GACZ,EAAE,0BAA0B,+BA6C5B"}
|
|
@@ -27,7 +27,7 @@ export declare const FUNKIT_ENVELOPE_KEY = "__funkitSwapped";
|
|
|
27
27
|
* `opener` instead of `parent`, and a top-level WebView has neither — without
|
|
28
28
|
* the shim those messages are silently dropped.
|
|
29
29
|
*/
|
|
30
|
-
export declare const SWAPPED_WEBVIEW_INJECTED_JS = "(function () {\n if (window.__funkitSwappedBridge) { return; }\n window.__funkitSwappedBridge = true;\n // The REAL postMessage, captured before the override below.\n var postToPage = window.postMessage.bind(window);\n function forwardToNative(message) {\n try {\n var data = typeof message === 'string' ? message : JSON.stringify(message);\n window.ReactNativeWebView && window.ReactNativeWebView.postMessage(data);\n } catch (e) {}\n }\n function bridged(message) {\n // funkit envelope (host \u2192 embed): unwrap + deliver to the page's listeners.\n if (message && message.__funkitSwapped) {\n try { postToPage(message.payload, '*'); } catch (e) {}\n return;\n }\n // Anything else is the embed talking to its host \u2192 forward to native.\n forwardToNative(message);\n }\n // The
|
|
30
|
+
export declare const SWAPPED_WEBVIEW_INJECTED_JS = "(function () {\n if (window.__funkitSwappedBridge) { return; }\n window.__funkitSwappedBridge = true;\n // The REAL postMessage, captured before the override below.\n var postToPage = window.postMessage.bind(window);\n function forwardToNative(message) {\n try {\n var data = typeof message === 'string' ? message : JSON.stringify(message);\n window.ReactNativeWebView && window.ReactNativeWebView.postMessage(data);\n } catch (e) {}\n }\n function bridged(message) {\n // funkit envelope (host \u2192 embed): unwrap + deliver to the page's listeners.\n if (message && message.__funkitSwapped) {\n try { postToPage(message.payload, '*'); } catch (e) {}\n return;\n }\n // Anything else is the embed talking to its host \u2192 forward to native.\n forwardToNative(message);\n }\n try { window.postMessage = bridged; } catch (e) {}\n // The widget only emits some messages (notably SWAPPED_ORDER_DATA, the sell\n // deposit address) when it believes it is embedded in a parent frame \u2014 on web\n // that's a real <iframe> so window.parent !== window. A top-level WebView has\n // window.parent === window, so present a DISTINCT parent/top (a proxy over\n // window) whose postMessage forwards to native; the get-trap delegates every\n // other property to the real window so the widget's other parent.* access works.\n var frameProxy = window;\n try {\n frameProxy = new Proxy(window, {\n get: function (target, prop) {\n if (prop === 'postMessage') { return bridged; }\n var value = target[prop];\n return typeof value === 'function' ? value.bind(target) : value;\n },\n });\n } catch (e) {\n // Proxy unavailable \u2192 fall back to bridging the real parent.\n try { if (window.parent) { window.parent.postMessage = bridged; } } catch (e2) {}\n }\n // Guard parent/top independently: parent is [Replaceable] so it sticks, but\n // top is [LegacyUnforgeable] (HTML spec) and throws on conforming engines\n // while succeeding on the WebView builds that gate embed detection on it \u2014\n // isolating them means a throw on one never skips the other.\n try { Object.defineProperty(window, 'parent', { configurable: true, get: function () { return frameProxy; } }); } catch (e) {}\n try { Object.defineProperty(window, 'top', { configurable: true, get: function () { return frameProxy; } }); } catch (e) {}\n // No parent frame \u2192 the widget posts lifecycle messages to window.opener.\n try { if (!window.opener) { window.opener = { postMessage: forwardToNative }; } } catch (e) {}\n true;\n})();\ntrue;";
|
|
31
31
|
/**
|
|
32
32
|
* Build the JS snippet that delivers an outbound message INTO the embed, run
|
|
33
33
|
* via `webView.injectJavaScript`. One shape for every message type: the payload
|
|
@@ -39,13 +39,14 @@ export declare const SWAPPED_WEBVIEW_INJECTED_JS = "(function () {\n if (window
|
|
|
39
39
|
export declare function buildSwappedSendScript(msg: SwappedOutboundMessage): string;
|
|
40
40
|
/**
|
|
41
41
|
* Parse + validate a raw WebView `onMessage` payload into a typed inbound
|
|
42
|
-
* Swapped message. Returns `null` (drop the message) when
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* `isSwappedOrigin(event.origin)` guard in the iframe transport).
|
|
42
|
+
* Swapped message. Returns `null` (drop the message) when the payload isn't
|
|
43
|
+
* valid JSON with a string `type`, or `url`'s origin isn't a Swapped origin
|
|
44
|
+
* (mirrors web's `isSwappedOrigin(event.origin)` iframe guard).
|
|
46
45
|
*
|
|
47
|
-
* `url` is the
|
|
48
|
-
*
|
|
46
|
+
* `url` is the page URL to validate against. The caller passes `nativeEvent.url`,
|
|
47
|
+
* falling back to the last committed navigation URL when a webview build omits it
|
|
48
|
+
* (see {@link SwappedWebView}) — so a missing url here means no trustworthy
|
|
49
|
+
* source, and we fail closed.
|
|
49
50
|
*/
|
|
50
51
|
export declare function handleWebViewMessage(rawData: unknown, url?: string): SwappedInboundMessage | null;
|
|
51
52
|
/** Minimal surface of `react-native-webview`'s ref the transport needs. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webViewSwappedTransport.d.ts","sourceRoot":"","sources":["../../../src/swapped/webViewSwappedTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"webViewSwappedTransport.d.ts","sourceRoot":"","sources":["../../../src/swapped/webViewSwappedTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,2BAA2B,ikFAkDlC,CAAA;AAEN;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,sBAAsB,GAAG,MAAM,CAM1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,MAAM,GACX,qBAAqB,GAAG,IAAI,CAoB9B;AAED,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACvC;AAED,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,SAAS,EAAE,gBAAgB,CAAA;IAC3B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/C;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,UAAU,GACX,EAAE;IACD,UAAU,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;CACrC,GAAG,uBAAuB,CA8B1B"}
|
|
@@ -23,4 +23,12 @@ export interface FopRow {
|
|
|
23
23
|
* V1).
|
|
24
24
|
*/
|
|
25
25
|
export declare function toFopRows(fops: SwappedFormOfPayment[], exchangeRates?: ExchangeRates): FopRow[];
|
|
26
|
+
/**
|
|
27
|
+
* Map Swapped payout methods to Withdraw rows. Deliberately NOT {@link toFopRows}:
|
|
28
|
+
* its `getFopsLimit` default invents a "$10k limit" when no exchange rate is
|
|
29
|
+
* available, which would misstate a limit on the user's own money (web's
|
|
30
|
+
* `getWithdrawalFopsDisclaimerLimit` returns no limit without rates). Subtitle
|
|
31
|
+
* is timing-only: bank transfers settle in days, everything else is instant.
|
|
32
|
+
*/
|
|
33
|
+
export declare function toWithdrawFopRows(fops: SwappedFormOfPayment[]): FopRow[];
|
|
26
34
|
//# sourceMappingURL=fops.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fops.d.ts","sourceRoot":"","sources":["../../../src/transfer/fops.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,sEAAsE;AACtE,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAOD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,oBAAoB,EAAE,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM,EAAE,CAeV"}
|
|
1
|
+
{"version":3,"file":"fops.d.ts","sourceRoot":"","sources":["../../../src/transfer/fops.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,sEAAsE;AACtE,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAOD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,oBAAoB,EAAE,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM,EAAE,CAeV;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAWxE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RN port of web's `useFiatExchangeRates`: the fiat exchange-rate table used to
|
|
3
|
+
* convert the host's USD source balance into Swapped's EUR sell cap. Keyless
|
|
4
|
+
* endpoint, cached for an hour (rates barely move within a session).
|
|
5
|
+
*/
|
|
6
|
+
export declare function useFiatExchangeRates(enabled?: boolean): {
|
|
7
|
+
data: import("@funkit/api-base").ExchangeRates | undefined;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useFiatExchangeRates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFiatExchangeRates.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useFiatExchangeRates.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,UAAO;;;;EAYlD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
|
+
import { type SwappedWithdrawalLegs } from '@funkit/connect-core';
|
|
3
|
+
import type { WithdrawalFlowConfig } from '../../flow/withdrawalFlowConfig';
|
|
4
|
+
/** Base react-query key for the withdrawal `/fops` query — shared with the
|
|
5
|
+
* flow's invalidation so the two can't drift. */
|
|
6
|
+
export declare const WITHDRAW_FOPS_QUERY_KEY = "withdrawFops";
|
|
7
|
+
export interface UseWithdrawalFopsParams {
|
|
8
|
+
config: WithdrawalFlowConfig;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface UseWithdrawalFopsResult {
|
|
12
|
+
/**
|
|
13
|
+
* Generic cash payout methods (Card / Bank Transfer / …). Saved FOPs are not
|
|
14
|
+
* supported for withdrawals (web parity) and are never returned.
|
|
15
|
+
*/
|
|
16
|
+
fops: SwappedFormOfPayment[];
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
isError: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* True only once we KNOW there's nothing to show (gate off, or a settled
|
|
21
|
+
* fetch returned zero) — never during a load, so the non-retryable
|
|
22
|
+
* "unavailable" screen can't flash.
|
|
23
|
+
*/
|
|
24
|
+
noPaymentMethodsAvailable: boolean;
|
|
25
|
+
/** Source balance can't clear Swapped's €7 minimum sell (cash impossible). */
|
|
26
|
+
isBelowMinimumBalance: boolean;
|
|
27
|
+
refetch: () => void;
|
|
28
|
+
/** Whether the Statsig `enableswappedwithdrawal` gate is on for this apiKey. */
|
|
29
|
+
isWithdrawalEnabled: boolean;
|
|
30
|
+
/** Resolved source→accepted-token route, shared by the fops fetch and quote. */
|
|
31
|
+
route: SwappedWithdrawalLegs;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* RN port of web's `useWithdrawFops`. Orchestrates the steps: resolve the
|
|
35
|
+
* accepted-token legs, the region country/currency, the balance-derived sell
|
|
36
|
+
* cap, then run the gated `/fops` query.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useWithdrawalFops({ config, enabled, }: UseWithdrawalFopsParams): UseWithdrawalFopsResult;
|
|
39
|
+
//# sourceMappingURL=useWithdrawalFops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWithdrawalFops.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useWithdrawalFops.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAIL,KAAK,qBAAqB,EAO3B,MAAM,sBAAsB,CAAA;AAM7B,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,iCAAiC,CAAA;AAQxC;iDACiD;AACjD,eAAO,MAAM,uBAAuB,iBAAiB,CAAA;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,IAAI,EAAE,oBAAoB,EAAE,CAAA;IAC5B,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,yBAAyB,EAAE,OAAO,CAAA;IAClC,8EAA8E;IAC9E,qBAAqB,EAAE,OAAO,CAAA;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,gFAAgF;IAChF,mBAAmB,EAAE,OAAO,CAAA;IAC5B,gFAAgF;IAChF,KAAK,EAAE,qBAAqB,CAAA;CAC7B;AAiND;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,OAAc,GACf,EAAE,uBAAuB,GAAG,uBAAuB,CA0HnD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PublicClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only client for a funkit-supported chain, built over the chain's
|
|
4
|
+
* fallback RPC list from @funkit/chains (the chain's default RPC may be
|
|
5
|
+
* private — e.g. the Robinhood chain — so the curated list matters).
|
|
6
|
+
* `undefined` for unsupported chain ids; the caller surfaces that as a
|
|
7
|
+
* mis-routed target.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPublicClientFor(chainId: number): Pick<PublicClient, 'readContract'> | undefined;
|
|
10
|
+
//# sourceMappingURL=publicClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicClient.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/publicClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,MAAM,CAAA;AAM5E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,SAAS,CAehD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SwappedSellOrderData, type SwappedWithdrawalLegs } from '@funkit/connect-core';
|
|
2
|
+
import type { WithdrawalFlowCallbacks, WithdrawalFlowConfig } from '../flow/withdrawalFlowConfig';
|
|
3
|
+
export interface UseWithdrawalExecutionParams {
|
|
4
|
+
config: WithdrawalFlowConfig;
|
|
5
|
+
/** The route resolved by `useWithdrawalFops` — one resolution for fetch + quote. */
|
|
6
|
+
route: SwappedWithdrawalLegs;
|
|
7
|
+
callbacks: WithdrawalFlowCallbacks;
|
|
8
|
+
/** Unrecoverable failure — the flow shows its error state. */
|
|
9
|
+
onError: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Thin React wrapper over connect-core's `processFiatWithdrawalOrder`: owns
|
|
13
|
+
* the control-flow guards for the unreliable embed message stream and maps
|
|
14
|
+
* outcomes onto host callbacks. The guards are intentionally refs, not state —
|
|
15
|
+
* both are read synchronously inside the async `executeOrder` (a re-entrancy
|
|
16
|
+
* flag set before the first await, and a dedupe set) and must not re-render.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useWithdrawalExecution({ config, route, callbacks, onError, }: UseWithdrawalExecutionParams): {
|
|
19
|
+
executeOrder: (data: SwappedSellOrderData) => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useWithdrawalExecution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAK3B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAmBrC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,oBAAoB,CAAA;IAC5B,oFAAoF;IACpF,KAAK,EAAE,qBAAqB,CAAA;IAC5B,SAAS,EAAE,uBAAuB,CAAA;IAClC,8DAA8D;IAC9D,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,GACR,EAAE,4BAA4B,GAAG;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D,CA4FA"}
|