@funkit/connect-rn 3.3.0 → 3.5.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 (107) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3654 -1430
  5. package/dist/index.js.map +4 -4
  6. package/dist/src/components/AmountInput.d.ts +40 -0
  7. package/dist/src/components/AmountInput.d.ts.map +1 -0
  8. package/dist/src/components/Grabber.d.ts +8 -0
  9. package/dist/src/components/Grabber.d.ts.map +1 -0
  10. package/dist/src/components/RecipientAddressInput.d.ts +28 -0
  11. package/dist/src/components/RecipientAddressInput.d.ts.map +1 -0
  12. package/dist/src/components/ScrollFade.d.ts +26 -0
  13. package/dist/src/components/ScrollFade.d.ts.map +1 -0
  14. package/dist/src/components/SelectedChainRow.d.ts +16 -0
  15. package/dist/src/components/SelectedChainRow.d.ts.map +1 -0
  16. package/dist/src/components/WithdrawFeeSummary.d.ts +17 -0
  17. package/dist/src/components/WithdrawFeeSummary.d.ts.map +1 -0
  18. package/dist/src/flow/FlowSheet.d.ts +10 -1
  19. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  20. package/dist/src/flow/FunkitFlowProvider.d.ts +4 -1
  21. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  22. package/dist/src/flow/depositFlowConfig.d.ts +4 -12
  23. package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
  24. package/dist/src/flow/guardHostCallbacks.d.ts +11 -0
  25. package/dist/src/flow/guardHostCallbacks.d.ts.map +1 -0
  26. package/dist/src/flow/selectedChainStorage.d.ts +4 -0
  27. package/dist/src/flow/selectedChainStorage.d.ts.map +1 -0
  28. package/dist/src/flow/useKeyboardHeight.d.ts +4 -10
  29. package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -1
  30. package/dist/src/flow/withdrawalFlowConfig.d.ts +61 -9
  31. package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -1
  32. package/dist/src/geo/useUserIpInfo.d.ts.map +1 -1
  33. package/dist/src/icons/ChainAvatar.d.ts +12 -0
  34. package/dist/src/icons/ChainAvatar.d.ts.map +1 -0
  35. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  36. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
  37. package/dist/src/logging/serializeLogBatch.d.ts +9 -0
  38. package/dist/src/logging/serializeLogBatch.d.ts.map +1 -0
  39. package/dist/src/providers/FunkitProvider.d.ts +9 -1
  40. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  41. package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
  42. package/dist/src/screens/SelectChainScreen.d.ts +27 -0
  43. package/dist/src/screens/SelectChainScreen.d.ts.map +1 -0
  44. package/dist/src/screens/SelectDestinationScreen.d.ts +19 -0
  45. package/dist/src/screens/SelectDestinationScreen.d.ts.map +1 -0
  46. package/dist/src/screens/SelectMethodScreen.d.ts +11 -0
  47. package/dist/src/screens/SelectMethodScreen.d.ts.map +1 -1
  48. package/dist/src/screens/TransferCryptoScreen.d.ts +13 -20
  49. package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
  50. package/dist/src/screens/WithdrawCompleteScreen.d.ts +17 -0
  51. package/dist/src/screens/WithdrawCompleteScreen.d.ts.map +1 -0
  52. package/dist/src/screens/WithdrawCryptoComplete.d.ts +16 -0
  53. package/dist/src/screens/WithdrawCryptoComplete.d.ts.map +1 -0
  54. package/dist/src/screens/WithdrawCryptoCta.d.ts +20 -0
  55. package/dist/src/screens/WithdrawCryptoCta.d.ts.map +1 -0
  56. package/dist/src/screens/WithdrawCryptoForm.d.ts +17 -0
  57. package/dist/src/screens/WithdrawCryptoForm.d.ts.map +1 -0
  58. package/dist/src/screens/WithdrawCryptoScreen.d.ts +17 -0
  59. package/dist/src/screens/WithdrawCryptoScreen.d.ts.map +1 -0
  60. package/dist/src/screens/WithdrawMethodScreen.d.ts +2 -0
  61. package/dist/src/screens/WithdrawMethodScreen.d.ts.map +1 -1
  62. package/dist/src/theme/buildFunkitTheme.d.ts +1 -0
  63. package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -1
  64. package/dist/src/theme/restyle.d.ts +33 -0
  65. package/dist/src/theme/restyle.d.ts.map +1 -1
  66. package/dist/src/theme/toRestyleTheme.d.ts +3 -0
  67. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
  68. package/dist/src/theme/tokens.d.ts +6 -0
  69. package/dist/src/theme/tokens.d.ts.map +1 -1
  70. package/dist/src/transfer/availableChains.d.ts +15 -22
  71. package/dist/src/transfer/availableChains.d.ts.map +1 -1
  72. package/dist/src/transfer/hooks/useCopyDepositAddress.d.ts +17 -0
  73. package/dist/src/transfer/hooks/useCopyDepositAddress.d.ts.map +1 -0
  74. package/dist/src/transfer/hooks/useLighterDepositRecipientOverride.d.ts +23 -0
  75. package/dist/src/transfer/hooks/useLighterDepositRecipientOverride.d.ts.map +1 -0
  76. package/dist/src/transfer/hooks/useTransferInit.d.ts +3 -2
  77. package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -1
  78. package/dist/src/utils/chainDisplay.d.ts +8 -0
  79. package/dist/src/utils/chainDisplay.d.ts.map +1 -0
  80. package/dist/src/utils/customers.d.ts +1 -0
  81. package/dist/src/utils/customers.d.ts.map +1 -1
  82. package/dist/src/withdrawal/sourceToken.d.ts +17 -0
  83. package/dist/src/withdrawal/sourceToken.d.ts.map +1 -0
  84. package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts +44 -0
  85. package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts.map +1 -0
  86. package/dist/src/withdrawal/useCryptoWithdrawalQuote.d.ts +42 -0
  87. package/dist/src/withdrawal/useCryptoWithdrawalQuote.d.ts.map +1 -0
  88. package/dist/src/withdrawal/useCryptoWithdrawalValidation.d.ts +24 -0
  89. package/dist/src/withdrawal/useCryptoWithdrawalValidation.d.ts.map +1 -0
  90. package/dist/src/withdrawal/useSourceTokenDecimals.d.ts +13 -0
  91. package/dist/src/withdrawal/useSourceTokenDecimals.d.ts.map +1 -0
  92. package/dist/src/withdrawal/useWithdrawalDestinationTokens.d.ts +32 -0
  93. package/dist/src/withdrawal/useWithdrawalDestinationTokens.d.ts.map +1 -0
  94. package/dist/src/withdrawal/useWithdrawalExecution.d.ts.map +1 -1
  95. package/dist/src/withdrawal/useWithdrawalRisk.d.ts +16 -0
  96. package/dist/src/withdrawal/useWithdrawalRisk.d.ts.map +1 -0
  97. package/dist/src/withdrawal/useWithdrawalStatus.d.ts +31 -0
  98. package/dist/src/withdrawal/useWithdrawalStatus.d.ts.map +1 -0
  99. package/dist/src/withdrawal/validation.d.ts +48 -0
  100. package/dist/src/withdrawal/validation.d.ts.map +1 -0
  101. package/package.json +3 -3
  102. package/dist/src/screens/AvailableChainsScreen.d.ts +0 -32
  103. package/dist/src/screens/AvailableChainsScreen.d.ts.map +0 -1
  104. package/dist/src/screens/NetworkSelector.d.ts +0 -31
  105. package/dist/src/screens/NetworkSelector.d.ts.map +0 -1
  106. package/dist/src/withdrawal/publicClient.d.ts +0 -10
  107. package/dist/src/withdrawal/publicClient.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"availableChains.d.ts","sourceRoot":"","sources":["../../../src/transfer/availableChains.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAIvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,sDAAsD;AACtD,eAAO,MAAM,cAAc,QAAQ,CAAA;AAEnC,kFAAkF;AAClF,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,OAAO,CAQT;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,CAAC,EACD,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,MAAM,GACP,EAAE;IACD,CAAC,EAAE,SAAS,CAAA;IACZ,gFAAgF;IAChF,YAAY,EAAE,gBAAgB,EAAE,CAAA;IAChC,8EAA8E;IAC9E,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B,GAAG,cAAc,EAAE,CAqBnB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,SAAS,EACZ,YAAY,EAAE,gBAAgB,EAAE,GAC/B,WAAW,EAAE,CAoCf"}
