@coinflowlabs/react 2.1.0 → 2.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.
Files changed (93) hide show
  1. package/README.md +8 -0
  2. package/build/cjs/CoinflowIFrame.d.ts +2 -18
  3. package/build/cjs/CoinflowIFrame.js +4 -16
  4. package/build/cjs/CoinflowIFrame.js.map +1 -1
  5. package/build/cjs/CoinflowPurchase.d.ts +4 -58
  6. package/build/cjs/CoinflowPurchase.js +8 -7
  7. package/build/cjs/CoinflowPurchase.js.map +1 -1
  8. package/build/cjs/CoinflowPurchaseHistory.d.ts +3 -3
  9. package/build/cjs/CoinflowPurchaseHistory.js +13 -12
  10. package/build/cjs/CoinflowPurchaseHistory.js.map +1 -1
  11. package/build/cjs/CoinflowTypes.d.ts +159 -0
  12. package/build/cjs/{CommonCoinflowProps.js → CoinflowTypes.js} +1 -1
  13. package/build/cjs/CoinflowTypes.js.map +1 -0
  14. package/build/cjs/CoinflowUtils.d.ts +3 -52
  15. package/build/cjs/CoinflowUtils.js +15 -2
  16. package/build/cjs/CoinflowUtils.js.map +1 -1
  17. package/build/cjs/CoinflowWithdraw.d.ts +3 -29
  18. package/build/cjs/CoinflowWithdraw.js +8 -7
  19. package/build/cjs/CoinflowWithdraw.js.map +1 -1
  20. package/build/cjs/CoinflowWithdrawHistory.d.ts +3 -3
  21. package/build/cjs/CoinflowWithdrawHistory.js +8 -7
  22. package/build/cjs/CoinflowWithdrawHistory.js.map +1 -1
  23. package/build/cjs/index.d.ts +2 -1
  24. package/build/cjs/index.js +2 -1
  25. package/build/cjs/index.js.map +1 -1
  26. package/build/{esm → cjs/wallet}/EthIFrameMessageHandlers.d.ts +1 -3
  27. package/build/cjs/wallet/EthIFrameMessageHandlers.js.map +1 -0
  28. package/build/cjs/{NearIFrameMessageHandlers.d.ts → wallet/NearIFrameMessageHandlers.d.ts} +1 -1
  29. package/build/cjs/wallet/NearIFrameMessageHandlers.js.map +1 -0
  30. package/build/cjs/wallet/SocketService.d.ts +5 -0
  31. package/build/cjs/wallet/SocketService.js +42 -0
  32. package/build/cjs/wallet/SocketService.js.map +1 -0
  33. package/build/cjs/{SolanaIFrameMessageHandlers.d.ts → wallet/SolanaIFrameMessageHandlers.d.ts} +1 -1
  34. package/build/cjs/wallet/SolanaIFrameMessageHandlers.js.map +1 -0
  35. package/build/{esm → cjs/wallet}/useIframeWallet.d.ts +5 -3
  36. package/build/cjs/{useIframeWallet.js → wallet/useIframeWallet.js} +20 -11
  37. package/build/cjs/wallet/useIframeWallet.js.map +1 -0
  38. package/build/esm/CoinflowIFrame.d.ts +2 -18
  39. package/build/esm/CoinflowIFrame.js +4 -16
  40. package/build/esm/CoinflowIFrame.js.map +1 -1
  41. package/build/esm/CoinflowPurchase.d.ts +4 -58
  42. package/build/esm/CoinflowPurchase.js +9 -8
  43. package/build/esm/CoinflowPurchase.js.map +1 -1
  44. package/build/esm/CoinflowPurchaseHistory.d.ts +3 -3
  45. package/build/esm/CoinflowPurchaseHistory.js +13 -12
  46. package/build/esm/CoinflowPurchaseHistory.js.map +1 -1
  47. package/build/esm/CoinflowTypes.d.ts +159 -0
  48. package/build/esm/CoinflowTypes.js +2 -0
  49. package/build/esm/CoinflowTypes.js.map +1 -0
  50. package/build/esm/CoinflowUtils.d.ts +3 -52
  51. package/build/esm/CoinflowUtils.js +15 -2
  52. package/build/esm/CoinflowUtils.js.map +1 -1
  53. package/build/esm/CoinflowWithdraw.d.ts +3 -29
  54. package/build/esm/CoinflowWithdraw.js +8 -7
  55. package/build/esm/CoinflowWithdraw.js.map +1 -1
  56. package/build/esm/CoinflowWithdrawHistory.d.ts +3 -3
  57. package/build/esm/CoinflowWithdrawHistory.js +8 -7
  58. package/build/esm/CoinflowWithdrawHistory.js.map +1 -1
  59. package/build/esm/index.d.ts +2 -1
  60. package/build/esm/index.js +2 -1
  61. package/build/esm/index.js.map +1 -1
  62. package/build/{cjs → esm/wallet}/EthIFrameMessageHandlers.d.ts +1 -3
  63. package/build/esm/wallet/EthIFrameMessageHandlers.js.map +1 -0
  64. package/build/esm/{NearIFrameMessageHandlers.d.ts → wallet/NearIFrameMessageHandlers.d.ts} +1 -1
  65. package/build/esm/wallet/NearIFrameMessageHandlers.js.map +1 -0
  66. package/build/esm/wallet/SocketService.d.ts +5 -0
  67. package/build/esm/wallet/SocketService.js +34 -0
  68. package/build/esm/wallet/SocketService.js.map +1 -0
  69. package/build/esm/{SolanaIFrameMessageHandlers.d.ts → wallet/SolanaIFrameMessageHandlers.d.ts} +1 -1
  70. package/build/esm/wallet/SolanaIFrameMessageHandlers.js.map +1 -0
  71. package/build/{cjs → esm/wallet}/useIframeWallet.d.ts +5 -3
  72. package/build/esm/{useIframeWallet.js → wallet/useIframeWallet.js} +20 -11
  73. package/build/esm/wallet/useIframeWallet.js.map +1 -0
  74. package/package.json +13 -8
  75. package/build/cjs/CommonCoinflowProps.d.ts +0 -26
  76. package/build/cjs/CommonCoinflowProps.js.map +0 -1
  77. package/build/cjs/EthIFrameMessageHandlers.js.map +0 -1
  78. package/build/cjs/NearIFrameMessageHandlers.js.map +0 -1
  79. package/build/cjs/SolanaIFrameMessageHandlers.js.map +0 -1
  80. package/build/cjs/useIframeWallet.js.map +0 -1
  81. package/build/esm/CommonCoinflowProps.d.ts +0 -26
  82. package/build/esm/CommonCoinflowProps.js +0 -2
  83. package/build/esm/CommonCoinflowProps.js.map +0 -1
  84. package/build/esm/EthIFrameMessageHandlers.js.map +0 -1
  85. package/build/esm/NearIFrameMessageHandlers.js.map +0 -1
  86. package/build/esm/SolanaIFrameMessageHandlers.js.map +0 -1
  87. package/build/esm/useIframeWallet.js.map +0 -1
  88. /package/build/cjs/{EthIFrameMessageHandlers.js → wallet/EthIFrameMessageHandlers.js} +0 -0
  89. /package/build/cjs/{NearIFrameMessageHandlers.js → wallet/NearIFrameMessageHandlers.js} +0 -0
  90. /package/build/cjs/{SolanaIFrameMessageHandlers.js → wallet/SolanaIFrameMessageHandlers.js} +0 -0
  91. /package/build/esm/{EthIFrameMessageHandlers.js → wallet/EthIFrameMessageHandlers.js} +0 -0
  92. /package/build/esm/{NearIFrameMessageHandlers.js → wallet/NearIFrameMessageHandlers.js} +0 -0
  93. /package/build/esm/{SolanaIFrameMessageHandlers.js → wallet/SolanaIFrameMessageHandlers.js} +0 -0
