@funkit/connect-rn 3.6.0 → 3.8.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +81 -0
  3. package/dist/{chunk-BNWA4HKO.js → chunk-UN5NP4RP.js} +342 -115
  4. package/dist/chunk-UN5NP4RP.js.map +7 -0
  5. package/dist/clients/lighter/index.d.ts +2 -0
  6. package/dist/clients/lighter/index.d.ts.map +1 -1
  7. package/dist/clients/lighter/lighterFastWithdrawal.d.ts.map +1 -1
  8. package/dist/clients/lighter/useLighterSecureWithdrawal.d.ts +42 -0
  9. package/dist/clients/lighter/useLighterSecureWithdrawal.d.ts.map +1 -0
  10. package/dist/clients/lighter/useLighterUnstakedFee.d.ts +12 -6
  11. package/dist/clients/lighter/useLighterUnstakedFee.d.ts.map +1 -1
  12. package/dist/clients/lighter/useLighterWithdrawal.d.ts.map +1 -1
  13. package/dist/clients/lighter/useLighterWithdrawalMethods.d.ts.map +1 -1
  14. package/dist/clients/lighter.js +170 -84
  15. package/dist/clients/lighter.js.map +4 -4
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3455 -1550
  19. package/dist/index.js.map +4 -4
  20. package/dist/src/components/AmountDisplay.d.ts +18 -0
  21. package/dist/src/components/AmountDisplay.d.ts.map +1 -0
  22. package/dist/src/components/AssetGrid.d.ts +39 -0
  23. package/dist/src/components/AssetGrid.d.ts.map +1 -0
  24. package/dist/src/components/NumPad.d.ts +14 -0
  25. package/dist/src/components/NumPad.d.ts.map +1 -0
  26. package/dist/src/components/PillButton.d.ts +25 -0
  27. package/dist/src/components/PillButton.d.ts.map +1 -0
  28. package/dist/src/components/ReceiveAmountSummary.d.ts +27 -0
  29. package/dist/src/components/ReceiveAmountSummary.d.ts.map +1 -0
  30. package/dist/src/components/ReceiveAsRow.d.ts +14 -0
  31. package/dist/src/components/ReceiveAsRow.d.ts.map +1 -0
  32. package/dist/src/components/SearchInput.d.ts +15 -0
  33. package/dist/src/components/SearchInput.d.ts.map +1 -0
  34. package/dist/src/components/SelectableAssetRow.d.ts +14 -0
  35. package/dist/src/components/SelectableAssetRow.d.ts.map +1 -0
  36. package/dist/src/components/SkeletonBar.d.ts +10 -0
  37. package/dist/src/components/SkeletonBar.d.ts.map +1 -0
  38. package/dist/src/components/TopBar.d.ts +12 -0
  39. package/dist/src/components/TopBar.d.ts.map +1 -0
  40. package/dist/src/components/WalletAddressInput.d.ts +35 -0
  41. package/dist/src/components/WalletAddressInput.d.ts.map +1 -0
  42. package/dist/src/components/WithdrawSourceCard.d.ts +23 -0
  43. package/dist/src/components/WithdrawSourceCard.d.ts.map +1 -0
  44. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  45. package/dist/src/flow/FlowSheet.d.ts +3 -1
  46. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  47. package/dist/src/flow/FunkitFlowProvider.d.ts +11 -3
  48. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  49. package/dist/src/flow/WithdrawalFlowContent.d.ts +4 -1
  50. package/dist/src/flow/WithdrawalFlowContent.d.ts.map +1 -1
  51. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  52. package/dist/src/flow/sheetSizing.d.ts +22 -0
  53. package/dist/src/flow/sheetSizing.d.ts.map +1 -0
  54. package/dist/src/flow/useCopiedToast.d.ts.map +1 -1
  55. package/dist/src/flow/withdrawalFlowConfig.d.ts +7 -0
  56. package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -1
  57. package/dist/src/haptics/HapticsContext.d.ts +21 -0
  58. package/dist/src/haptics/HapticsContext.d.ts.map +1 -0
  59. package/dist/src/haptics/hapticTap.d.ts +13 -0
  60. package/dist/src/haptics/hapticTap.d.ts.map +1 -0
  61. package/dist/src/hooks/useIsStablecoin.d.ts +3 -0
  62. package/dist/src/hooks/useIsStablecoin.d.ts.map +1 -0
  63. package/dist/src/hooks/useNestedSheet.d.ts +17 -0
  64. package/dist/src/hooks/useNestedSheet.d.ts.map +1 -0
  65. package/dist/src/hooks/useNestedSheetHeight.d.ts +7 -0
  66. package/dist/src/hooks/useNestedSheetHeight.d.ts.map +1 -0
  67. package/dist/src/hooks/usePulse.d.ts +7 -0
  68. package/dist/src/hooks/usePulse.d.ts.map +1 -0
  69. package/dist/src/icons/FigmaSystemIcons.d.ts +2 -0
  70. package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -1
  71. package/dist/src/icons/FunIcon.d.ts +5 -2
  72. package/dist/src/icons/FunIcon.d.ts.map +1 -1
  73. package/dist/src/icons/TokenChainIcon.d.ts +6 -1
  74. package/dist/src/icons/TokenChainIcon.d.ts.map +1 -1
  75. package/dist/src/identity/IdentityContext.d.ts +9 -0
  76. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  77. package/dist/src/providers/FunkitProvider.d.ts +17 -2
  78. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  79. package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -1
  80. package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
  81. package/dist/src/screens/SelectChainScreen.d.ts.map +1 -1
  82. package/dist/src/screens/SelectMethodScreen.d.ts.map +1 -1
  83. package/dist/src/screens/SelectReceiveTokenAndChainScreen.d.ts +18 -0
  84. package/dist/src/screens/SelectReceiveTokenAndChainScreen.d.ts.map +1 -0
  85. package/dist/src/screens/SelectReceiveTokenScreen.d.ts +13 -0
  86. package/dist/src/screens/SelectReceiveTokenScreen.d.ts.map +1 -0
  87. package/dist/src/screens/SelectSourceTokenScreen.d.ts.map +1 -1
  88. package/dist/src/screens/TransactionBreakdownScreen.d.ts +12 -0
  89. package/dist/src/screens/TransactionBreakdownScreen.d.ts.map +1 -0
  90. package/dist/src/screens/WithdrawAddressScreen.d.ts +48 -0
  91. package/dist/src/screens/WithdrawAddressScreen.d.ts.map +1 -0
  92. package/dist/src/screens/WithdrawAmountScreen.d.ts +53 -0
  93. package/dist/src/screens/WithdrawAmountScreen.d.ts.map +1 -0
  94. package/dist/src/screens/WithdrawCompleteScreen.d.ts +15 -4
  95. package/dist/src/screens/WithdrawCompleteScreen.d.ts.map +1 -1
  96. package/dist/src/screens/WithdrawCryptoComplete.d.ts +8 -1
  97. package/dist/src/screens/WithdrawCryptoComplete.d.ts.map +1 -1
  98. package/dist/src/screens/WithdrawCryptoSteps.d.ts +40 -0
  99. package/dist/src/screens/WithdrawCryptoSteps.d.ts.map +1 -0
  100. package/dist/src/transfer/clipboard.d.ts +22 -0
  101. package/dist/src/transfer/clipboard.d.ts.map +1 -1
  102. package/dist/src/transfer/hooks/useFops.d.ts +6 -0
  103. package/dist/src/transfer/hooks/useFops.d.ts.map +1 -1
  104. package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
  105. package/dist/src/transfer/hooks/useWithdrawalFops.d.ts.map +1 -1
  106. package/dist/src/utils/amountGlyphs.d.ts +15 -0
  107. package/dist/src/utils/amountGlyphs.d.ts.map +1 -0
  108. package/dist/src/utils/assetGrid.d.ts +20 -0
  109. package/dist/src/utils/assetGrid.d.ts.map +1 -0
  110. package/dist/src/utils/executionErrorMessage.d.ts +13 -0
  111. package/dist/src/utils/executionErrorMessage.d.ts.map +1 -0
  112. package/dist/src/utils/formatAmount.d.ts +21 -0
  113. package/dist/src/utils/formatAmount.d.ts.map +1 -0
  114. package/dist/src/utils/motion.d.ts +3 -0
  115. package/dist/src/utils/motion.d.ts.map +1 -0
  116. package/dist/src/utils/numpadInput.d.ts +14 -0
  117. package/dist/src/utils/numpadInput.d.ts.map +1 -0
  118. package/dist/src/utils/safeArea.d.ts +3 -0
  119. package/dist/src/utils/safeArea.d.ts.map +1 -0
  120. package/dist/src/withdrawal/receiveDestination.d.ts +11 -0
  121. package/dist/src/withdrawal/receiveDestination.d.ts.map +1 -0
  122. package/dist/src/withdrawal/sourceToken.d.ts +4 -11
  123. package/dist/src/withdrawal/sourceToken.d.ts.map +1 -1
  124. package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts +6 -0
  125. package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts.map +1 -1
  126. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts +91 -0
  127. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts.map +1 -0
  128. package/dist/src/withdrawal/useCryptoWithdrawalSubmit.d.ts +37 -0
  129. package/dist/src/withdrawal/useCryptoWithdrawalSubmit.d.ts.map +1 -0
  130. package/dist/src/withdrawal/useCryptoWithdrawalValidation.d.ts.map +1 -1
  131. package/dist/src/withdrawal/useSourceTokenUsdPrice.d.ts +20 -0
  132. package/dist/src/withdrawal/useSourceTokenUsdPrice.d.ts.map +1 -0
  133. package/dist/src/withdrawal/useWithdrawalAmountInput.d.ts +38 -0
  134. package/dist/src/withdrawal/useWithdrawalAmountInput.d.ts.map +1 -0
  135. package/dist/src/withdrawal/useWithdrawalDestinationTokens.d.ts.map +1 -1
  136. package/dist/src/withdrawal/useWithdrawalRisk.d.ts +2 -2
  137. package/dist/src/withdrawal/useWithdrawalRisk.d.ts.map +1 -1
  138. package/dist/src/withdrawal/useWithdrawalStatus.d.ts +6 -2
  139. package/dist/src/withdrawal/useWithdrawalStatus.d.ts.map +1 -1
  140. package/dist/src/withdrawal/validation.d.ts +23 -5
  141. package/dist/src/withdrawal/validation.d.ts.map +1 -1
  142. package/package.json +8 -3
  143. package/dist/chunk-BNWA4HKO.js.map +0 -7
  144. package/dist/src/components/AmountInput.d.ts +0 -40
  145. package/dist/src/components/AmountInput.d.ts.map +0 -1
  146. package/dist/src/components/WithdrawFeeSummary.d.ts +0 -23
  147. package/dist/src/components/WithdrawFeeSummary.d.ts.map +0 -1
  148. package/dist/src/screens/SelectDestinationScreen.d.ts +0 -19
  149. package/dist/src/screens/SelectDestinationScreen.d.ts.map +0 -1
  150. package/dist/src/screens/WithdrawCryptoCta.d.ts +0 -20
  151. package/dist/src/screens/WithdrawCryptoCta.d.ts.map +0 -1
  152. package/dist/src/screens/WithdrawCryptoForm.d.ts +0 -28
  153. package/dist/src/screens/WithdrawCryptoForm.d.ts.map +0 -1
  154. package/dist/src/screens/WithdrawCryptoScreen.d.ts +0 -17
  155. package/dist/src/screens/WithdrawCryptoScreen.d.ts.map +0 -1
  156. package/dist/src/withdrawal/flatFee.d.ts +0 -9
  157. package/dist/src/withdrawal/flatFee.d.ts.map +0 -1
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `1062.11` → `1,062.11`. The fraction is passed through untouched: rounding a
3
+ * balance would show the user a number they can't withdraw.
4
+ */
5
+ export declare function groupThousands(amount: string): string;
6
+ /**
7
+ * The fraction a token amount is shown to, matching web's `ASSET_DECIMALS` (see
8
+ * the checkout's `InputAmount/utils.ts`) so the two flows read the same.
9
+ */
10
+ export declare const ASSET_DECIMALS = 5;
11
+ /**
12
+ * `99.780000` → `99.78`, capped at {@link ASSET_DECIMALS}.
13
+ *
14
+ * Truncated rather than rounded: a figure the recipient won't actually get is
15
+ * worse than one digit less of it. Trailing zeros go, so a round amount reads as
16
+ * one.
17
+ */
18
+ export declare function formatTokenAmount(amount: string, maxDecimals?: number): string;
19
+ /** `99.94` → `$99.94`. Two decimals, as every USD figure in the design is. */
20
+ export declare function formatUsd(value: number): string;
21
+ //# sourceMappingURL=formatAmount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/formatAmount.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,MAAuB,GACnC,MAAM,CAKR;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C"}
@@ -0,0 +1,3 @@
1
+ export declare const MOTION_DURATION = 180;
2
+ export declare const MOTION_EASING: import("react-native-reanimated").EasingFunctionFactory;
3
+ //# sourceMappingURL=motion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../../src/utils/motion.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,MAAM,CAAA;AAClC,eAAO,MAAM,aAAa,yDAAkC,CAAA"}
@@ -0,0 +1,14 @@
1
+ export type NumpadDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
2
+ export type NumpadKey = NumpadDigit | '.' | 'backspace';
3
+ /**
4
+ * The typed amount after one keypress, as a decimal string.
5
+ *
6
+ * - A lone `.` is not a number any parser accepts, so the leading zero is
7
+ * written for the user; a second point, and any point at all on a 0-decimal
8
+ * token, is refused rather than swallowed later.
9
+ * - `0` is a placeholder rather than a leading digit, so typing `5` gives `5`.
10
+ * - Fraction digits stop at the token's `decimals`: past that the input is dust
11
+ * the transfer can't carry, and it would silently truncate at signing time.
12
+ */
13
+ export declare function applyNumpadKey(value: string, key: NumpadKey, maxDecimals?: number): string;
14
+ //# sourceMappingURL=numpadInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numpadInput.d.ts","sourceRoot":"","sources":["../../../src/utils/numpadInput.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GACnB,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAA;AAEP,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,GAAG,GAAG,WAAW,CAAA;AAIvD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,SAAS,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAyBR"}
@@ -0,0 +1,3 @@
1
+ /** What a full-window step's footer keeps between itself and the screen edge. */
2
+ export declare function footerBottomMargin(bottomInset: number): number;
3
+ //# sourceMappingURL=safeArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeArea.d.ts","sourceRoot":"","sources":["../../../src/utils/safeArea.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,11 @@
1
+ import type { DestinationChain } from './useWithdrawalDestinationTokens';
2
+ /** Nothing picked rules nothing out. */
3
+ export declare function chainCarries(chain: DestinationChain, token: string | undefined): boolean;
4
+ /**
5
+ * The preferred chain if it carries the token, else the first that does — keeping
6
+ * a still-valid preference is what stops a new token moving the network under it.
7
+ */
8
+ export declare function chainForToken(chains: DestinationChain[], token: string, preferredChainId: number | undefined): number | undefined;
9
+ /** Deduped, curated order intact. */
10
+ export declare function receivableTokens(chains: DestinationChain[]): string[];
11
+ //# sourceMappingURL=receiveDestination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiveDestination.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/receiveDestination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAExE,wCAAwC;AACxC,wBAAgB,YAAY,CAC1B,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,gBAAgB,EAAE,EAC1B,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,MAAM,GAAG,SAAS,GACnC,MAAM,GAAG,SAAS,CAMpB;AAED,qCAAqC;AACrC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAErE"}
@@ -1,17 +1,10 @@
1
- import type { WithdrawalFlowConfig, WithdrawalSourceTokenOption, WithdrawalToken } from '../flow/withdrawalFlowConfig';
1
+ import type { WithdrawalFlowConfig, WithdrawalSourceTokenOption } from '../flow/withdrawalFlowConfig';
2
2
  /**
3
3
  * The source tokens the user may pick between. A host with one source omits
4
4
  * `sourceTokens`, leaving the single `sourceToken` as the only option.
5
- */
6
- export declare function resolveWithdrawalSourceTokens(config: Pick<WithdrawalFlowConfig, 'sourceToken' | 'sourceTokens'>): WithdrawalSourceTokenOption[];
7
- /**
8
- * Resolve the integrator's `withdrawalSourceTokenBalance` callback to a numeric
9
- * string. Port of web's `resolveWithdrawalSourceTokenBalance`.
10
5
  *
11
- * `undefined` means no callback was supplied, which is not the same as a
12
- * callback returning `0` ("nothing withdrawable"). A throw or an unusable value
13
- * yields `'0'`, never `undefined`: a broken callback must not read as "unknown"
14
- * and let the form fall through to some other balance.
6
+ * Stays local to React Native: web's option type is keyed by symbol and carries
7
+ * per-option checkout data, so there is no shared shape to resolve against.
15
8
  */
