@coinflowlabs/react-native 1.0.0 → 1.2.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.
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { CoinflowPurchaseProps, WithStyles } from './CoinflowTypes';
3
- export declare function CoinflowPurchase(props: CoinflowPurchaseProps & WithStyles): JSX.Element | null;
3
+ export declare function CoinflowPurchase(props: CoinflowPurchaseProps & WithStyles): React.JSX.Element | null;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { CoinflowHistoryProps, WithStyles } from './CoinflowTypes';
3
- export declare function CoinflowPurchaseHistory(props: CoinflowHistoryProps & WithStyles): JSX.Element;
3
+ export declare function CoinflowPurchaseHistory(props: CoinflowHistoryProps & WithStyles): React.JSX.Element;
@@ -24,6 +24,7 @@ export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
24
24
  }) => Promise<void>;
25
25
  WebViewRef: React.RefObject<WebView>;
26
26
  onLoad?: () => void;
27
+ bankAccountLinkRedirect?: string;
27
28
  };
28
29
  export type WithStyles = {
29
30
  style?: StyleProp<ViewStyle>;
@@ -91,6 +92,10 @@ export interface CoinflowIFrameProps {
91
92
  env?: CoinflowEnvs;
92
93
  loaderBackground?: string;
93
94
  supportsVersionedTransactions?: boolean;
95
+ additionalWallets?: {
96
+ wallet: string;
97
+ blockchain: 'solana' | 'eth' | 'near' | 'polygon';
98
+ }[];
94
99
  }
95
100
  /** Transactions **/
96
101
  export type NearFtTransferCallAction = {
@@ -151,6 +156,11 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
151
156
  token?: string;
152
157
  amount?: number;
153
158
  email?: string;
159
+ bankAccountLinkRedirect?: string;
160
+ additionalWallets?: {
161
+ wallet: string;
162
+ blockchain: 'solana' | 'eth' | 'near' | 'polygon';
163
+ }[];
154
164
  }
155
165
  export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
156
166
  wallet: SolanaWallet;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { CoinflowWebViewProps, WithStyles } from './CoinflowTypes';
3
- export declare function CoinflowWebView(props: CoinflowWebViewProps & WithStyles): JSX.Element | null;
3
+ export declare function CoinflowWebView(props: CoinflowWebViewProps & WithStyles): React.JSX.Element | null;
@@ -16,12 +16,11 @@ export function CoinflowWebView(props) {
16
16
  },
17
17
  style,
18
18
  ], keyboardDisplayRequiresUserAction: false, showsVerticalScrollIndicator: false, onShouldStartLoadWithRequest: function (request) {
19
- // TODO handle other explorers
20
- if (request.url.includes('solscan')) {
21
- Linking.openURL(request.url).catch();
22
- return false;
19
+ if (request.url === url || request.url.startsWith('about:blank')) {
20
+ return true;
23
21
  }
24
- return true;
22
+ Linking.openURL(request.url).catch();
23
+ return false;
25
24
  }, ref: WebViewRef, source: { uri: url }, onMessage: function (event) {
26
25
  return handleIframeMessages({ data: event.nativeEvent.data });
27
26
  }, onLoad: onLoad }));
