@funkit/connect-rn 3.10.0 → 3.11.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 (170) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/chunk-5IWD2I7N.js +94 -0
  3. package/dist/chunk-5IWD2I7N.js.map +7 -0
  4. package/dist/chunk-75TJE4HO.js +1656 -0
  5. package/dist/chunk-75TJE4HO.js.map +7 -0
  6. package/dist/chunk-EL2UG6WN.js +1690 -0
  7. package/dist/chunk-EL2UG6WN.js.map +7 -0
  8. package/dist/chunk-FTD4HETU.js +94 -0
  9. package/dist/chunk-FTD4HETU.js.map +7 -0
  10. package/dist/chunk-KQEQB6MZ.js +94 -0
  11. package/dist/chunk-KQEQB6MZ.js.map +7 -0
  12. package/dist/chunk-L26YKVZ7.js +94 -0
  13. package/dist/chunk-L26YKVZ7.js.map +7 -0
  14. package/dist/chunk-LIOQVZV4.js +1753 -0
  15. package/dist/chunk-LIOQVZV4.js.map +7 -0
  16. package/dist/chunk-LKILQNGD.js +1655 -0
  17. package/dist/chunk-LKILQNGD.js.map +7 -0
  18. package/dist/chunk-LPJDURB5.js +1675 -0
  19. package/dist/chunk-LPJDURB5.js.map +7 -0
  20. package/dist/chunk-MJ4QBNTD.js +94 -0
  21. package/dist/chunk-MJ4QBNTD.js.map +7 -0
  22. package/dist/chunk-NNEV7EFP.js +94 -0
  23. package/dist/chunk-NNEV7EFP.js.map +7 -0
  24. package/dist/chunk-NYW4N5SQ.js +1328 -0
  25. package/dist/chunk-NYW4N5SQ.js.map +7 -0
  26. package/dist/chunk-OI54J6E6.js +1951 -0
  27. package/dist/chunk-OI54J6E6.js.map +7 -0
  28. package/dist/chunk-OIXZMXFJ.js +1681 -0
  29. package/dist/chunk-OIXZMXFJ.js.map +7 -0
  30. package/dist/chunk-OQVPCP4W.js +94 -0
  31. package/dist/chunk-OQVPCP4W.js.map +7 -0
  32. package/dist/chunk-PHUM52HD.js +1542 -0
  33. package/dist/chunk-PHUM52HD.js.map +7 -0
  34. package/dist/chunk-Q5OFOALX.js +94 -0
  35. package/dist/chunk-Q5OFOALX.js.map +7 -0
  36. package/dist/chunk-QNAMNQZX.js +1660 -0
  37. package/dist/chunk-QNAMNQZX.js.map +7 -0
  38. package/dist/chunk-RTQ4MJHE.js +1209 -0
  39. package/dist/chunk-RTQ4MJHE.js.map +7 -0
  40. package/dist/chunk-V23HUIDS.js +1744 -0
  41. package/dist/chunk-V23HUIDS.js.map +7 -0
  42. package/dist/chunk-V4LN3XNI.js +94 -0
  43. package/dist/chunk-V4LN3XNI.js.map +7 -0
  44. package/dist/chunk-VE6N6BHJ.js +94 -0
  45. package/dist/chunk-VE6N6BHJ.js.map +7 -0
  46. package/dist/chunk-VL4WQDU7.js +1654 -0
  47. package/dist/chunk-VL4WQDU7.js.map +7 -0
  48. package/dist/chunk-X2X2GENE.js +94 -0
  49. package/dist/chunk-X2X2GENE.js.map +7 -0
  50. package/dist/clients/lighter.js +1 -1
  51. package/dist/clients/nado/withdrawalSubmit.d.ts.map +1 -1
  52. package/dist/clients/nado.js +8 -6
  53. package/dist/clients/nado.js.map +2 -2
  54. package/dist/index.d.ts +2 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +2632 -1255
  57. package/dist/index.js.map +4 -4
  58. package/dist/src/branding/BrandingContext.d.ts +15 -0
  59. package/dist/src/branding/BrandingContext.d.ts.map +1 -0
  60. package/dist/src/components/AccountBalanceChip.d.ts +19 -0
  61. package/dist/src/components/AccountBalanceChip.d.ts.map +1 -0
  62. package/dist/src/components/AmountChipsRow.d.ts +17 -0
  63. package/dist/src/components/AmountChipsRow.d.ts.map +1 -0
  64. package/dist/src/components/AmountInput.d.ts +40 -0
  65. package/dist/src/components/AmountInput.d.ts.map +1 -0
  66. package/dist/src/components/AttributionWatermark.d.ts +10 -0
  67. package/dist/src/components/AttributionWatermark.d.ts.map +1 -0
  68. package/dist/src/components/Grabber.d.ts +7 -1
  69. package/dist/src/components/Grabber.d.ts.map +1 -1
  70. package/dist/src/components/PillButton.d.ts +3 -1
  71. package/dist/src/components/PillButton.d.ts.map +1 -1
  72. package/dist/src/components/RollingAmount.d.ts +20 -0
  73. package/dist/src/components/RollingAmount.d.ts.map +1 -0
  74. package/dist/src/components/SegmentedControl.d.ts +12 -0
  75. package/dist/src/components/SegmentedControl.d.ts.map +1 -0
  76. package/dist/src/components/WithdrawFeeSummary.d.ts +23 -0
  77. package/dist/src/components/WithdrawFeeSummary.d.ts.map +1 -0
  78. package/dist/src/components/v2/AmountDisplay.d.ts.map +1 -1
  79. package/dist/src/components/v2/NumPad.d.ts +1 -1
  80. package/dist/src/components/v2/NumPad.d.ts.map +1 -1
  81. package/dist/src/components/v2/QuickAmountsRow.d.ts +1 -1
  82. package/dist/src/components/v2/QuickAmountsRow.d.ts.map +1 -1
  83. package/dist/src/fiat/FiatStatusScreen.d.ts +19 -0
  84. package/dist/src/fiat/FiatStatusScreen.d.ts.map +1 -0
  85. package/dist/src/fiat/SurfaceSlot.d.ts +8 -0
  86. package/dist/src/fiat/SurfaceSlot.d.ts.map +1 -0
  87. package/dist/src/fiat/ctaLabel.d.ts +19 -0
  88. package/dist/src/fiat/ctaLabel.d.ts.map +1 -0
  89. package/dist/src/fiat/providers/TransakApplePaySurface.d.ts +7 -0
  90. package/dist/src/fiat/providers/TransakApplePaySurface.d.ts.map +1 -0
  91. package/dist/src/fiat/renderCaptureSurface.d.ts +12 -0
  92. package/dist/src/fiat/renderCaptureSurface.d.ts.map +1 -0
  93. package/dist/src/fiat/stepDetails.d.ts +18 -0
  94. package/dist/src/fiat/stepDetails.d.ts.map +1 -0
  95. package/dist/src/flow/BackdropBlurContext.d.ts +9 -0
  96. package/dist/src/flow/BackdropBlurContext.d.ts.map +1 -0
  97. package/dist/src/flow/DepositAmountStep.d.ts.map +1 -1
  98. package/dist/src/flow/DepositFlowContent.d.ts +1 -3
  99. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  100. package/dist/src/flow/FiatDepositAmountStep.d.ts +9 -0
  101. package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -0
  102. package/dist/src/flow/FlowSheet.d.ts +34 -5
  103. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  104. package/dist/src/flow/FunkitFlowProvider.d.ts +1 -1
  105. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  106. package/dist/src/flow/WithdrawalFlowContent.d.ts +1 -4
  107. package/dist/src/flow/WithdrawalFlowContent.d.ts.map +1 -1
  108. package/dist/src/flow/depositFlowConfig.d.ts +24 -3
  109. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  110. package/dist/src/hooks/useGuardedAmountInput.d.ts +9 -5
  111. package/dist/src/hooks/useGuardedAmountInput.d.ts.map +1 -1
  112. package/dist/src/hooks/usePressScale.d.ts +18 -0
  113. package/dist/src/hooks/usePressScale.d.ts.map +1 -0
  114. package/dist/src/identity/IdentityContext.d.ts +10 -0
  115. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  116. package/dist/src/logging/consoleLogTransport.d.ts +10 -0
  117. package/dist/src/logging/consoleLogTransport.d.ts.map +1 -0
  118. package/dist/src/providers/FunkitProvider.d.ts +6 -5
  119. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  120. package/dist/src/providers/NativeCapabilitiesContext.d.ts +43 -0
  121. package/dist/src/providers/NativeCapabilitiesContext.d.ts.map +1 -0
  122. package/dist/src/screens/AddMoneyScreen.d.ts +86 -0
  123. package/dist/src/screens/AddMoneyScreen.d.ts.map +1 -0
  124. package/dist/src/screens/AvailableChainsScreen.d.ts +32 -0
  125. package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -0
  126. package/dist/src/screens/DepositAmountScreen.d.ts +27 -11
  127. package/dist/src/screens/DepositAmountScreen.d.ts.map +1 -1
  128. package/dist/src/screens/FeeDetailsScreen.d.ts +36 -0
  129. package/dist/src/screens/FeeDetailsScreen.d.ts.map +1 -0
  130. package/dist/src/screens/NetworkSelector.d.ts +31 -0
  131. package/dist/src/screens/NetworkSelector.d.ts.map +1 -0
  132. package/dist/src/screens/SelectDestinationScreen.d.ts +19 -0
  133. package/dist/src/screens/SelectDestinationScreen.d.ts.map +1 -0
  134. package/dist/src/screens/WithdrawCryptoCta.d.ts +20 -0
  135. package/dist/src/screens/WithdrawCryptoCta.d.ts.map +1 -0
  136. package/dist/src/screens/WithdrawCryptoForm.d.ts +28 -0
  137. package/dist/src/screens/WithdrawCryptoForm.d.ts.map +1 -0
  138. package/dist/src/screens/WithdrawCryptoScreen.d.ts +17 -0
  139. package/dist/src/screens/WithdrawCryptoScreen.d.ts.map +1 -0
  140. package/dist/src/statsig/StatsigProviderRN.d.ts +7 -0
  141. package/dist/src/statsig/StatsigProviderRN.d.ts.map +1 -0
  142. package/dist/src/statsig/useClientBootstrapInitRN.d.ts +4 -0
  143. package/dist/src/statsig/useClientBootstrapInitRN.d.ts.map +1 -0
  144. package/dist/src/theme/buildFunkitTheme.d.ts +8 -0
  145. package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -1
  146. package/dist/src/theme/restyle.d.ts +264 -0
  147. package/dist/src/theme/restyle.d.ts.map +1 -1
  148. package/dist/src/theme/toRestyleTheme.d.ts +24 -0
  149. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
  150. package/dist/src/theme/tokens.d.ts +4 -1
  151. package/dist/src/theme/tokens.d.ts.map +1 -1
  152. package/dist/src/utils/formatAmount.d.ts +5 -0
  153. package/dist/src/utils/formatAmount.d.ts.map +1 -1
  154. package/dist/src/utils/motion.d.ts +5 -0
  155. package/dist/src/utils/motion.d.ts.map +1 -1
  156. package/dist/src/utils/numpadInput.d.ts +2 -1
  157. package/dist/src/utils/numpadInput.d.ts.map +1 -1
  158. package/dist/src/utils/v2/amountGlyphs.d.ts +5 -4
  159. package/dist/src/utils/v2/amountGlyphs.d.ts.map +1 -1
  160. package/dist/src/utils/v2/numberFormat.d.ts +36 -0
  161. package/dist/src/utils/v2/numberFormat.d.ts.map +1 -0
  162. package/dist/src/utils/withAlpha.d.ts +13 -0
  163. package/dist/src/utils/withAlpha.d.ts.map +1 -0
  164. package/dist/src/withdrawal/publicClient.d.ts +10 -0
  165. package/dist/src/withdrawal/publicClient.d.ts.map +1 -0
  166. package/dist/src/withdrawal/useCryptoWithdrawalForm.d.ts.map +1 -1
  167. package/dist/src/withdrawal/useCryptoWithdrawalValidation.d.ts.map +1 -1
  168. package/dist/src/withdrawal/validation.d.ts +5 -1
  169. package/dist/src/withdrawal/validation.d.ts.map +1 -1
  170. package/package.json +6 -4
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../clients/nado/useNadoWithdrawal.ts", "../../clients/nado/nadoWithdrawalConfig.ts", "../../clients/nado/withdrawalSubmit.ts", "../../clients/nado/withdrawalErrors.ts"],
4
- "sourcesContent": ["import {\n getMaxEnterableAmount,\n getSequencerFee,\n resolveNadoSubaccount,\n useInvalidateNadoMaxWithdrawable,\n useNadoFeeRates,\n useNadoMaxWithdrawable,\n} from '@funkit/connect-core/clients/nado'\nimport { useMemo, useRef } from 'react'\nimport type { Hex } from 'viem'\n\nimport type {\n WithdrawalFlowConfig,\n WithdrawalMethodOption,\n} from '../../src/flow/withdrawalFlowConfig'\nimport { logger } from '../../src/logging/logger'\nimport { useFunkitTranslation } from '../../src/providers/FunkitI18nProvider'\nimport { useSourceTokenUsdPrice } from '../../src/withdrawal/useSourceTokenUsdPrice'\nimport {\n NADO_METHOD_ID,\n NADO_MIN_WITHDRAWAL_TOKENS,\n NADO_MOBILE_SPOT_LEVERAGE,\n NADO_USDT0_SOURCE_TOKEN,\n type NadoWithdrawalFlowConfig,\n} from './nadoWithdrawalConfig'\nimport { createNadoWithdrawalSubmit } from './withdrawalSubmit'\n\n/**\n * The Nado method to hand `beginWithdrawal`, carrying the config it runs, so the\n * SDK never holds Nado config itself.\n *\n * Empty until the subaccount id can be built \u2014 every Nado query is keyed on it.\n */\nexport function useNadoWithdrawal({\n nado,\n config,\n}: {\n nado: NadoWithdrawalFlowConfig | undefined\n /** Title, callbacks and wallet carry over. Absent until the host has one. */\n config: WithdrawalFlowConfig | undefined\n}): WithdrawalMethodOption[] {\n const { t } = useFunkitTranslation()\n const sourceOption = NADO_USDT0_SOURCE_TOKEN\n const subaccount = useNadoSubaccount(nado)\n\n const { data: feeRates, isFetched: isFeeSettled } = useNadoFeeRates({\n sender: subaccount,\n logger,\n })\n // Asked rather than derived from a spot balance: only Nado's own accounting\n // sees margin, locked collateral and account health.\n const { data: maxWithdrawableX18, isFetched: isMaxSettled } =\n useNadoMaxWithdrawable({\n productId: subaccount ? sourceOption.productId : undefined,\n sender: subaccount,\n spotLeverage: NADO_MOBILE_SPOT_LEVERAGE,\n logger,\n })\n // `beginWithdrawal` snapshots the config, so the getter reads a ref rather\n // than the value of the render it was built in.\n const maxWithdrawableRef = useRef(maxWithdrawableX18)\n maxWithdrawableRef.current = maxWithdrawableX18\n\n const sequencerFee = getSequencerFee(feeRates, sourceOption)\n const sourceToken = {\n chainId: sourceOption.tokenChainId,\n address: sourceOption.tokenAddress,\n symbol: sourceOption.symbol,\n decimals: sourceOption.decimals,\n }\n const sourceTokenUsdPrice = useSourceTokenUsdPrice(sourceToken)\n const invalidateMaxWithdrawable = useInvalidateNadoMaxWithdrawable()\n // `isFetched` is true after a failure too, so settled is not known.\n const hasMaximum = maxWithdrawableX18 !== undefined\n\n // Withheld only while the first answer is still in flight.\n if (!nado || !config || !subaccount || !isFeeSettled || !isMaxSettled) {\n return []\n }\n\n return [\n {\n id: NADO_METHOD_ID,\n title: t('withdrawCrypto.methodTitle'),\n subtitle: t('withdrawCrypto.methodSubtitle'),\n config: {\n ...config,\n sourceToken,\n sourceTokens: [{ token: sourceToken, iconSrc: sourceOption.iconSrc }],\n // Unknown is not zero \u2014 omitted, validation skips the check rather\n // than rejecting every amount. Submit re-reads the real maximum.\n withdrawalSourceTokenBalance: hasMaximum\n ? () =>\n getMaxEnterableAmount({\n maxWithdrawableX18: maxWithdrawableRef.current,\n sequencerFee: sequencerFee.x18,\n decimals: sourceOption.decimals,\n })\n : undefined,\n defaultReceiveToken: config.defaultReceiveToken ?? sourceOption.symbol,\n getMinWithdrawalAmount:\n config.getMinWithdrawalAmount ?? (() => NADO_MIN_WITHDRAWAL_TOKENS),\n // Taken off the amount before quoting, and billed as source-chain cost.\n quoteInputFeeTokens: sequencerFee.tokenAmount,\n extraSourceGasUsd: sequencerFee.tokenAmount * sourceTokenUsdPrice,\n submitWithdrawal: createNadoWithdrawalSubmit({\n nado,\n subaccount,\n sourceToken: sourceOption,\n wallet: config.withdrawalWallet,\n onWithdrawn: invalidateMaxWithdrawable,\n }),\n },\n },\n ]\n}\n\nfunction useNadoSubaccount(\n nado: NadoWithdrawalFlowConfig | undefined,\n): Hex | undefined {\n const { walletAddress, subaccountName } = nado ?? {}\n return useMemo(\n () => resolveNadoSubaccount({ walletAddress, subaccountName, logger }),\n [walletAddress, subaccountName],\n )\n}\n", "import {\n INK_CHAIN_ID,\n type NadoWithdrawalSourceOption,\n} from '@funkit/connect-core/clients/nado'\nimport type { Address } from 'viem'\n\n/** Row identity, routing and logs. */\nexport const NADO_METHOD_ID = 'nado'\n\n/**\n * Sent explicitly on every call: Nado treats an absent `spot_leverage` as\n * `true`, so omitting it would open a margin position for a user with no\n * affordance to see or close one.\n */\nexport const NADO_MOBILE_SPOT_LEVERAGE = false\n\n/**\n * Below this the sequencer fee and routing costs eat most of the withdrawal.\n * Token units, calibrated for USDT0 \u2014 the only source mobile ships.\n */\nexport const NADO_MIN_WITHDRAWAL_TOKENS = 4\n\n/**\n * The only source mobile withdraws. Web has the integrator declare the whole\n * product table because it offers every listing; mobile ships the one it\n * supports rather than making every host restate Nado's ids.\n */\nexport const NADO_USDT0_SOURCE_TOKEN: NadoWithdrawalSourceOption = {\n productId: 0,\n symbol: 'USDT0',\n decimals: 6,\n tokenAddress: '0x0200C29006150606B650577BBE7B6248F58470c1',\n tokenChainId: `${INK_CHAIN_ID}`,\n iconSrc: undefined,\n}\n\n/**\n * Nado withdrawal, as the host configures it. Mirrors web's\n * `NadoWithdrawalConfig` where the concepts overlap, minus the borrow toggle and\n * the multi-product picker.\n */\nexport interface NadoWithdrawalFlowConfig {\n /** Must also be the signer \u2014 Nado rejects linked signers on withdrawals. */\n walletAddress: Address\n /** Omit for the default subaccount. Packed with the wallet; capped at 12 bytes. */\n subaccountName?: string\n /**\n * Awaited after the user taps Withdraw, before anything is minted or signed.\n * Throw to abort.\n */\n onBeforeSign?: () => Promise<void> | void\n}\n", "/**\n * The Nado withdrawal money path: generate a Fun deposit address, sign Nado's\n * gasless `withdraw_collateral_v2` with `sendTo` pointing at it, and submit.\n *\n * Port of web's `createNadoWithdrawalCallback` over {@link WithdrawalClient}.\n * Two differences from web:\n * - The amount arrives **already net** of the sequencer fee, where web's\n * callback deducts it itself. Deducting again would short the user a fee.\n * - Borrowing is never offered, so `spot_leverage` is always `false`.\n *\n * Re-submitting belongs to the gateway, which reuses the signed nonce; a retry\n * from here would mint a fresh one and withdraw twice.\n */\n\nimport {\n NADO_API_KEY,\n initializeCheckoutTokenTransferAddress,\n} from '@funkit/api-base'\nimport {\n type WithdrawalClient,\n isEVMAddressEquivalent,\n isUserRejectedError,\n safeBigInt,\n toWithdrawalAmountBaseUnit,\n} from '@funkit/connect-core'\nimport {\n INK_CHAIN_ID,\n NADO_WITHDRAWAL_ACTION_TYPE,\n NadoGatewayError,\n type NadoWithdrawalSourceOption,\n NadoWithdrawalUnconfirmedError,\n buildWithdrawCollateralV2TypedData,\n executeNadoWithdrawCollateralV2,\n getNadoMaxWithdrawable,\n getNadoTxNonce,\n isExpectedNadoWithdrawalFailure,\n x18ToRawBaseUnit,\n} from '@funkit/connect-core/clients/nado'\nimport type { Address, Hex } from 'viem'\n\nimport type { CustomWithdrawalSubmission } from '../../src/flow/withdrawalFlowConfig'\nimport { i18n } from '../../src/locales/i18n'\nimport { logger } from '../../src/logging/logger'\nimport type { NadoWithdrawalFlowConfig } from './nadoWithdrawalConfig'\nimport { NADO_MOBILE_SPOT_LEVERAGE } from './nadoWithdrawalConfig'\nimport { toNadoWithdrawalErrorMessage } from './withdrawalErrors'\n\n/** Steps are logged on failure so a support ticket names the stage it died at. */\ntype NadoWithdrawalStep =\n | 'validate'\n | 'beforeSign'\n | 'switchChain'\n | 'uda'\n | 'sign'\n | 'execute'\n\n/** A wiring bug, not a user-correctable condition; the user gets the generic line. */\nclass NadoWithdrawalInputError extends Error {}\n\n/** Already logged where it was raised, so the catch neither re-logs nor escalates. */\nclass NadoWithdrawalUserError extends Error {}\n\nexport interface NadoWithdrawalSubmitContext {\n nado: NadoWithdrawalFlowConfig\n /** Packed id of the subaccount being debited (`buildNadoSubaccountId`). */\n subaccount: Hex\n sourceToken: NadoWithdrawalSourceOption\n /** The host's signer. Nado needs `signTypedData`; a client without it fails. */\n wallet: WithdrawalClient\n /** Drops the cached max, or a follow-up withdrawal opens on a stale balance. */\n onWithdrawn: () => void\n}\n\n/**\n * The `submitWithdrawal` the crypto rail runs in place of a relay execution.\n * Resolves with the deposit address Nado was told to send to \u2014 nothing of ours\n * goes on-chain, so there is no transaction to return.\n */\nexport function createNadoWithdrawalSubmit({\n nado,\n subaccount,\n sourceToken,\n wallet,\n onWithdrawn,\n}: NadoWithdrawalSubmitContext) {\n return async ({\n recipientAddress,\n destinationToken,\n amountTokenUnits,\n }: CustomWithdrawalSubmission): Promise<{ depositAddress: Address }> => {\n const { walletAddress, onBeforeSign } = nado\n const { productId, decimals } = sourceToken\n let step: NadoWithdrawalStep = 'validate'\n\n try {\n // Already net of the fee \u2014 see the note at the top of the file.\n const netRawAmount = toWithdrawalAmountBaseUnit(\n amountTokenUnits,\n decimals,\n )\n if (netRawAmount <= 0n) {\n logger.warn('nado:withdrawal:amountTooLow', {\n productId,\n amountTokenUnits,\n })\n throw new NadoWithdrawalUserError(\n i18n.t('withdrawNado.errorAmountTooLow'),\n )\n }\n\n logger.info('nado:withdrawal:start', {\n productId,\n spotLeverage: NADO_MOBILE_SPOT_LEVERAGE,\n decimals,\n amountTokenUnits,\n toChainId: destinationToken.chainId,\n toToken: destinationToken.address,\n recipientAddress,\n })\n\n await assertWithinMaxWithdrawable({\n subaccount,\n productId,\n decimals,\n netRawAmount,\n })\n\n // Before the deposit address: a declined switch or swapped account would\n // otherwise orphan one.\n step = 'beforeSign'\n try {\n await onBeforeSign?.()\n } catch (error) {\n // The documented way for a host to abort \u2014 a user choice, not a failure.\n const message = error instanceof Error ? error.message : String(error)\n logger.warn('nado:withdrawal:abortedByHost', {\n walletAddress,\n errorMessage: message,\n })\n throw new NadoWithdrawalUserError(message)\n }\n\n step = 'switchChain'\n await ensureWalletOnInk(wallet)\n await assertOwnerIsSigner({ walletAddress, wallet })\n\n step = 'uda'\n const { depositAddr } = await initializeCheckoutTokenTransferAddress({\n apiKey: NADO_API_KEY,\n // The owner wallet is the stable per-user id, and is what the completion\n // tracker later looks the arrival up by.\n userId: walletAddress,\n recipientAddr: recipientAddress,\n toChainId: destinationToken.chainId,\n toTokenAddress: destinationToken.address,\n sourceOfFund: `balance|nado|${walletAddress}`,\n // Attribution only \u2014 forces a separate address from Nado deposits.\n actionType: NADO_WITHDRAWAL_ACTION_TYPE,\n logger,\n clientMetadata: { isWithdrawal: true },\n })\n logger.info('nado:withdrawal:udaGenerated', {\n depositAddr,\n productId,\n recipientAddress,\n })\n\n step = 'sign'\n // Immediately before signing: a stale nonce is rejected outright.\n const nonce = await getNadoTxNonce(walletAddress, { logger })\n const signature = await signWithdrawal({\n wallet,\n subaccount,\n productId,\n netRawAmount,\n nonce,\n sendTo: depositAddr as Address,\n })\n logger.info('nado:withdrawal:signed', {\n nonce: nonce.toString(),\n depositAddr,\n productId,\n })\n\n step = 'execute'\n try {\n await executeNadoWithdrawCollateralV2(\n {\n sender: subaccount,\n productId,\n amount: netRawAmount,\n nonce,\n sendTo: depositAddr,\n signature,\n spotLeverage: NADO_MOBILE_SPOT_LEVERAGE,\n },\n { logger },\n )\n } catch (error) {\n // An unconfirmed execute may still have debited. Re-reading Nado is\n // right either way; keeping the cached maximum is only right if it did\n // not land.\n if (error instanceof NadoWithdrawalUnconfirmedError) {\n onWithdrawn()\n }\n throw error\n }\n logger.info('nado:withdrawal:executeSubmitted', {\n nonce: nonce.toString(),\n depositAddr,\n productId,\n netRawAmount: netRawAmount.toString(),\n })\n onWithdrawn()\n\n return { depositAddress: depositAddr as Address }\n } catch (error) {\n throw toThrownWithdrawalError(error, {\n step,\n walletAddress,\n subaccount,\n recipientAddress,\n toChainId: destinationToken.chainId,\n })\n }\n }\n}\n\n/**\n * The signature is off-chain and gasless, but wallets reject an\n * `eth_signTypedData_v4` whose domain chainId isn't the active chain \u2014 so the\n * wallet still has to sit on Ink to sign it.\n */\nasync function ensureWalletOnInk(wallet: WithdrawalClient): Promise<void> {\n const connectedChainId = await wallet.getChainId()\n if (connectedChainId === INK_CHAIN_ID) {\n return\n }\n logger.info('nado:withdrawal:switchingChain', {\n fromChainId: connectedChainId,\n })\n try {\n await wallet.switchChain(INK_CHAIN_ID)\n } catch (error) {\n if (isUserRejectedError(error)) {\n throw error\n }\n logger.warn('nado:withdrawal:switchChainFailed', {\n fromChainId: connectedChainId,\n errorMessage: error instanceof Error ? error.message : String(error),\n })\n throw new NadoWithdrawalUserError(i18n.t('withdrawCrypto.errorSwitchChain'))\n }\n}\n\n/** Nado only honors owner-wallet signatures, so a switched account must fail loudly. */\nasync function assertOwnerIsSigner({\n walletAddress,\n wallet,\n}: {\n walletAddress: Address\n wallet: WithdrawalClient\n}): Promise<void> {\n const connectedAddress = wallet.address()\n if (\n connectedAddress &&\n isEVMAddressEquivalent({\n firstAddress: connectedAddress,\n secondAddress: walletAddress,\n })\n ) {\n return\n }\n logger.warn('nado:withdrawal:signerMismatch', {\n walletAddress,\n connectedAddress: connectedAddress ?? null,\n })\n throw new NadoWithdrawalUserError(i18n.t('withdrawNado.errorSignerMismatch'))\n}\n\n/** `signTypedData` is optional on the client, but Nado cannot withdraw without it. */\nasync function signWithdrawal({\n wallet,\n subaccount,\n productId,\n netRawAmount,\n nonce,\n sendTo,\n}: {\n wallet: WithdrawalClient\n subaccount: Hex\n productId: number\n netRawAmount: bigint\n nonce: bigint\n sendTo: Address\n}): Promise<Hex> {\n if (!wallet.signTypedData) {\n throw new NadoWithdrawalInputError(\n 'withdrawalWallet cannot signTypedData, which Nado withdrawals require',\n )\n }\n const signature = await wallet.signTypedData(\n buildWithdrawCollateralV2TypedData({\n sender: subaccount,\n productId,\n amount: netRawAmount,\n nonce,\n sendTo,\n }),\n )\n return signature as Hex\n}\n\n/**\n * Race backstop, not the primary gate: the amount screen already blocks this,\n * but account health can move between render and submit \u2014 and catching it here\n * saves a wallet prompt and a burnt nonce. `max_withdrawable` is already net of\n * the fee, so it compares against the signed amount.\n */\nasync function assertWithinMaxWithdrawable({\n subaccount,\n productId,\n decimals,\n netRawAmount,\n}: {\n subaccount: Hex\n productId: number\n decimals: number\n netRawAmount: bigint\n}): Promise<void> {\n const maxWithdrawableX18 = await getNadoMaxWithdrawable(\n { productId, sender: subaccount, spotLeverage: NADO_MOBILE_SPOT_LEVERAGE },\n { logger },\n )\n const maxRawAmount = x18ToRawBaseUnit(\n safeBigInt(maxWithdrawableX18, 0n),\n decimals,\n )\n if (netRawAmount <= maxRawAmount) {\n return\n }\n logger.warn('nado:withdrawal:exceedsMaxWithdrawable', {\n productId,\n netRawAmount: netRawAmount.toString(),\n maxRawAmount: maxRawAmount.toString(),\n })\n // No figure in the copy: on a race it is stale by the time it is read.\n throw new NadoWithdrawalUserError(i18n.t('withdrawNado.errorBalanceChanged'))\n}\n\n/**\n * Failure \u2192 what the user sees, and at what severity.\n *\n * - Recovered states (declined signature, precondition rejections, expected\n * gateway codes) log at WARN; ERROR is reserved for what is worth alerting on.\n * - Gateway failures map to Nado copy; everything else already carries a usable\n * message and passes through.\n */\nfunction toThrownWithdrawalError(\n error: unknown,\n context: {\n step: NadoWithdrawalStep\n walletAddress: Address\n subaccount: Hex\n recipientAddress: Address\n toChainId: string\n },\n): unknown {\n const logContext = {\n ...context,\n nadoErrorCode:\n error instanceof NadoGatewayError ? (error.errorCode ?? null) : null,\n nadoErrorKind: error instanceof NadoGatewayError ? error.kind : null,\n errorMessage: error instanceof Error ? error.message : String(error),\n }\n // A user choice, not a failure to alert on.\n if (isUserRejectedError(error)) {\n logger.warn('nado:withdrawal:rejected', logContext)\n return error\n }\n // Already warned where it was raised, with the context only that site had.\n if (error instanceof NadoWithdrawalUserError) {\n return error\n }\n if (error instanceof NadoWithdrawalInputError) {\n logger.error('nado:withdrawal:invalidInput', error, logContext)\n return new Error(i18n.t('withdrawCrypto.errorGeneric'))\n }\n // Already logged at the gateway; the copy steers away from a retry.\n if (error instanceof NadoWithdrawalUnconfirmedError) {\n return new Error(toNadoWithdrawalErrorMessage(error))\n }\n if (!(error instanceof NadoGatewayError)) {\n logger.error(\n 'nado:withdrawal:failed',\n error instanceof Error ? error : new Error(String(error)),\n logContext,\n )\n return error\n }\n if (isExpectedNadoWithdrawalFailure(error)) {\n logger.warn('nado:withdrawal:gatewayRejected', logContext)\n } else {\n logger.error('nado:withdrawal:gatewayFailed', error, logContext)\n }\n return new Error(toNadoWithdrawalErrorMessage(error))\n}\n", "/**\n * Nado failure code \u2192 the copy the user sees. Core classifies; each platform\n * owns its map, and an exhaustive `Record` fails the build on a new code.\n *\n * Thunks rather than a key lookup: `t(KEYS[code])` passes a non-literal to `t`,\n * which `.ast-grep/rules/i18n-t-string-literal.yml` rejects.\n */\n\nimport {\n type NadoWithdrawalFailure,\n toNadoWithdrawalFailure,\n} from '@funkit/connect-core/clients/nado'\n\nimport { i18n } from '../../src/locales/i18n'\n\nconst MESSAGE_FOR: Record<NadoWithdrawalFailure, () => string> = {\n generic: () => i18n.t('withdrawCrypto.errorGeneric'),\n network: () => i18n.t('withdrawNado.errorNetwork'),\n rateLimited: () => i18n.t('withdrawNado.errorRateLimited'),\n // Borrowing is off on mobile, so this only ever means the balance moved.\n exceedsBorrowLimit: () => i18n.t('withdrawNado.errorBalanceChanged'),\n invalidNonce: () => i18n.t('withdrawNado.errorInvalidNonce'),\n noPriorDeposit: () => i18n.t('withdrawNado.errorNoPriorDeposit'),\n withdrawRisk: () => i18n.t('withdrawNado.errorWithdrawRisk'),\n unconfirmed: () => i18n.t('withdrawNado.errorUnconfirmed'),\n}\n\nexport function toNadoWithdrawalErrorMessage(error: unknown): string {\n return MESSAGE_FOR[toNadoWithdrawalFailure(error)]()\n}\n"],
5
- "mappings": ";;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,cAAc;;;ACRhC;AAAA,EACE;AAAA,OAEK;AAIA,IAAM,iBAAiB;AAOvB,IAAM,4BAA4B;AAMlC,IAAM,6BAA6B;AAOnC,IAAM,0BAAsD;AAAA,EACjE,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc;AAAA,EACd,cAAc,GAAG,YAAY;AAAA,EAC7B,SAAS;AACX;;;ACpBA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;AC7BP;AAAA,EAEE;AAAA,OACK;AAIP,IAAM,cAA2D;AAAA,EAC/D,SAAS,MAAM,KAAK,EAAE,6BAA6B;AAAA,EACnD,SAAS,MAAM,KAAK,EAAE,2BAA2B;AAAA,EACjD,aAAa,MAAM,KAAK,EAAE,+BAA+B;AAAA;AAAA,EAEzD,oBAAoB,MAAM,KAAK,EAAE,kCAAkC;AAAA,EACnE,cAAc,MAAM,KAAK,EAAE,gCAAgC;AAAA,EAC3D,gBAAg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ACN,GAAG;AAAA,QACH;AAAA,QACA,cAAc,CAAC,EAAE,OAAO,aAAa,SAAS,aAAa,QAAQ,CAAC;AAAA;AAAA;AAAA,QAGpE,8BAA8B,aAC1B,MACE,sBAAsB;AAAA,UACpB,oBAAoB,mBAAmB;AAAA,UACvC,cAAc,aAAa;AAAA,UAC3B,UAAU,aAAa;AAAA,QACzB,CAAC,IACH;AAAA,QACJ,qBAAqB,OAAO,uBAAuB,aAAa;AAAA,QAChE,wBACE,OAAO,2BAA2B,MAAM;AAAA;AAAA,QAE1C,qBAAqB,aAAa;AAAA,QAClC,mBAAmB,aAAa,cAAc;AAAA,QAC9C,kBAAkB,2BAA2B;AAAA,UAC3C;AAAA,UACA;AAAA,UACA,aAAa;AAAA,UACb,QAAQ,OAAO;AAAA,UACf,aAAa;AAAA,QACf,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,kBACP,MACiB;AACjB,QAAM,EAAE,eAAe,eAAe,IAAI,QAAQ,CAAC;AACnD,SAAO;AAAA,IACL,MAAM,sBAAsB,EAAE,eAAe,gBAAgB,OAAO,CAAC;AAAA,IACrE,CAAC,eAAe,cAAc;AAAA,EAChC;AACF;",
4
+ "sourcesContent": ["import {\n getMaxEnterableAmount,\n getSequencerFee,\n resolveNadoSubaccount,\n useInvalidateNadoMaxWithdrawable,\n useNadoFeeRates,\n useNadoMaxWithdrawable,\n} from '@funkit/connect-core/clients/nado'\nimport { useMemo, useRef } from 'react'\nimport type { Hex } from 'viem'\n\nimport type {\n WithdrawalFlowConfig,\n WithdrawalMethodOption,\n} from '../../src/flow/withdrawalFlowConfig'\nimport { logger } from '../../src/logging/logger'\nimport { useFunkitTranslation } from '../../src/providers/FunkitI18nProvider'\nimport { useSourceTokenUsdPrice } from '../../src/withdrawal/useSourceTokenUsdPrice'\nimport {\n NADO_METHOD_ID,\n NADO_MIN_WITHDRAWAL_TOKENS,\n NADO_MOBILE_SPOT_LEVERAGE,\n NADO_USDT0_SOURCE_TOKEN,\n type NadoWithdrawalFlowConfig,\n} from './nadoWithdrawalConfig'\nimport { createNadoWithdrawalSubmit } from './withdrawalSubmit'\n\n/**\n * The Nado method to hand `beginWithdrawal`, carrying the config it runs, so the\n * SDK never holds Nado config itself.\n *\n * Empty until the subaccount id can be built \u2014 every Nado query is keyed on it.\n */\nexport function useNadoWithdrawal({\n nado,\n config,\n}: {\n nado: NadoWithdrawalFlowConfig | undefined\n /** Title, callbacks and wallet carry over. Absent until the host has one. */\n config: WithdrawalFlowConfig | undefined\n}): WithdrawalMethodOption[] {\n const { t } = useFunkitTranslation()\n const sourceOption = NADO_USDT0_SOURCE_TOKEN\n const subaccount = useNadoSubaccount(nado)\n\n const { data: feeRates, isFetched: isFeeSettled } = useNadoFeeRates({\n sender: subaccount,\n logger,\n })\n // Asked rather than derived from a spot balance: only Nado's own accounting\n // sees margin, locked collateral and account health.\n const { data: maxWithdrawableX18, isFetched: isMaxSettled } =\n useNadoMaxWithdrawable({\n productId: subaccount ? sourceOption.productId : undefined,\n sender: subaccount,\n spotLeverage: NADO_MOBILE_SPOT_LEVERAGE,\n logger,\n })\n // `beginWithdrawal` snapshots the config, so the getter reads a ref rather\n // than the value of the render it was built in.\n const maxWithdrawableRef = useRef(maxWithdrawableX18)\n maxWithdrawableRef.current = maxWithdrawableX18\n\n const sequencerFee = getSequencerFee(feeRates, sourceOption)\n const sourceToken = {\n chainId: sourceOption.tokenChainId,\n address: sourceOption.tokenAddress,\n symbol: sourceOption.symbol,\n decimals: sourceOption.decimals,\n }\n const sourceTokenUsdPrice = useSourceTokenUsdPrice(sourceToken)\n const invalidateMaxWithdrawable = useInvalidateNadoMaxWithdrawable()\n // `isFetched` is true after a failure too, so settled is not known.\n const hasMaximum = maxWithdrawableX18 !== undefined\n\n // Withheld only while the first answer is still in flight.\n if (!nado || !config || !subaccount || !isFeeSettled || !isMaxSettled) {\n return []\n }\n\n return [\n {\n id: NADO_METHOD_ID,\n title: t('withdrawCrypto.methodTitle'),\n subtitle: t('withdrawCrypto.methodSubtitle'),\n config: {\n ...config,\n sourceToken,\n sourceTokens: [{ token: sourceToken, iconSrc: sourceOption.iconSrc }],\n // Unknown is not zero \u2014 omitted, validation skips the check rather\n // than rejecting every amount. Submit re-reads the real maximum.\n withdrawalSourceTokenBalance: hasMaximum\n ? () =>\n getMaxEnterableAmount({\n maxWithdrawableX18: maxWithdrawableRef.current,\n sequencerFee: sequencerFee.x18,\n decimals: sourceOption.decimals,\n })\n : undefined,\n defaultReceiveToken: config.defaultReceiveToken ?? sourceOption.symbol,\n getMinWithdrawalAmount:\n config.getMinWithdrawalAmount ?? (() => NADO_MIN_WITHDRAWAL_TOKENS),\n // Taken off the amount before quoting, and billed as source-chain cost.\n quoteInputFeeTokens: sequencerFee.tokenAmount,\n extraSourceGasUsd: sequencerFee.tokenAmount * sourceTokenUsdPrice,\n submitWithdrawal: createNadoWithdrawalSubmit({\n nado,\n subaccount,\n sourceToken: sourceOption,\n wallet: config.withdrawalWallet,\n onWithdrawn: invalidateMaxWithdrawable,\n }),\n },\n },\n ]\n}\n\nfunction useNadoSubaccount(\n nado: NadoWithdrawalFlowConfig | undefined,\n): Hex | undefined {\n const { walletAddress, subaccountName } = nado ?? {}\n return useMemo(\n () => resolveNadoSubaccount({ walletAddress, subaccountName, logger }),\n [walletAddress, subaccountName],\n )\n}\n", "import {\n INK_CHAIN_ID,\n type NadoWithdrawalSourceOption,\n} from '@funkit/connect-core/clients/nado'\nimport type { Address } from 'viem'\n\n/** Row identity, routing and logs. */\nexport const NADO_METHOD_ID = 'nado'\n\n/**\n * Sent explicitly on every call: Nado treats an absent `spot_leverage` as\n * `true`, so omitting it would open a margin position for a user with no\n * affordance to see or close one.\n */\nexport const NADO_MOBILE_SPOT_LEVERAGE = false\n\n/**\n * Below this the sequencer fee and routing costs eat most of the withdrawal.\n * Token units, calibrated for USDT0 \u2014 the only source mobile ships.\n */\nexport const NADO_MIN_WITHDRAWAL_TOKENS = 4\n\n/**\n * The only source mobile withdraws. Web has the integrator declare the whole\n * product table because it offers every listing; mobile ships the one it\n * supports rather than making every host restate Nado's ids.\n */\nexport const NADO_USDT0_SOURCE_TOKEN: NadoWithdrawalSourceOption = {\n productId: 0,\n symbol: 'USDT0',\n decimals: 6,\n tokenAddress: '0x0200C29006150606B650577BBE7B6248F58470c1',\n tokenChainId: `${INK_CHAIN_ID}`,\n iconSrc: undefined,\n}\n\n/**\n * Nado withdrawal, as the host configures it. Mirrors web's\n * `NadoWithdrawalConfig` where the concepts overlap, minus the borrow toggle and\n * the multi-product picker.\n */\nexport interface NadoWithdrawalFlowConfig {\n /** Must also be the signer \u2014 Nado rejects linked signers on withdrawals. */\n walletAddress: Address\n /** Omit for the default subaccount. Packed with the wallet; capped at 12 bytes. */\n subaccountName?: string\n /**\n * Awaited after the user taps Withdraw, before anything is minted or signed.\n * Throw to abort.\n */\n onBeforeSign?: () => Promise<void> | void\n}\n", "/**\n * The Nado withdrawal money path: generate a Fun deposit address, sign Nado's\n * gasless `withdraw_collateral_v2` with `sendTo` pointing at it, and submit.\n *\n * Port of web's `createNadoWithdrawalCallback` over {@link WithdrawalClient}.\n * Two differences from web:\n * - The amount arrives **already net** of the sequencer fee, where web's\n * callback deducts it itself. Deducting again would short the user a fee.\n * - Borrowing is never offered, so `spot_leverage` is always `false`.\n *\n * Re-submitting belongs to the gateway, which reuses the signed nonce; a retry\n * from here would mint a fresh one and withdraw twice.\n */\n\nimport {\n type FunAddress,\n NADO_API_KEY,\n initializeCheckoutTokenTransferAddress,\n} from '@funkit/api-base'\nimport {\n type WithdrawalClient,\n isEVMAddressEquivalent,\n isUserRejectedError,\n normalizeRecipientAddress,\n safeBigInt,\n toWithdrawalAmountBaseUnit,\n} from '@funkit/connect-core'\nimport {\n INK_CHAIN_ID,\n NADO_WITHDRAWAL_ACTION_TYPE,\n NadoGatewayError,\n type NadoWithdrawalSourceOption,\n NadoWithdrawalUnconfirmedError,\n buildWithdrawCollateralV2TypedData,\n executeNadoWithdrawCollateralV2,\n getNadoMaxWithdrawable,\n getNadoTxNonce,\n isExpectedNadoWithdrawalFailure,\n x18ToRawBaseUnit,\n} from '@funkit/connect-core/clients/nado'\nimport type { Address, Hex } from 'viem'\n\nimport type { CustomWithdrawalSubmission } from '../../src/flow/withdrawalFlowConfig'\nimport { i18n } from '../../src/locales/i18n'\nimport { logger } from '../../src/logging/logger'\nimport type { NadoWithdrawalFlowConfig } from './nadoWithdrawalConfig'\nimport { NADO_MOBILE_SPOT_LEVERAGE } from './nadoWithdrawalConfig'\nimport { toNadoWithdrawalErrorMessage } from './withdrawalErrors'\n\n/** Steps are logged on failure so a support ticket names the stage it died at. */\ntype NadoWithdrawalStep =\n | 'validate'\n | 'beforeSign'\n | 'switchChain'\n | 'uda'\n | 'sign'\n | 'execute'\n\n/** A wiring bug, not a user-correctable condition; the user gets the generic line. */\nclass NadoWithdrawalInputError extends Error {}\n\n/** Already logged where it was raised, so the catch neither re-logs nor escalates. */\nclass NadoWithdrawalUserError extends Error {}\n\nexport interface NadoWithdrawalSubmitContext {\n nado: NadoWithdrawalFlowConfig\n /** Packed id of the subaccount being debited (`buildNadoSubaccountId`). */\n subaccount: Hex\n sourceToken: NadoWithdrawalSourceOption\n /** The host's signer. Nado needs `signTypedData`; a client without it fails. */\n wallet: WithdrawalClient\n /** Drops the cached max, or a follow-up withdrawal opens on a stale balance. */\n onWithdrawn: () => void\n}\n\n/**\n * The `submitWithdrawal` the crypto rail runs in place of a relay execution.\n * Resolves with the deposit address Nado was told to send to \u2014 nothing of ours\n * goes on-chain, so there is no transaction to return.\n */\nexport function createNadoWithdrawalSubmit({\n nado,\n subaccount,\n sourceToken,\n wallet,\n onWithdrawn,\n}: NadoWithdrawalSubmitContext) {\n return async ({\n recipientAddress,\n destinationToken,\n amountTokenUnits,\n }: CustomWithdrawalSubmission): Promise<{ depositAddress: Address }> => {\n const { walletAddress, onBeforeSign } = nado\n const { productId, decimals } = sourceToken\n const recipientAddr = normalizeRecipientAddress(recipientAddress)\n\n let step: NadoWithdrawalStep = 'validate'\n\n try {\n // Already net of the fee \u2014 see the note at the top of the file.\n const netRawAmount = toWithdrawalAmountBaseUnit(\n amountTokenUnits,\n decimals,\n )\n if (netRawAmount <= 0n) {\n logger.warn('nado:withdrawal:amountTooLow', {\n productId,\n amountTokenUnits,\n })\n throw new NadoWithdrawalUserError(\n i18n.t('withdrawNado.errorAmountTooLow'),\n )\n }\n\n logger.info('nado:withdrawal:start', {\n productId,\n spotLeverage: NADO_MOBILE_SPOT_LEVERAGE,\n decimals,\n amountTokenUnits,\n toChainId: destinationToken.chainId,\n toToken: destinationToken.address,\n recipientAddress: recipientAddr,\n })\n\n await assertWithinMaxWithdrawable({\n subaccount,\n productId,\n decimals,\n netRawAmount,\n })\n\n // Before the deposit address: a declined switch or swapped account would\n // otherwise orphan one.\n step = 'beforeSign'\n try {\n await onBeforeSign?.()\n } catch (error) {\n // The documented way for a host to abort \u2014 a user choice, not a failure.\n const message = error instanceof Error ? error.message : String(error)\n logger.warn('nado:withdrawal:abortedByHost', {\n walletAddress,\n errorMessage: message,\n })\n throw new NadoWithdrawalUserError(message)\n }\n\n step = 'switchChain'\n await ensureWalletOnInk(wallet)\n await assertOwnerIsSigner({ walletAddress, wallet })\n\n step = 'uda'\n const { depositAddr } = await initializeCheckoutTokenTransferAddress({\n apiKey: NADO_API_KEY,\n // The owner wallet is the stable per-user id, and is what the completion\n // tracker later looks the arrival up by.\n userId: walletAddress,\n recipientAddr,\n toChainId: destinationToken.chainId,\n toTokenAddress: destinationToken.address,\n sourceOfFund: `balance|nado|${walletAddress}`,\n // Attribution only \u2014 forces a separate address from Nado deposits.\n actionType: NADO_WITHDRAWAL_ACTION_TYPE,\n logger,\n clientMetadata: { isWithdrawal: true },\n })\n logger.info('nado:withdrawal:udaGenerated', {\n depositAddr,\n productId,\n recipientAddress: recipientAddr,\n })\n\n step = 'sign'\n // Immediately before signing: a stale nonce is rejected outright.\n const nonce = await getNadoTxNonce(walletAddress, { logger })\n const signature = await signWithdrawal({\n wallet,\n subaccount,\n productId,\n netRawAmount,\n nonce,\n sendTo: depositAddr as Address,\n })\n logger.info('nado:withdrawal:signed', {\n nonce: nonce.toString(),\n depositAddr,\n productId,\n })\n\n step = 'execute'\n try {\n await executeNadoWithdrawCollateralV2(\n {\n sender: subaccount,\n productId,\n amount: netRawAmount,\n nonce,\n sendTo: depositAddr,\n signature,\n spotLeverage: NADO_MOBILE_SPOT_LEVERAGE,\n },\n { logger },\n )\n } catch (error) {\n // An unconfirmed execute may still have debited. Re-reading Nado is\n // right either way; keeping the cached maximum is only right if it did\n // not land.\n if (error instanceof NadoWithdrawalUnconfirmedError) {\n onWithdrawn()\n }\n throw error\n }\n logger.info('nado:withdrawal:executeSubmitted', {\n nonce: nonce.toString(),\n depositAddr,\n productId,\n netRawAmount: netRawAmount.toString(),\n })\n onWithdrawn()\n\n return { depositAddress: depositAddr as Address }\n } catch (error) {\n throw toThrownWithdrawalError(error, {\n step,\n walletAddress,\n subaccount,\n recipientAddress: recipientAddr,\n toChainId: destinationToken.chainId,\n })\n }\n }\n}\n\n/**\n * The signature is off-chain and gasless, but wallets reject an\n * `eth_signTypedData_v4` whose domain chainId isn't the active chain \u2014 so the\n * wallet still has to sit on Ink to sign it.\n */\nasync function ensureWalletOnInk(wallet: WithdrawalClient): Promise<void> {\n const connectedChainId = await wallet.getChainId()\n if (connectedChainId === INK_CHAIN_ID) {\n return\n }\n logger.info('nado:withdrawal:switchingChain', {\n fromChainId: connectedChainId,\n })\n try {\n await wallet.switchChain(INK_CHAIN_ID)\n } catch (error) {\n if (isUserRejectedError(error)) {\n throw error\n }\n logger.warn('nado:withdrawal:switchChainFailed', {\n fromChainId: connectedChainId,\n errorMessage: error instanceof Error ? error.message : String(error),\n })\n throw new NadoWithdrawalUserError(i18n.t('withdrawCrypto.errorSwitchChain'))\n }\n}\n\n/** Nado only honors owner-wallet signatures, so a switched account must fail loudly. */\nasync function assertOwnerIsSigner({\n walletAddress,\n wallet,\n}: {\n walletAddress: Address\n wallet: WithdrawalClient\n}): Promise<void> {\n const connectedAddress = wallet.address()\n if (\n connectedAddress &&\n isEVMAddressEquivalent({\n firstAddress: connectedAddress,\n secondAddress: walletAddress,\n })\n ) {\n return\n }\n logger.warn('nado:withdrawal:signerMismatch', {\n walletAddress,\n connectedAddress: connectedAddress ?? null,\n })\n throw new NadoWithdrawalUserError(i18n.t('withdrawNado.errorSignerMismatch'))\n}\n\n/** `signTypedData` is optional on the client, but Nado cannot withdraw without it. */\nasync function signWithdrawal({\n wallet,\n subaccount,\n productId,\n netRawAmount,\n nonce,\n sendTo,\n}: {\n wallet: WithdrawalClient\n subaccount: Hex\n productId: number\n netRawAmount: bigint\n nonce: bigint\n sendTo: Address\n}): Promise<Hex> {\n if (!wallet.signTypedData) {\n throw new NadoWithdrawalInputError(\n 'withdrawalWallet cannot signTypedData, which Nado withdrawals require',\n )\n }\n const signature = await wallet.signTypedData(\n buildWithdrawCollateralV2TypedData({\n sender: subaccount,\n productId,\n amount: netRawAmount,\n nonce,\n sendTo,\n }),\n )\n return signature as Hex\n}\n\n/**\n * Race backstop, not the primary gate: the amount screen already blocks this,\n * but account health can move between render and submit \u2014 and catching it here\n * saves a wallet prompt and a burnt nonce. `max_withdrawable` is already net of\n * the fee, so it compares against the signed amount.\n */\nasync function assertWithinMaxWithdrawable({\n subaccount,\n productId,\n decimals,\n netRawAmount,\n}: {\n subaccount: Hex\n productId: number\n decimals: number\n netRawAmount: bigint\n}): Promise<void> {\n const maxWithdrawableX18 = await getNadoMaxWithdrawable(\n { productId, sender: subaccount, spotLeverage: NADO_MOBILE_SPOT_LEVERAGE },\n { logger },\n )\n const maxRawAmount = x18ToRawBaseUnit(\n safeBigInt(maxWithdrawableX18, 0n),\n decimals,\n )\n if (netRawAmount <= maxRawAmount) {\n return\n }\n logger.warn('nado:withdrawal:exceedsMaxWithdrawable', {\n productId,\n netRawAmount: netRawAmount.toString(),\n maxRawAmount: maxRawAmount.toString(),\n })\n // No figure in the copy: on a race it is stale by the time it is read.\n throw new NadoWithdrawalUserError(i18n.t('withdrawNado.errorBalanceChanged'))\n}\n\n/**\n * Failure \u2192 what the user sees, and at what severity.\n *\n * - Recovered states (declined signature, precondition rejections, expected\n * gateway codes) log at WARN; ERROR is reserved for what is worth alerting on.\n * - Gateway failures map to Nado copy; everything else already carries a usable\n * message and passes through.\n */\nfunction toThrownWithdrawalError(\n error: unknown,\n context: {\n step: NadoWithdrawalStep\n walletAddress: Address\n subaccount: Hex\n recipientAddress: FunAddress\n toChainId: string\n },\n): unknown {\n const logContext = {\n ...context,\n nadoErrorCode:\n error instanceof NadoGatewayError ? (error.errorCode ?? null) : null,\n nadoErrorKind: error instanceof NadoGatewayError ? error.kind : null,\n errorMessage: error instanceof Error ? error.message : String(error),\n }\n // A user choice, not a failure to alert on.\n if (isUserRejectedError(error)) {\n logger.warn('nado:withdrawal:rejected', logContext)\n return error\n }\n // Already warned where it was raised, with the context only that site had.\n if (error instanceof NadoWithdrawalUserError) {\n return error\n }\n if (error instanceof NadoWithdrawalInputError) {\n logger.error('nado:withdrawal:invalidInput', error, logContext)\n return new Error(i18n.t('withdrawCrypto.errorGeneric'))\n }\n // Already logged at the gateway; the copy steers away from a retry.\n if (error instanceof NadoWithdrawalUnconfirmedError) {\n return new Error(toNadoWithdrawalErrorMessage(error))\n }\n if (!(error instanceof NadoGatewayError)) {\n logger.error(\n 'nado:withdrawal:failed',\n error instanceof Error ? error : new Error(String(error)),\n logContext,\n )\n return error\n }\n if (isExpectedNadoWithdrawalFailure(error)) {\n logger.warn('nado:withdrawal:gatewayRejected', logContext)\n } else {\n logger.error('nado:withdrawal:gatewayFailed', error, logContext)\n }\n return new Error(toNadoWithdrawalErrorMessage(error))\n}\n", "/**\n * Nado failure code \u2192 the copy the user sees. Core classifies; each platform\n * owns its map, and an exhaustive `Record` fails the build on a new code.\n *\n * Thunks rather than a key lookup: `t(KEYS[code])` passes a non-literal to `t`,\n * which `.ast-grep/rules/i18n-t-string-literal.yml` rejects.\n */\n\nimport {\n type NadoWithdrawalFailure,\n toNadoWithdrawalFailure,\n} from '@funkit/connect-core/clients/nado'\n\nimport { i18n } from '../../src/locales/i18n'\n\nconst MESSAGE_FOR: Record<NadoWithdrawalFailure, () => string> = {\n generic: () => i18n.t('withdrawCrypto.errorGeneric'),\n network: () => i18n.t('withdrawNado.errorNetwork'),\n rateLimited: () => i18n.t('withdrawNado.errorRateLimited'),\n // Borrowing is off on mobile, so this only ever means the balance moved.\n exceedsBorrowLimit: () => i18n.t('withdrawNado.errorBalanceChanged'),\n invalidNonce: () => i18n.t('withdrawNado.errorInvalidNonce'),\n noPriorDeposit: () => i18n.t('withdrawNado.errorNoPriorDeposit'),\n withdrawRisk: () => i18n.t('withdrawNado.errorWithdrawRisk'),\n unconfirmed: () => i18n.t('withdrawNado.errorUnconfirmed'),\n}\n\nexport function toNadoWithdrawalErrorMessage(error: unknown): string {\n return MESSAGE_FOR[toNadoWithdrawalFailure(error)]()\n}\n"],
5
+ "mappings": ";;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,cAAc;;;ACRhC;AAAA,EACE;AAAA,OAEK;AAIA,IAAM,iBAAiB;AAOvB,IAAM,4BAA4B;AAMlC,IAAM,6BAA6B;AAOnC,IAAM,0BAAsD;AAAA,EACjE,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,cAAc;AAAA,EACd,cAAc,GAAG,YAAY;AAAA,EAC7B,SAAS;AACX;;;ACpBA;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAC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/providers/useFunkitCheckout'
24
24
  export { useFunkitRecentDeposits, useFunkitRecentDepositsImpl, } from './src/history/useRecentDeposits';
25
25
  export { useCheckoutsListenerByUserId } from './src/history/useCheckoutsListenerByUserId';
26
26
  export type { PurifiedCheckoutHistoryItem } from '@funkit/connect-core';
27
- export type { DepositAmountEntryConfig, DepositFlowCallbacks, DepositFlowConfig, DynamicTargetAssetCandidate, } from './src/flow/depositFlowConfig';
27
+ export type { FiatProvider } from '@funkit/connect-core';
28
+ export type { DepositAmountEntryConfig, DepositFlowCallbacks, DepositFlowConfig, DynamicTargetAssetCandidate, FiatRailConfig, } from './src/flow/depositFlowConfig';
28
29
  export type { CustomWithdrawalSubmission, WithdrawalFlowCallbacks, WithdrawalFlowConfig, WithdrawalMethodOption, WithdrawalSourceTokenOption, WithdrawalSourceTokenParams, WithdrawalToken, } from './src/flow/withdrawalFlowConfig';
29
30
  export type { PaymentMethodOption, ReceiveTokenOption, } from './src/screens/SelectMethodScreen';
30
31
  export type { ChainOption } from './src/flow/depositFlowConfig';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAmBA,YAAY,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAK7B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAI7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC1D,YAAY,EAAE,oBAAoB,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