16
- export declare function resolveWithdrawalSourceBalance(config: Pick<WithdrawalFlowConfig, 'withdrawalSourceTokenBalance'>, sourceToken: WithdrawalToken): string | undefined;
9
+ export declare function resolveWithdrawalSourceTokens(config: Pick<WithdrawalFlowConfig, 'sourceToken' | 'sourceTokens'>): WithdrawalSourceTokenOption[];
17
10
  //# sourceMappingURL=sourceToken.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sourceToken.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/sourceToken.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAQrC;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,cAAc,CAAC,GACjE,2BAA2B,EAAE,CAG/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,EAClE,WAAW,EAAE,eAAe,GAC3B,MAAM,GAAG,SAAS,CAuBpB"}
1
+ {"version":3,"file":"sourceToken.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/sourceToken.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,8BAA8B,CAAA;AAErC;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,cAAc,CAAC,GACjE,2BAA2B,EAAE,CAG/B"}
@@ -14,6 +14,12 @@ export type CryptoWithdrawalSubmission = {
14
14
  } | {
15
15
  status: 'failed';
16
16
  code: WalletExecutionErrorCode;
17
+ /**
18
+ * The error's own text. Read by the form only where the classified cause
19
+ * says nothing the user can act on — a failure the SDK cannot name is
20
+ * better reported in the provider's words than as "please try again".
21
+ */
22
+ message: string;
17
23
  };
