@coinflowlabs/react 1.1.2 → 1.3.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 +10 -0
- package/build/cjs/CoinflowIFrame.d.ts +8 -5
- package/build/cjs/CoinflowIFrame.js +9 -17
- package/build/cjs/CoinflowIFrame.js.map +1 -1
- package/build/cjs/CoinflowPurchase.d.ts +32 -7
- package/build/cjs/CoinflowPurchase.js +37 -9
- package/build/cjs/CoinflowPurchase.js.map +1 -1
- package/build/cjs/CoinflowPurchaseHistory.d.ts +1 -1
- package/build/cjs/CoinflowPurchaseHistory.js +9 -9
- package/build/cjs/CoinflowPurchaseHistory.js.map +1 -1
- package/build/cjs/CoinflowUtils.d.ts +37 -13
- package/build/cjs/CoinflowUtils.js +19 -6
- package/build/cjs/CoinflowUtils.js.map +1 -1
- package/build/cjs/CoinflowWithdraw.d.ts +12 -6
- package/build/cjs/CoinflowWithdraw.js +23 -9
- package/build/cjs/CoinflowWithdraw.js.map +1 -1
- package/build/cjs/CoinflowWithdrawHistory.d.ts +2 -17
- package/build/cjs/CoinflowWithdrawHistory.js +21 -9
- package/build/cjs/CoinflowWithdrawHistory.js.map +1 -1
- package/build/cjs/CommonCoinflowProps.d.ts +25 -0
- package/build/cjs/CommonCoinflowProps.js +3 -0
- package/build/cjs/CommonCoinflowProps.js.map +1 -0
- package/build/cjs/EthIFrameMessageHandlers.d.ts +7 -0
- package/build/cjs/EthIFrameMessageHandlers.js +46 -0
- package/build/cjs/EthIFrameMessageHandlers.js.map +1 -0
- package/build/cjs/NearIFrameMessageHandlers.js +1 -22
- package/build/cjs/NearIFrameMessageHandlers.js.map +1 -1
- package/build/cjs/SolanaIFrameMessageHandlers.d.ts +1 -1
- package/build/cjs/SolanaIFrameMessageHandlers.js +22 -30
- package/build/cjs/SolanaIFrameMessageHandlers.js.map +1 -1
- package/build/cjs/index.js +1 -1
- package/build/cjs/useIframeWallet.d.ts +1 -1
- package/build/cjs/useIframeWallet.js +24 -21
- package/build/cjs/useIframeWallet.js.map +1 -1
- package/build/esm/CoinflowIFrame.d.ts +8 -5
- package/build/esm/CoinflowIFrame.js +7 -15
- package/build/esm/CoinflowIFrame.js.map +1 -1
- package/build/esm/CoinflowPurchase.d.ts +32 -7
- package/build/esm/CoinflowPurchase.js +33 -6
- package/build/esm/CoinflowPurchase.js.map +1 -1
- package/build/esm/CoinflowPurchaseHistory.d.ts +1 -1
- package/build/esm/CoinflowPurchaseHistory.js +7 -7
- package/build/esm/CoinflowPurchaseHistory.js.map +1 -1
- package/build/esm/CoinflowUtils.d.ts +37 -13
- package/build/esm/CoinflowUtils.js +18 -5
- package/build/esm/CoinflowUtils.js.map +1 -1
- package/build/esm/CoinflowWithdraw.d.ts +12 -6
- package/build/esm/CoinflowWithdraw.js +21 -7
- package/build/esm/CoinflowWithdraw.js.map +1 -1
- package/build/esm/CoinflowWithdrawHistory.d.ts +2 -17
- package/build/esm/CoinflowWithdrawHistory.js +20 -8
- package/build/esm/CoinflowWithdrawHistory.js.map +1 -1
- package/build/esm/CommonCoinflowProps.d.ts +25 -0
- package/build/esm/CommonCoinflowProps.js +2 -0
- package/build/esm/CommonCoinflowProps.js.map +1 -0
- package/build/esm/EthIFrameMessageHandlers.d.ts +7 -0
- package/build/esm/EthIFrameMessageHandlers.js +42 -0
- package/build/esm/EthIFrameMessageHandlers.js.map +1 -0
- package/build/esm/NearIFrameMessageHandlers.js +0 -21
- package/build/esm/NearIFrameMessageHandlers.js.map +1 -1
- package/build/esm/SolanaIFrameMessageHandlers.d.ts +1 -1
- package/build/esm/SolanaIFrameMessageHandlers.js +18 -26
- package/build/esm/SolanaIFrameMessageHandlers.js.map +1 -1
- package/build/esm/useIframeWallet.d.ts +1 -1
- package/build/esm/useIframeWallet.js +23 -20
- package/build/esm/useIframeWallet.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -36,6 +36,7 @@ Props:
|
|
|
36
36
|
* `transaction` (optional): transaction for the user to run which redeems their credits with your smart contract. Create this transaction just like you would for a normal user who has USDC in their account.
|
|
37
37
|
* `partialSigners` (optional): Keypairs of Partial Signers to sign the transaction with, this is necessary when initializing new accounts as the new account Keypair must sign the transaction.
|
|
38
38
|
* `debugTx` (optional): Setting this to `true` will sign the transaction with the wallet, and send the transaction with no preflight checks allowing for easier debug of any issues.
|
|
39
|
+
* `token` (optional): The token to use for the purchase. Defaults to USDC. Currently only supported for the Solana Blockchain.
|
|
39
40
|
|
|
40
41
|
## Utils
|
|
41
42
|
|
|
@@ -45,6 +46,15 @@ Props:
|
|
|
45
46
|
|
|
46
47
|
# Changelog
|
|
47
48
|
|
|
49
|
+
### 1.3.0
|
|
50
|
+
|
|
51
|
+
- Added support for Polygon blockchain
|
|
52
|
+
- Added support for Solana Checkout with non-USDC tokens
|
|
53
|
+
|
|
54
|
+
### 1.2.0
|
|
55
|
+
|
|
56
|
+
- Added support for Ethereum Mainnet blockchain
|
|
57
|
+
|
|
48
58
|
### 1.0.0
|
|
49
59
|
|
|
50
60
|
- Added support for the NEAR blockchain
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CoinflowBlockchain, CoinflowEnvs } from './CoinflowUtils';
|
|
3
|
-
|
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
|
4
|
+
interface CoinflowIFrameProps {
|
|
4
5
|
walletPubkey: string;
|
|
5
6
|
IFrameRef: React.RefObject<HTMLIFrameElement>;
|
|
6
|
-
env?: CoinflowEnvs;
|
|
7
7
|
route: string;
|
|
8
8
|
amount?: number;
|
|
9
9
|
transaction?: string;
|
|
10
10
|
blockchain: CoinflowBlockchain;
|
|
11
11
|
webhookInfo?: object;
|
|
12
|
-
token?: string;
|
|
12
|
+
token?: string | PublicKey;
|
|
13
13
|
email?: string;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
env?: CoinflowEnvs;
|
|
15
|
+
loaderBackground?: string;
|
|
16
|
+
supportsVersionedTransactions?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function CoinflowIFrame({ walletPubkey, IFrameRef, env, route, transaction, amount, blockchain, webhookInfo, token, email, loaderBackground, supportsVersionedTransactions }: CoinflowIFrameProps): JSX.Element;
|
|
16
19
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
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
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;
|
|
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;
|
|
9
9
|
var url = (0, react_1.useMemo)(function () {
|
|
10
10
|
return CoinflowUtils_1.CoinflowUtils.getCoinflowUrl({
|
|
11
11
|
walletPubkey: walletPubkey,
|
|
@@ -15,28 +15,20 @@ function CoinflowIFrame(_a) {
|
|
|
15
15
|
transaction: transaction,
|
|
16
16
|
blockchain: blockchain,
|
|
17
17
|
webhookInfo: webhookInfo,
|
|
18
|
-
token: token,
|
|
19
|
-
email: email
|
|
18
|
+
token: token === null || token === void 0 ? void 0 : token.toString(),
|
|
19
|
+
email: email,
|
|
20
|
+
loaderBackground: loaderBackground,
|
|
21
|
+
supportsVersionedTransactions: supportsVersionedTransactions
|
|
20
22
|
});
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
amount,
|
|
24
|
-
env,
|
|
25
|
-
route,
|
|
26
|
-
transaction,
|
|
27
|
-
blockchain,
|
|
28
|
-
webhookInfo,
|
|
29
|
-
token,
|
|
30
|
-
email,
|
|
31
|
-
]);
|
|
32
|
-
return (0, react_1.useMemo)(function () { return (react_1["default"].createElement("iframe", { onLoad: function () {
|
|
23
|
+
}, [walletPubkey, amount, env, route, transaction, blockchain, webhookInfo, token, email, loaderBackground, supportsVersionedTransactions]);
|
|
24
|
+
return (0, react_1.useMemo)(function () { return (react_1.default.createElement("iframe", { onLoad: function () {
|
|
33
25
|
if (IFrameRef.current)
|
|
34
26
|
IFrameRef.current.style.opacity = '1';
|
|
35
27
|
}, ref: IFrameRef, style: {
|
|
36
28
|
width: '100%',
|
|
37
29
|
height: '100%',
|
|
38
30
|
opacity: 0,
|
|
39
|
-
transition: 'opacity 300ms linear'
|
|
31
|
+
transition: 'opacity 300ms linear',
|
|
40
32
|
}, title: "withdraw", frameBorder: "0", src: url })); }, [IFrameRef, url]);
|
|
41
33
|
}
|
|
42
34
|
exports.CoinflowIFrame = CoinflowIFrame;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowIFrame.js","sourceRoot":"","sources":["../../src/CoinflowIFrame.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AACrC,iDAAgF;
|
|
1
|
+
{"version":3,"file":"CoinflowIFrame.js","sourceRoot":"","sources":["../../src/CoinflowIFrame.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AACrC,iDAAgF;AAkBhF,SAAgB,cAAc,CAAC,EAaT;QAZpB,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;IAE7B,IAAM,GAAG,GAAG,IAAA,eAAO,EAAC;QAClB,OAAO,6BAAa,CAAC,cAAc,CAAC;YAClC,YAAY,cAAA;YACZ,MAAM,QAAA;YACN,GAAG,KAAA;YACH,KAAK,OAAA;YACL,WAAW,aAAA;YACX,UAAU,YAAA;YACV,WAAW,aAAA;YACX,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;YACxB,KAAK,OAAA;YACL,gBAAgB,kBAAA;YAChB,6BAA6B,+BAAA;SAC9B,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,6BAA6B,CAAC,CAAC,CAAC;IAE5I,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CACJ,0CACE,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,EAhBK,CAgBL,EACD,CAAC,SAAS,EAAE,GAAG,CAAC,CACjB,CAAC;AACJ,CAAC;AAlDD,wCAkDC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Connection, Signer, Transaction } from
|
|
3
|
-
import {
|
|
2
|
+
import { Connection, PublicKey, Signer, Transaction } from "@solana/web3.js";
|
|
3
|
+
import { EthWallet, NearWallet, SolanaWalletContextState } from './CoinflowUtils';
|
|
4
4
|
import { OnSuccessMethod } from './useIframeWallet';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { CommonCoinflowProps } from './CommonCoinflowProps';
|
|
6
|
+
export interface CoinflowCommonPurchaseProps extends CommonCoinflowProps {
|
|
7
7
|
amount?: number;
|
|
8
|
-
env?: CoinflowEnvs;
|
|
9
8
|
onSuccess?: OnSuccessMethod;
|
|
10
|
-
blockchain: CoinflowBlockchain;
|
|
11
9
|
webhookInfo?: object;
|
|
12
10
|
email?: string;
|
|
13
11
|
}
|
|
@@ -18,6 +16,8 @@ export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps
|
|
|
18
16
|
debugTx?: boolean;
|
|
19
17
|
connection: Connection;
|
|
20
18
|
blockchain: 'solana';
|
|
19
|
+
token?: PublicKey | string;
|
|
20
|
+
supportsVersionedTransactions?: boolean;
|
|
21
21
|
}
|
|
22
22
|
export type NearFtTransferCallAction = {
|
|
23
23
|
methodName: 'ft_transfer_call';
|
|
@@ -30,4 +30,29 @@ export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
|
30
30
|
blockchain: 'near';
|
|
31
31
|
action?: NearFtTransferCallAction;
|
|
32
32
|
}
|
|
33
|
-
|
|
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({ merchantId, amount, env, onSuccess, wallet, transaction, webhookInfo, email, loaderBackground, }: CoinflowPolygonPurchaseProps): JSX.Element | null;
|
|
58
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
exports.CoinflowPurchase = void 0;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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");
|
|
@@ -8,20 +8,22 @@ var SolanaIFrameMessageHandlers_1 = require("./SolanaIFrameMessageHandlers");
|
|
|
8
8
|
var CoinflowUtils_1 = require("./CoinflowUtils");
|
|
9
9
|
var useIframeWallet_1 = require("./useIframeWallet");
|
|
10
10
|
var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
|
|
11
|
+
var EthIFrameMessageHandlers_1 = require("./EthIFrameMessageHandlers");
|
|
11
12
|
function CoinflowPurchase(props) {
|
|
12
13
|
return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
|
|
13
|
-
solana: (react_1
|
|
14
|
-
near: react_1
|
|
14
|
+
solana: (react_1.default.createElement(SolanaCoinflowPurchase, tslib_1.__assign({}, props))),
|
|
15
|
+
near: react_1.default.createElement(NearCoinflowPurchase, tslib_1.__assign({}, props)),
|
|
16
|
+
polygon: (react_1.default.createElement(PolygonCoinflowPurchase, tslib_1.__assign({}, props))),
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
19
|
exports.CoinflowPurchase = CoinflowPurchase;
|
|
18
20
|
function SolanaCoinflowPurchase(_a) {
|
|
19
|
-
var merchantId = _a.merchantId, amount = _a.amount, env = _a.env, onSuccess = _a.onSuccess, wallet = _a.wallet, transaction = _a.transaction, partialSigners = _a.partialSigners, debugTx = _a.debugTx, connection = _a.connection, webhookInfo = _a.webhookInfo, email = _a.email;
|
|
21
|
+
var merchantId = _a.merchantId, amount = _a.amount, env = _a.env, onSuccess = _a.onSuccess, wallet = _a.wallet, transaction = _a.transaction, partialSigners = _a.partialSigners, debugTx = _a.debugTx, connection = _a.connection, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, token = _a.token, supportsVersionedTransactionsParam = _a.supportsVersionedTransactions;
|
|
20
22
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)({
|
|
21
23
|
wallet: wallet,
|
|
22
24
|
connection: connection,
|
|
23
25
|
partialSigners: partialSigners,
|
|
24
|
-
debugTx: debugTx
|
|
26
|
+
debugTx: debugTx,
|
|
25
27
|
});
|
|
26
28
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
27
29
|
var transactionStr = (0, react_1.useMemo)(function () {
|
|
@@ -29,13 +31,23 @@ function SolanaCoinflowPurchase(_a) {
|
|
|
29
31
|
? CoinflowUtils_1.CoinflowUtils.serializeSolanaTransaction(transaction)
|
|
30
32
|
: undefined;
|
|
31
33
|
}, [transaction]);
|
|
34
|
+
var supportsVersionedTransactions = (0, react_1.useMemo)(function () {
|
|
35
|
+
if (supportsVersionedTransactionsParam !== undefined)
|
|
36
|
+
return supportsVersionedTransactionsParam;
|
|
37
|
+
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.wallet))
|
|
38
|
+
return false;
|
|
39
|
+
var supportedTransactionVersions = wallet.wallet.adapter.supportedTransactionVersions;
|
|
40
|
+
if (!supportedTransactionVersions)
|
|
41
|
+
return false;
|
|
42
|
+
return supportedTransactionVersions.has(0);
|
|
43
|
+
}, [supportsVersionedTransactionsParam, wallet.wallet]);
|
|
32
44
|
if (!wallet.publicKey)
|
|
33
45
|
return null;
|
|
34
46
|
var walletPubkey = wallet.publicKey.toString();
|
|
35
|
-
return (react_1
|
|
47
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/purchase/".concat(merchantId), env: env, transaction: transactionStr, amount: amount, blockchain: 'solana', webhookInfo: webhookInfo, email: email, loaderBackground: loaderBackground, token: token, supportsVersionedTransactions: supportsVersionedTransactions }));
|
|
36
48
|
}
|
|
37
49
|
function NearCoinflowPurchase(_a) {
|
|
38
|
-
var merchantId = _a.merchantId, amount = _a.amount, env = _a.env, onSuccess = _a.onSuccess, wallet = _a.wallet, action = _a.action, webhookInfo = _a.webhookInfo, email = _a.email;
|
|
50
|
+
var merchantId = _a.merchantId, amount = _a.amount, env = _a.env, onSuccess = _a.onSuccess, wallet = _a.wallet, action = _a.action, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground;
|
|
39
51
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)({ wallet: wallet });
|
|
40
52
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
41
53
|
var transaction = (0, react_1.useMemo)(function () {
|
|
@@ -43,6 +55,22 @@ function NearCoinflowPurchase(_a) {
|
|
|
43
55
|
? Buffer.from(JSON.stringify(action)).toString('base64')
|
|
44
56
|
: undefined;
|
|
45
57
|
}, [action]);
|
|
46
|
-
return (react_1
|
|
58
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: wallet.accountId, IFrameRef: IFrameRef, route: "/purchase/".concat(merchantId), env: env, amount: amount, blockchain: 'near', transaction: transaction, webhookInfo: webhookInfo, email: email, loaderBackground: loaderBackground }));
|
|
47
59
|
}
|
|
60
|
+
function PolygonCoinflowPurchase(_a) {
|
|
61
|
+
var merchantId = _a.merchantId, amount = _a.amount, env = _a.env, onSuccess = _a.onSuccess, wallet = _a.wallet, transaction = _a.transaction, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground;
|
|
62
|
+
var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)({ wallet: wallet });
|
|
63
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
64
|
+
var transactionStr = (0, react_1.useMemo)(function () {
|
|
65
|
+
if (!transaction)
|
|
66
|
+
return undefined;
|
|
67
|
+
return Buffer.from(JSON.stringify(transaction)).toString('base64');
|
|
68
|
+
}, [transaction]);
|
|
69
|
+
if (!wallet.address)
|
|
70
|
+
return null;
|
|
71
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { transaction: transactionStr, walletPubkey: wallet.address, IFrameRef: IFrameRef, route: "/purchase/".concat(merchantId), env: env, amount: amount, blockchain: 'polygon',
|
|
72
|
+
// transaction={transaction} TODO
|
|
73
|
+
webhookInfo: webhookInfo, email: email, loaderBackground: loaderBackground }));
|
|
74
|
+
}
|
|
75
|
+
exports.PolygonCoinflowPurchase = PolygonCoinflowPurchase;
|
|
48
76
|
//# sourceMappingURL=CoinflowPurchase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../../src/CoinflowPurchase.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AAErC,mDAAgD;AAChD,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../../src/CoinflowPurchase.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AAErC,mDAAgD;AAChD,6EAA6E;AAC7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,EAC3B,YAAY,EAAE,MAAM,CAAC,OAAO,EAC5B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,oBAAa,UAAU,CAAE,EAChC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,SAAS;QACrB,iCAAiC;QACjC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC;AApCD,0DAoCC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CoinflowNearHistoryProps, CoinflowSolanaHistoryProps } from './
|
|
2
|
+
import { CoinflowNearHistoryProps, CoinflowSolanaHistoryProps } from './CommonCoinflowProps';
|
|
3
3
|
export declare function CoinflowPurchaseHistory(props: CoinflowSolanaHistoryProps | CoinflowNearHistoryProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoinflowPurchaseHistory = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var useIframeWallet_1 = require("./useIframeWallet");
|
|
@@ -10,32 +10,32 @@ var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
|
|
|
10
10
|
var CoinflowUtils_1 = require("./CoinflowUtils");
|
|
11
11
|
function CoinflowPurchaseHistory(props) {
|
|
12
12
|
return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
|
|
13
|
-
solana: (react_1
|
|
14
|
-
near: react_1
|
|
13
|
+
solana: (react_1.default.createElement(SolanaPurchaseHistory, tslib_1.__assign({}, props))),
|
|
14
|
+
near: react_1.default.createElement(NearPurchaseHistory, tslib_1.__assign({}, props)),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
exports.CoinflowPurchaseHistory = CoinflowPurchaseHistory;
|
|
18
18
|
function SolanaPurchaseHistory(_a) {
|
|
19
|
-
var wallet = _a.wallet, merchantId = _a.merchantId, connection = _a.connection, env = _a.env;
|
|
19
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, connection = _a.connection, env = _a.env, loaderBackground = _a.loaderBackground;
|
|
20
20
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)({
|
|
21
21
|
wallet: wallet,
|
|
22
|
-
connection: connection
|
|
22
|
+
connection: connection,
|
|
23
23
|
});
|
|
24
24
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers).IFrameRef;
|
|
25
25
|
if (!wallet.publicKey)
|
|
26
26
|
return null;
|
|
27
27
|
var walletPubkey = wallet.publicKey.toString();
|
|
28
|
-
return (react_1
|
|
28
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/purchase/".concat(merchantId), env: env, blockchain: 'solana', loaderBackground: loaderBackground }));
|
|
29
29
|
}
|
|
30
30
|
function NearPurchaseHistory(_a) {
|
|
31
|
-
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env;
|
|
31
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, loaderBackground = _a.loaderBackground;
|
|
32
32
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)({
|
|
33
|
-
wallet: wallet
|
|
33
|
+
wallet: wallet,
|
|
34
34
|
});
|
|
35
35
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers).IFrameRef;
|
|
36
36
|
if (!wallet)
|
|
37
37
|
return null;
|
|
38
38
|
var walletPubkey = wallet.accountId;
|
|
39
|
-
return (react_1
|
|
39
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/purchase/".concat(merchantId), env: env, blockchain: 'near', loaderBackground: loaderBackground }));
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=CoinflowPurchaseHistory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../../src/CoinflowPurchaseHistory.tsx"],"names":[],"mappings":";;;;AAAA,qDAAkD;AAClD,mDAAgD;AAChD,wDAA0B;
|
|
1
|
+
{"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../../src/CoinflowPurchaseHistory.tsx"],"names":[],"mappings":";;;;AAAA,qDAAkD;AAClD,mDAAgD;AAChD,wDAA0B;AAC1B,6EAA6E;AAC7E,yEAAyE;AACzE,iDAA8C;AAM9C,SAAgB,uBAAuB,CACrC,KAA4D;IAE5D,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;KACvE,CAAC,CAAC;AACL,CAAC;AATD,0DASC;AAED,SAAS,qBAAqB,CAAC,EAMF;QAL3B,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,GAAG,SAAA,EACH,gBAAgB,sBAAA;IAEhB,IAAM,QAAQ,GAAG,IAAA,4DAA8B,EAAC;QAC9C,MAAM,QAAA;QACN,UAAU,YAAA;KACX,CAAC,CAAC;IACI,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,CAAC,UAA7B,CAA8B;IAE9C,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IACnC,IAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAEjD,OAAO,CACL,8BAAC,+BAAc,IACb,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,4BAAqB,UAAU,CAAE,EACxC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,QAAQ,EACpB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,EAKF;QAJzB,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,GAAG,SAAA,EACH,gBAAgB,sBAAA;IAEhB,IAAM,QAAQ,GAAG,IAAA,wDAA4B,EAAC;QAC5C,MAAM,QAAA;KACP,CAAC,CAAC;IACI,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,CAAC,UAA7B,CAA8B;IAE9C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,IAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC;IAEtC,OAAO,CACL,8BAAC,+BAAc,IACb,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,4BAAqB,UAAU,CAAE,EACxC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { PublicKey, Transaction } from '@solana/web3.js';
|
|
2
2
|
import { WalletContextState } from '@solana/wallet-adapter-react';
|
|
3
|
-
export type CoinflowBlockchain = 'solana' | 'near';
|
|
3
|
+
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
|
|
4
4
|
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
5
|
-
|
|
5
|
+
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
6
|
+
export type SolanaWalletContextState = PartialBy<Pick<WalletContextState, 'wallet' | 'signTransaction' | 'connected' | 'publicKey' | 'sendTransaction'>, 'wallet'>;
|
|
6
7
|
export type NearWallet = {
|
|
7
8
|
accountId: string;
|
|
8
|
-
verifyOwner: (params: {
|
|
9
|
-
message: string;
|
|
10
|
-
}) => Promise<{
|
|
11
|
-
accountId: string;
|
|
12
|
-
message: string;
|
|
13
|
-
blockId: string;
|
|
14
|
-
publicKey: string;
|
|
15
|
-
signature: string;
|
|
16
|
-
keyType: number;
|
|
17
|
-
}>;
|
|
18
9
|
signAndSendTransaction: (params: {
|
|
19
10
|
signerId?: string;
|
|
20
11
|
receiverId?: string;
|
|
@@ -29,6 +20,35 @@ export type NearWallet = {
|
|
|
29
20
|
receipts_outcome: any;
|
|
30
21
|
}>;
|
|
31
22
|
};
|
|
23
|
+
type Bytes = ArrayLike<number>;
|
|
24
|
+
type BytesLike = Bytes | string;
|
|
25
|
+
type AccessList = Array<{
|
|
26
|
+
address: string;
|
|
27
|
+
storageKeys: Array<string>;
|
|
28
|
+
}>;
|
|
29
|
+
type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
30
|
+
export type EthWallet = {
|
|
31
|
+
address: string | null | undefined;
|
|
32
|
+
sendTransaction: (transaction: {
|
|
33
|
+
to: string;
|
|
34
|
+
from?: string;
|
|
35
|
+
nonce?: Bytes | bigint | string | number;
|
|
36
|
+
gasLimit?: Bytes | bigint | string | number;
|
|
37
|
+
gasPrice?: Bytes | bigint | string | number;
|
|
38
|
+
data?: BytesLike;
|
|
39
|
+
value?: Bytes | bigint | string | number;
|
|
40
|
+
chainId?: number;
|
|
41
|
+
type?: number;
|
|
42
|
+
accessList?: AccessListish;
|
|
43
|
+
maxPriorityFeePerGas?: Bytes | bigint | string | number;
|
|
44
|
+
maxFeePerGas?: Bytes | bigint | string | number;
|
|
45
|
+
customData?: Record<string, any>;
|
|
46
|
+
ccipReadEnabled?: boolean;
|
|
47
|
+
}) => Promise<{
|
|
48
|
+
hash: string;
|
|
49
|
+
}>;
|
|
50
|
+
signMessage: (message: string) => Promise<string>;
|
|
51
|
+
};
|
|
32
52
|
export declare class CoinflowUtils {
|
|
33
53
|
env: CoinflowEnvs;
|
|
34
54
|
url: string;
|
|
@@ -36,7 +56,7 @@ export declare class CoinflowUtils {
|
|
|
36
56
|
getFeePayer(merchantId: string): Promise<PublicKey>;
|
|
37
57
|
getCreditBalance(publicKey: string, blockchain: 'solana' | 'near'): Promise<number>;
|
|
38
58
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
39
|
-
static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, }: {
|
|
59
|
+
static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, loaderBackground, }: {
|
|
40
60
|
walletPubkey: string;
|
|
41
61
|
route: string;
|
|
42
62
|
env?: CoinflowEnvs;
|
|
@@ -47,11 +67,15 @@ export declare class CoinflowUtils {
|
|
|
47
67
|
webhookInfo?: object;
|
|
48
68
|
token?: string;
|
|
49
69
|
email?: string;
|
|
70
|
+
loaderBackground?: string;
|
|
50
71
|
}): string;
|
|
51
72
|
static serializeSolanaTransaction(transaction: Transaction | undefined): string | undefined;
|
|
52
73
|
static solanaWalletSupportsVersionedTransactions(wallet: SolanaWalletContextState): boolean;
|
|
53
74
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
54
75
|
solana: T;
|
|
55
76
|
near: T;
|
|
77
|
+
eth?: T;
|
|
78
|
+
polygon?: T;
|
|
56
79
|
}): T;
|
|
57
80
|
}
|
|
81
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoinflowUtils = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var web3_js_1 = require("@solana/web3.js");
|
|
@@ -54,7 +54,7 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
54
54
|
return "https://".concat(env, ".coinflow.cash");
|
|
55
55
|
};
|
|
56
56
|
CoinflowUtils.getCoinflowUrl = function (_a) {
|
|
57
|
-
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;
|
|
57
|
+
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;
|
|
58
58
|
var url = new URL("/".concat(blockchain) + route, CoinflowUtils.getCoinflowBaseUrl(env));
|
|
59
59
|
url.searchParams.append('pubkey', walletPubkey);
|
|
60
60
|
if (transaction) {
|
|
@@ -75,26 +75,39 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
75
75
|
if (token) {
|
|
76
76
|
url.searchParams.append('token', token);
|
|
77
77
|
}
|
|
78
|
+
if (loaderBackground) {
|
|
79
|
+
url.searchParams.append('loaderBackground', loaderBackground);
|
|
80
|
+
}
|
|
78
81
|
return url.toString();
|
|
79
82
|
};
|
|
80
83
|
CoinflowUtils.serializeSolanaTransaction = function (transaction) {
|
|
81
84
|
if (!transaction)
|
|
82
85
|
return undefined;
|
|
83
|
-
|
|
86
|
+
var serializedTx = transaction.serialize({
|
|
84
87
|
requireAllSignatures: false,
|
|
85
|
-
verifySignatures: false
|
|
86
|
-
})
|
|
88
|
+
verifySignatures: false,
|
|
89
|
+
});
|
|
90
|
+
return bs58_1.default.encode(serializedTx);
|
|
87
91
|
};
|
|
88
92
|
CoinflowUtils.solanaWalletSupportsVersionedTransactions = function (wallet) {
|
|
89
93
|
var _a, _b, _c;
|
|
90
94
|
return !!((_c = (_b = (_a = wallet.wallet) === null || _a === void 0 ? void 0 : _a.adapter) === null || _b === void 0 ? void 0 : _b.supportedTransactionVersions) === null || _c === void 0 ? void 0 : _c.has(0));
|
|
91
95
|
};
|
|
92
|
-
CoinflowUtils.byBlockchain = function (blockchain, args
|
|
96
|
+
CoinflowUtils.byBlockchain = function (blockchain, args // TODO polygon not optional
|
|
97
|
+
) {
|
|
93
98
|
switch (blockchain) {
|
|
94
99
|
case 'solana':
|
|
95
100
|
return args.solana;
|
|
96
101
|
case 'near':
|
|
97
102
|
return args.near;
|
|
103
|
+
case 'eth':
|
|
104
|
+
if (args.eth === undefined)
|
|
105
|
+
throw new Error('blockchain not supported for this operation!');
|
|
106
|
+
return args.eth;
|
|
107
|
+
case 'polygon':
|
|
108
|
+
if (args.polygon === undefined)
|
|
109
|
+
throw new Error('blockchain not supported for this operation!');
|
|
110
|
+
return args.polygon;
|
|
98
111
|
default:
|
|
99
112
|
throw new Error('blockchain not supported!');
|
|
100
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;AAAA,2CAAuD;AAEvD,sDAA0B;
|
|
1
|
+
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;AAAA,2CAAuD;AAEvD,sDAA0B;AA+D1B;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,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEK,mCAAW,GAAjB,UAAkB,UAAkB;;;;;4BACjB,qBAAM,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,yBAAkB,UAAU,CAAE,CAAC,EAAA;;wBAAjE,QAAQ,GAAG,SAAsD;wBAC1D,qBAAM,QAAQ,CAA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8B,EAC9B,IAAgD,CAAC,4BAA4B;;QAE7E,QAAQ,UAAU,EAAE;YAClB,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,MAAM,CAAC;YACrB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB,KAAK,KAAK;gBACR,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;oBACxB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAClE,OAAO,IAAI,CAAC,GAAG,CAAC;YAClB,KAAK,SAAS;gBACZ,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;oBAC5B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAClE,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB;gBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAChD;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AA1ID,IA0IC;AA1IY,sCAAa"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Connection } from '@solana/web3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { EthWallet, NearWallet, SolanaWalletContextState } from './CoinflowUtils';
|
|
4
4
|
import { OnSuccessMethod } from './useIframeWallet';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
env?: CoinflowEnvs;
|
|
5
|
+
import { CommonCoinflowProps } from './CommonCoinflowProps';
|
|
6
|
+
export interface CoinflowCommonWithdrawProps extends CommonCoinflowProps {
|
|
8
7
|
onSuccess?: OnSuccessMethod;
|
|
9
|
-
blockchain: CoinflowBlockchain;
|
|
10
8
|
token?: string;
|
|
11
9
|
amount?: number;
|
|
12
10
|
email?: string;
|
|
@@ -20,4 +18,12 @@ export interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
|
20
18
|
wallet: NearWallet;
|
|
21
19
|
blockchain: 'near';
|
|
22
20
|
}
|
|
23
|
-
export
|
|
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,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoinflowWithdraw = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
@@ -8,34 +8,48 @@ var CoinflowUtils_1 = require("./CoinflowUtils");
|
|
|
8
8
|
var useIframeWallet_1 = require("./useIframeWallet");
|
|
9
9
|
var SolanaIFrameMessageHandlers_1 = require("./SolanaIFrameMessageHandlers");
|
|
10
10
|
var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
|
|
11
|
+
var EthIFrameMessageHandlers_1 = require("./EthIFrameMessageHandlers");
|
|
11
12
|
function CoinflowWithdraw(props) {
|
|
12
13
|
return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
|
|
13
|
-
solana: (react_1
|
|
14
|
-
near: react_1
|
|
14
|
+
solana: (react_1.default.createElement(CoinflowSolanaWithdraw, tslib_1.__assign({}, props))),
|
|
15
|
+
near: react_1.default.createElement(CoinflowNearWithdraw, tslib_1.__assign({}, props)),
|
|
16
|
+
eth: react_1.default.createElement(CoinflowEthWithdraw, tslib_1.__assign({}, props)),
|
|
17
|
+
polygon: (react_1.default.createElement(CoinflowEthWithdraw, tslib_1.__assign({}, props))),
|
|
15
18
|
});
|
|
16
19
|
}
|
|
17
20
|
exports.CoinflowWithdraw = CoinflowWithdraw;
|
|
18
21
|
function CoinflowSolanaWithdraw(_a) {
|
|
19
|
-
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, connection = _a.connection, onSuccess = _a.onSuccess, email = _a.email, token = _a.token, amount = _a.amount;
|
|
22
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, connection = _a.connection, onSuccess = _a.onSuccess, email = _a.email, token = _a.token, amount = _a.amount, loaderBackground = _a.loaderBackground;
|
|
20
23
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)({
|
|
21
24
|
wallet: wallet,
|
|
22
|
-
connection: connection
|
|
25
|
+
connection: connection,
|
|
23
26
|
});
|
|
24
27
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
25
28
|
if (!wallet.publicKey)
|
|
26
29
|
return null;
|
|
27
30
|
var walletPubkey = wallet.publicKey.toString();
|
|
28
|
-
return (react_1
|
|
31
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/withdraw/".concat(merchantId), env: env, blockchain: 'solana', email: email, token: token, amount: amount, loaderBackground: loaderBackground }));
|
|
29
32
|
}
|
|
30
33
|
function CoinflowNearWithdraw(_a) {
|
|
31
|
-
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, onSuccess = _a.onSuccess, email = _a.email, token = _a.token, amount = _a.amount;
|
|
34
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, onSuccess = _a.onSuccess, email = _a.email, token = _a.token, amount = _a.amount, loaderBackground = _a.loaderBackground;
|
|
32
35
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)({
|
|
33
|
-
wallet: wallet
|
|
36
|
+
wallet: wallet,
|
|
34
37
|
});
|
|
35
38
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
36
39
|
if (!wallet)
|
|
37
40
|
return null;
|
|
38
41
|
var walletPubkey = wallet.accountId;
|
|
39
|
-
return (react_1
|
|
42
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/withdraw/".concat(merchantId), env: env, blockchain: 'near', token: token, amount: amount, email: email, loaderBackground: loaderBackground }));
|
|
43
|
+
}
|
|
44
|
+
function CoinflowEthWithdraw(_a) {
|
|
45
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, onSuccess = _a.onSuccess, email = _a.email, token = _a.token, amount = _a.amount, loaderBackground = _a.loaderBackground, blockchain = _a.blockchain;
|
|
46
|
+
var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)({
|
|
47
|
+
wallet: wallet,
|
|
48
|
+
});
|
|
49
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
50
|
+
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.address))
|
|
51
|
+
return null;
|
|
52
|
+
var walletPubkey = wallet.address;
|
|
53
|
+
return (react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/withdraw/".concat(merchantId), env: env, blockchain: blockchain, token: token, amount: amount, email: email, loaderBackground: loaderBackground }));
|
|
40
54
|
}
|
|
41
55
|
//# sourceMappingURL=CoinflowWithdraw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAE1B,mDAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";;;;AAAA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