@funkit/connect 11.0.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/clients/{chunk-JD2J5K6S.js → chunk-2QYQNTOI.js} +153 -18
  3. package/dist/clients/chunk-63XTVHO3.js +19 -0
  4. package/dist/clients/{chunk-6CYZKITE.js → chunk-6T6URLBM.js} +1 -1
  5. package/dist/clients/chunk-A44M6EAG.js +160 -0
  6. package/dist/clients/chunk-A6OXZWCN.js +40 -0
  7. package/dist/clients/{chunk-LT4EWLDA.js → chunk-BPDLF2R6.js} +1 -0
  8. package/dist/clients/{chunk-2FSEE3AW.js → chunk-C53FRCUM.js} +2 -89
  9. package/dist/clients/{chunk-6PIIYPQK.js → chunk-EJKHMZW3.js} +4 -327
  10. package/dist/clients/chunk-FAYBQQNB.js +15 -0
  11. package/dist/clients/chunk-NAVU6W7V.js +89 -0
  12. package/dist/clients/{chunk-BNMZM23Q.js → chunk-OJZNF6EM.js} +2 -2
  13. package/dist/clients/chunk-PENJ5JGH.js +331 -0
  14. package/dist/clients/{chunk-C4SHJFOV.js → chunk-QIMCURVA.js} +9 -9
  15. package/dist/clients/{chunk-YFHTV7DT.js → chunk-SH3MHRHX.js} +1 -1
  16. package/dist/clients/chunk-SO756ELD.js +35 -0
  17. package/dist/clients/{chunk-MGQLVTSH.js → chunk-SYFHMTUO.js} +27 -21
  18. package/dist/clients/chunk-WVM4ZJD2.js +61 -0
  19. package/dist/clients/{chunk-L2KSNS7H.js → chunk-WZRW6WUM.js} +1 -1
  20. package/dist/clients/chunk-YMGRBJAS.js +302 -0
  21. package/dist/clients/chunk-YZSO4EMO.js +44 -0
  22. package/dist/clients/{chunk-2YWQL3AO.js → chunk-Z7HTQFEO.js} +26 -3
  23. package/dist/clients/fanatics.js +2 -1
  24. package/dist/clients/internal/nado/encoding.d.ts +5 -2
  25. package/dist/clients/internal/nado/encoding.js +1 -1
  26. package/dist/clients/internal/nado/errors.d.ts +14 -1
  27. package/dist/clients/internal/nado/errors.js +7 -3
  28. package/dist/clients/internal/nado/fetch.js +2 -2
  29. package/dist/clients/internal/nado/gateway.d.ts +19 -20
  30. package/dist/clients/internal/nado/gateway.js +3 -5
  31. package/dist/clients/internal/nado/hooks.d.ts +8 -2
  32. package/dist/clients/internal/nado/hooks.js +9 -9
  33. package/dist/clients/internal/nado/indexer.js +3 -3
  34. package/dist/clients/internal/nado/typedData.js +4 -37
  35. package/dist/clients/internal/nado/withdrawalCallback.d.ts +20 -0
  36. package/dist/clients/internal/nado/withdrawalCallback.js +20 -0
  37. package/dist/clients/internal/nado/withdrawalConfig.d.ts +8 -3
  38. package/dist/clients/internal/nado/withdrawalConfig.js +7 -3
  39. package/dist/clients/internal/nado/withdrawalErrors.d.ts +14 -0
  40. package/dist/clients/internal/nado/withdrawalErrors.js +11 -0
  41. package/dist/clients/internal/nado/withdrawalForm.d.ts +6 -7
  42. package/dist/clients/internal/nado/withdrawalForm.js +75 -96
  43. package/dist/clients/internal/nado/withdrawalStatus.d.ts +41 -0
  44. package/dist/clients/internal/nado/withdrawalStatus.js +231 -0
  45. package/dist/clients/internal/nado/withdrawalTypes.d.ts +21 -7
  46. package/dist/clients/lighter.css +18 -18
  47. package/dist/clients/lighter.js +7 -4
  48. package/dist/clients/mallard.js +4 -3
  49. package/dist/clients/nado.d.ts +67 -0
  50. package/dist/clients/nado.js +73 -0
  51. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +60 -60
  52. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +9 -6
  53. package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -2
  54. package/dist/clients/polymarket/index.css +60 -60
  55. package/dist/clients/polymarket/index.js +9 -6
  56. package/dist/clients/polymarket/polymarket.js +2 -1
  57. package/dist/consts/customers.d.ts +1 -1
  58. package/dist/hooks/track/analytics/events.d.ts +57 -0
  59. package/dist/hooks/track/analytics/mappers.d.ts +6 -0
  60. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +20 -0
  61. package/dist/hooks/track/useTrack.d.ts +2 -1
  62. package/dist/index.d.ts +1 -1
  63. package/dist/index.js +3044 -2602
  64. package/dist/modals/WithdrawalModal/NadoWithdrawalSuccess.d.ts +20 -0
  65. package/dist/providers/FunkitCheckoutContext/types.d.ts +0 -1
  66. package/dist/providers/GeneralWalletProvider.d.ts +1 -0
  67. package/dist/wallets/walletConnectors/index.js +41 -41
  68. package/package.json +3 -3
  69. package/dist/clients/chunk-SFDEST63.js +0 -18
  70. package/dist/clients/chunk-ZCCLJW6F.js +0 -99
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 11.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3e69426: Wire up Nado withdrawals to execute transfers
8
+ - edbd567: Nado's withdrawal balance now comes from Nado's `max_withdrawable` instead of a client-derived spot balance.
9
+
10
+ ### Patch Changes
11
+
12
+ - 4596831: Expose the active wallet connector ID to Connect consumers.
13
+ - 92016a9: Fix Nado withdrawal's completion tx
14
+ - 07bc53e: fix(connect): resolve unanswered Nado withdrawal submits by replaying the signed payload instead of reporting an ambiguous failure
15
+ - 8a78382: Nado withdrawals now track through to delivery on the success screen instead of ending on static "requested" copy.
16
+ - e5218b2: Prepare typed deposit asset-selection analytics for consistent checkout reporting.
17
+ - 5fcd876: Cap the withdrawal source-token dropdown height so long asset lists scroll instead of overflowing the modal.
18
+ - Updated dependencies [f3f4e42]
19
+ - @funkit/fun-relay@2.10.0
20
+ - @funkit/connect-core@2.4.1
21
+
3
22
  ## 11.0.0