package/README.md CHANGED
@@ -46,6 +46,14 @@ Props:
46
46
 
47
47
  # Changelog
48
48
 
49
+ ### 2.2.0
50
+
51
+ Added useSocket property to handle browser instances where iframe messages are unavailable
52
+
53
+ ### 2.1.1
54
+
55
+ - Bug fix to set useHeightChange url param to true if using the handleHeightChange prop
56
+
49
57
  ### 2.1.0
50
58
 
51
59
  - Added handleHeightChange to all components to allow for dynamic height changes
@@ -1,19 +1,3 @@
1
1
  import React from 'react';
2
- import { CoinflowBlockchain, CoinflowEnvs } from './CoinflowUtils';
3
- import type { PublicKey } from '@solana/web3.js';
4
- export interface CoinflowIFrameProps {
5
- walletPubkey: string;
6
- IFrameRef: React.RefObject<HTMLIFrameElement>;
7
- route: string;
8
- amount?: number;
9
- transaction?: string;
10
- blockchain: CoinflowBlockchain;
11
- webhookInfo?: object;
12
- token?: string | PublicKey;
13
- email?: string;
14
- env?: CoinflowEnvs;
15
- loaderBackground?: string;
16
- supportsVersionedTransactions?: boolean;
17
- handleHeightChange?: (height: string) => void;
18
- }
19
- export declare function CoinflowIFrame({ walletPubkey, IFrameRef, env, route, transaction, amount, blockchain, webhookInfo, token, email, loaderBackground, supportsVersionedTransactions, handleHeightChange, }: CoinflowIFrameProps): JSX.Element;
2
+ import { CoinflowIFrameProps } from './CoinflowTypes';
3
+ export declare function CoinflowIFrame(props: CoinflowIFrameProps): React.JSX.Element;
@@ -4,23 +4,11 @@ exports.CoinflowIFrame = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var react_1 = tslib_1.__importStar(require("react"));
6
6
  var CoinflowUtils_1 = require("./CoinflowUtils");
