@funkit/connect-rn 0.2.0-next.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.
- package/README.md +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2694 -0
- package/dist/index.js.map +7 -0
- package/dist/src/flow/FunkitFlowProvider.d.ts +20 -0
- package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -0
- package/dist/src/flow/depositFlowConfig.d.ts +70 -0
- package/dist/src/flow/depositFlowConfig.d.ts.map +1 -0
- package/dist/src/geo/useUserIpInfo.d.ts +22 -0
- package/dist/src/geo/useUserIpInfo.d.ts.map +1 -0
- package/dist/src/icons/ChainClusterIcon.d.ts +12 -0
- package/dist/src/icons/ChainClusterIcon.d.ts.map +1 -0
- package/dist/src/icons/FunIcon.d.ts +18 -0
- package/dist/src/icons/FunIcon.d.ts.map +1 -0
- package/dist/src/icons/assetLogos.d.ts +12 -0
- package/dist/src/icons/assetLogos.d.ts.map +1 -0
- package/dist/src/icons/funIconUri.d.ts +16 -0
- package/dist/src/icons/funIconUri.d.ts.map +1 -0
- package/dist/src/identity/IdentityContext.d.ts +52 -0
- package/dist/src/identity/IdentityContext.d.ts.map +1 -0
- package/dist/src/logging/consoleLogTransport.d.ts +10 -0
- package/dist/src/logging/consoleLogTransport.d.ts.map +1 -0
- package/dist/src/logging/datadogHttpLogTransport.d.ts +46 -0
- package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -0
- package/dist/src/logging/logger.d.ts +9 -0
- package/dist/src/logging/logger.d.ts.map +1 -0
- package/dist/src/providers/FunkitProvider.d.ts +55 -0
- package/dist/src/providers/FunkitProvider.d.ts.map +1 -0
- package/dist/src/providers/FunkitStatsigProvider.d.ts +13 -0
- package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -0
- package/dist/src/providers/index.d.ts +2 -0
- package/dist/src/providers/index.d.ts.map +1 -0
- package/dist/src/providers/useFunkitCheckout.d.ts +14 -0
- package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -0
- package/dist/src/screens/AddMoneyScreen.d.ts +31 -0
- package/dist/src/screens/AddMoneyScreen.d.ts.map +1 -0
- package/dist/src/screens/ChooseChainScreen.d.ts +35 -0
- package/dist/src/screens/ChooseChainScreen.d.ts.map +1 -0
- package/dist/src/screens/CryptoCashToggle.d.ts +17 -0
- package/dist/src/screens/CryptoCashToggle.d.ts.map +1 -0
- package/dist/src/screens/QrCodeScreen.d.ts +26 -0
- package/dist/src/screens/QrCodeScreen.d.ts.map +1 -0
- package/dist/src/screens/SupportedTokensScreen.d.ts +44 -0
- package/dist/src/screens/SupportedTokensScreen.d.ts.map +1 -0
- package/dist/src/screens/TransferCryptoScreen.d.ts +29 -0
- package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -0
- package/dist/src/statsig/StatsigClientRN.d.ts +6 -0
- package/dist/src/statsig/StatsigClientRN.d.ts.map +1 -0
- package/dist/src/statsig/StatsigProviderRN.d.ts +7 -0
- package/dist/src/statsig/StatsigProviderRN.d.ts.map +1 -0
- package/dist/src/statsig/appVisibilityShim.d.ts +2 -0
- package/dist/src/statsig/appVisibilityShim.d.ts.map +1 -0
- package/dist/src/statsig/preloadedAsyncStorage.d.ts +3 -0
- package/dist/src/statsig/preloadedAsyncStorage.d.ts.map +1 -0
- package/dist/src/statsig/rnSetup.d.ts +3 -0
- package/dist/src/statsig/rnSetup.d.ts.map +1 -0
- package/dist/src/statsig/statsigMetadata.d.ts +2 -0
- package/dist/src/statsig/statsigMetadata.d.ts.map +1 -0
- package/dist/src/statsig/useClientAsyncInitRN.d.ts +7 -0
- package/dist/src/statsig/useClientAsyncInitRN.d.ts.map +1 -0
- package/dist/src/statsig/useClientBootstrapInitRN.d.ts +4 -0
- package/dist/src/statsig/useClientBootstrapInitRN.d.ts.map +1 -0
- package/dist/src/swapped/SwappedScreen.d.ts +21 -0
- package/dist/src/swapped/SwappedScreen.d.ts.map +1 -0
- package/dist/src/swapped/SwappedWebView.d.ts +18 -0
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -0
- package/dist/src/swapped/webViewSwappedTransport.d.ts +47 -0
- package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -0
- package/dist/src/theme/FunkitProvider.d.ts +45 -0
- package/dist/src/theme/FunkitProvider.d.ts.map +1 -0
- package/dist/src/theme/FunkitThemeProvider.d.ts +50 -0
- package/dist/src/theme/FunkitThemeProvider.d.ts.map +1 -0
- package/dist/src/theme/index.d.ts +7 -0
- package/dist/src/theme/index.d.ts.map +1 -0
- package/dist/src/theme/restyle.d.ts +5125 -0
- package/dist/src/theme/restyle.d.ts.map +1 -0
- package/dist/src/theme/toRestyleTheme.d.ts +448 -0
- package/dist/src/theme/toRestyleTheme.d.ts.map +1 -0
- package/dist/src/theme/tokens.d.ts +115 -0
- package/dist/src/theme/tokens.d.ts.map +1 -0
- package/dist/src/theme/useColorScheme.d.ts +25 -0
- package/dist/src/theme/useColorScheme.d.ts.map +1 -0
- package/dist/src/theme/useFunkitTheme.d.ts +29 -0
- package/dist/src/theme/useFunkitTheme.d.ts.map +1 -0
- package/dist/src/transfer/QrCode.d.ts +15 -0
- package/dist/src/transfer/QrCode.d.ts.map +1 -0
- package/dist/src/transfer/clipboard.d.ts +15 -0
- package/dist/src/transfer/clipboard.d.ts.map +1 -0
- package/dist/src/transfer/fops.d.ts +26 -0
- package/dist/src/transfer/fops.d.ts.map +1 -0
- package/dist/src/transfer/formatDepositAddress.d.ts +9 -0
- package/dist/src/transfer/formatDepositAddress.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useFops.d.ts +38 -0
- package/dist/src/transfer/hooks/useFops.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useSupportedTokens.d.ts +26 -0
- package/dist/src/transfer/hooks/useSupportedTokens.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useTokenTransfer.d.ts +33 -0
- package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useTransferInit.d.ts +27 -0
- package/dist/src/transfer/hooks/useTransferInit.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useUDAParams.d.ts +9 -0
- package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -0
- package/dist/src/transfer/supportedTokens.d.ts +23 -0
- package/dist/src/transfer/supportedTokens.d.ts.map +1 -0
- package/dist/src/version.d.ts +2 -0
- package/dist/src/version.d.ts.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QrCode.d.ts","sourceRoot":"","sources":["../../../src/transfer/QrCode.tsx"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,IAAU,EAAE,EAAE,WAAW,2CAUxD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy text to the clipboard via the optional `@react-native-clipboard/clipboard`
|
|
3
|
+
* peer.
|
|
4
|
+
*
|
|
5
|
+
* The peer is a native module, so it's loaded **lazily** (dynamic import) and
|
|
6
|
+
* guarded: a host that hasn't linked it — an un-rebuilt dev client, Expo Go, or
|
|
7
|
+
* a consumer that just didn't install the peer — degrades to a no-op + warning
|
|
8
|
+
* instead of crashing at startup with the TurboModule invariant
|
|
9
|
+
* `'RNCClipboard' could not be found`. A static top-level import would evaluate
|
|
10
|
+
* the native spec at bundle-eval time and brick the whole app.
|
|
11
|
+
*
|
|
12
|
+
* Returns whether the copy succeeded.
|
|
13
|
+
*/
|
|
14
|
+
export declare function copyToClipboard(value: string): Promise<boolean>;
|
|
15
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../src/transfer/clipboard.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAarE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ExchangeRates, type SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
|
+
/** A cash-tab payment row, derived from a Swapped form of payment. */
|
|
3
|
+
export interface FopRow {
|
|
4
|
+
/** Stable id passed back to `onSelectFop`. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Display name, e.g. "Card", "Apple Pay". */
|
|
7
|
+
name: string;
|
|
8
|
+
/** CDN icon URL (rendered via `FunIcon`). */
|
|
9
|
+
iconUri: string;
|
|
10
|
+
/** Subtitle, e.g. "$10,000.00 limit • Instant". */
|
|
11
|
+
subtitle: string;
|
|
12
|
+
/**
|
|
13
|
+
* Disabled when the FOP has no embedded-flow URL — these are the
|
|
14
|
+
* "coming soon" placeholders Swapped returns when geoblocked/unavailable.
|
|
15
|
+
*/
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Map Swapped forms of payment to Add money rows. Subtitle mirrors the Figma:
|
|
20
|
+
* `"<limit> limit"`, with `" · 1-2 days"` appended for bank transfers. The
|
|
21
|
+
* limit is the FOP's max converted to USD via {@link getFopsLimit} (falls back
|
|
22
|
+
* to a default when no exchange rate is available — RN doesn't fetch rates in
|
|
23
|
+
* V1).
|
|
24
|
+
*/
|
|
25
|
+
export declare function toFopRows(fops: SwappedFormOfPayment[], exchangeRates?: ExchangeRates): FopRow[];
|
|
26
|
+
//# sourceMappingURL=fops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fops.d.ts","sourceRoot":"","sources":["../../../src/transfer/fops.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAGzB,sEAAsE;AACtE,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAOD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,oBAAoB,EAAE,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM,EAAE,CAeV"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncate a deposit address for display, e.g.
|
|
3
|
+
* `0x7854f3…5139F0` (Figma: Transfer Crypto). Keeps the leading + trailing
|
|
4
|
+
* characters with an ellipsis between; short strings are returned unchanged.
|
|
5
|
+
* Kept local (not `@funkit/utils`) so connect-rn doesn't take that dep just for
|
|
6
|
+
* one formatter, and so the lead/trail counts can match the RN design.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatDepositAddress(address: string | undefined, leading?: number, trailing?: number): string;
|
|
9
|
+
//# sourceMappingURL=formatDepositAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDepositAddress.d.ts","sourceRoot":"","sources":["../../../src/transfer/formatDepositAddress.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,SAAI,EACX,QAAQ,SAAI,GACX,MAAM,CAQR"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
|
+
import { type CheckoutTokenTransferConfig } from '@funkit/connect-core';
|
|
3
|
+
export interface UseFopsParams {
|
|
4
|
+
/** Destination chain/asset — drives the deposit recipient + FOP query. */
|
|
5
|
+
checkoutConfig: CheckoutTokenTransferConfig | undefined;
|
|
6
|
+
dynamicRoutingId?: string;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UseFopsResult {
|
|
10
|
+
/**
|
|
11
|
+
* The user's saved forms of payment (e.g. "Mastercard (…3869)"). Rendered at
|
|
12
|
+
* the top of the Add money list, above the Crypto row — mirroring web, where
|
|
13
|
+
* saved FOPs sort first.
|
|
14
|
+
*/
|
|
15
|
+
savedFops: SwappedFormOfPayment[];
|
|
16
|
+
/** Generic forms of payment (Card / Apple Pay / Revolut Pay / Bank Transfer). */
|
|
17
|
+
genericFops: SwappedFormOfPayment[];
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
isFetching: boolean;
|
|
20
|
+
/** Whether Swapped (cash) methods are offered at all. */
|
|
21
|
+
isSwappedEnabled: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Thin RN port of `@funkit/connect`'s `useFops`: fetches the Swapped forms of
|
|
25
|
+
* payment (`getFops`) that populate the "Use Cash" tab. Identity comes from
|
|
26
|
+
* {@link useFunkitIdentity}; the deposit recipient is derived from
|
|
27
|
+
* {@link useTransferInit} + the core `getDepositAddressForChain`.
|
|
28
|
+
*
|
|
29
|
+
* Adaptations vs. web (per the connect-rn V1 scope):
|
|
30
|
+
* - **No geo-fencing.** Web gates the query on `useFunkitUserIp` and passes the
|
|
31
|
+
* user's `countryCode`; RN omits both (`countryCode` is optional on
|
|
32
|
+
* `GetFopsParams`), so FOPs are fetched regardless of region.
|
|
33
|
+
* - The Swapped theme query params (web's `resolveObjectCssVars(activeTheme)`),
|
|
34
|
+
* the EUR min-amount (`checkoutLimitsCriteria`), the saved-currency lookup,
|
|
35
|
+
* and `validateFops` are dropped for V1 (see TODOs).
|
|
36
|
+
*/
|
|
37
|
+
export declare function useFops({ checkoutConfig, dynamicRoutingId, enabled, }: UseFopsParams): UseFopsResult;
|
|
38
|
+
//# sourceMappingURL=useFops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFops.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useFops.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EACL,KAAK,2BAA2B,EAKjC,MAAM,sBAAsB,CAAA;AAyB7B,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,EAAE,oBAAoB,EAAE,CAAA;IACjC,iFAAiF;IACjF,WAAW,EAAE,oBAAoB,EAAE,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,EACtB,cAAc,EACd,gBAAgB,EAChB,OAAc,GACf,EAAE,aAAa,GAAG,aAAa,CAsG/B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base';
|
|
2
|
+
import type { SupportedToken, TokenChainFilter } from '../../screens/SupportedTokensScreen';
|
|
3
|
+
export interface UseSupportedTokensResult {
|
|
4
|
+
/** Curated deposit tokens (no icons attached), priority symbols first. */
|
|
5
|
+
tokens: SupportedToken[];
|
|
6
|
+
/** `All` + one chip per configured chain. */
|
|
7
|
+
chainFilters: TokenChainFilter[];
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fetch + resolve the deposit token list the same way the web SDK does: the
|
|
12
|
+
* curated Statsig `tokentransferconfig` (chains + asset addresses), filtered by
|
|
13
|
+
* the disabled list and merged with `@funkit/api-base`'s `getSupportedAssets`
|
|
14
|
+
* metadata (`resolveTokenTransferConfig`, shared via connect-core) — NOT the raw
|
|
15
|
+
* allow-list. Identity (apiKey) comes from {@link useFunkitIdentity}; the query
|
|
16
|
+
* is disabled until an apiKey is present.
|
|
17
|
+
*
|
|
18
|
+
* `transferInit` gates which chains are offered: Solana / Bitcoin / Tron only
|
|
19
|
+
* appear once the deposit-init response carries their address (mirrors web's
|
|
20
|
+
* `useEnabledTokenTransferChainTokens` via the shared `isTransferChainEnabled`).
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSupportedTokens({ enabled, transferInit, }?: {
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
transferInit?: CheckoutInitTokenTransferResponse;
|
|
25
|
+
}): UseSupportedTokensResult;
|
|
26
|
+
//# sourceMappingURL=useSupportedTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSupportedTokens.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useSupportedTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,kBAAkB,CAAA;AAYzE,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,qCAAqC,CAAA;AAG5C,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,6CAA6C;IAC7C,YAAY,EAAE,gBAAgB,EAAE,CAAA;IAChC,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAc,EACd,YAAY,GACb,GAAE;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,iCAAiC,CAAA;CAC5C,GAAG,wBAAwB,CA0ChC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CheckoutInitTokenTransferResponse, FunAddress } from '@funkit/api-base';
|
|
2
|
+
import { type CheckoutTokenTransferConfig, type QRCodeUri, type TransferTokenQrCodeType } from '@funkit/connect-core';
|
|
3
|
+
export interface UseTokenTransferParams {
|
|
4
|
+
checkoutConfig: CheckoutTokenTransferConfig | undefined;
|
|
5
|
+
/** Chain the user picked to send funds on. */
|
|
6
|
+
selectedChainId: number | undefined;
|
|
7
|
+
dynamicRoutingId?: string;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseTokenTransferResult {
|
|
11
|
+
/** Where the user sends funds first. */
|
|
12
|
+
depositAddress: FunAddress | undefined;
|
|
13
|
+
/** Raw deposit-init response (per-chain addresses); gates which chains show. */
|
|
14
|
+
transferInit: CheckoutInitTokenTransferResponse | undefined;
|
|
15
|
+
/** Final destination of the funds. */
|
|
16
|
+
recipientAddr: string;
|
|
17
|
+
/** Minimum transfer value (USD) for the selected chain, rounded up. */
|
|
18
|
+
minTransferUsd: number;
|
|
19
|
+
/** Default max slippage, as a percent. */
|
|
20
|
+
maxSlippagePercent: number;
|
|
21
|
+
qrCodeUri: QRCodeUri | undefined;
|
|
22
|
+
blockchain: TransferTokenQrCodeType;
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thin RN reimplementation of `@funkit/connect`'s `useTokenTransfer`: resolves
|
|
27
|
+
* the deposit address + QR URI for the selected chain and the minimum transfer
|
|
28
|
+
* value from the `mintokentransfervalue` dynamic config. The web hook's i18n
|
|
29
|
+
* tooltips, fiat conversion, price-impact estimate, per-customer slippage, and
|
|
30
|
+
* Polygon "original recipient" special-case are intentionally omitted.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useTokenTransfer({ checkoutConfig, selectedChainId, dynamicRoutingId, enabled, }: UseTokenTransferParams): UseTokenTransferResult;
|
|
33
|
+
//# sourceMappingURL=useTokenTransfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTokenTransfer.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useTokenTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,UAAU,EACX,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,uBAAuB,EAK7B,MAAM,sBAAsB,CAAA;AAuB7B,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,2BAA2B,GAAG,SAAS,CAAA;IACvD,8CAA8C;IAC9C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,cAAc,EAAE,UAAU,GAAG,SAAS,CAAA;IACtC,gFAAgF;IAChF,YAAY,EAAE,iCAAiC,GAAG,SAAS,CAAA;IAC3D,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAA;IACtB,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,uBAAuB,CAAA;IACnC,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,EAAE,sBAAsB,GAAG,sBAAsB,CAoCjD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CheckoutInitTokenTransferResponse, type FunAddress } from '@funkit/api-base';
|
|
2
|
+
import { type CheckoutTokenTransferConfig } from '@funkit/connect-core';
|
|
3
|
+
export interface UseTransferInitParams {
|
|
4
|
+
/** Destination chain/asset to derive the deposit address for. */
|
|
5
|
+
checkoutConfig: CheckoutTokenTransferConfig | undefined;
|
|
6
|
+
/** Final recipient. Defaults to the identity's wallet address. */
|
|
7
|
+
recipientAddr?: FunAddress;
|
|
8
|
+
/** Dynamic-routing id used to resolve UDA params. */
|
|
9
|
+
dynamicRoutingId?: string;
|
|
10
|
+
/** Gate the network call (e.g. only when the screen is visible). */
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface UseTransferInitResult {
|
|
14
|
+
transferInit: CheckoutInitTokenTransferResponse | undefined;
|
|
15
|
+
recipientAddr: FunAddress;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
isFetching: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thin RN reimplementation of `@funkit/connect`'s `useCheckoutTransferInit`:
|
|
21
|
+
* builds the (customer-agnostic) transfer params via the core helper and
|
|
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.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useTransferInit({ checkoutConfig, recipientAddr, dynamicRoutingId, enabled, }: UseTransferInitParams): UseTransferInitResult;
|
|
27
|
+
//# sourceMappingURL=useTransferInit.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type UDAConfig } from '@funkit/connect-core';
|
|
2
|
+
/**
|
|
3
|
+
* Thin RN reimplementation of `@funkit/connect`'s `useUDAParams`. Resolves the
|
|
4
|
+
* Universal Deposit Address config for a dynamic-routing id from the
|
|
5
|
+
* `uda_params` Statsig dynamic config. Unlike web, the routing id is passed in
|
|
6
|
+
* (web reads it from the checkout context, which RN doesn't have).
|
|
7
|
+
*/
|
|
8
|
+
export declare function useUDAParams(dynamicRoutingId?: string): UDAConfig | undefined;
|
|
9
|
+
//# sourceMappingURL=useUDAParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUDAParams.d.ts","sourceRoot":"","sources":["../../../../src/transfer/hooks/useUDAParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,sBAAsB,CAAA;AAGvE;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQ7E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TokenTransferConfigResult } from '@funkit/connect-core';
|
|
2
|
+
import type { SupportedToken, TokenChainFilter } from '../screens/SupportedTokensScreen';
|
|
3
|
+
/**
|
|
4
|
+
* Flatten a resolved token-transfer config (the curated Statsig
|
|
5
|
+
* `tokentransferconfig` merged with `/assets/supported` metadata — see
|
|
6
|
+
* `resolveTokenTransferConfig`) into the supported-tokens screen's token rows +
|
|
7
|
+
* chain-filter chips. One row per curated (chain, asset); chains keep their
|
|
8
|
+
* config order; priority symbols float to the top. NOT the raw allow-list, so
|
|
9
|
+
* no meme coins — only the customer's configured deposit tokens.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildSupportedTokenList(resolved: TokenTransferConfigResult): {
|
|
12
|
+
tokens: SupportedToken[];
|
|
13
|
+
chainFilters: TokenChainFilter[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Filter the token list by the search text (symbol or chain name, case-
|
|
17
|
+
* insensitive) and the selected chain chip (`'all'` keeps every chain).
|
|
18
|
+
*/
|
|
19
|
+
export declare function filterSupportedTokens(tokens: SupportedToken[], { search, chainFilterId, }: {
|
|
20
|
+
search?: string;
|
|
21
|
+
chainFilterId?: string;
|
|
22
|
+
}): SupportedToken[];
|
|
23
|
+
//# sourceMappingURL=supportedTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportedTokens.d.ts","sourceRoot":"","sources":["../../../src/transfer/supportedTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErE,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AAEzC;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,yBAAyB,GAAG;IAC5E,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,YAAY,EAAE,gBAAgB,EAAE,CAAA;CACjC,CAgCA;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EAAE,EACxB,EACE,MAAW,EACX,aAAqB,GACtB,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7C,cAAc,EAAE,CAclB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,EAAE,MAGhB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@funkit/connect-rn",
|
|
3
|
+
"version": "0.2.0-next.0",
|
|
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
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"blockchain",
|
|
20
|
+
"funkit",
|
|
21
|
+
"react-native"
|
|
22
|
+
],
|
|
23
|
+
"author": "https://fun.xyz/",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@shopify/restyle": "^2.4.5",
|
|
27
|
+
"@funkit/api-base": "4.5.1",
|
|
28
|
+
"@funkit/connect-core": "0.4.0-next.0",
|
|
29
|
+
"@funkit/chains": "2.1.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@react-native-async-storage/async-storage": ">=1.23.1",
|
|
33
|
+
"@react-native-clipboard/clipboard": ">=1.13.0",
|
|
34
|
+
"@statsig/react-bindings": ">=3.25",
|
|
35
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
36
|
+
"i18next": ">=23",
|
|
37
|
+
"react": ">=18",
|
|
38
|
+
"react-native": ">=0.74",
|
|
39
|
+
"react-native-qrcode-svg": ">=6.3.0",
|
|
40
|
+
"react-native-svg": ">=15.0.0",
|
|
41
|
+
"react-native-webview": ">=13.0.0",
|
|
42
|
+
"viem": ">=2.22.14"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@react-native-async-storage/async-storage": "2.2.0",
|
|
46
|
+
"@react-native-clipboard/clipboard": "1.16.3",
|
|
47
|
+
"@statsig/react-bindings": "3.25.4",
|
|
48
|
+
"@tanstack/react-query": "5.76.1",
|
|
49
|
+
"@types/react": "^19.2.2",
|
|
50
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
51
|
+
"i18next": "25.6.2",
|
|
52
|
+
"react": "^19.0.0",
|
|
53
|
+
"react-native": "0.85.3",
|
|
54
|
+
"react-native-qrcode-svg": "6.3.21",
|
|
55
|
+
"react-native-svg": "15.15.5",
|
|
56
|
+
"react-native-webview": "13.16.0",
|
|
57
|
+
"react-test-renderer": "19.2.4",
|
|
58
|
+
"tsc-alias": "1.8.16",
|
|
59
|
+
"viem": ">=2.22.14",
|
|
60
|
+
"vitest": "^4.1.6"
|
|
61
|
+
},
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://github.com/fun-xyz/funkit.git",
|
|
65
|
+
"directory": "packages/connect-rn"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://github.com/fun-xyz/funkit/tree/main/packages/connect-rn",
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "node build.js && pnpm typecheck",
|
|
70
|
+
"build:watch": "node build.js --watch",
|
|
71
|
+
"dev": "pnpm build:watch & pnpm typegen:watch",
|
|
72
|
+
"prebuild": "pnpm typegen",
|
|
73
|
+
"typecheck": "pnpm tsc --noEmit",
|
|
74
|
+
"typegen": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsc-alias",
|
|
75
|
+
"typegen:watch": "tsc --project tsconfig.build.json --emitDeclarationOnly --watch",
|
|
76
|
+
"lint": "oxlint",
|
|
77
|
+
"lint:fix": "oxlint --fix",
|
|
78
|
+
"test": "vitest"
|
|
79
|
+
}
|
|
80
|
+
}
|