18
24
  export interface UseCryptoWithdrawalExecutionParams {
19
25
  config: WithdrawalFlowConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"useCryptoWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,wBAAwB,EAM9B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AA4CrC,MAAM,MAAM,0BAA0B,GAClC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C;IACE,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;CACf,GAGD;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,wBAAwB,CAAA;CAAE,CAAA;AAExD,MAAM,WAAW,kCAAkC;IACjD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,CAAA;IACjC,SAAS,EAAE,uBAAuB,CAAA;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,SAAS,GACV,EAAE,kCAAkC;;mDAY9B;QACD,yEAAyE;QACzE,KAAK,EAAE,qBAAqB,CAAA;QAC5B,gBAAgB,EAAE,MAAM,CAAA;QACxB,MAAM,EAAE,MAAM,CAAA;KACf;;EAuFJ"}
1
+ {"version":3,"file":"useCryptoWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,wBAAwB,EAM9B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AA4CrC,MAAM,MAAM,0BAA0B,GAClC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C;IACE,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;CACf,GACD;IACE,MAAM,EAAE,QAAQ,CAAA;IAChB,IAAI,EAAE,wBAAwB,CAAA;IAC9B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAEL,MAAM,WAAW,kCAAkC;IACjD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,CAAA;IACjC,SAAS,EAAE,uBAAuB,CAAA;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,SAAS,GACV,EAAE,kCAAkC;;mDAY9B;QACD,yEAAyE;QACzE,KAAK,EAAE,qBAAqB,CAAA;QAC5B,gBAAgB,EAAE,MAAM,CAAA;QACxB,MAAM,EAAE,MAAM,CAAA;KACf;;EAwFJ"}
@@ -0,0 +1,91 @@
1
+ import { type WithdrawalAmountValidation } from '@funkit/connect-core';
2
+ import type { WithdrawalFlowConfig } from '../flow/withdrawalFlowConfig';
3
+ import { type WithdrawCtaBlocker } from './validation';
4
+ /** What the crypto withdrawal's screens read and write. */
5
+ export type CryptoWithdrawalForm = ReturnType<typeof useCryptoWithdrawalForm>;
6
+ /**
7
+ * One withdrawal in progress, across the screens that build it: the amount, the
8
+ * recipient and the fees are asked for a step at a time, and all of it is priced
9
+ * against the same quote.
10
+ *
11
+ * Held above the screens rather than inside one of them, so a step can be added
12
+ * (or reordered) without the state moving house — and so the quote isn't thrown
13
+ * away and re-fetched on every navigation.
14
+ */
15
+ export declare function useCryptoWithdrawalForm({ config, quoteInputFeeTokens, quoteInputFeeSettled, }: {
16
+ config: WithdrawalFlowConfig;
17
+ /**
18
+ * A flat fee the venue takes off the withdrawal before it is quoted, in
19
+ * source-token units, or 0.
20
+ */
21
+ quoteInputFeeTokens: number;
22
+ /** See `WithdrawalFlowConfig.quoteInputFeeSettled`. */
23
+ quoteInputFeeSettled?: boolean;
24
+ }): {
25
+ recipient: string;
26
+ setRecipient: import("react").Dispatch<import("react").SetStateAction<string>>;
27
+ sourceOptions: import("../..").WithdrawalSourceTokenOption[];
28
+ selectedSourceIndex: number;
29
+ sourceOption: import("../..").WithdrawalSourceTokenOption;
30
+ sourceToken: import("../..").WithdrawalToken;
31
+ sourceLabel: string;
32
+ sourceDecimals: number | undefined;
33
+ balance: string | undefined;
34
+ /**
35
+ * Records the decision and clears the amount: it was in the previous token's
36
+ * units, and the balance and minimum it was checked against are the new
37
+ * token's. Returns whether the source actually moved.
38
+ */
39
+ selectSource: (index: number) => boolean;
40
+ destinationChains: import("./useWithdrawalDestinationTokens").DestinationChain[];
41
+ destinationToken: import("../..").WithdrawalToken | undefined;
42
+ selectDestinationToken: (chainId: number, symbol: string) => void;
43
+ isLoadingDestinations: boolean;
44
+ isRecipientBlacklisted: boolean;
45
+ amountValidation: WithdrawalAmountValidation;
46
+ ctaBlocker: WithdrawCtaBlocker | undefined;
47
+ risk: import("./useWithdrawalRisk").WithdrawalRiskResult;
48
+ /**
49
+ * Whether what has been typed is a wallet address at all — `undefined` while
50
+ * the field is empty. Being one doesn't make it usable: the blacklist and the
51
+ * destination's chain are the separate verdicts in `recipientError`.
52
+ */
53
+ isRecipientAddress: boolean | undefined;
54
+ /** Why a well-formed address still can't be used. */
55
+ recipientError: string | undefined;
56
+ /** Screening's non-blocking verdict; the submit is what it gates. */
57
+ recipientWarning: string | undefined;
58
+ /** Enough to leave the recipient step, which the amount's problems don't hold. */
59
+ canConfirmRecipient: boolean;
60
+ /**
61
+ * Fail closed: only a completed, clean screening lets the withdrawal through,
62
+ * and only while the quote on screen is the one for what the field says —
63
+ * mid-edit the query is disabled and `quote` still holds the last price.
64
+ */
65
+ canSubmit: boolean;
66
+ quote: import("./useCryptoWithdrawalQuote").CryptoWithdrawalQuoteView | undefined;
67
+ quoteAmount: string;
68
+ /** Destination-token units, absent until the quote matches what is typed. */
69
+ receiveAmount: string | undefined;
70
+ receiveUsd: number | undefined;
71
+ receiveFloorUsd: number | undefined;
72
+ isQuoteLoading: boolean;
73
+ isQuoteError: boolean;
74
+ isSettled: boolean;
75
+ isAmountBelowFee: boolean;
76
+ /**
77
+ * The amount step's own gate: `ctaBlocker` also weighs the recipient, which
78
+ * isn't asked for until the step after.
79
+ */
80
+ amountError: string | undefined;
81
+ canContinue: boolean;
82
+ input: string;
83
+ setInput: (next: string) => void;
84
+ inUsd: boolean;
85
+ swapDenomination: () => void;
86
+ canSwapDenomination: boolean;
87
+ amountUsd: string | undefined;
88
+ amount: string;
89
+ setAmount: import("react").Dispatch<import("react").SetStateAction<string>>;
90
+ };
91
+ //# sourceMappingURL=useCryptoWithdrawalForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCryptoWithdrawalForm.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAKhC,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAWxE,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,cAAc,CAAA;AAmB7E,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,mBAAmB,EACnB,oBAA2B,GAC5B,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAC3B,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;;;;;;;;;;IAgJG;;;;OAIG;0BACmB,MAAM;;;;;;;;;IA0B5B;;;;OAIG;;IAGH,qDAAqD;;IAErD,qEAAqE;;IAIrE,kFAAkF;;IAElF;;;;OAIG;;;;IAWH,6EAA6E;;;;;;;;IAS7E;;;OAGG;;;;;;;;;;;EAmBN"}
@@ -0,0 +1,37 @@
1
+ import type { WithdrawalFlowCallbacks, WithdrawalFlowConfig } from '../flow/withdrawalFlowConfig';
2
+ import type { CryptoWithdrawalForm } from './useCryptoWithdrawalForm';
3
+ /**
4
+ * Signing the withdrawal {@link CryptoWithdrawalForm} describes: the press, the
5
+ * once-only hand-off to the outcome, and what the step shows while either is in
6
+ * flight.
7
+ *
8
+ * Held apart from the step that renders it so the money path's invariants — one
9
+ * hand-off, the source the signature was actually raised against, nothing
10
+ * executed but the quote on screen — can be exercised without a rendered screen.
11
+ */
12
+ /** What the recipient step is showing the withdrawal will land as. */
13
+ interface ReceiveLabels {
14
+ usdLabel: string | undefined;
15
+ tokenLabel: string | undefined;
16
+ }
17
+ export declare function useCryptoWithdrawalSubmit({ config, callbacks, form, receiveLabels, onSubmitted, }: {
18
+ config: WithdrawalFlowConfig;
19
+ callbacks: WithdrawalFlowCallbacks;
20
+ /** The withdrawal being built, which is what gets signed. */
21
+ form: CryptoWithdrawalForm;
22
+ receiveLabels: ReceiveLabels;
23
+ onSubmitted: (result: {
24
+ txHash: string;
25
+ amountLabel: string;
26
+ } & ReceiveLabels) => void;
27
+ }): {
28
+ isSubmitting: boolean;
29
+ /** The button holds for the price and the screening too, not only the signature. */
30
+ isBusy: boolean;
31
+ /** An unrecoverable failure from the last attempt, in the user's words. */
32
+ executionErrorText: string | undefined;
33
+ /** Executes the quote on screen. `form.canSubmit` is what gates the press. */
34
+ submit: () => void;
35
+ };
36
+ export {};
37
+ //# sourceMappingURL=useCryptoWithdrawalSubmit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCryptoWithdrawalSubmit.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalSubmit.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAKrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE;;;;;;;;GAQG;AACH,sEAAsE;AACtE,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B;AAED,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,SAAS,EACT,IAAI,EACJ,aAAa,EACb,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,SAAS,EAAE,uBAAuB,CAAA;IAClC,6DAA6D;IAC7D,IAAI,EAAE,oBAAoB,CAAA;IAC1B,aAAa,EAAE,aAAa,CAAA;IAC5B,WAAW,EAAE,CACX,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,aAAa,KAC5D,IAAI,CAAA;CACV;;IA4CG,oFAAoF;;IAEpF,2EAA2E;;IAK3E,8EAA8E;;EAqBjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCryptoWithdrawalValidation.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,0BAA0B;IACzC,oEAAoE;IACpE,sBAAsB,EAAE,OAAO,CAAA;IAC/B,gBAAgB,EAAE,0BAA0B,CAAA;IAC5C,8EAA8E;IAC9E,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,0BAA0B,CAiC7B"}
1
+ {"version":3,"file":"useCryptoWithdrawalValidation.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAIrC,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,0BAA0B;IACzC,oEAAoE;IACpE,sBAAsB,EAAE,OAAO,CAAA;IAC/B,gBAAgB,EAAE,0BAA0B,CAAA;IAC5C,8EAA8E;IAC9E,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,0BAA0B,CA2C7B"}
@@ -0,0 +1,20 @@
1
+ import type { WithdrawalToken } from '../flow/withdrawalFlowConfig';
2
+ /**
3
+ * Spot USD price of the source token, for the USD floor and ceiling the host
4
+ * configures (`getMinWithdrawalUSD` / `getMaxWithdrawalUSD`).
5
+ *
6
+ * A dollar stablecoin is priced from its symbol and never fetched, as web's
7
+ * `useAssetAddressPrice` does — it is the common withdrawal source, and the
8
+ * amount screen was waiting on a round trip to be told a dollar is a dollar.
9
+ *
10
+ * `0` means "unknown", which is what the core validator reads as "no price" —
11
+ * so a failed or in-flight lookup leaves the USD limits inert rather than
12
+ * judging an amount against a made-up rate. Per-token limits and the balance
13
+ * check are unaffected either way.
14
+ *
15
+ * Not every source has a price: Lighter's L2 assets are addressed by index, not
16
+ * by an ERC-20 funkit's price API knows, so that lookup 404s and core's Relay
17
+ * fallback is what prices them.
18
+ */
19
+ export declare function useSourceTokenUsdPrice(sourceToken: WithdrawalToken): number;
20
+ //# sourceMappingURL=useSourceTokenUsdPrice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSourceTokenUsdPrice.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useSourceTokenUsdPrice.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAanE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAuC3E"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The amount as the user types it, and which denomination they are typing in.
3
+ *
4
+ * - `amount` never changes meaning: the quote, the validation and the signature
5
+ * are all in source-token units, so when typing in dollars the typed figure
6
+ * is held here and `amount` is what it converts to.
7
+ * - Held with the form rather than in the screen, which unmounts on the way to
8
+ * the recipient — local state would drop both on Continue.
9
+ */
10
+ export declare function useWithdrawalAmountInput({ amount, setAmount, sourceUsdPrice, sourceDecimals, }: {
11
+ /** The withdrawal amount, in source-token units. */
12
+ amount: string;
13
+ setAmount: (amount: string) => void;
14
+ /** Spot USD price of the source token; `0` is the price hook's "unknown". */
15
+ sourceUsdPrice: number;
16
+ /** Fraction digits the source token carries, once they're known. */
17
+ sourceDecimals: number | undefined;
18
+ }): {
19
+ /** What to show and edit: dollars when {@link inUsd}, else token units. */
20
+ input: string;
21
+ setInput: (next: string) => void;
22
+ inUsd: boolean;
23
+ /**
24
+ * Switches denomination, converting the amount rather than clearing it.
25
+ *
26
+ * - Deliberately does not re-price against a rate that moved since the
27
+ * figure was typed: rewriting what someone entered, under them, is worse
28
+ * than showing it at the rate they entered it at.
29
+ * - The staleness is bounded by refreshing the price on the way into this
30
+ * screen rather than while it is open.
31
+ */
32
+ swapDenomination: () => void;
33
+ /** Offering the swap without a rate would promise one we don't have. */
34
+ canSwapDenomination: boolean;
35
+ /** What the amount is worth, or `undefined` when nothing prices it. */
36
+ amountUsd: string | undefined;
37
+ };
38
+ //# sourceMappingURL=useWithdrawalAmountInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWithdrawalAmountInput.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalAmountInput.ts"],"names":[],"mappings":"AA0CA;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,SAAS,EACT,cAAc,EACd,cAAc,GACf,EAAE;IACD,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAA;IACtB,oEAAoE;IACpE,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;CACnC;IAqDG,2EAA2E;;qBAtBpE,MAAM;;IA0Bb;;;;;;;;OAQG;;IAEH,wEAAwE;;IAExE,uEAAuE;;EAS1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"useWithdrawalDestinationTokens.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalDestinationTokens.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAKnE,eAAO,MAAM,uCAAuC,2BAA2B,CAAA;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,oCAAoC;IACnD,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,yEAAyE;IACzE,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACjE,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,mBAAmB,GACpB,EAAE;IACD,WAAW,EAAE,eAAe,CAAA;IAC5B,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,GAAG,oCAAoC,CA2EvC"}
1
+ {"version":3,"file":"useWithdrawalDestinationTokens.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalDestinationTokens.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAKnE,eAAO,MAAM,uCAAuC,2BAA2B,CAAA;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,oCAAoC;IACnD,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,yEAAyE;IACzE,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACjE,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,mBAAmB,GACpB,EAAE;IACD,WAAW,EAAE,eAAe,CAAA;IAC5B,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,GAAG,oCAAoC,CAiFvC"}
@@ -9,8 +9,8 @@ export interface WithdrawalRiskResult {
9
9
  * Chainalysis screening for the recipient.
10
10
  *
11
11
  * **Fails closed**: callers must require `isRisky === false`, so in-flight and
12
- * errored both block. The chain id only gates the query — risk is a property of
13
- * the address, so it stays out of the key (web does the same).
12
+ * errored both block. The chain id scopes the screen to the destination chain,
13
+ * so it is part of the key (web does the same).
14
14
  */
15
15
  export declare function useWithdrawalRisk(address: string, chainId: number | undefined): WithdrawalRiskResult;
16
16
  //# sourceMappingURL=useWithdrawalRisk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWithdrawalRisk.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalRisk.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;AAEzD,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,oBAAoB,CAkCtB"}
1
+ {"version":3,"file":"useWithdrawalRisk.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalRisk.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;AAEzD,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,oBAAoB,CAmCtB"}
@@ -4,11 +4,15 @@ export declare const WITHDRAWAL_STATUS_QUERY_KEY = "withdrawalStatus";
4
4
  * Whether there is still anything to learn by asking again. Split out because
5
5
  * the "record never appeared" bound is the part worth testing directly — driving
6
6
  * it through the query would mean waiting out real poll intervals.
7
+ *
8
+ * Only answered-and-absent counts against the bound: a network or 5xx failure
9
+ * says nothing about the record, so giving up on one would abandon a withdrawal
10
+ * we could still have followed.
7
11
  */
8
- export declare function shouldKeepPollingStatus({ status, hasRecord, failedFetches, }: {
12
+ export declare function shouldKeepPollingStatus({ status, hasRecord, notFoundFetches, }: {
9
13
  status: RelayExecutionStatus | undefined;
10
14
  hasRecord: boolean;
11
- failedFetches: number;
15
+ notFoundFetches: number;
12
16
  }): boolean;
13
17
  export interface WithdrawalStatusResult {
14
18
  status: RelayExecutionStatus | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useWithdrawalStatus.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAErB,MAAM,kBAAkB,CAAA;AAUzB,eAAO,MAAM,2BAA2B,qBAAqB,CAAA;AAU7D;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,SAAS,EACT,aAAa,GACd,EAAE;IACD,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,GAAG,OAAO,CAGV;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACxC,wEAAwE;IACxE,WAAW,EAAE,OAAO,CAAA;IACpB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAA;IACjB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,sBAAsB,CA0CxB"}
1
+ {"version":3,"file":"useWithdrawalStatus.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAErB,MAAM,kBAAkB,CAAA;AAYzB,eAAO,MAAM,2BAA2B,qBAAqB,CAAA;AAU7D;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,SAAS,EACT,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;CACxB,GAAG,OAAO,CAKV;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACxC,wEAAwE;IACxE,WAAW,EAAE,OAAO,CAAA;IACpB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAA;IACjB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,sBAAsB,CAwDxB"}
@@ -11,14 +11,18 @@ export type WithdrawCtaBlocker = 'enter-recipient' | 'unsupported-recipient' | '
11
11
  /**
12
12
  * Amount limits, resolved from the host's callbacks.
13
13
  *
14
- * `sourceTokenUsdPrice` is 0 until a price source is wired: the core validator
15
- * reads that as "no price", which leaves the USD floor and ceiling inert while
16
- * still applying the per-token minimum and the balance check. It is not a
17
- * stand-in value — 0 genuinely means unknown here.
14
+ * `sourceTokenUsdPrice` of 0 means unknown, not free: the core validator reads
15
+ * it as "no price" and leaves the USD floor and ceiling inert, while the
16
+ * per-token minimum and the balance check still apply. Sources whose price the
17
+ * API cannot resolve (Lighter's index-addressed L2 assets) run that way.
18
18
  */
19
- export declare function validateAmount({ config, sourceToken, amount, balance, }: {
19
+ export declare function validateAmount({ config, sourceToken, sourceTokenUsdPrice, sourceTokenDecimals, amount, balance, }: {
20
20
  config: Pick<WithdrawalFlowConfig, 'getMinWithdrawalAmount' | 'getMinWithdrawalUSD' | 'getMaxWithdrawalUSD' | 'getMaxWithdrawalAmount'>;
21
21
  sourceToken: WithdrawalToken;
22
+ /** Spot USD price of one source token; 0 when unknown. */
23
+ sourceTokenUsdPrice?: number;
24
+ /** Fraction digits the source carries; caps how fine the USD floor gets. */
25
+ sourceTokenDecimals?: number;
22
26
  amount: string;
23
27
  balance: string | undefined;
24
28
  }): WithdrawalAmountValidation;
@@ -45,4 +49,18 @@ export declare function getWithdrawCtaBlocker({ recipientAddress, isRecipientBla
45
49
  amountValidation: WithdrawalAmountValidation;
46
50
  destinationToken: WithdrawalToken | undefined;
47
51
  }): WithdrawCtaBlocker | undefined;
52
+ /**
53
+ * Whether the venue's flat fee leaves nothing for the quote to price.
54
+ *
55
+ * - Two ways to leave nothing: the fee meets or exceeds the amount, or the
56
+ * remainder is under one base unit of the source token — `parseUnits` trims
57
+ * the extra digits, so a positive remainder still reaches the quote as 0.
58
+ * - Undefined `decimals` means the read hasn't landed. The quote can't run
59
+ * without it either, so the fee-only verdict stands until it does.
60
+ */
61
+ export declare function isAmountBelowQuoteFee({ amount, feeTokenAmount, decimals, }: {
62
+ amount: string;
63
+ feeTokenAmount: number;
64
+ decimals: number | undefined;
65
+ }): boolean;
48
66
  //# sourceMappingURL=validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAMrC;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,uBAAuB,GACvB,0BAA0B,GAC1B,cAAc,GACd,cAAc,GACd,oBAAoB,GACpB,mBAAmB,CAAA;AAEvB;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,IAAI,CACV,oBAAoB,EAClB,wBAAwB,GACxB,qBAAqB,GACrB,qBAAqB,GACrB,wBAAwB,CAC3B,CAAA;IACD,WAAW,EAAE,eAAe,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,0BAA0B,CAkC7B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C,GAAG,OAAO,CAOV;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,EACN,gBAAgB,EAChB,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,uBAAuB,EAAE,OAAO,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,0BAA0B,CAAA;IAC5C,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C,GAAG,kBAAkB,GAAG,SAAS,CAiBjC"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAMhC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAMrC;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,uBAAuB,GACvB,0BAA0B,GAC1B,cAAc,GACd,cAAc,GACd,oBAAoB,GACpB,mBAAmB,CAAA;AAEvB;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,IAAI,CACV,oBAAoB,EAClB,wBAAwB,GACxB,qBAAqB,GACrB,qBAAqB,GACrB,wBAAwB,CAC3B,CAAA;IACD,WAAW,EAAE,eAAe,CAAA;IAC5B,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,0BAA0B,CAmC7B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C,GAAG,OAAO,CASV;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,EACN,gBAAgB,EAChB,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,uBAAuB,EAAE,OAAO,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,0BAA0B,CAAA;IAC5C,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C,GAAG,kBAAkB,GAAG,SAAS,CA6BjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,cAAc,EACd,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,GAAG,OAAO,CAiBV"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect-rn",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "React Native bindings for @funkit/connect. Re-exports the headless @funkit/connect-core logic; the RN platform halves (Restyle theme, WebView Swapped transport, Transfer/Swapped screens, logging) land in later releases.",
5
5
  "files": [
6
6
  "dist",
@@ -36,9 +36,9 @@
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
38
  "@shopify/restyle": "^2.4.5",
39
- "@funkit/api-base": "7.0.0",
39
+ "@funkit/api-base": "7.1.1",
40
40
  "@funkit/chains": "2.2.0",
41
- "@funkit/connect-core": "3.0.0"
41
+ "@funkit/connect-core": "4.0.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@gorhom/bottom-sheet": ">=5",
@@ -50,6 +50,7 @@
50
50
  "react": ">=18",
51
51
  "react-native": ">=0.74",
52
52
  "react-native-gesture-handler": ">=2.0.0",
53
+ "react-native-haptic-feedback": ">=2",
53
54
  "react-native-qrcode-svg": ">=6.3.0",
54
55
  "react-native-reanimated": ">=3.0.0",
55
56
  "react-native-safe-area-context": ">=4.0.0",
@@ -71,6 +72,7 @@
71
72
  "react-dom": "^19.0.0",
72
73
  "react-native": "0.85.3",
73
74
  "react-native-gesture-handler": "2.31.2",
75
+ "react-native-haptic-feedback": "^3.0.0",
74
76
  "react-native-qrcode-svg": "6.3.21",
75
77
  "react-native-reanimated": "4.3.1",
76
78
  "react-native-safe-area-context": "5.4.0",
@@ -93,6 +95,9 @@
93
95
  "peerDependenciesMeta": {
94
96
  "@react-native-clipboard/clipboard": {
95
97
  "optional": true
98
+ },
99
+ "react-native-haptic-feedback": {
100
+ "optional": true
96
101
  }
97
102
  },
98
103
  "scripts": {