@coinflowlabs/react-native 0.1.4 → 0.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.
package/README.md CHANGED
@@ -45,9 +45,13 @@ Props:
45
45
 
46
46
  # Changelog
47
47
 
48
+ ### 0.2.0
49
+
50
+ - Added Withdraw and Purchase history components
51
+
48
52
  ### 0.1.3
49
53
 
50
- - Added the ability to sign transactions
54
+ - Added the ability to sign transactions instead of sign messages
51
55
 
52
56
  # 0.1.0
53
57
  Genesis 1:1
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { WithStyles } from './CoinflowWebView';
3
+ import { CoinflowHistoryProps } from './CoinflowWithdrawHistory';
4
+ export declare function CoinflowPurchaseHistory({ wallet, merchantId, connection, env, style, }: CoinflowHistoryProps & WithStyles): JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { useIframeWallet } from './useIframeWallet';
3
+ import { CoinflowWebView } from './CoinflowWebView';
4
+ export function CoinflowPurchaseHistory({ wallet, merchantId, connection, env, style, }) {
5
+ const { WebViewRef, handleIframeMessages } = useIframeWallet({
6
+ wallet,
7
+ connection,
8
+ });
9
+ if (!wallet.publicKey || !wallet.connected)
10
+ return null;
11
+ return (React.createElement(CoinflowWebView, { publicKey: wallet.publicKey.toString(), WebViewRef: WebViewRef, handleIframeMessages: handleIframeMessages, style: style, route: `/history/purchase/${merchantId}`, env: env }));
12
+ }
13
+ //# sourceMappingURL=CoinflowPurchaseHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../src/CoinflowPurchaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAa,MAAM,mBAAmB,CAAC;AAG9D,MAAM,UAAU,uBAAuB,CAAC,EACtC,MAAM,EACN,UAAU,EACV,UAAU,EACV,GAAG,EACH,KAAK,GAC6B;IAClC,MAAM,EAAC,UAAU,EAAE,oBAAoB,EAAC,GAAG,eAAe,CAAC;QACzD,MAAM;QACN,UAAU;KACX,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAExD,OAAO,CACL,oBAAC,eAAe,IACd,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EACtC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,oBAAoB,EAC1C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,qBAAqB,UAAU,EAAE,EACxC,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { WithStyles } from './CoinflowWebView';
3
+ import { CoinflowEnvs, SubsetWalletContextState } from './ReactNativeCoinflowUtils';
4
+ import { Connection } from '@solana/web3.js';
5
+ export type CoinflowHistoryProps = {
6
+ wallet: SubsetWalletContextState;
7
+ merchantId: string;
8
+ connection: Connection;
9
+ env?: CoinflowEnvs;
10
+ };
11
+ export declare function CoinflowWithdrawHistory({ wallet, merchantId, connection, env, style, }: CoinflowHistoryProps & WithStyles): JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { CoinflowWebView } from './CoinflowWebView';
3
+ import { useIframeWallet } from './useIframeWallet';
4
+ export function CoinflowWithdrawHistory({ wallet, merchantId, connection, env, style, }) {
5
+ const { WebViewRef, handleIframeMessages } = useIframeWallet({
6
+ wallet,
7
+ connection,
8
+ });
9
+ if (!wallet.publicKey || !wallet.connected)
10
+ return null;
11
+ return (React.createElement(CoinflowWebView, { publicKey: wallet.publicKey.toString(), WebViewRef: WebViewRef, handleIframeMessages: handleIframeMessages, style: style, route: `/history/withdraw/${merchantId}`, env: env }));
12
+ }
13
+ //# sourceMappingURL=CoinflowWithdrawHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAa,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAclD,MAAM,UAAU,uBAAuB,CAAC,EACtC,MAAM,EACN,UAAU,EACV,UAAU,EACV,GAAG,EACH,KAAK,GAC6B;IAClC,MAAM,EAAC,UAAU,EAAE,oBAAoB,EAAC,GAAG,eAAe,CAAC;QACzD,MAAM;QACN,UAAU;KACX,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAExD,OAAO,CACL,oBAAC,eAAe,IACd,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EACtC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,oBAAoB,EAC1C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,qBAAqB,UAAU,EAAE,EACxC,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './CoinflowWithdraw';
2
2
  export * from './CoinflowPurchase';
3
+ export * from './CoinflowPurchaseHistory';
4
+ export * from './CoinflowWithdrawHistory';
package/build/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './CoinflowWithdraw';
2
2
  export * from './CoinflowPurchase';
3
+ export * from './CoinflowPurchaseHistory';
4
+ export * from './CoinflowWithdrawHistory';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
@@ -1,17 +1,11 @@
1
1
  import { useCallback, useRef } from 'react';
2
2
  import { useHandleIFrameMessages, } from './IFrameWalletConnector';
3
- import { Platform } from 'react-native';
4
3
  export function useIframeWallet({ wallet, connection, onSuccess, partialSigners, debugTx = false, }) {
5
4
  const WebViewRef = useRef(null);
6
5
  const sendIFrameMessage = useCallback((message) => {
7
6
  if (!(WebViewRef === null || WebViewRef === void 0 ? void 0 : WebViewRef.current))
8
7
  throw new Error('WebViewRef not defined');
9
- if (Platform.OS === 'ios') {
10
- WebViewRef.current.postMessage(message);
11
- }
12
- else {
13
- WebViewRef.current.injectJavaScript(`(function() {window.onmessage(${message});})();`);
14
- }
8
+ WebViewRef.current.postMessage(message);
15
9
  }, [WebViewRef]);
16
10
  const { handleIframeMessages } = useHandleIFrameMessages({
17
11
  wallet,
@@ -1 +1 @@
1
- {"version":3,"file":"useIframeWallet.js","sourceRoot":"","sources":["../src/useIframeWallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAE1C,OAAO,EAEL,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAUtC,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,OAAO,GAAG,KAAK,GACG;IAClB,MAAM,UAAU,GAAG,MAAM,CAAU,IAAI,CAAC,CAAC;IAEzC,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,OAAe,EAAE,EAAE;QAClB,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBA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D,MAAM;QACN,UAAU;QACV,SAAS;QACT,cAAc;QACd,OAAO;QACP,iBAAiB;KAClB,CAAC,CAAC;IAEH,OAAO,EAAC,UAAU,EAAE,oBAAoB,EAAC,CAAC;AAC5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinflowlabs/react-native",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "React Native Component for Coinflow Withdraw",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",