1
+ {"version":3,"file":"availableChains.d.ts","sourceRoot":"","sources":["../../../src/transfer/availableChains.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAGvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAA;IACZ,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,CAAC,EACD,YAAY,EACZ,iBAAiB,EACjB,MAAM,GACP,EAAE;IACD,CAAC,EAAE,SAAS,CAAA;IACZ,gFAAgF;IAChF,YAAY,EAAE,gBAAgB,EAAE,CAAA;IAChC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B,GAAG,cAAc,EAAE,CAsBnB"}
@@ -0,0 +1,17 @@
1
+ import type { ClipboardWriter } from '../clipboard';
2
+ export interface UseCopyDepositAddressParams {
3
+ copyToClipboard: ClipboardWriter;
4
+ /** Shows the "Address copied" toast. */
5
+ onCopySuccess: () => void;
6
+ isTransferOpen: boolean;
7
+ /** Undefined while it's still generating. */
8
+ address: string | undefined;
9
+ }
10
+ /**
11
+ * The Copy buttons' clipboard write + toast, plus the auto-copy when Transfer
12
+ * opens and whenever the address changes.
13
+ *
14
+ * The returned write never rejects; `false` means the address wasn't copied.
15
+ */
16
+ export declare function useCopyDepositAddress({ copyToClipboard, onCopySuccess, isTransferOpen, address, }: UseCopyDepositAddressParams): (value: string) => Promise<boolean>;
17
+ //# sourceMappingURL=useCopyDepositAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCopyDepositAddress.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useCopyDepositAddress.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,eAAe,CAAA;IAChC,wCAAwC;IACxC,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,cAAc,EAAE,OAAO,CAAA;IACvB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,eAAe,EACf,aAAa,EACb,cAAc,EACd,OAAO,GACR,EAAE,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAqCnE"}
@@ -0,0 +1,23 @@
1
+ export interface LighterDepositRecipientOverride {
2
+ /** True when this deposit targets Lighter — callers must not fall back to the L1 wallet address. */
3
+ isLighterDeposit: boolean;
4
+ /** The L2 main-account index. Undefined while the lookup is pending, failed, or found no main account. */
5
+ recipientOverride: string | undefined;
6
+ /** True while the account lookup is in flight — an unresolved recipient is expected then. */
7
+ isLookupFetching: boolean;
8
+ /** Lookup query status, for the unresolved-recipient WARN log. */
9
+ lookupStatus: 'pending' | 'error' | 'success';
10
+ }
11
+ /**
12
+ * Lighter EOA generation targets the L2 main-account index, not the L1
13
+ * address — resolves it as a deposit recipientAddr override (mirrors web's
14
+ * `useLighterAccounts`). `isLighterDeposit` lets callers withhold the L1
15
+ * wallet fallback until `recipientOverride` resolves, since the backend
16
+ * rejects an L1 address for Lighter.
17
+ */
18
+ export declare function useLighterDepositRecipientOverride({ apiKey, targetChain, walletAddress, }: {
19
+ apiKey: string;
20
+ targetChain: string | undefined;
21
+ walletAddress: string | undefined;
22
+ }): LighterDepositRecipientOverride;
23
+ //# sourceMappingURL=useLighterDepositRecipientOverride.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLighterDepositRecipientOverride.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useLighterDepositRecipientOverride.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,+BAA+B;IAC9C,oGAAoG;IACpG,gBAAgB,EAAE,OAAO,CAAA;IACzB,0GAA0G;IAC1G,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,6FAA6F;IAC7F,gBAAgB,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,YAAY,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,MAAM,EACN,WAAW,EACX,aAAa,GACd,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;CAClC,GAAG,+BAA+B,CAclC"}
@@ -20,8 +20,9 @@ export interface UseTransferInitResult {
20
20
  * Thin RN reimplementation of `@funkit/connect`'s `useCheckoutTransferInit`:
21
21
  * builds the (customer-agnostic) transfer params via the core helper and
22
22
  * creates the deposit-address EOA through `@funkit/api-base`. Identity comes
23
- * from {@link useFunkitIdentity}; all web/customer branches (Lighter main
24
- * account, Polymarket target override, geo / post-action gating) are dropped.
23
+ * from {@link useFunkitIdentity}; web's Polymarket target override and geo /
24
+ * post-action gating are dropped. Lighter's main-account override is kept —
25
+ * see {@link useLighterDepositRecipientOverride}.
25
26
  */
26
27
  export declare function useTransferInit({ checkoutConfig, recipientAddr, dynamicRoutingId, enabled, }: UseTransferInitParams): UseTransferInitResult;
27
28
  //# sourceMappingURL=useTransferInit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTransferInit.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTransferInit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,sBAAsB,CAAA;AAa7B,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,kEAAkE;IAClE,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,aAAa,EAAE,UAAU,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAc,GACf,EAAE,qBAAqB,GAAG,qBAAqB,CAsC/C"}
1
+ {"version":3,"file":"useTransferInit.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTransferInit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,sBAAsB,CAAA;AAe7B,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,kEAAkE;IAClE,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,aAAa,EAAE,UAAU,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,OAAc,GACf,EAAE,qBAAqB,GAAG,qBAAqB,CAuF/C"}
@@ -0,0 +1,8 @@
1
+ /** Chain logo, or the placeholder for a chain the metadata doesn't cover. */
2
+ export declare function chainIconUri(chainId: number): string;
3
+ /**
4
+ * The chain's name, or `undefined` when the metadata doesn't know it — callers
5
+ * supply their own fallback, since not all of them have a `t` to hand.
6
+ */
7
+ export declare function chainName(chainId: number): string | undefined;
8
+ //# sourceMappingURL=chainDisplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainDisplay.d.ts","sourceRoot":"","sources":["../../../src/utils/chainDisplay.ts"],"names":[],"mappings":"AAQA,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D"}
@@ -1,2 +1,3 @@
1
1
  export declare function isMallardApiKey(apiKey: string): boolean;
2
+ export declare function isLighterxyzApiKey(apiKey: string): boolean;
2
3
  //# sourceMappingURL=customers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/utils/customers.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD"}
1
+ {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/utils/customers.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D"}
@@ -0,0 +1,17 @@
1
+ import type { WithdrawalFlowConfig, WithdrawalSourceTokenOption, WithdrawalToken } from '../flow/withdrawalFlowConfig';
2
+ /**
3
+ * The source tokens the user may pick between. A host with one source omits
4
+ * `sourceTokens`, leaving the single `sourceToken` as the only option.
5
+ */
6
+ export declare function resolveWithdrawalSourceTokens(config: Pick<WithdrawalFlowConfig, 'sourceToken' | 'sourceTokens'>): WithdrawalSourceTokenOption[];
7
+ /**
8
+ * Resolve the integrator's `withdrawalSourceTokenBalance` callback to a numeric
9
+ * string. Port of web's `resolveWithdrawalSourceTokenBalance`.
10
+ *
11
+ * `undefined` means no callback was supplied, which is not the same as a
12
+ * callback returning `0` ("nothing withdrawable"). A throw or an unusable value
13
+ * yields `'0'`, never `undefined`: a broken callback must not read as "unknown"
14
+ * and let the form fall through to some other balance.
15
+ */
16
+ export declare function resolveWithdrawalSourceBalance(config: Pick<WithdrawalFlowConfig, 'withdrawalSourceTokenBalance'>, sourceToken: WithdrawalToken): string | undefined;
17
+ //# sourceMappingURL=sourceToken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceToken.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/sourceToken.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAQrC;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,cAAc,CAAC,GACjE,2BAA2B,EAAE,CAG/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,EAClE,WAAW,EAAE,eAAe,GAC3B,MAAM,GAAG,SAAS,CAuBpB"}
@@ -0,0 +1,44 @@
1
+ import { type CheckoutQuoteResponse, type WithdrawalExecutionErrorCode } from '@funkit/connect-core';
2
+ import type { WithdrawalFlowCallbacks, WithdrawalFlowConfig, WithdrawalToken } from '../flow/withdrawalFlowConfig';
3
+ export type CryptoWithdrawalSubmission = {
4
+ status: 'idle';
5
+ } | {
6
+ status: 'submitting';
7
+ stepMessage?: string;
8
+ } | {
9
+ status: 'submitted';
10
+ txHash: string;
11
+ submissionId: string;
12
+ /** The amount that executed, not whatever the field says by now. */
13
+ amount: string;
14
+ } | {
15
+ status: 'failed';
16
+ code: WithdrawalExecutionErrorCode;
17
+ };
18
+ export interface UseCryptoWithdrawalExecutionParams {
19
+ config: WithdrawalFlowConfig;
20
+ sourceToken: WithdrawalToken;
21
+ destinationToken: WithdrawalToken;
22
+ callbacks: WithdrawalFlowCallbacks;
23
+ }
24
+ /**
25
+ * Executes the quote the user approved.
26
+ *
27
+ * Both guards are read synchronously inside the async submit — before the first
28
+ * await — so neither may wait for a re-render: a ref for a double-tap on this
29
+ * mount, and a module-scoped set of in-flight withdrawals for a second press
30
+ * after the sheet was closed and reopened mid-execution. The set holds only
31
+ * while the signature is outstanding; deliberately sending the same amount to
32
+ * the same address again once it has settled is a legitimate withdrawal.
33
+ */
34
+ export declare function useCryptoWithdrawalExecution({ config, sourceToken, destinationToken, callbacks, }: UseCryptoWithdrawalExecutionParams): {
35
+ submission: CryptoWithdrawalSubmission;
36
+ submit: ({ quote, recipientAddress, amount, }: {
37
+ /** The quote on screen — executed as-is, so fees shown are fees paid. */
38
+ quote: CheckoutQuoteResponse;
39
+ recipientAddress: string;
40
+ amount: string;
41
+ }) => Promise<void>;
42
+ reset: () => void;
43
+ };
44
+ //# sourceMappingURL=useCryptoWithdrawalExecution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCryptoWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,4BAA4B,EAMlC,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AA4CrC,MAAM,MAAM,0BAA0B,GAClC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C;IACE,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;CACf,GAGD;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,4BAA4B,CAAA;CAAE,CAAA;AAE5D,MAAM,WAAW,kCAAkC;IACjD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,CAAA;IACjC,SAAS,EAAE,uBAAuB,CAAA;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,SAAS,GACV,EAAE,kCAAkC;;mDAY9B;QACD,yEAAyE;QACzE,KAAK,EAAE,qBAAqB,CAAA;QAC5B,gBAAgB,EAAE,MAAM,CAAA;QACxB,MAAM,EAAE,MAAM,CAAA;KACf;;EAuFJ"}
@@ -0,0 +1,42 @@
1
+ import { type CheckoutQuoteResponse } from '@funkit/connect-core';
2
+ import type { FeeBreakdownV2 } from '@funkit/api-base';
3
+ import type { WithdrawalToken } from '../flow/withdrawalFlowConfig';
4
+ export declare const CRYPTO_WITHDRAWAL_QUOTE_QUERY_KEY = "cryptoWithdrawalQuote";
5
+ /**
6
+ * How long a quote stays good for. Used for BOTH `staleTime` and
7
+ * `refetchInterval`, and the equality is load-bearing: with `staleTime: 0`, an
8
+ * `enabled` flip mid-edit remounts the query and refetches the previous key
9
+ * before the new amount lands, replaying a stale quote. The interval keeps it
10
+ * fresh regardless.
11
+ */
12
+ export declare const QUOTE_REFRESH_INTERVAL_MS = 25000;
13
+ export interface CryptoWithdrawalQuoteView {
14
+ /** Executed as-is by the pipeline — never rebuilt from the fields below. */
15
+ raw: CheckoutQuoteResponse;
16
+ /** What the recipient gets, in destination-token units. */
17
+ receiveAmount: string | undefined;
18
+ fees: FeeBreakdownV2;
19
+ }
20
+ export interface UseCryptoWithdrawalQuoteParams {
21
+ sourceToken: WithdrawalToken;
22
+ destinationToken: WithdrawalToken | undefined;
23
+ recipientAddress: string;
24
+ /** Source-token units. Already debounced and settled by the caller. */
25
+ amount: string;
26
+ walletAddress: string;
27
+ /** The caller's own gate — validation, risk, blacklist (see `useQuoteGate`). */
28
+ enabled: boolean;
29
+ }
30
+ /**
31
+ * The EXACT_IN quote for a crypto withdrawal, refreshed on an interval so the
32
+ * fees on screen stay the fees that execute.
33
+ *
34
+ * The query key is the inputs themselves — no context round-trip — so a quote
35
+ * can never describe a different withdrawal than the form shows.
36
+ */
37
+ export declare function useCryptoWithdrawalQuote({ sourceToken, destinationToken, recipientAddress, amount, walletAddress, enabled, }: UseCryptoWithdrawalQuoteParams): {
38
+ quote: CryptoWithdrawalQuoteView | undefined;
39
+ isLoading: boolean;
40
+ isError: boolean;
41
+ };
42
+ //# sourceMappingURL=useCryptoWithdrawalQuote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCryptoWithdrawalQuote.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalQuote.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAK3B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAItD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAKnE,eAAO,MAAM,iCAAiC,0BAA0B,CAAA;AAExE;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,QAAS,CAAA;AAE/C,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,GAAG,EAAE,qBAAqB,CAAA;IAC1B,2DAA2D;IAC3D,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,IAAI,EAAE,cAAc,CAAA;CACrB;AAED,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,gBAAgB,EAAE,MAAM,CAAA;IACxB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,OAAO,GACR,EAAE,8BAA8B;;;;EAiEhC"}
@@ -0,0 +1,24 @@
1
+ import { type WithdrawalAmountValidation } from '@funkit/connect-core';
2
+ import type { WithdrawalFlowConfig, WithdrawalToken } from '../flow/withdrawalFlowConfig';
3
+ import { type WithdrawCtaBlocker } from './validation';
4
+ export interface CryptoWithdrawalValidation {
5
+ /** Recipient the funds would be lost in (e.g. a token contract). */
6
+ isRecipientBlacklisted: boolean;
7
+ amountValidation: WithdrawalAmountValidation;
8
+ /** The single thing left to fix, or `undefined` when the form is complete. */
9
+ ctaBlocker: WithdrawCtaBlocker | undefined;
10
+ }
11
+ /**
12
+ * Everything the crypto withdrawal form knows synchronously about what the user
13
+ * has typed. The Statsig-backed blacklist is why this is a hook; the verdicts
14
+ * themselves come from the pure functions in `validation.ts`.
15
+ */
16
+ export declare function useCryptoWithdrawalValidation({ config, sourceToken, destinationToken, amount, recipient, balance, }: {
17
+ config: WithdrawalFlowConfig;
18
+ sourceToken: WithdrawalToken;
19
+ destinationToken: WithdrawalToken | undefined;
20
+ amount: string;
21
+ recipient: string;
22
+ balance: string | undefined;
23
+ }): CryptoWithdrawalValidation;
24
+ //# sourceMappingURL=useCryptoWithdrawalValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCryptoWithdrawalValidation.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useCryptoWithdrawalValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,0BAA0B;IACzC,oEAAoE;IACpE,sBAAsB,EAAE,OAAO,CAAA;IAC/B,gBAAgB,EAAE,0BAA0B,CAAA;IAC5C,8EAA8E;IAC9E,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,0BAA0B,CAiC7B"}
@@ -0,0 +1,13 @@
1
+ import type { WithdrawalToken } from '../flow/withdrawalFlowConfig';
2
+ export declare const SOURCE_TOKEN_DECIMALS_QUERY_KEY = "sourceTokenDecimals";
3
+ /**
4
+ * Decimals for the amount conversion: the host's value when it has one,
5
+ * otherwise read on-chain. A stale host value would mis-scale the transfer, so
6
+ * the read is preferred over a guess.
7
+ *
8
+ * Its own query rather than a step inside the quote, so the read runs once per
9
+ * token — as soon as the form knows what it is spending — instead of on every
10
+ * 25-second quote refresh.
11
+ */
12
+ export declare function useSourceTokenDecimals(sourceToken: WithdrawalToken): number | undefined;
13
+ //# sourceMappingURL=useSourceTokenDecimals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSourceTokenDecimals.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useSourceTokenDecimals.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,eAAO,MAAM,+BAA+B,wBAAwB,CAAA;AAEpE;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,eAAe,GAC3B,MAAM,GAAG,SAAS,CA2BpB"}
@@ -0,0 +1,32 @@
1
+ import type { WithdrawalToken } from '../flow/withdrawalFlowConfig';
2
+ export declare const WITHDRAWAL_DESTINATION_TOKENS_QUERY_KEY = "withdrawalDestinations";
3
+ export interface DestinationChain {
4
+ chainId: number;
5
+ /** Symbols receivable on this chain, priority ones first. */
6
+ symbols: string[];
7
+ }
8
+ export interface UseWithdrawalDestinationTokensResult {
9
+ chains: DestinationChain[];
10
+ /** Where the funds land. `undefined` until the curated list resolves. */
11
+ destinationToken: WithdrawalToken | undefined;
12
+ selectDestinationToken: (chainId: number, symbol: string) => void;
13
+ isLoading: boolean;
14
+ }
15
+ /**
16
+ * Everything a withdrawal can be received as: the curated Statsig
17
+ * `withdrawalconfig` chains and assets, minus
18
+ * `disablewithdrawalchainsandassets`, resolved against api-base's asset
19
+ * metadata — the same pipeline the deposit list uses, and the same one web
20
+ * feeds into its receive-token dropdown.
21
+ *
22
+ * The destination token is the point of this rail. Sending the source token back out
23
+ * on its own chain is a plain transfer with nothing to quote; the relay quote
24
+ * exists precisely so a user holding USDG on one chain can receive USDC on
25
+ * another.
26
+ */
27
+ export declare function useWithdrawalDestinationTokens({ sourceToken, defaultReceiveToken, }: {
28
+ sourceToken: WithdrawalToken;
29
+ /** Symbol to preselect; falls back to the source token's symbol. */
30
+ defaultReceiveToken?: string;
31
+ }): UseWithdrawalDestinationTokensResult;
32
+ //# sourceMappingURL=useWithdrawalDestinationTokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWithdrawalDestinationTokens.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalDestinationTokens.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAKnE,eAAO,MAAM,uCAAuC,2BAA2B,CAAA;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,oCAAoC;IACnD,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,yEAAyE;IACzE,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;IAC7C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACjE,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,mBAAmB,GACpB,EAAE;IACD,WAAW,EAAE,eAAe,CAAA;IAC5B,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,GAAG,oCAAoC,CA2EvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAK3B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAmBrC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,oBAAoB,CAAA;IAC5B,oFAAoF;IACpF,KAAK,EAAE,qBAAqB,CAAA;IAC5B,SAAS,EAAE,uBAAuB,CAAA;IAClC,8DAA8D;IAC9D,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,GACR,EAAE,4BAA4B,GAAG;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D,CA4FA"}
1
+ {"version":3,"file":"useWithdrawalExecution.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAM3B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,8BAA8B,CAAA;AAkBrC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,oBAAoB,CAAA;IAC5B,oFAAoF;IACpF,KAAK,EAAE,qBAAqB,CAAA;IAC5B,SAAS,EAAE,uBAAuB,CAAA;IAClC,8DAA8D;IAC9D,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,KAAK,EACL,SAAS,EACT,OAAO,GACR,EAAE,4BAA4B,GAAG;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D,CA4FA"}
@@ -0,0 +1,16 @@
1
+ export declare const WITHDRAWAL_RISK_QUERY_KEY = "withdrawalRisk";
2
+ export interface WithdrawalRiskResult {
3
+ /** `true` blocks. `undefined` while unknown — which also blocks. */
4
+ isRisky: boolean | undefined;
5
+ isChecking: boolean;
6
+ isError: boolean;
7
+ }
8
+ /**
9
+ * Chainalysis screening for the recipient.
10
+ *
11
+ * **Fails closed**: callers must require `isRisky === false`, so in-flight and
12
+ * errored both block. The chain id only gates the query — risk is a property of
13
+ * the address, so it stays out of the key (web does the same).
14
+ */
15
+ export declare function useWithdrawalRisk(address: string, chainId: number | undefined): WithdrawalRiskResult;
16
+ //# sourceMappingURL=useWithdrawalRisk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWithdrawalRisk.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalRisk.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;AAEzD,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,oBAAoB,CAkCtB"}
@@ -0,0 +1,31 @@
1
+ import { RelayExecutionStatus } from '@funkit/api-base';
2
+ export declare const WITHDRAWAL_STATUS_QUERY_KEY = "withdrawalStatus";
3
+ /**
4
+ * Whether there is still anything to learn by asking again. Split out because
5
+ * the "record never appeared" bound is the part worth testing directly — driving
6
+ * it through the query would mean waiting out real poll intervals.
7
+ */
8
+ export declare function shouldKeepPollingStatus({ status, hasRecord, failedFetches, }: {
9
+ status: RelayExecutionStatus | undefined;
10
+ hasRecord: boolean;
11
+ failedFetches: number;
12
+ }): boolean;
13
+ export interface WithdrawalStatusResult {
14
+ status: RelayExecutionStatus | undefined;
15
+ /** Confirmed on-chain. Only `SUCCESS` — not merely "stopped moving". */
16
+ isCompleted: boolean;
17
+ /** `FAILURE` or `REFUND`: the transfer did not reach the recipient. */
18
+ isFailed: boolean;
19
+ /** Funds came back to the sender, so there is nothing to chase. */
20
+ isRefunded: boolean;
21
+ }
22
+ /**
23
+ * Follow a submitted withdrawal to a terminal state.
24
+ *
25
+ * The record is written best-effort by the pipeline, so a missing one is not a
26
+ * failure — the transfer is already on-chain. It just means we cannot report
27
+ * progress, and polling stops rather than hammering the API forever. An
28
+ * explicit terminal failure is different, and is reported as one.
29
+ */
30
+ export declare function useWithdrawalStatus(txHash: string | undefined): WithdrawalStatusResult;
31
+ //# sourceMappingURL=useWithdrawalStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWithdrawalStatus.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/useWithdrawalStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAErB,MAAM,kBAAkB,CAAA;AAUzB,eAAO,MAAM,2BAA2B,qBAAqB,CAAA;AAU7D;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,SAAS,EACT,aAAa,GACd,EAAE;IACD,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,GAAG,OAAO,CAGV;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;IACxC,wEAAwE;IACxE,WAAW,EAAE,OAAO,CAAA;IACpB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAA;IACjB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,sBAAsB,CA0CxB"}
@@ -0,0 +1,48 @@
1
+ import { type WithdrawalAmountValidation } from '@funkit/connect-core';
2
+ import type { WithdrawalFlowConfig, WithdrawalToken } from '../flow/withdrawalFlowConfig';
3
+ /**
4
+ * The one thing the user has left to fix, named so the submit button can say it.
5
+ *
6
+ * Nothing left to fix is `undefined`, not a `ready` member: these are what the
7
+ * typed form is missing, and that is not the same as being submittable — the
8
+ * async verdicts (risk screening, a settled quote) decide that.
9
+ */
10
+ export type WithdrawCtaBlocker = 'enter-recipient' | 'unsupported-recipient' | 'recipient-same-as-source' | 'max-exceeded' | 'enter-amount' | 'select-destination' | 'invalid-for-chain';
11
+ /**
12
+ * Amount limits, resolved from the host's callbacks.
13
+ *
14
+ * `sourceTokenUsdPrice` is 0 until a price source is wired: the core validator
15
+ * reads that as "no price", which leaves the USD floor and ceiling inert while
16
+ * still applying the per-token minimum and the balance check. It is not a
17
+ * stand-in value — 0 genuinely means unknown here.
18
+ */
19
+ export declare function validateAmount({ config, sourceToken, amount, balance, }: {
20
+ config: Pick<WithdrawalFlowConfig, 'getMinWithdrawalAmount' | 'getMinWithdrawalUSD' | 'getMaxWithdrawalUSD'>;
21
+ sourceToken: WithdrawalToken;
22
+ amount: string;
23
+ balance: string | undefined;
24
+ }): WithdrawalAmountValidation;
25
+ /**
26
+ * A same-chain, same-token transfer back to the sending wallet. Relay rejects
27
+ * these with a generic error, so name the reason before quoting.
28
+ */
29
+ export declare function isNoOpSelfWithdrawal({ recipientAddress, walletAddress, sourceToken, destinationToken, }: {
30
+ recipientAddress: string;
31
+ walletAddress: string;
32
+ sourceToken: WithdrawalToken;
33
+ destinationToken: WithdrawalToken | undefined;
34
+ }): boolean;
35
+ /**
36
+ * Order is a faithful port of web's `getWithdrawButtonText`: the most specific
37
+ * blocker wins, so the user is told the one thing to fix next rather than the
38
+ * first thing that happens to fail.
39
+ */
40
+ export declare function getWithdrawCtaBlocker({ recipientAddress, isRecipientBlacklisted, isRecipientSameAsSource, amount, amountValidation, destinationToken, }: {
41
+ recipientAddress: string;
42
+ isRecipientBlacklisted: boolean;
43
+ isRecipientSameAsSource: boolean;
44
+ amount: string;
45
+ amountValidation: WithdrawalAmountValidation;
46
+ destinationToken: WithdrawalToken | undefined;
47
+ }): WithdrawCtaBlocker | undefined;
48
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAMrC;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,uBAAuB,GACvB,0BAA0B,GAC1B,cAAc,GACd,cAAc,GACd,oBAAoB,GACpB,mBAAmB,CAAA;AAEvB;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,IAAI,CACV,oBAAoB,EACpB,wBAAwB,GAAG,qBAAqB,GAAG,qBAAqB,CACzE,CAAA;IACD,WAAW,EAAE,eAAe,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,GAAG,0BAA0B,CAiC7B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C,GAAG,OAAO,CAOV;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,EACN,gBAAgB,EAChB,gBAAgB,GACjB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,uBAAuB,EAAE,OAAO,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,0BAA0B,CAAA;IAC5C,gBAAgB,EAAE,eAAe,GAAG,SAAS,CAAA;CAC9C,GAAG,kBAAkB,GAAG,SAAS,CAiBjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect-rn",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "React Native bindings for @funkit/connect. Re-exports the headless @funkit/connect-core logic; the RN platform halves (Restyle theme, WebView Swapped transport, Transfer/Swapped screens, logging) land in later releases.",
5
5
  "files": [
6
6
  "dist",
@@ -32,9 +32,9 @@
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
34
  "@shopify/restyle": "^2.4.5",
35
- "@funkit/api-base": "6.0.0",
35
+ "@funkit/api-base": "7.0.0",
36
36
  "@funkit/chains": "2.2.0",
37
- "@funkit/connect-core": "2.4.0"
37
+ "@funkit/connect-core": "2.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@gorhom/bottom-sheet": ">=5",
@@ -1,32 +0,0 @@
1
- /**
2
- * One chain row in {@link AvailableChainsScreen} — a member chain of the
3
- * selected deposit network (e.g. Ethereum within the EVM group). The SDK
4
- * derives these from the curated `tokentransferconfig` + `@funkit/chains`
5
- * metadata + the `mintokentransfervalue` config (see `buildAvailableChains`).
6
- */
7
- export interface AvailableChain {
8
- id: string;
9
- /** Display name, e.g. `Ethereum`, `Binance Smart Chain`. */
10
- name: string;
11
- /** Full CDN logo URL for the 36px chain icon. */
12
- iconUri: string;
13
- /** Minimum-deposit label shown on the trailing side, e.g. `Min $10`. */
14
- minLabel?: string;
15
- }
16
- /**
17
- * The "Available {network} Chains" screen — reached by tapping the chain-logo
18
- * cluster on the Transfer screen. An X-close + centered title bar, then a
19
- * read-only list of the
20
- * network's member chains with their minimum-deposit amounts. Presentational:
21
- * the host supplies the chain rows.
22
- */
23
- export interface AvailableChainsScreenProps {
24
- /** Network whose chains are listed; the title reads `Available {networkLabel}`. */
25
- networkLabel: string;
26
- chains: AvailableChain[];
27
- loading?: boolean;
28
- skeletonCount?: number;
29
- onClose?: () => void;
30
- }
31
- export declare function AvailableChainsScreen(props: AvailableChainsScreenProps): import("react").JSX.Element;
32
- //# sourceMappingURL=AvailableChainsScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AvailableChainsScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/AvailableChainsScreen.tsx"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BA0JtE"}
@@ -1,31 +0,0 @@
1
- /**
2
- * One network in {@link NetworkSelector}. The leading glyph is built from chain
3
- * logos (asset-free): a single entry renders one logo, several render a 2×2
4
- * cluster (e.g. the EVM group).
5
- */
6
- export interface NetworkOption {
7
- /** Stable id passed back to `onSelect` (e.g. the deposit-chain id). */
8
- id: string;
9
- /** Label shown when this network is selected, e.g. `"EVM Chains"`. */
10
- label: string;
11
- /**
12
- * Chain logos — either CDN chain **keys** (e.g. `['ethereum']`) or full image
13
- * **URLs** (`@funkit/chains` `iconUrl`s). One → single logo, several → a 2×2
14
- * cluster.
15
- */
16
- iconKeys: string[];
17
- }
18
- export interface NetworkSelectorProps {
19
- networks: NetworkOption[];
20
- selectedId: string;
21
- onSelect: (id: string) => void;
22
- }
23
- /**
24
- * The Transfer Crypto network switcher (Figma: Fun Mobile / Transfer Crypto
25
- * `selector-v2`). A pill-shaped segmented control: the selected network expands
26
- * to a white pill with its glyph + label, the rest collapse to icon-only
27
- * buttons. Built from the connect-rn Restyle theme; chain glyphs resolve from
28
- * the CDN so the package stays asset-free.
29
- */
30
- export declare function NetworkSelector({ networks, selectedId, onSelect, }: NetworkSelectorProps): import("react").JSX.Element;
31
- //# sourceMappingURL=NetworkSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NetworkSelector.d.ts","sourceRoot":"","sources":["../../../src/screens/NetworkSelector.tsx"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAA;IACV,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAOD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,oBAAoB,+BA+EtB"}
@@ -1,10 +0,0 @@
1
- import { type PublicClient } from 'viem';
2
- /**
3
- * Read-only client for a funkit-supported chain, built over the chain's
4
- * fallback RPC list from @funkit/chains (the chain's default RPC may be
5
- * private — e.g. the Robinhood chain — so the curated list matters).
6
- * `undefined` for unsupported chain ids; the caller surfaces that as a
7
- * mis-routed target.
8
- */
9
- export declare function getPublicClientFor(chainId: number): Pick<PublicClient, 'readContract'> | undefined;
10
- //# sourceMappingURL=publicClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publicClient.d.ts","sourceRoot":"","sources":["../../../src/withdrawal/publicClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,MAAM,CAAA;AAM5E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,SAAS,CAehD"}