7
- function CoinflowIFrame(_a) {
8
- var walletPubkey = _a.walletPubkey, IFrameRef = _a.IFrameRef, env = _a.env, route = _a.route, transaction = _a.transaction, amount = _a.amount, blockchain = _a.blockchain, webhookInfo = _a.webhookInfo, token = _a.token, email = _a.email, loaderBackground = _a.loaderBackground, supportsVersionedTransactions = _a.supportsVersionedTransactions, handleHeightChange = _a.handleHeightChange;
7
+ function CoinflowIFrame(props) {
9
8
  var url = (0, react_1.useMemo)(function () {
10
- return CoinflowUtils_1.CoinflowUtils.getCoinflowUrl({
11
- walletPubkey: walletPubkey,
12
- amount: amount,
13
- env: env,
14
- route: route,
15
- transaction: transaction,
16
- blockchain: blockchain,
17
- webhookInfo: webhookInfo,
18
- token: token === null || token === void 0 ? void 0 : token.toString(),
19
- email: email,
20
- loaderBackground: loaderBackground,
21
- supportsVersionedTransactions: supportsVersionedTransactions
22
- });
23
- }, [walletPubkey, amount, env, route, transaction, blockchain, webhookInfo, token, email, loaderBackground, supportsVersionedTransactions]);
9
+ return CoinflowUtils_1.CoinflowUtils.getCoinflowUrl(props);
10
+ }, [props]);
11
+ var handleHeightChange = props.handleHeightChange, IFrameRef = props.IFrameRef;
24
12
  return (0, react_1.useMemo)(function () { return (react_1.default.createElement("iframe", { scrolling: handleHeightChange ? 'no' : 'yes', onLoad: function () {
25
13
  if (IFrameRef.current)
26
14
  IFrameRef.current.style.opacity = '1';
@@ -1 +1 @@
1
- {"version":3,"file":"CoinflowIFrame.js","sourceRoot":"","sources":["../../src/CoinflowIFrame.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AACrC,iDAAgF;AAmBhF,SAAgB,cAAc,CAAC,EAcT;QAbpB,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,GAAG,SAAA,EACH,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,KAAK,WAAA,EACL,KAAK,WAAA,EACL,gBAAgB,sBAAA,EAChB,6BAA6B,mCAAA,EAC7B,kBAAkB,wBAAA;IAEl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IAAM,GAAG,GAAG,IAAA,eAAO,EAAC;QAClB,OAAO,6BAAa,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEL,IAAA,kBAAkB,GAAe,KAAK,mBAApB,EAAE,SAAS,GAAI,KAAK,UAAT,CAAU;IAC9C,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CACJ,0CACE,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAA,CAAC,CAAC,KAAK,EAC3C,MAAM,EAAE;YACN,IAAI,SAAS,CAAC,OAAO;gBAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QAC/D,CAAC,EACD,GAAG,EAAE,SAAS,EACd,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,CAAC;YACV,UAAU,EAAE,sBAAsB;SACnC,EACD,KAAK,EAAC,UAAU,EAChB,WAAW,EAAC,GAAG,EACf,GAAG,EAAE,GAAG,GACR,CACH,EAjBK,CAiBL,EACD,CAAC,SAAS,EAAE,GAAG,CAAC,CACjB,CAAC;AACJ,CAAC;AA3BD,wCA2BC"}
@@ -1,58 +1,4 @@
1
- /// <reference types="react" />
2
- import type { Connection, PublicKey, Signer, Transaction } from "@solana/web3.js";
3
- import { EthWallet, NearWallet, SolanaWallet } from './CoinflowUtils';
4
- import { OnSuccessMethod } from './useIframeWallet';
5
- import { CommonCoinflowProps } from './CommonCoinflowProps';
6
- export interface CoinflowCommonPurchaseProps extends CommonCoinflowProps {
7
- amount?: number;
8
- onSuccess?: OnSuccessMethod;
9
- webhookInfo?: object;
10
- email?: string;
11
- }
12
- export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
13
- wallet: SolanaWallet;
14
- transaction?: Transaction;
15
- partialSigners?: Signer[];
16
- debugTx?: boolean;
17
- connection: Connection;
18
- blockchain: 'solana';
19
- token?: PublicKey | string;
20
- supportsVersionedTransactions?: boolean;
21
- }
22
- export type NearFtTransferCallAction = {
23
- methodName: 'ft_transfer_call';
24
- args: object;
25
- gas: string;
26
- deposit: string;
27
- };
28
- export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
29
- wallet: NearWallet;
30
- blockchain: 'near';
31
- action?: NearFtTransferCallAction;
32
- }
33
- type BigNumberish = object | bigint | string | number;
34
- type Bytes = ArrayLike<number>;
35
- type BytesLike = Bytes | string;
36
- type EvmTransaction = {
37
- to: string;
38
- from?: string;
39
- nonce?: BigNumberish;
40
- gasLimit?: BigNumberish;
41
- gasPrice?: BigNumberish;
42
- data?: BytesLike;
43
- value?: BigNumberish;
44
- chainId?: number;
45
- type?: number;
46
- maxPriorityFeePerGas?: BigNumberish;
47
- maxFeePerGas?: BigNumberish;
48
- customData?: Record<string, any>;
49
- ccipReadEnabled?: boolean;
50
- };
51
- export interface CoinflowPolygonPurchaseProps extends CoinflowCommonPurchaseProps {
52
- transaction?: EvmTransaction;
53
- wallet: EthWallet;
54
- blockchain: 'polygon';
55
- }
56
- export declare function CoinflowPurchase(props: CoinflowSolanaPurchaseProps | CoinflowNearPurchaseProps | CoinflowPolygonPurchaseProps): JSX.Element;
57
- export declare function PolygonCoinflowPurchase(props: CoinflowPolygonPurchaseProps): JSX.Element | null;
58
- export {};
1
+ import React from 'react';
2
+ import { CoinflowPolygonPurchaseProps, CoinflowPurchaseProps } from './CoinflowTypes';
3
+ export declare function CoinflowPurchase(props: CoinflowPurchaseProps): React.JSX.Element;
4
+ export declare function PolygonCoinflowPurchase(props: CoinflowPolygonPurchaseProps): React.JSX.Element | null;
@@ -4,11 +4,11 @@ exports.PolygonCoinflowPurchase = exports.CoinflowPurchase = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var react_1 = tslib_1.__importStar(require("react"));
6
6
  var CoinflowIFrame_1 = require("./CoinflowIFrame");
7
- var SolanaIFrameMessageHandlers_1 = require("./SolanaIFrameMessageHandlers");
7
+ var SolanaIFrameMessageHandlers_1 = require("./wallet/SolanaIFrameMessageHandlers");
8
8
  var CoinflowUtils_1 = require("./CoinflowUtils");
9
- var useIframeWallet_1 = require("./useIframeWallet");
10
- var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
11
- var EthIFrameMessageHandlers_1 = require("./EthIFrameMessageHandlers");
9
+ var useIframeWallet_1 = require("./wallet/useIframeWallet");
10
+ var NearIFrameMessageHandlers_1 = require("./wallet/NearIFrameMessageHandlers");
11
+ var EthIFrameMessageHandlers_1 = require("./wallet/EthIFrameMessageHandlers");
12
12
  function CoinflowPurchase(props) {
13
13
  return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
14
14
  solana: (react_1.default.createElement(SolanaCoinflowPurchase, tslib_1.__assign({}, props))),
@@ -18,9 +18,10 @@ function CoinflowPurchase(props) {
18
18
  }
19
19
  exports.CoinflowPurchase = CoinflowPurchase;
20
20
  function SolanaCoinflowPurchase(props) {
21
+ var _a;
21
22
  var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)(props);
22
- var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
23
23
  var wallet = props.wallet, transaction = props.transaction, supportsVersionedTransactionsParam = props.supportsVersionedTransactions;
24
+ var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, (_a = wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString()).IFrameRef;
24
25
  var transactionStr = (0, react_1.useMemo)(function () {
25
26
  return transaction
26
27
  ? CoinflowUtils_1.CoinflowUtils.serializeSolanaTransaction(transaction)
@@ -44,8 +45,8 @@ function SolanaCoinflowPurchase(props) {
44
45
  }
45
46
  function NearCoinflowPurchase(props) {
46
47
  var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)(props);
47
- var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
48
48
  var wallet = props.wallet, action = props.action;
49
+ var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, wallet.accountId).IFrameRef;
49
50
  var transaction = (0, react_1.useMemo)(function () {
50
51
  return action
51
52
  ? Buffer.from(JSON.stringify(action)).toString('base64')
@@ -56,8 +57,8 @@ function NearCoinflowPurchase(props) {
56
57
  }
57
58
  function PolygonCoinflowPurchase(props) {
58
59
  var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)(props);
59
- var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
60
60
  var transaction = props.transaction, wallet = props.wallet;
61
+ var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, wallet.address).IFrameRef;
61
62
  var transactionStr = (0, react_1.useMemo)(function () {
62
63
  if (!transaction)
63
64
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../../src/CoinflowPurchase.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AAErC,mDAAqE;AACrE,6EAA6E;AAC7E,iDAKyB;AACzB,qDAAmE;AACnE,yEAAyE;AAEzE,uEAAuE;AAkEvE,SAAgB,gBAAgB,CAC9B,KAGgC;IAEhC,OAAO,6BAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,8BAAC,sBAAsB,uBAAM,KAAqC,EAAI,CACvE;QACD,IAAI,EAAE,8BAAC,oBAAoB,uBAAM,KAAmC,EAAI;QACxE,OAAO,EAAE,CACP,8BAAC,uBAAuB,uBAAM,KAAsC,EAAI,CACzE;KACF,CAAC,CAAC;AACL,CAAC;AAfD,4CAeC;AAED,SAAS,sBAAsB,CAAC,KAAkC;IAChE,IAAM,QAAQ,GAAG,IAAA,4DAA8B,EAAC,KAAK,CAAC,CAAC;IAChD,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,EAAE,KAAK,CAAC,UAApC,CAAqC;IAE9C,IAAA,M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AC;AACJ,CAAC;AAtBD,0DAsBC"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- import { CoinflowNearHistoryProps, CoinflowPolygonHistoryProps, CoinflowSolanaHistoryProps } from './CommonCoinflowProps';
3
- export declare function CoinflowPurchaseHistory(props: CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps): JSX.Element;
1
+ import React from 'react';
2
+ import { CoinflowHistoryProps } from './CoinflowTypes';
3
+ export declare function CoinflowPurchaseHistory(props: CoinflowHistoryProps): React.JSX.Element;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CoinflowPurchaseHistory = void 0;
4
4
  var tslib_1 = require("tslib");
5
- var useIframeWallet_1 = require("./useIframeWallet");
5
+ var useIframeWallet_1 = require("./wallet/useIframeWallet");
6
6
  var CoinflowIFrame_1 = require("./CoinflowIFrame");
7
7
  var react_1 = tslib_1.__importDefault(require("react"));
8
- var SolanaIFrameMessageHandlers_1 = require("./SolanaIFrameMessageHandlers");
9
- var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
8
+ var SolanaIFrameMessageHandlers_1 = require("./wallet/SolanaIFrameMessageHandlers");
9
+ var NearIFrameMessageHandlers_1 = require("./wallet/NearIFrameMessageHandlers");
10
10
  var CoinflowUtils_1 = require("./CoinflowUtils");
11
- var EthIFrameMessageHandlers_1 = require("./EthIFrameMessageHandlers");
11
+ var EthIFrameMessageHandlers_1 = require("./wallet/EthIFrameMessageHandlers");
12
12
  function CoinflowPurchaseHistory(props) {
13
13
  return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
14
14
  solana: (react_1.default.createElement(SolanaPurchaseHistory, tslib_1.__assign({}, props))),
@@ -18,9 +18,10 @@ function CoinflowPurchaseHistory(props) {
18
18
  }
19
19
  exports.CoinflowPurchaseHistory = CoinflowPurchaseHistory;
20
20
  function SolanaPurchaseHistory(props) {
21
+ var _a;
21
22
  var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)(props);
22
- var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
23
23
  var wallet = props.wallet;
24
+ var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, (_a = wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString()).IFrameRef;
24
25
  if (!wallet.publicKey)
25
26
  return null;
26
27
  var walletPubkey = wallet.publicKey.toString();
@@ -28,21 +29,21 @@ function SolanaPurchaseHistory(props) {
28
29
  return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({}, iframeProps)));
29
30
  }
30
31
  function NearPurchaseHistory(props) {
31
- var _a;
32
+ var _a, _b;
32
33
  var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)(props);
33
- var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
34
- if (!((_a = props.wallet) === null || _a === void 0 ? void 0 : _a.accountId))
34
+ var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, (_a = props.wallet) === null || _a === void 0 ? void 0 : _a.accountId).IFrameRef;
35
+ if (!((_b = props.wallet) === null || _b === void 0 ? void 0 : _b.accountId))
35
36
  return null;
36
37
  var iframeProps = tslib_1.__assign(tslib_1.__assign({}, props), { walletPubkey: props.wallet.accountId, IFrameRef: IFrameRef, route: "/history/purchase/".concat(props.merchantId) });
37
38
  return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({}, iframeProps)));
38
39
  }
39
40
  function PolygonPurchaseHistory(props) {
40
- var _a, _b;
41
+ var _a, _b, _c;
41
42
  var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)(props);
42
- var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
43
- if (!((_a = props.wallet) === null || _a === void 0 ? void 0 : _a.address))
43
+ var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, (_a = props.wallet) === null || _a === void 0 ? void 0 : _a.address).IFrameRef;
44
+ if (!((_b = props.wallet) === null || _b === void 0 ? void 0 : _b.address))
44
45
  return null;
45
- var iframeProps = tslib_1.__assign(tslib_1.__assign({}, props), { walletPubkey: (_b = props.wallet) === null || _b === void 0 ? void 0 : _b.address, IFrameRef: IFrameRef, route: "/history/purchase/".concat(props.merchantId) });
46
+ var iframeProps = tslib_1.__assign(tslib_1.__assign({}, props), { walletPubkey: (_c = props.wallet) === null || _c === void 0 ? void 0 : _c.address, IFrameRef: IFrameRef, route: "/history/purchase/".concat(props.merchantId) });
46
47
  return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({}, iframeProps)));
47
48
  }
48
49
  //# sourceMappingURL=CoinflowPurchaseHistory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../../src/CoinflowPurchaseHistory.tsx"],"names":[],"mappings":";;;;AAAA,qDAAkD;AAClD,mDAAqE;AACrE,wDAA0B;AAC1B,6EAA6E;AAC7E,yEAAyE;AACzE,iDAA8C;AAM9C,uEAAuE;AAEvE,SAAgB,uBAAuB,CACrC,KAA0F;IAE1F,OAAO,6BAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,8BAAC,qBAAqB,uBAAM,KAAoC,EAAI,CACrE;QACD,IAAI,EAAE,8BAAC,mBAAmB,uBAAM,KAAkC,EAAI;QACtE,OAAO,EAAE,8BAAC,sBAAsB,uBAAM,KAAqC,EAAI;KAChF,CAAC,CAAC;AACL,CAAC;AAVD,0DAUC;AAED,SAAS,qBAAqB,CAAC,KAAiC;IAC9D,IAAM,QAAQ,GAAG,IAAA,4DAA8B,EAAC,KAAK,CAAC,CAAC;IAChD,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,EAAE,KAAK,CAAC,UAApC,CAAqC;IAE9C,IAAA,MAAM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ction } from '@solana/web3.js';
4
+ import { WalletContextState } from '@solana/wallet-adapter-react';
5
+ import { Wallet } from '@near-wallet-selector/core';
6
+ /** Coinflow Types **/
7
+ export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
8
+ export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
9
+ export interface CoinflowTypes {
10
+ merchantId: string;
11
+ env?: CoinflowEnvs;
12
+ loaderBackground?: string;
13
+ blockchain: CoinflowBlockchain;
14
+ handleHeightChange?: (height: string) => void;
15
+ useSocket?: boolean;
16
+ }
17
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
18
+ export type OnSuccessMethod = (params: string) => void | Promise<void>;
19
+ /** Wallets **/
20
+ export type SolanaWallet = PartialBy<Pick<WalletContextState, 'wallet' | 'signTransaction' | 'publicKey' | 'sendTransaction'>, 'wallet' | 'signTransaction'>;
21
+ export type NearWallet = {
22
+ accountId: string;
23
+ } & Pick<Wallet, 'signAndSendTransaction'>;
24
+ type AccessList = Array<{
25
+ address: string;
26
+ storageKeys: Array<string>;
27
+ }>;
28
+ type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
29
+ export type EthWallet = {
30
+ address: string | null | undefined;
31
+ sendTransaction: (transaction: {
32
+ to: string;
33
+ from?: string;
34
+ nonce?: Bytes | bigint | string | number;
35
+ gasLimit?: Bytes | bigint | string | number;
36
+ gasPrice?: Bytes | bigint | string | number;
37
+ data?: BytesLike;
38
+ value?: Bytes | bigint | string | number;
39
+ chainId?: number;
40
+ type?: number;
41
+ accessList?: AccessListish;
42
+ maxPriorityFeePerGas?: Bytes | bigint | string | number;
43
+ maxFeePerGas?: Bytes | bigint | string | number;
44
+ customData?: Record<string, any>;
45
+ ccipReadEnabled?: boolean;
46
+ }) => Promise<{
47
+ hash: string;
48
+ }>;
49
+ signMessage: (message: string) => Promise<string>;
50
+ };
51
+ /** History **/
52
+ export interface CoinflowSolanaHistoryProps extends CoinflowTypes {
53
+ wallet: SolanaWallet;
54
+ connection: Connection;
55
+ blockchain: 'solana';
56
+ }
57
+ export interface CoinflowNearHistoryProps extends CoinflowTypes {
58
+ wallet: NearWallet;
59
+ blockchain: 'near';
60
+ }
61
+ export interface CoinflowEthHistoryProps extends CoinflowTypes {
62
+ wallet: EthWallet;
63
+ blockchain: 'eth';
64
+ }
65
+ export interface CoinflowPolygonHistoryProps extends CoinflowTypes {
66
+ wallet: EthWallet;
67
+ blockchain: 'polygon';
68
+ }
69
+ export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps;
70
+ export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'> {
71
+ walletPubkey: string;
72
+ IFrameRef: React.RefObject<HTMLIFrameElement>;
73
+ route: string;
74
+ amount?: number;
75
+ transaction?: string;
76
+ webhookInfo?: object;
77
+ token?: string | PublicKey;
78
+ email?: string;
79
+ supportsVersionedTransactions?: boolean;
80
+ }
81
+ /** Transactions **/
82
+ export type NearFtTransferCallAction = {
83
+ methodName: 'ft_transfer_call';
84
+ args: object;
85
+ gas: string;
86
+ deposit: string;
87
+ };
88
+ type BigNumberish = object | bigint | string | number;
89
+ type Bytes = ArrayLike<number>;
90
+ type BytesLike = Bytes | string;
91
+ export type EvmTransaction = {
92
+ to: string;
93
+ from?: string;
94
+ nonce?: BigNumberish;
95
+ gasLimit?: BigNumberish;
96
+ gasPrice?: BigNumberish;
97
+ data?: BytesLike;
98
+ value?: BigNumberish;
99
+ chainId?: number;
100
+ type?: number;
101
+ maxPriorityFeePerGas?: BigNumberish;
102
+ maxFeePerGas?: BigNumberish;
103
+ customData?: Record<string, any>;
104
+ ccipReadEnabled?: boolean;
105
+ };
106
+ /** Purchase **/
107
+ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
108
+ amount?: number;
109
+ onSuccess?: OnSuccessMethod;
110
+ webhookInfo?: object;
111
+ email?: string;
112
+ }
113
+ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
114
+ wallet: SolanaWallet;
115
+ transaction?: Transaction;
116
+ partialSigners?: Signer[];
117
+ debugTx?: boolean;
118
+ connection: Connection;
119
+ blockchain: 'solana';
120
+ token?: PublicKey | string;
121
+ supportsVersionedTransactions?: boolean;
122
+ }
123
+ export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
124
+ wallet: NearWallet;
125
+ blockchain: 'near';
126
+ action?: NearFtTransferCallAction;
127
+ }
128
+ export interface CoinflowPolygonPurchaseProps extends CoinflowCommonPurchaseProps {
129
+ transaction?: EvmTransaction;
130
+ wallet: EthWallet;
131
+ blockchain: 'polygon';
132
+ }
133
+ export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowNearPurchaseProps | CoinflowPolygonPurchaseProps;
134
+ /** Withdraw **/
135
+ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
136
+ onSuccess?: OnSuccessMethod;
137
+ token?: string;
138
+ amount?: number;
139
+ email?: string;
140
+ }
141
+ export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
142
+ wallet: SolanaWallet;
143
+ connection: Connection;
144
+ blockchain: 'solana';
145
+ }
146
+ export interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {
147
+ wallet: NearWallet;
148
+ blockchain: 'near';
149
+ }
150
+ export interface CoinflowEthWithdrawProps extends CoinflowCommonWithdrawProps {
151
+ wallet: Omit<EthWallet, 'signMessage'>;
152
+ blockchain: 'eth';
153
+ }
154
+ export interface CoinflowPolygonWithdrawProps extends CoinflowCommonWithdrawProps {
155
+ wallet: Omit<EthWallet, 'signMessage'>;
156
+ blockchain: 'polygon';
157
+ }
158
+ export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps;
159
+ export {};
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=CommonCoinflowProps.js.map
3
+ //# sourceMappingURL=CoinflowTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../src/CoinflowTypes.ts"],"names":[],"mappings":""}
@@ -1,42 +1,5 @@
1
1
  import type { Transaction } from '@solana/web3.js';