4
23
 
5
24
  ### Major Changes
@@ -1,8 +1,5 @@
1
1
  "use client";
2
2
 
3
- // src/hooks/useFunkitTranslation.ts
4
- import { useTranslation } from "react-i18next";
5
-
6
3
  // src/locales/i18n.ts
7
4
  import i18next from "i18next";
8
5
 
@@ -420,7 +417,25 @@ var en_default = {
420
417
  lighterFastTokenTooltip: "Fast withdrawals are only available for your USDC (Perps) balance",
421
418
  lighterWithdrawOnChain: "Withdraw on-chain",
422
419
  lighterL1FallbackNotice: "You've reached Lighter's secure withdrawal rate limit. You can withdraw directly on-chain instead.",
423
- enableBorrowing: "Enable borrowing"
420
+ enableBorrowing: "Enable borrowing",
421
+ nado: {
422
+ requestedTitle: "Withdrawal Requested",
423
+ requestedDescription: "Your withdrawal has been requested and will be processed shortly.",
424
+ withdrawing: "Withdrawing",
425
+ trackOnNado: "Track on Nado",
426
+ errorGeneric: "Withdrawal failed. Please try again.",
427
+ errorNetwork: "Can't reach Nado right now. Please try again.",
428
+ errorUnconfirmed: "We couldn't confirm your withdrawal. Check your Nado balance before trying again.",
429
+ errorRateLimited: "Too many requests. Please wait a moment and try again.",
430
+ errorExceedsBorrowLimit: "Amount exceeds your available balance. Reduce the amount or enable borrowing.",
431
+ errorInvalidNonce: "This withdrawal request expired. Please try again.",
432
+ errorNoPriorDeposit: "Deposit to Nado before withdrawing.",
433
+ errorWithdrawRisk: "Nado's 24-hour withdrawal limit was reached. Please try again later.",
434
+ errorBalanceChanged: "Your withdrawable balance changed. Tap Max and try again.",
435
+ errorAmountTooLow: "Amount is too low to cover the Nado withdrawal fee.",
436
+ errorSignerMismatch: "Switch back to the wallet that owns this Nado account to withdraw.",
437
+ errorSwitchChain: "Switch your wallet to the Ink network to sign this withdrawal."
438
+ }
424
439
  },