@@ -1 +1 @@
1
- {"version":3,"file":"CoinflowWebView.js","sourceRoot":"","sources":["../src/CoinflowWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAGpE,MAAM,UAAU,eAAe,CAAC,KAAwC;IACtE,IAAM,GAAG,GAAG,OAAO,CAAC;QAClB,OAAO,wBAAwB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEL,IAAA,oBAAoB,GAA+B,KAAK,qBAApC,EAAE,UAAU,GAAmB,KAAK,WAAxB,EAAE,KAAK,GAAY,KA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Ac,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEL,IAAA,oBAAoB,GAA+B,KAAK,qBAApC,EAAE,UAAU,GAAmB,KAAK,WAAxB,EAAE,KAAK,GAAY,KAAK,MAAjB,EAAE,MAAM,GAAI,KAAK,OAAT,CAAU;IAChE,OAAO,OAAO,CAAC;QACb,IAAI,CAAC,KAAK,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAElC,OAAO,CACL,oBAAC,OAAO,IACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,CAAC;iBACR;gBACD,KAAK;aACN,EACD,iCAAiC,EAAE,KAAK,EACxC,4BAA4B,EAAE,KAAK,EACnC,4BAA4B,EAAE,UAAA,OAAO;gBACnC,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;oBAChE,OAAO,IAAI,CAAC;iBACb;gBACD,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;gBACrC,OAAO,KAAK,CAAC;YACf,CAAC,EACD,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC,EAClB,SAAS,EAAE,UAAA,KAAK;gBACd,OAAA,oBAAoB,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAC,CAAC;YAApD,CAAoD,EAEtD,MAAM,EAAE,MAAM,GACd,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { CoinflowWithdrawProps, WithStyles } from './CoinflowTypes';
3
- export declare function CoinflowWithdraw(props: CoinflowWithdrawProps & WithStyles): JSX.Element | null;
3
+ export declare function CoinflowWithdraw(props: CoinflowWithdrawProps & WithStyles): React.JSX.Element | null;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { CoinflowHistoryProps, WithStyles } from './CoinflowTypes';
3
- export declare function CoinflowWithdrawHistory(props: CoinflowHistoryProps & WithStyles): JSX.Element;
3
+ export declare function CoinflowWithdrawHistory(props: CoinflowHistoryProps & WithStyles): React.JSX.Element;
@@ -4,11 +4,16 @@ export declare class ReactNativeCoinflowUtils {
4
4
  url: string;
5
5
  constructor(env?: CoinflowEnvs);
6
6
  static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
7
- static getCoinflowUrl({ route, env, amount, publicKey, transaction, }: {
7
+ static getCoinflowUrl({ route, env, amount, publicKey, transaction, bankAccountLinkRedirect, additionalWallets, }: {
8
8
  route: string;
9
9
  publicKey: string | null | undefined;
10
10
  env?: CoinflowEnvs;
11
11
  amount?: number;
12
12
  transaction?: string;
13
+ bankAccountLinkRedirect?: string;
14
+ additionalWallets?: {
15
+ wallet: string;
16
+ blockchain: 'solana' | 'eth' | 'near' | 'polygon';
17
+ }[];
13
18
  }): string;
14
19
  }
@@ -16,7 +16,7 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
16
16
  return "https://".concat(env, ".coinflow.cash");
17
17
  };
18
18
  ReactNativeCoinflowUtils.getCoinflowUrl = function (_a) {
19
- var route = _a.route, env = _a.env, amount = _a.amount, publicKey = _a.publicKey, transaction = _a.transaction;
19
+ var route = _a.route, env = _a.env, amount = _a.amount, publicKey = _a.publicKey, transaction = _a.transaction, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets;
20
20
  if (!publicKey)
21
21
  return '';
22
22
  var url = new URL(route, ReactNativeCoinflowUtils.getCoinflowBaseUrl(env));
@@ -27,6 +27,11 @@ var ReactNativeCoinflowUtils = /** @class */ (function () {
27
27
  if (amount) {
28
28
  url.searchParams.append('amount', amount.toString());
29
29
  }
30
+ if (bankAccountLinkRedirect) {
31
+ url.searchParams.append('bankAccountLinkRedirect', bankAccountLinkRedirect);
32
+ }
33
+ if (additionalWallets)
34
+ url.searchParams.append('additionalWallets', JSON.stringify(additionalWallets));
30
35
  return url.toString();
31
36
  };
32
37
  return ReactNativeCoinflowUtils;
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativeCoinflowUtils.js","sourceRoot":"","sources":["../src/ReactNativeCoinflowUtils.ts"],"names":[],"mappings":"AAEA;IAIE,kCAAY,GAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,MAAM;YAAE,IAAI,CAAC,GAAG,GAAG,2BAA2B,CAAC;aAC3D,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO;YAAE,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAAC;;YAC7D,IAAI,CAAC,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEM,2CAAkB,GAAzB,UAA0B,GAAkB;QAC1C,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,uBAAuB,CAAC;QAC3D,IAAI,GAAG,KAAK,OAAO;YAAE,OAAO,uBAAuB,CAAC;QAEpD,OAAO,kBAAW,GAAG,mBAAgB,CAAC;IACxC,CAAC;IAEM,uCAAc,GAArB,UAAsB,EAYrB;YAXC,KAAK,WAAA,EACL,GAAG,SAAA,EACH,MAAM,YAAA,EACN,SAAS,eAAA,EACT,WAAW,iBAAA;QAQX,IAAI,CAAC,SAAS;YAAE,OAAO,EAAE,CAAC;QAE1B,IAAM,GAAG,GAAG,IAAI,GAAG,CACjB,KAAK,EACL,wBAAwB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CACjD,CAAC;QACF,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAE7C,IAAI,WAAW,EAAE;YACf,GAAG,CAAC,Y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AAC,kBAAkB,CAAC,GAAG,CAAC,CACjD,CAAC;QACF,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAE7C,IAAI,WAAW,EAAE;YACf,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;SACrD;QACD,IAAI,MAAM,EAAE;YACV,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;SACtD;QACD,IAAI,uBAAuB,EAAE;YAC3B,GAAG,CAAC,YAAY,CAAC,MAAM,CACrB,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;SACH;QACD,IAAI,iBAAiB;YACnB,GAAG,CAAC,YAAY,CAAC,MAAM,CACrB,mBAAmB,EACnB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAClC,CAAC;QAEJ,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IACH,+BAAC;AAAD,CAAC,AAlED,IAkEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/react-native",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "React Native Component for Coinflow",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -36,13 +36,13 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "react-native-get-random-values": "^1.8.0",
39
+ "react-native-get-random-values": "^1.9.0",
40
40
  "bs58": "^5.0.0",
41
41
  "bn.js": "^5.2.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/react": "^18.2.0",
45
- "@types/react-native": "^0.71.6",
44
+ "@types/react": "^18.2.8",
45
+ "@types/react-native": "^0.72.2",
46
46
  "eslint-config-react-app": "^7.0.1",
47
47
  "typescript": "^5.0.4",
48
48
  "@solana/wallet-adapter-react": "^0.15.32"