2
- import type { WalletContextState } from '@solana/wallet-adapter-react';
3
- import type { Wallet } from '@near-wallet-selector/core';
4
- export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
5
- export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
6
- type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
7
- export type SolanaWallet = PartialBy<Pick<WalletContextState, 'wallet' | 'signTransaction' | 'publicKey' | 'sendTransaction'>, 'wallet' | 'signTransaction'>;
8
- export type NearWallet = {
9
- accountId: string;
10
- } & Pick<Wallet, 'signAndSendTransaction'>;
11
- type Bytes = ArrayLike<number>;
12
- type BytesLike = Bytes | string;
13
- type AccessList = Array<{
14
- address: string;
15
- storageKeys: Array<string>;
16
- }>;
17
- type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
18
- export type EthWallet = {
19
- address: string | null | undefined;
20
- sendTransaction: (transaction: {
21
- to: string;
22
- from?: string;
23
- nonce?: Bytes | bigint | string | number;
24
- gasLimit?: Bytes | bigint | string | number;
25
- gasPrice?: Bytes | bigint | string | number;
26
- data?: BytesLike;
27
- value?: Bytes | bigint | string | number;
28
- chainId?: number;
29
- type?: number;
30
- accessList?: AccessListish;
31
- maxPriorityFeePerGas?: Bytes | bigint | string | number;
32
- maxFeePerGas?: Bytes | bigint | string | number;
33
- customData?: Record<string, any>;
34
- ccipReadEnabled?: boolean;
35
- }) => Promise<{
36
- hash: string;
37
- }>;
38
- signMessage: (message: string) => Promise<string>;
39
- };
2
+ import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, SolanaWallet } from './CoinflowTypes';
40
3
  export declare class CoinflowUtils {
41
4
  env: CoinflowEnvs;
42
5
  url: string;
@@ -44,19 +7,8 @@ export declare class CoinflowUtils {
44
7
  getFeePayer(merchantId: string): Promise<string>;
45
8
  getCreditBalance(publicKey: string, blockchain: 'solana' | 'near'): Promise<number>;
46
9
  static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
47
- static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, loaderBackground, }: {
48
- walletPubkey: string;
49
- route: string;
50
- env?: CoinflowEnvs;
51
- amount?: number;
52
- transaction?: string;
53
- supportsVersionedTransactions?: boolean;
54
- blockchain: CoinflowBlockchain;
55
- webhookInfo?: object;
56
- token?: string;
57
- email?: string;
58
- loaderBackground?: string;
59
- }): string;
10
+ static getCoinflowApiUrl(env?: CoinflowEnvs): string;
11
+ static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, loaderBackground, handleHeightChange, useSocket, }: CoinflowIFrameProps): string;
60
12
  static serializeSolanaTransaction(transaction: Transaction | undefined): string | undefined;