425
440
  directExecution: {
426
441
  fillStatus: "Fill status",
@@ -988,7 +1003,25 @@ var es_default = {
988
1003
  lighterFastTokenTooltip: "Los retiros r\xE1pidos solo est\xE1n disponibles para tu saldo de USDC (Perps)",
989
1004
  lighterWithdrawOnChain: "Retirar on-chain",
990
1005
  lighterL1FallbackNotice: "Has alcanzado el l\xEDmite de retiros seguros de Lighter. Puedes retirar directamente on-chain.",
991
- enableBorrowing: "Habilitar pr\xE9stamo"
1006
+ enableBorrowing: "Habilitar pr\xE9stamo",
1007
+ nado: {
1008
+ requestedTitle: "Retiro solicitado",
1009
+ requestedDescription: "Tu retiro ha sido solicitado y se procesar\xE1 en breve.",
1010
+ withdrawing: "Retirando",
1011
+ trackOnNado: "Seguir en Nado",
1012
+ errorGeneric: "El retiro fall\xF3. Int\xE9ntalo nuevamente.",
1013
+ errorNetwork: "No se puede conectar con Nado en este momento. Int\xE9ntalo nuevamente.",
1014
+ errorUnconfirmed: "No pudimos confirmar tu retiro. Revisa tu saldo de Nado antes de volver a intentarlo.",
1015
+ errorRateLimited: "Demasiadas solicitudes. Espera un momento e int\xE9ntalo nuevamente.",
1016
+ errorExceedsBorrowLimit: "El monto excede tu saldo disponible. Reduce el monto o habilita el pr\xE9stamo.",
1017
+ errorInvalidNonce: "Esta solicitud de retiro expir\xF3. Int\xE9ntalo nuevamente.",
1018
+ errorNoPriorDeposit: "Deposita en Nado antes de retirar.",
1019
+ errorWithdrawRisk: "Se alcanz\xF3 el l\xEDmite de retiro de 24 horas de Nado. Int\xE9ntalo m\xE1s tarde.",
1020
+ errorBalanceChanged: "Tu saldo retirable cambi\xF3. Toca M\xE1x e int\xE9ntalo nuevamente.",
1021
+ errorAmountTooLow: "El monto es demasiado bajo para cubrir la comisi\xF3n de retiro de Nado.",
1022
+ errorSignerMismatch: "Vuelve a la billetera propietaria de esta cuenta de Nado para retirar.",
1023
+ errorSwitchChain: "Cambia tu billetera a la red Ink para firmar este retiro."
1024
+ }
992
1025
  },
993
1026
  directExecution: {
994
1027
  fillStatus: "Estado de completado",
@@ -1556,7 +1589,25 @@ var fr_default = {
1556
1589
  lighterFastTokenTooltip: "Les retraits rapides ne sont disponibles que pour votre solde USDC (Perps)",
1557
1590
  lighterWithdrawOnChain: "Retirer on-chain",
1558
1591
  lighterL1FallbackNotice: "Vous avez atteint la limite de retraits s\xE9curis\xE9s de Lighter. Vous pouvez retirer directement on-chain.",
1559
- enableBorrowing: "Activer l'emprunt"
1592
+ enableBorrowing: "Activer l'emprunt",
1593
+ nado: {
1594
+ requestedTitle: "Retrait demand\xE9",
1595
+ requestedDescription: "Votre retrait a \xE9t\xE9 demand\xE9 et sera trait\xE9 sous peu.",
1596
+ withdrawing: "Retrait en cours",
1597
+ trackOnNado: "Suivre sur Nado",
1598
+ errorGeneric: "Le retrait a \xE9chou\xE9. Veuillez r\xE9essayer.",
1599
+ errorNetwork: "Impossible de joindre Nado pour le moment. Veuillez r\xE9essayer.",
1600
+ errorUnconfirmed: "Nous n'avons pas pu confirmer votre retrait. V\xE9rifiez votre solde Nado avant de r\xE9essayer.",
1601
+ errorRateLimited: "Trop de requ\xEAtes. Veuillez patienter un instant et r\xE9essayer.",
1602
+ errorExceedsBorrowLimit: "Le montant d\xE9passe votre solde disponible. R\xE9duisez le montant ou activez l'emprunt.",
1603
+ errorInvalidNonce: "Cette demande de retrait a expir\xE9. Veuillez r\xE9essayer.",
1604
+ errorNoPriorDeposit: "D\xE9posez sur Nado avant de retirer.",
1605
+ errorWithdrawRisk: "La limite de retrait sur 24 heures de Nado a \xE9t\xE9 atteinte. Veuillez r\xE9essayer plus tard.",
1606
+ errorBalanceChanged: "Votre solde retirable a chang\xE9. Appuyez sur Max et r\xE9essayez.",
1607
+ errorAmountTooLow: "Le montant est trop faible pour couvrir les frais de retrait Nado.",
1608
+ errorSignerMismatch: "Revenez au portefeuille propri\xE9taire de ce compte Nado pour retirer.",
1609
+ errorSwitchChain: "Basculez votre portefeuille sur le r\xE9seau Ink pour signer ce retrait."
1610
+ }
1560
1611
  },
1561
1612
  directExecution: {
1562
1613
  fillStatus: "Statut d'ex\xE9cution",
@@ -2124,7 +2175,25 @@ var ja_default = {
2124
2175
  lighterFastTokenTooltip: "\u9AD8\u901F\u51FA\u91D1\u306FUSDC (Perps)\u6B8B\u9AD8\u3067\u306E\u307F\u5229\u7528\u3067\u304D\u307E\u3059",
2125
2176
  lighterWithdrawOnChain: "\u30AA\u30F3\u30C1\u30A7\u30FC\u30F3\u3067\u51FA\u91D1",
2126
2177
  lighterL1FallbackNotice: "Lighter\u306E\u30BB\u30AD\u30E5\u30A2\u51FA\u91D1\u306E\u30EC\u30FC\u30C8\u5236\u9650\u306B\u9054\u3057\u307E\u3057\u305F\u3002\u4EE3\u308F\u308A\u306B\u30AA\u30F3\u30C1\u30A7\u30FC\u30F3\u3067\u76F4\u63A5\u51FA\u91D1\u3067\u304D\u307E\u3059\u3002",
2127
- enableBorrowing: "\u501F\u5165\u3092\u6709\u52B9\u306B\u3059\u308B"
2178
+ enableBorrowing: "\u501F\u5165\u3092\u6709\u52B9\u306B\u3059\u308B",
2179
+ nado: {
2180
+ requestedTitle: "\u51FA\u91D1\u3092\u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u307E\u3057\u305F",
2181
+ requestedDescription: "\u51FA\u91D1\u304C\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u307E\u3057\u305F\u3002\u307E\u3082\u306A\u304F\u51E6\u7406\u3055\u308C\u307E\u3059\u3002",
2182
+ withdrawing: "\u51FA\u91D1\u4E2D",
2183
+ trackOnNado: "Nado \u3067\u8FFD\u8DE1",
2184
+ errorGeneric: "\u51FA\u91D1\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2185
+ errorNetwork: "\u73FE\u5728 Nado \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2186
+ errorUnconfirmed: "\u51FA\u91D1\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u518D\u8A66\u884C\u3059\u308B\u524D\u306B Nado \u306E\u6B8B\u9AD8\u3092\u3054\u78BA\u8A8D\u304F\u3060\u3055\u3044\u3002",
2187
+ errorRateLimited: "\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u3057\u3070\u3089\u304F\u5F85\u3063\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2188
+ errorExceedsBorrowLimit: "\u91D1\u984D\u304C\u5229\u7528\u53EF\u80FD\u6B8B\u9AD8\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002\u91D1\u984D\u3092\u6E1B\u3089\u3059\u304B\u3001\u501F\u5165\u3092\u6709\u52B9\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2189
+ errorInvalidNonce: "\u3053\u306E\u51FA\u91D1\u30EA\u30AF\u30A8\u30B9\u30C8\u306F\u671F\u9650\u5207\u308C\u3067\u3059\u3002\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2190
+ errorNoPriorDeposit: "\u51FA\u91D1\u3059\u308B\u524D\u306B Nado \u3078\u5165\u91D1\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2191
+ errorWithdrawRisk: "Nado \u306E 24 \u6642\u9593\u51FA\u91D1\u4E0A\u9650\u306B\u9054\u3057\u307E\u3057\u305F\u3002\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
2192
+ errorBalanceChanged: "\u51FA\u91D1\u53EF\u80FD\u6B8B\u9AD8\u304C\u5909\u308F\u308A\u307E\u3057\u305F\u3002\u300C\u6700\u5927\u300D\u3092\u62BC\u3057\u3066\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
2193
+ errorAmountTooLow: "\u91D1\u984D\u304C\u5C11\u306A\u3059\u304E\u3066 Nado \u306E\u51FA\u91D1\u624B\u6570\u6599\u3092\u652F\u6255\u3048\u307E\u305B\u3093\u3002",
2194
+ errorSignerMismatch: "\u51FA\u91D1\u3059\u308B\u306B\u306F\u3001\u3053\u306E Nado \u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u6240\u6709\u3059\u308B\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u5207\u308A\u66FF\u3048\u3066\u304F\u3060\u3055\u3044\u3002",
2195
+ errorSwitchChain: "\u3053\u306E\u51FA\u91D1\u306B\u7F72\u540D\u3059\u308B\u306B\u306F\u3001\u30A6\u30A9\u30EC\u30C3\u30C8\u3092 Ink \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u306B\u5207\u308A\u66FF\u3048\u3066\u304F\u3060\u3055\u3044\u3002"
2196
+ }
2128
2197
  },
2129
2198
  directExecution: {
2130
2199
  fillStatus: "\u51E6\u7406\u72B6\u6CC1",
@@ -2692,7 +2761,25 @@ var ko_default = {
2692
2761
  lighterFastTokenTooltip: "\uBE60\uB978 \uCD9C\uAE08\uC740 USDC (Perps) \uC794\uC561\uC5D0\uC11C\uB9CC \uC774\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4",
2693
2762
  lighterWithdrawOnChain: "\uC628\uCCB4\uC778\uC73C\uB85C \uCD9C\uAE08",
2694
2763
  lighterL1FallbackNotice: "Lighter\uC758 \uBCF4\uC548 \uCD9C\uAE08 \uD55C\uB3C4\uC5D0 \uB3C4\uB2EC\uD588\uC2B5\uB2C8\uB2E4. \uB300\uC2E0 \uC628\uCCB4\uC778\uC5D0\uC11C \uC9C1\uC811 \uCD9C\uAE08\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
2695
- enableBorrowing: "\uCC28\uC785 \uC0AC\uC6A9"
2764
+ enableBorrowing: "\uCC28\uC785 \uC0AC\uC6A9",
2765
+ nado: {
2766
+ requestedTitle: "\uCD9C\uAE08 \uC694\uCCAD\uB428",
2767
+ requestedDescription: "\uCD9C\uAE08\uC774 \uC694\uCCAD\uB418\uC5C8\uC73C\uBA70 \uACE7 \uCC98\uB9AC\uB429\uB2C8\uB2E4.",
2768
+ withdrawing: "\uCD9C\uAE08 \uC911",
2769
+ trackOnNado: "Nado\uC5D0\uC11C \uCD94\uC801",
2770
+ errorGeneric: "\uCD9C\uAE08\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
2771
+ errorNetwork: "\uD604\uC7AC Nado\uC5D0 \uC5F0\uACB0\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
2772
+ errorUnconfirmed: "\uCD9C\uAE08\uC744 \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uAE30 \uC804\uC5D0 Nado \uC794\uC561\uC744 \uD655\uC778\uD558\uC138\uC694.",
2773
+ errorRateLimited: "\uC694\uCCAD\uC774 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4. \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
2774
+ errorExceedsBorrowLimit: "\uAE08\uC561\uC774 \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uC794\uC561\uC744 \uCD08\uACFC\uD569\uB2C8\uB2E4. \uAE08\uC561\uC744 \uC904\uC774\uAC70\uB098 \uCC28\uC785\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2775
+ errorInvalidNonce: "\uC774 \uCD9C\uAE08 \uC694\uCCAD\uC774 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
2776
+ errorNoPriorDeposit: "\uCD9C\uAE08\uD558\uAE30 \uC804\uC5D0 Nado\uC5D0 \uC785\uAE08\uD558\uC138\uC694.",
2777
+ errorWithdrawRisk: "Nado\uC758 24\uC2DC\uAC04 \uCD9C\uAE08 \uD55C\uB3C4\uC5D0 \uB3C4\uB2EC\uD588\uC2B5\uB2C8\uB2E4. \uB098\uC911\uC5D0 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
2778
+ errorBalanceChanged: "\uCD9C\uAE08 \uAC00\uB2A5 \uC794\uC561\uC774 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uCD5C\uB300\uB97C \uB204\uB978 \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",
2779
+ errorAmountTooLow: "\uAE08\uC561\uC774 \uB108\uBB34 \uC801\uC5B4 Nado \uCD9C\uAE08 \uC218\uC218\uB8CC\uB97C \uCDA9\uB2F9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
2780
+ errorSignerMismatch: "\uCD9C\uAE08\uD558\uB824\uBA74 \uC774 Nado \uACC4\uC815\uC744 \uC18C\uC720\uD55C \uC9C0\uAC11\uC73C\uB85C \uB2E4\uC2DC \uC804\uD658\uD558\uC138\uC694.",
2781
+ errorSwitchChain: "\uC774 \uCD9C\uAE08\uC5D0 \uC11C\uBA85\uD558\uB824\uBA74 \uC9C0\uAC11\uC744 Ink \uB124\uD2B8\uC6CC\uD06C\uB85C \uC804\uD658\uD558\uC138\uC694."
2782
+ }
2696
2783
  },
2697
2784
  directExecution: {
2698
2785
  fillStatus: "\uCC98\uB9AC \uC0C1\uD0DC",
@@ -3260,7 +3347,25 @@ var ru_default = {
3260
3347
  lighterFastTokenTooltip: "\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u0432\u044B\u0432\u043E\u0434 \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0432\u0430\u0448\u0435\u0433\u043E \u0431\u0430\u043B\u0430\u043D\u0441\u0430 USDC (Perps)",
3261
3348
  lighterWithdrawOnChain: "\u0412\u044B\u0432\u0435\u0441\u0442\u0438 \u0432 \u0441\u0435\u0442\u0438",
3262
3349
  lighterL1FallbackNotice: "\u0412\u044B \u0434\u043E\u0441\u0442\u0438\u0433\u043B\u0438 \u043B\u0438\u043C\u0438\u0442\u0430 \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0445 \u0432\u044B\u0432\u043E\u0434\u043E\u0432 Lighter. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\u044B\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043D\u0430\u043F\u0440\u044F\u043C\u0443\u044E \u0432 \u0441\u0435\u0442\u0438.",
3263
- enableBorrowing: "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0430\u0451\u043C"
3350
+ enableBorrowing: "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0430\u0451\u043C",
3351
+ nado: {
3352
+ requestedTitle: "\u0412\u044B\u0432\u043E\u0434 \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D",
3353
+ requestedDescription: "\u0412\u0430\u0448 \u0432\u044B\u0432\u043E\u0434 \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D \u0438 \u0431\u0443\u0434\u0435\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D \u0432 \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043C\u044F.",
3354
+ withdrawing: "\u0412\u044B\u0432\u043E\u0434",
3355
+ trackOnNado: "\u041E\u0442\u0441\u043B\u0435\u0434\u0438\u0442\u044C \u0432 Nado",
3356
+ errorGeneric: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0432\u044B\u0432\u043E\u0434. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
3357
+ errorNetwork: "\u0421\u0435\u0439\u0447\u0430\u0441 \u043D\u0435\u0442 \u0441\u0432\u044F\u0437\u0438 \u0441 Nado. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
3358
+ errorUnconfirmed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0432\u044B\u0432\u043E\u0434 \u0441\u0440\u0435\u0434\u0441\u0442\u0432. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0431\u0430\u043B\u0430\u043D\u0441 Nado, \u043F\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043C \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043F\u043E\u043F\u044B\u0442\u043A\u0443.",
3359
+ errorRateLimited: "\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u043D\u043E\u0433\u043E \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u0432. \u041F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435 \u043D\u0435\u043C\u043D\u043E\u0433\u043E \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
3360
+ errorExceedsBorrowLimit: "\u0421\u0443\u043C\u043C\u0430 \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0439 \u0431\u0430\u043B\u0430\u043D\u0441. \u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u0435 \u0441\u0443\u043C\u043C\u0443 \u0438\u043B\u0438 \u0432\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u0437\u0430\u0451\u043C.",
3361
+ errorInvalidNonce: "\u0421\u0440\u043E\u043A \u044D\u0442\u043E\u0433\u043E \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u043D\u0430 \u0432\u044B\u0432\u043E\u0434 \u0438\u0441\u0442\u0451\u043A. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
3362
+ errorNoPriorDeposit: "\u0412\u043D\u0435\u0441\u0438\u0442\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0432 Nado \u043F\u0435\u0440\u0435\u0434 \u0432\u044B\u0432\u043E\u0434\u043E\u043C.",
3363
+ errorWithdrawRisk: "\u0414\u043E\u0441\u0442\u0438\u0433\u043D\u0443\u0442 24-\u0447\u0430\u0441\u043E\u0432\u043E\u0439 \u043B\u0438\u043C\u0438\u0442 \u0432\u044B\u0432\u043E\u0434\u0430 Nado. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0437\u0436\u0435.",
3364
+ errorBalanceChanged: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0430\u044F \u0434\u043B\u044F \u0432\u044B\u0432\u043E\u0434\u0430 \u0441\u0443\u043C\u043C\u0430 \u0438\u0437\u043C\u0435\u043D\u0438\u043B\u0430\u0441\u044C. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 \xAB\u041C\u0430\u043A\u0441\xBB \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
3365
+ errorAmountTooLow: "\u0421\u0443\u043C\u043C\u0430 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u043A\u0440\u044B\u0442\u044C \u043A\u043E\u043C\u0438\u0441\u0441\u0438\u044E \u0437\u0430 \u0432\u044B\u0432\u043E\u0434 Nado.",
3366
+ errorSignerMismatch: "\u0427\u0442\u043E\u0431\u044B \u0432\u044B\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430, \u0432\u0435\u0440\u043D\u0438\u0442\u0435\u0441\u044C \u043A \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0443, \u043A\u043E\u0442\u043E\u0440\u043E\u043C\u0443 \u043F\u0440\u0438\u043D\u0430\u0434\u043B\u0435\u0436\u0438\u0442 \u044D\u0442\u043E\u0442 \u0430\u043A\u043A\u0430\u0443\u043D\u0442 Nado.",
3367
+ errorSwitchChain: "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u043A\u043E\u0448\u0435\u043B\u0451\u043A \u043D\u0430 \u0441\u0435\u0442\u044C Ink, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u0442\u044C \u044D\u0442\u043E\u0442 \u0432\u044B\u0432\u043E\u0434."
3368
+ }
3264
3369
  },
3265
3370
  directExecution: {
3266
3371
  fillStatus: "\u0421\u0442\u0430\u0442\u0443\u0441 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F",
@@ -3828,7 +3933,25 @@ var tr_default = {
3828
3933
  lighterFastTokenTooltip: "H\u0131zl\u0131 \xE7ekimler yaln\u0131zca USDC (Perps) bakiyeniz i\xE7in kullan\u0131labilir",
3829
3934
  lighterWithdrawOnChain: "Zincir \xFCzerinde \xE7ek",
3830
3935
  lighterL1FallbackNotice: "Lighter'\u0131n g\xFCvenli \xE7ekim h\u0131z s\u0131n\u0131r\u0131na ula\u015Ft\u0131n\u0131z. Bunun yerine do\u011Frudan zincir \xFCzerinden \xE7ekebilirsiniz.",
3831
- enableBorrowing: "Bor\xE7lanmay\u0131 etkinle\u015Ftir"
3936
+ enableBorrowing: "Bor\xE7lanmay\u0131 etkinle\u015Ftir",
3937
+ nado: {
3938
+ requestedTitle: "Para \xC7ekme Talep Edildi",
3939
+ requestedDescription: "Para \xE7ekme i\u015Fleminiz talep edildi ve k\u0131sa s\xFCre i\xE7inde i\u015Flenecek.",
3940
+ withdrawing: "\xC7ekiliyor",
3941
+ trackOnNado: "Nado'da takip et",
3942
+ errorGeneric: "Para \xE7ekme ba\u015Far\u0131s\u0131z oldu. L\xFCtfen tekrar deneyin.",
3943
+ errorNetwork: "\u015Eu anda Nado'ya ula\u015F\u0131lam\u0131yor. L\xFCtfen tekrar deneyin.",
3944
+ errorUnconfirmed: "Para \xE7ekme i\u015Fleminizi do\u011Frulayamad\u0131k. Tekrar denemeden \xF6nce Nado bakiyenizi kontrol edin.",
3945
+ errorRateLimited: "\xC7ok fazla istek. L\xFCtfen biraz bekleyip tekrar deneyin.",
3946
+ errorExceedsBorrowLimit: "Tutar kullan\u0131labilir bakiyenizi a\u015F\u0131yor. Tutar\u0131 azalt\u0131n veya bor\xE7lanmay\u0131 etkinle\u015Ftirin.",
3947
+ errorInvalidNonce: "Bu para \xE7ekme talebinin s\xFCresi doldu. L\xFCtfen tekrar deneyin.",
3948
+ errorNoPriorDeposit: "Para \xE7ekmeden \xF6nce Nado'ya yat\u0131rma yap\u0131n.",
3949
+ errorWithdrawRisk: "Nado'nun 24 saatlik para \xE7ekme limitine ula\u015F\u0131ld\u0131. L\xFCtfen daha sonra tekrar deneyin.",
3950
+ errorBalanceChanged: "\xC7ekilebilir bakiyeniz de\u011Fi\u015Fti. Maks'a dokunup tekrar deneyin.",
3951
+ errorAmountTooLow: "Tutar, Nado para \xE7ekme \xFCcretini kar\u015F\u0131lamak i\xE7in \xE7ok d\xFC\u015F\xFCk.",
3952
+ errorSignerMismatch: "Para \xE7ekmek i\xE7in bu Nado hesab\u0131n\u0131n sahibi olan c\xFCzdana geri ge\xE7in.",
3953
+ errorSwitchChain: "Bu para \xE7ekme i\u015Flemini imzalamak i\xE7in c\xFCzdan\u0131n\u0131z\u0131 Ink a\u011F\u0131na ge\xE7irin."
3954
+ }
3832
3955
  },
3833
3956
  directExecution: {
3834
3957
  fillStatus: "\u0130\u015Flem durumu",
@@ -4396,7 +4519,25 @@ var zh_default = {
4396
4519
  lighterFastTokenTooltip: "\u5FEB\u901F\u63D0\u73B0\u4EC5\u652F\u6301\u60A8\u7684 USDC (Perps) \u4F59\u989D",
4397
4520
  lighterWithdrawOnChain: "\u94FE\u4E0A\u63D0\u73B0",
4398
4521
  lighterL1FallbackNotice: "\u60A8\u5DF2\u8FBE\u5230 Lighter \u7684\u5B89\u5168\u63D0\u73B0\u9891\u7387\u9650\u5236\u3002\u60A8\u53EF\u4EE5\u6539\u4E3A\u76F4\u63A5\u5728\u94FE\u4E0A\u63D0\u73B0\u3002",
4399
- enableBorrowing: "\u542F\u7528\u501F\u5E01"
4522
+ enableBorrowing: "\u542F\u7528\u501F\u5E01",
4523
+ nado: {
4524
+ requestedTitle: "\u63D0\u73B0\u5DF2\u8BF7\u6C42",
4525
+ requestedDescription: "\u60A8\u7684\u63D0\u73B0\u5DF2\u63D0\u4EA4\uFF0C\u5C06\u5F88\u5FEB\u5904\u7406\u3002",
4526
+ withdrawing: "\u63D0\u73B0\u4E2D",
4527
+ trackOnNado: "\u5728 Nado \u4E0A\u8FFD\u8E2A",
4528
+ errorGeneric: "\u63D0\u73B0\u5931\u8D25\u3002\u8BF7\u91CD\u8BD5\u3002",
4529
+ errorNetwork: "\u76EE\u524D\u65E0\u6CD5\u8FDE\u63A5 Nado\u3002\u8BF7\u91CD\u8BD5\u3002",
4530
+ errorUnconfirmed: "\u6211\u4EEC\u65E0\u6CD5\u786E\u8BA4\u60A8\u7684\u63D0\u73B0\u3002\u8BF7\u5148\u67E5\u770B\u60A8\u7684 Nado \u4F59\u989D\uFF0C\u7136\u540E\u518D\u91CD\u8BD5\u3002",
4531
+ errorRateLimited: "\u8BF7\u6C42\u8FC7\u4E8E\u9891\u7E41\u3002\u8BF7\u7A0D\u7B49\u540E\u91CD\u8BD5\u3002",
4532
+ errorExceedsBorrowLimit: "\u91D1\u989D\u8D85\u51FA\u53EF\u7528\u4F59\u989D\u3002\u8BF7\u51CF\u5C11\u91D1\u989D\u6216\u542F\u7528\u501F\u5E01\u3002",
4533
+ errorInvalidNonce: "\u6B64\u63D0\u73B0\u8BF7\u6C42\u5DF2\u8FC7\u671F\u3002\u8BF7\u91CD\u8BD5\u3002",
4534
+ errorNoPriorDeposit: "\u8BF7\u5148\u5411 Nado \u5B58\u5165\u8D44\u91D1\uFF0C\u7136\u540E\u518D\u63D0\u73B0\u3002",
4535
+ errorWithdrawRisk: "\u5DF2\u8FBE\u5230 Nado \u7684 24 \u5C0F\u65F6\u63D0\u73B0\u9650\u989D\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
4536
+ errorBalanceChanged: "\u60A8\u7684\u53EF\u63D0\u73B0\u4F59\u989D\u5DF2\u53D8\u52A8\u3002\u8BF7\u70B9\u51FB\u300C\u6700\u5927\u300D\u540E\u91CD\u8BD5\u3002",
4537
+ errorAmountTooLow: "\u91D1\u989D\u8FC7\u4F4E\uFF0C\u4E0D\u8DB3\u4EE5\u652F\u4ED8 Nado \u63D0\u73B0\u8D39\u7528\u3002",
4538
+ errorSignerMismatch: "\u8BF7\u5207\u6362\u56DE\u62E5\u6709\u6B64 Nado \u8D26\u6237\u7684\u94B1\u5305\u4EE5\u8FDB\u884C\u63D0\u73B0\u3002",
4539
+ errorSwitchChain: "\u8BF7\u5C06\u94B1\u5305\u5207\u6362\u5230 Ink \u7F51\u7EDC\u4EE5\u7B7E\u7F72\u6B64\u63D0\u73B0\u3002"
4540
+ }
4400
4541
  },
4401
4542
  directExecution: {
4402
4543
  fillStatus: "\u586B\u5145\u72B6\u6001",
@@ -4673,12 +4814,6 @@ i18n.init({
4673
4814
  });
4674
4815
  var i18n_default = i18n;
4675
4816
 
4676
- // src/hooks/useFunkitTranslation.ts
4677
- var funkitI18nOptions = { i18n: i18n_default };
4678
- function useFunkitTranslation() {
4679
- return useTranslation(void 0, funkitI18nOptions);
4680
- }
4681
-
4682
4817
  export {
4683
- useFunkitTranslation
4818
+ i18n_default
4684
4819
  };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+
3
+ // src/utils/safeBigInt.ts
4
+ function safeBigInt(value, fallback) {
5
+ if (typeof value === "bigint") {
6
+ return value;
7
+ }
8
+ if (typeof value === "number") {
9
+ return Number.isFinite(value) && Number.isInteger(value) ? BigInt(value) : fallback;
10
+ }
11
+ if (typeof value === "string" && /^-?\d+$/.test(value)) {
12
+ return BigInt(value);
13
+ }
14
+ return fallback;
15
+ }
16
+
17
+ export {
18
+ safeBigInt
19
+ };
@@ -20,7 +20,7 @@ function buildNadoSubaccountId(owner, name = "default") {
20
20
  ]);
21
21
  }
22
22
  function x18ToRawBaseUnit(x18Amount, decimals) {
23
- return BigInt(x18Amount) * 10n ** BigInt(decimals) / 10n ** BigInt(X18_DECIMALS);
23
+ return x18Amount * 10n ** BigInt(decimals) / 10n ** BigInt(X18_DECIMALS);
24
24
  }
25
25
  function x18ToTokenUnits(x18Amount, decimals) {
26
26
  return formatUnits(x18ToRawBaseUnit(x18Amount, decimals), decimals);
@@ -0,0 +1,160 @@
1
+ "use client";
2
+ import {
3
+ NADO_GATEWAY_URL
4
+ } from "./chunk-II5CZTBC.js";
5
+ import {
6
+ nadoFetch
7
+ } from "./chunk-WZRW6WUM.js";
8
+ import {
9
+ NadoGatewayError,
10
+ NadoWithdrawalUnconfirmedError,
11
+ createNadoGatewayError,
12
+ isNadoTransportError,
13
+ parseNadoExpectedNonce
14
+ } from "./chunk-Z7HTQFEO.js";
15
+ import {
16
+ logger
17
+ } from "./chunk-AHYOV7AV.js";
18
+
19
+ // src/clients/internal/nado/gateway.ts
20
+ function parseNadoGatewayResponse(response, uri) {
21
+ if (response.status !== "success") {
22
+ logger.warn("nado:gateway_rejected", {
23
+ uri,
24
+ error: response.error,
25
+ errorCode: response.error_code
26
+ });
27
+ throw createNadoGatewayError(response, "Nado gateway request failed");
28
+ }
29
+ return response.data;
30
+ }
31
+ async function nadoQuery(params, signal) {
32
+ const uri = `${NADO_GATEWAY_URL}/query?${new URLSearchParams(params)}`;
33
+ const response = await nadoFetch({
34
+ uri,
35
+ method: "GET",
36
+ signal
37
+ });
38
+ const data = parseNadoGatewayResponse(response, uri);
39
+ if (data === void 0) {
40
+ throw new NadoGatewayError("Nado returned success without data", {
41
+ kind: "api"
42
+ });
43
+ }
44
+ return data;
45
+ }
46
+ async function getNadoMaxWithdrawable(params, signal) {
47
+ const data = await nadoQuery(
48
+ {
49
+ type: "max_withdrawable",
50
+ product_id: params.productId.toString(),
51
+ sender: params.sender,
52
+ spot_leverage: params.spotLeverage ? "true" : "false"
53
+ },
54
+ signal
55
+ );
56
+ return data.max_withdrawable;
57
+ }
58
+ async function getNadoTxNonce(address) {
59
+ const query = () => nadoQuery({ type: "nonces", address });
60
+ let data;
61
+ try {
62
+ data = await query();
63
+ } catch (error) {
64
+ if (!isNadoTransportError(error)) {
65
+ throw error;
66
+ }
67
+ data = await query();
68
+ }
69
+ return BigInt(data.tx_nonce);
70
+ }
71
+ async function getNadoFeeRates(sender, signal) {
72
+ return nadoQuery({ type: "fee_rates", sender }, signal);
73
+ }
74
+ async function executeNadoWithdrawCollateralV2(params) {
75
+ const uri = `${NADO_GATEWAY_URL}/execute`;
76
+ const body = {
77
+ // spot_leverage sits INSIDE the execute object (sibling of tx/signature),
78
+ // matching @nadohq's EngineBaseClient — top-level is silently ignored.
79
+ withdraw_collateral_v2: {
80
+ tx: {
81
+ sender: params.sender,
82
+ productId: params.productId,
83
+ amount: params.amount.toString(),
84
+ nonce: params.nonce.toString(),
85
+ sendTo: params.sendTo,
86
+ appendix: "0"
87
+ },
88
+ signature: params.signature,
89
+ spot_leverage: params.spotLeverage
90
+ }
91
+ };
92
+ try {
93
+ const response = await nadoFetch({
94
+ uri,
95
+ method: "POST",
96
+ body
97
+ });
98
+ parseNadoGatewayResponse(response, uri);
99
+ } catch (error) {
100
+ if (!isNadoUnansweredError(error)) {
101
+ throw error;
102
+ }
103
+ logger.warn("nado:execute_unanswered", {
104
+ uri,
105
+ nonce: params.nonce.toString(),
106
+ productId: params.productId,
107
+ errorKind: error instanceof NadoGatewayError ? error.kind : null
108
+ });
109
+ await replayNadoWithdrawExecute({ uri, body, nonce: params.nonce });
110
+ }
111
+ }
112
+ function isNadoUnansweredError(error) {
113
+ return error instanceof NadoGatewayError && (error.kind === "timeout" || error.kind === "transport");
114
+ }
115
+ async function replayNadoWithdrawExecute({
116
+ uri,
117
+ body,
118
+ nonce
119
+ }) {
120
+ try {
121
+ const response = await nadoFetch({
122
+ uri,
123
+ method: "POST",
124
+ body
125
+ });
126
+ parseNadoGatewayResponse(response, uri);
127
+ logger.warn("nado:execute_replay_accepted", {
128
+ uri,
129
+ nonce: nonce.toString()
130
+ });
131
+ } catch (error) {
132
+ const expectedNonce = parseNadoExpectedNonce(error);
133
+ if (expectedNonce !== void 0 && expectedNonce > nonce) {
134
+ logger.warn("nado:execute_replay_alreadyLanded", {
135
+ uri,
136
+ nonce: nonce.toString(),
137
+ expectedNonce: expectedNonce.toString()
138
+ });
139
+ return;
140
+ }
141
+ logger.error(
142
+ "nado:execute_replay_unconfirmed",
143
+ error instanceof Error ? error : new Error(String(error)),
144
+ {
145
+ uri,
146
+ nonce: nonce.toString(),
147
+ expectedNonce: expectedNonce?.toString() ?? null,
148
+ errorMessage: error instanceof Error ? error.message : String(error)
149
+ }
150
+ );
151
+ throw new NadoWithdrawalUnconfirmedError();
152
+ }
153
+ }
154
+
155
+ export {
156
+ getNadoMaxWithdrawable,
157
+ getNadoTxNonce,
158
+ getNadoFeeRates,
159
+ executeNadoWithdrawCollateralV2
160
+ };
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import {
3
+ isCustomWithdrawalConfig
4
+ } from "./chunk-SO756ELD.js";
5
+ import {
6
+ buildNadoSubaccountId
7
+ } from "./chunk-6T6URLBM.js";
8
+ import {
9
+ logger
10
+ } from "./chunk-AHYOV7AV.js";
11
+
12
+ // src/clients/internal/nado/withdrawalConfig.ts
13
+ var HEX_SHAPED_SUBACCOUNT_NAME = /^(?:[0-9a-f]{2})+$/i;
14
+ function isNadoWithdrawalConfig(config) {
15
+ return !!config && isCustomWithdrawalConfig(config) && config.customerConfig?.customerName === "nado";
16
+ }
17
+ function resolveNadoSubaccount(walletAddress, subaccountName) {
18
+ if (!walletAddress) {
19
+ return void 0;
20
+ }
21
+ if (subaccountName && HEX_SHAPED_SUBACCOUNT_NAME.test(subaccountName)) {
22
+ logger.warn("nado:withdrawal:hexShapedSubaccountName", {
23
+ name: subaccountName
24
+ });
25
+ }
26
+ try {
27
+ return buildNadoSubaccountId(walletAddress, subaccountName);
28
+ } catch (err) {
29
+ const error = err instanceof Error ? err : new Error(String(err));
30
+ logger.error("nado:withdrawal:invalidSubaccountName", error, {
31
+ name: subaccountName
32
+ });
33
+ return void 0;
34
+ }
35
+ }
36
+
37
+ export {
38
+ isNadoWithdrawalConfig,
39
+ resolveNadoSubaccount
40
+ };
@@ -17,6 +17,7 @@ var GeneralWalletContext = createContext({
17
17
  walletAddress: "",
18
18
  isUserLoggedIn: false,
19
19
  loginType: "guest" /* Guest */,
20
+ connectorId: void 0,
20
21
  userInfo: PLACEHOLDER_FUNKIT_USER_INFO,
21
22
  handleLogout: () => void 0,
22
23
  logoutSymbol: void 0
@@ -1,11 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useFunkitTranslation
4
- } from "./chunk-JD2J5K6S.js";
5
-
6
- // src/utils/customer.ts
7
- import { useQuery, useQueryClient } from "@tanstack/react-query";
8
- import { useCallback } from "react";
4
+ } from "./chunk-FAYBQQNB.js";
9
5
 
10
6
  // src/providers/FunkitConfigContext.tsx
11
7
  import {
@@ -189,89 +185,6 @@ function useFunkitConfig() {
189
185
  return finalFunkitConfig;
190
186
  }
191
187
 
192
- // src/utils/customer.ts
193
- var LIGHTER_MAIN_ACCOUNT_TYPE = 0;
194
- var LIGHTER_TRADING_MODE = {
195
- SIMPLE: 0,
196
- UNIFIED: 1
197
- };
198
- async function getLighterAccountsByL1Address(address) {
199
- const response = await fetch(
200
- `https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${address}`
201
- );
202
- if (!response.ok) {
203
- throw new Error(`Failed to fetch lighter accounts: ${response.statusText}`);
204
- }
205
- const data = await response.json();
206
- return data;
207
- }
208
- async function getLighterAccount(lookup, activeOnly) {
209
- const params = new URLSearchParams({
210
- by: lookup.by,
211
- value: String(lookup.value),
212
- ...activeOnly !== void 0 && { active_only: String(activeOnly) }
213
- });
214
- const response = await fetch(
215
- `https://mainnet.zklighter.elliot.ai/api/v1/account?${params}`
216
- );
217
- if (!response.ok) {
218
- throw new Error(`Failed to fetch lighter account: ${response.statusText}`);
219
- }
220
- return response.json();
221
- }
222
- function useLighterAccountQuery(lookup, options) {
223
- const enabled = lookup !== null && (lookup.by === "index" ? true : !!lookup.value && lookup.value !== "0x");
224
- const query = useQuery({
225
- queryKey: [
226
- "lighterAccount",
227
- lookup?.by,
228
- lookup?.value,
229
- options?.activeOnly
230
- ],
231
- // biome-ignore lint/style/noNonNullAssertion: already checked for null
232
- queryFn: () => getLighterAccount(lookup, options?.activeOnly),
233
- enabled,
234
- // Refetch on every (re)mount so reopening the withdraw widget shows a fresh
235
- // balance after a spot→perps transfer; 10s stale window keeps it current.
236
- staleTime: 1e4,
237
- refetchOnMount: "always",
238
- retry: false
239
- });
240
- return {
241
- ...query,
242
- account: query.data?.accounts?.[0]
243
- };
244
- }
245
- function useLighterAccountsQuery({
246
- address
247
- }) {
248
- const enabled = !!address && address !== "0x";
249
- const query = useQuery({
250
- queryKey: ["lighterAccounts", address],
251
- queryFn: () => getLighterAccountsByL1Address(address),
252
- enabled,
253
- staleTime: Number.POSITIVE_INFINITY,
254
- gcTime: Number.POSITIVE_INFINITY,
255
- retry: false,
256
- // allows us to always refetch the data but return the previous data until the new data is fetched
257
- refetchOnMount: "always"
258
- });
259
- const subAccounts = query.data?.sub_accounts;
260
- const mainAccount = subAccounts?.find(
261
- (account) => account.account_type === LIGHTER_MAIN_ACCOUNT_TYPE
262
- );
263
- return {
264
- ...query,
265
- mainAccountIndex: mainAccount?.index?.toString(),
266
- // False until the accounts load — consumers fall back to the simple-mode
267
- // UI (both USDC variants shown) while the trading mode is unknown.
268
- isUnifiedTradingMode: mainAccount?.account_trading_mode === LIGHTER_TRADING_MODE.UNIFIED,
269
- subAccounts
270
- };
271
- }
272
-
273
188
  export {
274
- useFunkitConfig,
275
- useLighterAccountQuery,
276
- useLighterAccountsQuery
189
+ useFunkitConfig
277
190
  };