@funkit/connect-rn 3.4.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 (79) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2261 -387
  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/RecipientAddressInput.d.ts +28 -0
  9. package/dist/src/components/RecipientAddressInput.d.ts.map +1 -0
  10. package/dist/src/components/WithdrawFeeSummary.d.ts +17 -0
  11. package/dist/src/components/WithdrawFeeSummary.d.ts.map +1 -0
  12. package/dist/src/flow/FlowSheet.d.ts +10 -1
  13. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  14. package/dist/src/flow/FunkitFlowProvider.d.ts +4 -1
  15. package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
  16. package/dist/src/flow/guardHostCallbacks.d.ts +11 -0
  17. package/dist/src/flow/guardHostCallbacks.d.ts.map +1 -0
  18. package/dist/src/flow/useKeyboardHeight.d.ts +4 -10
  19. package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -1
  20. package/dist/src/flow/withdrawalFlowConfig.d.ts +61 -9
  21. package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -1
  22. package/dist/src/geo/useUserIpInfo.d.ts.map +1 -1
  23. package/dist/src/identity/IdentityContext.d.ts.map +1 -1
  24. package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
  25. package/dist/src/logging/serializeLogBatch.d.ts +9 -0
  26. package/dist/src/logging/serializeLogBatch.d.ts.map +1 -0
  27. package/dist/src/providers/FunkitProvider.d.ts +9 -1
  28. package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
  29. package/dist/src/screens/SelectDestinationScreen.d.ts +19 -0
  30. package/dist/src/screens/SelectDestinationScreen.d.ts.map +1 -0
  31. package/dist/src/screens/WithdrawCompleteScreen.d.ts +17 -0
  32. package/dist/src/screens/WithdrawCompleteScreen.d.ts.map +1 -0
  33. package/dist/src/screens/WithdrawCryptoComplete.d.ts +16 -0
  34. package/dist/src/screens/WithdrawCryptoComplete.d.ts.map +1 -0
  35. package/dist/src/screens/WithdrawCryptoCta.d.ts +20 -0
  36. package/dist/src/screens/WithdrawCryptoCta.d.ts.map +1 -0
  37. package/dist/src/screens/WithdrawCryptoForm.d.ts +17 -0
  38. package/dist/src/screens/WithdrawCryptoForm.d.ts.map +1 -0
  39. package/dist/src/screens/WithdrawCryptoScreen.d.ts +3 -1
  40. package/dist/src/screens/WithdrawCryptoScreen.d.ts.map +1 -1
  41. package/dist/src/theme/buildFunkitTheme.d.ts +1 -0
  42. package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -1
  43. package/dist/src/theme/restyle.d.ts +33 -0
  44. package/dist/src/theme/restyle.d.ts.map +1 -1
  45. package/dist/src/theme/toRestyleTheme.d.ts +3 -0
  46. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
  47. package/dist/src/theme/tokens.d.ts +6 -0
  48. package/dist/src/theme/tokens.d.ts.map +1 -1
  49. package/dist/src/transfer/availableChains.d.ts.map +1 -1
  50. package/dist/src/transfer/hooks/useLighterDepositRecipientOverride.d.ts +23 -0
  51. package/dist/src/transfer/hooks/useLighterDepositRecipientOverride.d.ts.map +1 -0
  52. package/dist/src/transfer/hooks/useTransferInit.d.ts +3 -2
  53. package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -1
  54. package/dist/src/utils/chainDisplay.d.ts +8 -0
  55. package/dist/src/utils/chainDisplay.d.ts.map +1 -0
  56. package/dist/src/utils/customers.d.ts +1 -0
  57. package/dist/src/utils/customers.d.ts.map +1 -1
  58. package/dist/src/withdrawal/sourceToken.d.ts +17 -0
  59. package/dist/src/withdrawal/sourceToken.d.ts.map +1 -0
  60. package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts +44 -0
  61. package/dist/src/withdrawal/useCryptoWithdrawalExecution.d.ts.map +1 -0
  62. package/dist/src/withdrawal/useCryptoWithdrawalQuote.d.ts +42 -0
  63. package/dist/src/withdrawal/useCryptoWithdrawalQuote.d.ts.map +1 -0
  64. package/dist/src/withdrawal/useCryptoWithdrawalValidation.d.ts +24 -0
  65. package/dist/src/withdrawal/useCryptoWithdrawalValidation.d.ts.map +1 -0
  66. package/dist/src/withdrawal/useSourceTokenDecimals.d.ts +13 -0
  67. package/dist/src/withdrawal/useSourceTokenDecimals.d.ts.map +1 -0
  68. package/dist/src/withdrawal/useWithdrawalDestinationTokens.d.ts +32 -0
  69. package/dist/src/withdrawal/useWithdrawalDestinationTokens.d.ts.map +1 -0
  70. package/dist/src/withdrawal/useWithdrawalExecution.d.ts.map +1 -1
  71. package/dist/src/withdrawal/useWithdrawalRisk.d.ts +16 -0
  72. package/dist/src/withdrawal/useWithdrawalRisk.d.ts.map +1 -0
  73. package/dist/src/withdrawal/useWithdrawalStatus.d.ts +31 -0
  74. package/dist/src/withdrawal/useWithdrawalStatus.d.ts.map +1 -0
  75. package/dist/src/withdrawal/validation.d.ts +48 -0
  76. package/dist/src/withdrawal/validation.d.ts.map +1 -0
  77. package/package.json +3 -3
  78. package/dist/src/withdrawal/publicClient.d.ts +0 -10
  79. package/dist/src/withdrawal/publicClient.d.ts.map +0 -1
@@ -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,EACp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version": "3.4.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.1"
37
+ "@funkit/connect-core": "2.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@gorhom/bottom-sheet": ">=5",
@@ -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"}