61
13
  static solanaWalletSupportsVersionedTransactions(wallet: SolanaWallet): boolean;
62
14
  static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
@@ -66,4 +18,3 @@ export declare class CoinflowUtils {
66
18
  polygon: T;
67
19
  }): T;
68
20
  }
69
- export {};
@@ -52,8 +52,15 @@ var CoinflowUtils = /** @class */ (function () {
52
52
  return 'http://localhost:3000';
53
53
  return "https://".concat(env, ".coinflow.cash");
54
54
  };
55
+ CoinflowUtils.getCoinflowApiUrl = function (env) {
56
+ if (!env || env === 'prod')
57
+ return 'https://api.coinflow.cash';
58
+ if (env === 'local')
59
+ return 'http://localhost:5000';
60
+ return "https://api-".concat(env, ".coinflow.cash");
61
+ };
55
62
  CoinflowUtils.getCoinflowUrl = function (_a) {
56
- var walletPubkey = _a.walletPubkey, route = _a.route, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, supportsVersionedTransactions = _a.supportsVersionedTransactions, webhookInfo = _a.webhookInfo, token = _a.token, email = _a.email, loaderBackground = _a.loaderBackground;
63
+ var walletPubkey = _a.walletPubkey, route = _a.route, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, supportsVersionedTransactions = _a.supportsVersionedTransactions, webhookInfo = _a.webhookInfo, token = _a.token, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, useSocket = _a.useSocket;
57
64
  var url = new URL("/".concat(blockchain) + route, CoinflowUtils.getCoinflowBaseUrl(env));
58
65
  url.searchParams.append('pubkey', walletPubkey);
59
66
  if (transaction) {
@@ -72,11 +79,17 @@ var CoinflowUtils = /** @class */ (function () {
72
79
  url.searchParams.append('email', email);
73
80
  }
74
81
  if (token) {
75
- url.searchParams.append('token', token);
82
+ url.searchParams.append('token', token.toString());
76
83
  }
77
84
  if (loaderBackground) {
78
85
  url.searchParams.append('loaderBackground', loaderBackground);
79
86
  }
87
+ if (handleHeightChange) {
88
+ url.searchParams.append('useHeightChange', 'true');
89
+ }
90
+ if (useSocket) {
91
+ url.searchParams.append('useSocket', 'true');
92
+ }
80
93
  return url.toString();
81
94
  };
82
95
  CoinflowUtils.serializeSolanaTransaction = function (transaction) {
@@ -1 +1 @@
1
- {"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;AAGA,sDAA0B;AAgD1B;IAIE,uBAAY,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,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AW,EAAE,MAAM,CAAC,CAAC;SAC9C;QAED,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAEM,wCAA0B,GAAjC,UACE,WAAoC;QAEpC,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QAEnC,IAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC;YACzC,oBAAoB,EAAE,KAAK;YAC3B,gBAAgB,EAAE,KAAK;SACxB,CAAC,CAAC;QACH,OAAO,cAAM,CAAC,MAAM,CAAC,YAA0B,CAAC,CAAC;IACnD,CAAC;IAEM,uDAAyC,GAAhD,UACE,MAAoB;;QAEpB,OAAO,CAAC,CAAC,CAAA,MAAA,MAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,OAAO,0CAAE,4BAA4B,0CAAE,GAAG,CAAC,CAAC,CAAC,CAAA,CAAC;IACxE,CAAC;IAEM,0BAAY,GAAnB,UACE,UAA8B,EAC9B,IAA+C;QAE/C,QAAQ,UAAU,EAAE;YAClB,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,MAAM,CAAC;YACrB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB,KAAK,KAAK;gBACR,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;oBACxB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAClE,OAAO,IAAI,CAAC,GAAG,CAAC;YAClB;gBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAChD;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AA7ID,IA6IC;AA7IY,sCAAa"}
@@ -1,29 +1,3 @@
1
- /// <reference types="react" />
2
- import type { Connection } from '@solana/web3.js';
3
- import { EthWallet, NearWallet, SolanaWallet } from './CoinflowUtils';
4
- import { OnSuccessMethod } from './useIframeWallet';
5
- import { CommonCoinflowProps } from './CommonCoinflowProps';
6
- export interface CoinflowCommonWithdrawProps extends CommonCoinflowProps {
7
- onSuccess?: OnSuccessMethod;
8
- token?: string;
9
- amount?: number;
10
- email?: string;
11
- }
12
- export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
13
- wallet: SolanaWallet;
14
- connection: Connection;
15
- blockchain: 'solana';
16
- }
17
- export interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {
18
- wallet: NearWallet;
19
- blockchain: 'near';
20
- }
21
- export interface CoinflowEthWithdrawProps extends CoinflowCommonWithdrawProps {
22
- wallet: Omit<EthWallet, 'signMessage'>;
23
- blockchain: 'eth';
24
- }
25
- export interface CoinflowPolygonWithdrawProps extends CoinflowCommonWithdrawProps {
26
- wallet: Omit<EthWallet, 'signMessage'>;
27
- blockchain: 'polygon';
28
- }
29
- export declare function CoinflowWithdraw(props: CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps): JSX.Element;
1
+ import React from 'react';
2
+ import { CoinflowWithdrawProps } from './CoinflowTypes';
3
+ export declare function CoinflowWithdraw(props: CoinflowWithdrawProps): React.JSX.Element;