@coinflowlabs/react 1.1.2 → 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.
- package/README.md +4 -0
- package/build/cjs/CoinflowIFrame.d.ts +5 -4
- package/build/cjs/CoinflowIFrame.js +4 -2
- package/build/cjs/CoinflowIFrame.js.map +1 -1
- package/build/cjs/CoinflowPurchase.d.ts +3 -5
- package/build/cjs/CoinflowPurchase.js +4 -4
- package/build/cjs/CoinflowPurchase.js.map +1 -1
- package/build/cjs/CoinflowPurchaseHistory.d.ts +1 -1
- package/build/cjs/CoinflowPurchaseHistory.js +4 -4
- package/build/cjs/CoinflowPurchaseHistory.js.map +1 -1
- package/build/cjs/CoinflowUtils.d.ts +34 -2
- package/build/cjs/CoinflowUtils.js +8 -1
- package/build/cjs/CoinflowUtils.js.map +1 -1
- package/build/cjs/CoinflowWithdraw.d.ts +8 -6
- package/build/cjs/CoinflowWithdraw.js +18 -5
- package/build/cjs/CoinflowWithdraw.js.map +1 -1
- package/build/cjs/CoinflowWithdrawHistory.d.ts +2 -17
- package/build/cjs/CoinflowWithdrawHistory.js +17 -5
- package/build/cjs/CoinflowWithdrawHistory.js.map +1 -1
- package/build/cjs/CommonCoinflowProps.d.ts +21 -0
- package/build/cjs/CommonCoinflowProps.js +3 -0
- package/build/cjs/CommonCoinflowProps.js.map +1 -0
- package/build/cjs/EthIFrameMessageHandlers.d.ts +5 -0
- package/build/cjs/EthIFrameMessageHandlers.js +47 -0
- package/build/cjs/EthIFrameMessageHandlers.js.map +1 -0
- package/build/cjs/SolanaIFrameMessageHandlers.js +1 -1
- package/build/cjs/SolanaIFrameMessageHandlers.js.map +1 -1
- package/build/esm/CoinflowIFrame.d.ts +5 -4
- package/build/esm/CoinflowIFrame.js +4 -2
- package/build/esm/CoinflowIFrame.js.map +1 -1
- package/build/esm/CoinflowPurchase.d.ts +3 -5
- package/build/esm/CoinflowPurchase.js +4 -4
- package/build/esm/CoinflowPurchase.js.map +1 -1
- package/build/esm/CoinflowPurchaseHistory.d.ts +1 -1
- package/build/esm/CoinflowPurchaseHistory.js +4 -4
- package/build/esm/CoinflowPurchaseHistory.js.map +1 -1
- package/build/esm/CoinflowUtils.d.ts +34 -2
- package/build/esm/CoinflowUtils.js +8 -1
- package/build/esm/CoinflowUtils.js.map +1 -1
- package/build/esm/CoinflowWithdraw.d.ts +8 -6
- package/build/esm/CoinflowWithdraw.js +18 -5
- package/build/esm/CoinflowWithdraw.js.map +1 -1
- package/build/esm/CoinflowWithdrawHistory.d.ts +2 -17
- package/build/esm/CoinflowWithdrawHistory.js +18 -6
- package/build/esm/CoinflowWithdrawHistory.js.map +1 -1
- package/build/esm/CommonCoinflowProps.d.ts +21 -0
- package/build/esm/CommonCoinflowProps.js +2 -0
- package/build/esm/CommonCoinflowProps.js.map +1 -0
- package/build/esm/EthIFrameMessageHandlers.d.ts +5 -0
- package/build/esm/EthIFrameMessageHandlers.js +43 -0
- package/build/esm/EthIFrameMessageHandlers.js.map +1 -0
- package/build/esm/SolanaIFrameMessageHandlers.js +1 -1
- package/build/esm/SolanaIFrameMessageHandlers.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CoinflowBlockchain, CoinflowEnvs } from './CoinflowUtils';
|
|
3
|
-
|
|
3
|
+
interface CoinflowIFrameProps {
|
|
4
4
|
walletPubkey: string;
|
|
5
5
|
IFrameRef: React.RefObject<HTMLIFrameElement>;
|
|
6
|
-
env?: CoinflowEnvs;
|
|
7
6
|
route: string;
|
|
8
7
|
amount?: number;
|
|
9
8
|
transaction?: string;
|
|
@@ -11,6 +10,8 @@ type CoinflowIFrameProps = {
|
|
|
11
10
|
webhookInfo?: object;
|
|
12
11
|
token?: string;
|
|
13
12
|
email?: string;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
env?: CoinflowEnvs;
|
|
14
|
+
loaderBackground?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function CoinflowIFrame({ walletPubkey, IFrameRef, env, route, transaction, amount, blockchain, webhookInfo, token, email, loaderBackground, }: CoinflowIFrameProps): JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -5,7 +5,7 @@ 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;
|
|
9
9
|
var url = (0, react_1.useMemo)(function () {
|
|
10
10
|
return CoinflowUtils_1.CoinflowUtils.getCoinflowUrl({
|
|
11
11
|
walletPubkey: walletPubkey,
|
|
@@ -16,9 +16,11 @@ function CoinflowIFrame(_a) {
|
|
|
16
16
|
blockchain: blockchain,
|
|
17
17
|
webhookInfo: webhookInfo,
|
|
18
18
|
token: token,
|
|
19
|
-
email: email
|
|
19
|
+
email: email,
|
|
20
|
+
loaderBackground: loaderBackground
|
|
20
21
|
});
|
|
21
22
|
}, [
|
|
23
|
+
loaderBackground,
|
|
22
24
|
walletPubkey,
|
|
23
25
|
amount,
|
|
24
26
|
env,
|
|
@@ -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/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1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Connection, Signer, Transaction } from '@solana/web3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { 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
|
}
|
|
@@ -16,7 +16,7 @@ function CoinflowPurchase(props) {
|
|
|
16
16
|
}
|
|
17
17
|
exports.CoinflowPurchase = CoinflowPurchase;
|
|
18
18
|
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;
|
|
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, loaderBackground = _a.loaderBackground;
|
|
20
20
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)({
|
|
21
21
|
wallet: wallet,
|
|
22
22
|
connection: connection,
|
|
@@ -32,10 +32,10 @@ function SolanaCoinflowPurchase(_a) {
|
|
|
32
32
|
if (!wallet.publicKey)
|
|
33
33
|
return null;
|
|
34
34
|
var walletPubkey = wallet.publicKey.toString();
|
|
35
|
-
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 }));
|
|
35
|
+
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 }));
|
|
36
36
|
}
|
|
37
37
|
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;
|
|
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, loaderBackground = _a.loaderBackground;
|
|
39
39
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)({ wallet: wallet });
|
|
40
40
|
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
41
41
|
var transaction = (0, react_1.useMemo)(function () {
|
|
@@ -43,6 +43,6 @@ function NearCoinflowPurchase(_a) {
|
|
|
43
43
|
? Buffer.from(JSON.stringify(action)).toString('base64')
|
|
44
44
|
: undefined;
|
|
45
45
|
}, [action]);
|
|
46
|
-
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 }));
|
|
46
|
+
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
47
|
}
|
|
48
48
|
//# 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;AAC7E,iDAIyB;AACzB,qDAAmE;AACnE,yEAAyE;AAiCzE,SAAgB,gBAAgB,CAC9B,KAA8D;IAE9D,OAAO,6BAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,iCAAC,sBAAsB,uBAAM,KAAqC,EAAI,CACvE;QACD,IAAI,EAAE,iCAAC,oBAAoB,uBAAM,KAAmC,EAAI;KACzE,CAAC,CAAC;AACL,CAAC;AATD,4CASC;AAED,SAAS,sBAAsB,CAAC,EAaF;QAZ5B,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,GAAG,SAAA,EACH,SAAS,eAAA,EACT,MAAM,YAAA,EACN,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,KAAK,WAAA,EACL,gBAAgB,sBAAA;IAEhB,IAAM,QAAQ,GAAG,IAAA,4DAA8B,EAAC;QAC9C,MAAM,QAAA;QACN,UAAU,YAAA;QACV,cAAc,gBAAA;QACd,OAAO,SAAA;KACR,CAAC,CAAC;IACI,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,EAAE,SAAS,CAAC,UAAxC,CAAyC;IAEzD,IAAM,cAAc,GAAG,IAAA,eAAO,EAC5B;QACE,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EAAE,MAAM,CAAC,SAAS,EAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,oBAAa,UAAU,CAAE,EAChC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -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;
|
|
@@ -16,7 +16,7 @@ function CoinflowPurchaseHistory(props) {
|
|
|
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
22
|
connection: connection
|
|
@@ -25,10 +25,10 @@ function SolanaPurchaseHistory(_a) {
|
|
|
25
25
|
if (!wallet.publicKey)
|
|
26
26
|
return null;
|
|
27
27
|
var walletPubkey = wallet.publicKey.toString();
|
|
28
|
-
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/purchase/".concat(merchantId), env: env, blockchain: 'solana' }));
|
|
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
33
|
wallet: wallet
|
|
34
34
|
});
|
|
@@ -36,6 +36,6 @@ function NearPurchaseHistory(_a) {
|
|
|
36
36
|
if (!wallet)
|
|
37
37
|
return null;
|
|
38
38
|
var walletPubkey = wallet.accountId;
|
|
39
|
-
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/purchase/".concat(merchantId), env: env, blockchain: 'near' }));
|
|
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,uBA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AS,CAAC;IAEtC,OAAO,CACL,iCAAC,+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,6 +1,6 @@
|
|
|
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';
|
|
4
4
|
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
5
5
|
export type SolanaWalletContextState = Pick<WalletContextState, 'wallet' | 'signTransaction' | 'signMessage' | 'connected' | 'publicKey' | 'sendTransaction'>;
|
|
6
6
|
export type NearWallet = {
|
|
@@ -29,6 +29,35 @@ export type NearWallet = {
|
|
|
29
29
|
receipts_outcome: any;
|
|
30
30
|
}>;
|
|
31
31
|
};
|
|
32
|
+
type Bytes = ArrayLike<number>;
|
|
33
|
+
type BytesLike = Bytes | string;
|
|
34
|
+
type AccessList = Array<{
|
|
35
|
+
address: string;
|
|
36
|
+
storageKeys: Array<string>;
|
|
37
|
+
}>;
|
|
38
|
+
type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
39
|
+
export type EthWallet = {
|
|
40
|
+
address: string | null | undefined;
|
|
41
|
+
signMessage: (message: string) => Promise<string>;
|
|
42
|
+
sendTransaction: (transaction: {
|
|
43
|
+
to: string;
|
|
44
|
+
from?: string;
|
|
45
|
+
nonce?: Bytes | bigint | string | number;
|
|
46
|
+
gasLimit?: Bytes | bigint | string | number;
|
|
47
|
+
gasPrice?: Bytes | bigint | string | number;
|
|
48
|
+
data?: BytesLike;
|
|
49
|
+
value?: Bytes | bigint | string | number;
|
|
50
|
+
chainId?: number;
|
|
51
|
+
type?: number;
|
|
52
|
+
accessList?: AccessListish;
|
|
53
|
+
maxPriorityFeePerGas?: Bytes | bigint | string | number;
|
|
54
|
+
maxFeePerGas?: Bytes | bigint | string | number;
|
|
55
|
+
customData?: Record<string, any>;
|
|
56
|
+
ccipReadEnabled?: boolean;
|
|
57
|
+
}) => Promise<{
|
|
58
|
+
hash: string;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
32
61
|
export declare class CoinflowUtils {
|
|
33
62
|
env: CoinflowEnvs;
|
|
34
63
|
url: string;
|
|
@@ -36,7 +65,7 @@ export declare class CoinflowUtils {
|
|
|
36
65
|
getFeePayer(merchantId: string): Promise<PublicKey>;
|
|
37
66
|
getCreditBalance(publicKey: string, blockchain: 'solana' | 'near'): Promise<number>;
|
|
38
67
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
39
|
-
static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, }: {
|
|
68
|
+
static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, loaderBackground, }: {
|
|
40
69
|
walletPubkey: string;
|
|
41
70
|
route: string;
|
|
42
71
|
env?: CoinflowEnvs;
|
|
@@ -47,11 +76,14 @@ export declare class CoinflowUtils {
|
|
|
47
76
|
webhookInfo?: object;
|
|
48
77
|
token?: string;
|
|
49
78
|
email?: string;
|
|
79
|
+
loaderBackground?: string;
|
|
50
80
|
}): string;
|
|
51
81
|
static serializeSolanaTransaction(transaction: Transaction | undefined): string | undefined;
|
|
52
82
|
static solanaWalletSupportsVersionedTransactions(wallet: SolanaWalletContextState): boolean;
|
|
53
83
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
54
84
|
solana: T;
|
|
55
85
|
near: T;
|
|
86
|
+
eth?: T;
|
|
56
87
|
}): T;
|
|
57
88
|
}
|
|
89
|
+
export {};
|
|
@@ -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,6 +75,9 @@ 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) {
|
|
@@ -95,6 +98,10 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
95
98
|
return args.solana;
|
|
96
99
|
case 'near':
|
|
97
100
|
return args.near;
|
|
101
|
+
case 'eth':
|
|
102
|
+
if (args.eth === undefined)
|
|
103
|
+
throw new Error('blockchain not supported for this operation!');
|
|
104
|
+
return args.eth;
|
|
98
105
|
default:
|
|
99
106
|
throw new Error('blockchain not supported!');
|
|
100
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","source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
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,8 @@ 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: EthWallet;
|
|
23
|
+
blockchain: 'eth';
|
|
24
|
+
}
|
|
25
|
+
export declare function CoinflowWithdraw(props: CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps): JSX.Element;
|
|
@@ -8,15 +8,17 @@ 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
14
|
solana: (react_1["default"].createElement(CoinflowSolanaWithdraw, tslib_1.__assign({}, props))),
|
|
14
|
-
near: react_1["default"].createElement(CoinflowNearWithdraw, 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))
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
19
|
exports.CoinflowWithdraw = CoinflowWithdraw;
|
|
18
20
|
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;
|
|
21
|
+
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
22
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)({
|
|
21
23
|
wallet: wallet,
|
|
22
24
|
connection: connection
|
|
@@ -25,10 +27,10 @@ function CoinflowSolanaWithdraw(_a) {
|
|
|
25
27
|
if (!wallet.publicKey)
|
|
26
28
|
return null;
|
|
27
29
|
var walletPubkey = wallet.publicKey.toString();
|
|
28
|
-
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 }));
|
|
30
|
+
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
31
|
}
|
|
30
32
|
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;
|
|
33
|
+
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
34
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)({
|
|
33
35
|
wallet: wallet
|
|
34
36
|
});
|
|
@@ -36,6 +38,17 @@ function CoinflowNearWithdraw(_a) {
|
|
|
36
38
|
if (!wallet)
|
|
37
39
|
return null;
|
|
38
40
|
var walletPubkey = wallet.accountId;
|
|
39
|
-
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 }));
|
|
41
|
+
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 }));
|
|
42
|
+
}
|
|
43
|
+
function CoinflowEthWithdraw(_a) {
|
|
44
|
+
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;
|
|
45
|
+
var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)({
|
|
46
|
+
wallet: wallet
|
|
47
|
+
});
|
|
48
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, onSuccess).IFrameRef;
|
|
49
|
+
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.address))
|
|
50
|
+
return null;
|
|
51
|
+
var walletPubkey = wallet.address;
|
|
52
|
+
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/withdraw/".concat(merchantId), env: env, blockchain: 'eth', token: token, amount: amount, email: email, loaderBackground: loaderBackground }));
|
|
40
53
|
}
|
|
41
54
|
//# 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,wDAA0B;AAE1B,mDAAgD;AAChD,iDAKyB;AACzB,qDAAmE;AACnE,6EAA6E;AAC7E,yEAAyE;AAEzE,uEAAuE;AA0BvE,SAAgB,gBAAgB,CAC9B,KAG4B;IAE5B,OAAO,6BAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,iCAAC,sBAAsB,uBAAM,KAAqC,EAAI,CACvE;QACD,IAAI,EAAE,iCAAC,oBAAoB,uBAAM,KAAmC,EAAI;QACxE,GAAG,EAAE,iCAAC,mBAAmB,uBAAM,KAAkC,EAAI;KACtE,CAAC,CAAC;AACL,CAAC;AAbD,4CAaC;AAED,SAAS,sBAAsB,CAAC,EAUF;QAT5B,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,GAAG,SAAA,EACH,UAAU,gBAAA,EACV,SAAS,eAAA,EACT,KAAK,WAAA,EACL,KAAK,WAAA,EACL,MAAM,YAAA,EACN,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,EAAE,SAAS,CAAC,UAAxC,CAAyC;IAEzD,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IACnC,IAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAEjD,OAAO,CACL,iCAAC,+BAAc,IACb,YAAY,EAAE,YAA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A,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,EAAE,SAAS,CAAC,UAAxC,CAAyC;IAEzD,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA;QAAE,OAAO,IAAI,CAAC;IAClC,IAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAEpC,OAAO,CACL,iCAAC,+BAAc,IACb,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,oBAAa,UAAU,CAAE,EAChC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface CoinflowHistoryProps {
|
|
5
|
-
merchantId: string;
|
|
6
|
-
env?: CoinflowEnvs;
|
|
7
|
-
blockchain: CoinflowBlockchain;
|
|
8
|
-
}
|
|
9
|
-
export interface CoinflowSolanaHistoryProps extends CoinflowHistoryProps {
|
|
10
|
-
wallet: SolanaWalletContextState;
|
|
11
|
-
connection: Connection;
|
|
12
|
-
blockchain: 'solana';
|
|
13
|
-
}
|
|
14
|
-
export interface CoinflowNearHistoryProps extends CoinflowHistoryProps {
|
|
15
|
-
wallet: NearWallet;
|
|
16
|
-
blockchain: 'near';
|
|
17
|
-
}
|
|
18
|
-
export declare function CoinflowWithdrawHistory(props: CoinflowSolanaHistoryProps | CoinflowNearHistoryProps): JSX.Element;
|
|
2
|
+
import { CoinflowNearHistoryProps, CoinflowSolanaHistoryProps, CoinflowEthHistoryProps } from './CommonCoinflowProps';
|
|
3
|
+
export declare function CoinflowWithdrawHistory(props: CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowEthHistoryProps): JSX.Element;
|
|
@@ -8,15 +8,17 @@ var CoinflowIFrame_1 = require("./CoinflowIFrame");
|
|
|
8
8
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
9
9
|
var SolanaIFrameMessageHandlers_1 = require("./SolanaIFrameMessageHandlers");
|
|
10
10
|
var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
|
|
11
|
+
var EthIFrameMessageHandlers_1 = require("./EthIFrameMessageHandlers");
|
|
11
12
|
function CoinflowWithdrawHistory(props) {
|
|
12
13
|
return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
|
|
13
14
|
solana: (react_1["default"].createElement(SolanaWithdrawHistory, tslib_1.__assign({}, props))),
|
|
14
|
-
near: react_1["default"].createElement(NearWithdrawHistory, tslib_1.__assign({}, props))
|
|
15
|
+
near: react_1["default"].createElement(NearWithdrawHistory, tslib_1.__assign({}, props)),
|
|
16
|
+
eth: react_1["default"].createElement(EthWithdrawHistory, tslib_1.__assign({}, props))
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
19
|
exports.CoinflowWithdrawHistory = CoinflowWithdrawHistory;
|
|
18
20
|
function SolanaWithdrawHistory(_a) {
|
|
19
|
-
var wallet = _a.wallet, merchantId = _a.merchantId, connection = _a.connection, env = _a.env;
|
|
21
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, connection = _a.connection, env = _a.env, loaderBackground = _a.loaderBackground;
|
|
20
22
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)({
|
|
21
23
|
wallet: wallet,
|
|
22
24
|
connection: connection
|
|
@@ -25,10 +27,10 @@ function SolanaWithdrawHistory(_a) {
|
|
|
25
27
|
if (!wallet.publicKey)
|
|
26
28
|
return null;
|
|
27
29
|
var walletPubkey = wallet.publicKey.toString();
|
|
28
|
-
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/withdraw/".concat(merchantId), env: env, blockchain: 'solana' }));
|
|
30
|
+
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/withdraw/".concat(merchantId), env: env, blockchain: 'solana', loaderBackground: loaderBackground }));
|
|
29
31
|
}
|
|
30
32
|
function NearWithdrawHistory(_a) {
|
|
31
|
-
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env;
|
|
33
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, loaderBackground = _a.loaderBackground;
|
|
32
34
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)({
|
|
33
35
|
wallet: wallet
|
|
34
36
|
});
|
|
@@ -36,6 +38,16 @@ function NearWithdrawHistory(_a) {
|
|
|
36
38
|
if (!wallet)
|
|
37
39
|
return null;
|
|
38
40
|
var walletPubkey = wallet.accountId;
|
|
39
|
-
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/withdraw/".concat(merchantId), env: env, blockchain: 'near' }));
|
|
41
|
+
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: walletPubkey, IFrameRef: IFrameRef, route: "/history/withdraw/".concat(merchantId), env: env, blockchain: 'near', loaderBackground: loaderBackground }));
|
|
42
|
+
}
|
|
43
|
+
function EthWithdrawHistory(_a) {
|
|
44
|
+
var wallet = _a.wallet, merchantId = _a.merchantId, env = _a.env, loaderBackground = _a.loaderBackground;
|
|
45
|
+
var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)({
|
|
46
|
+
wallet: wallet
|
|
47
|
+
});
|
|
48
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers).IFrameRef;
|
|
49
|
+
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.address))
|
|
50
|
+
return null;
|
|
51
|
+
return (react_1["default"].createElement(CoinflowIFrame_1.CoinflowIFrame, { walletPubkey: wallet.address, IFrameRef: IFrameRef, route: "/history/withdraw/".concat(merchantId), env: env, blockchain: 'eth', loaderBackground: loaderBackground }));
|
|
40
52
|
}
|
|
41
53
|
//# sourceMappingURL=CoinflowWithdrawHistory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";;;;AAAA,iDAA8C;AAC9C,qDAAkD;AAClD,mDAAgD;AAChD,wDAA0B;AAC1B,6EAA6E;AAC7E,yEAAyE;AAMzE,uEAAuE;AAEvE,SAAgB,uBAAuB,CACrC,KAG2B;IAE3B,OAAO,6BAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,iCAAC,qBAAqB,uBAAM,KAAoC,EAAI,CACrE;QACD,IAAI,EAAE,iCAAC,mBAAmB,uBAAM,KAAkC,EAAI;QACtE,GAAG,EAAE,iCAAC,kBAAkB,uBAAM,KAAiC,EAAI;KACpE,CAAC,CAAC;AACL,CAAC;AAbD,0DAaC;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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AO,EAC5B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,4BAAqB,UAAU,CAAE,EACxC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,KAAK,EACjB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CoinflowBlockchain, CoinflowEnvs, EthWallet, NearWallet, SolanaWalletContextState } from './CoinflowUtils';
|
|
2
|
+
import { Connection } from '@solana/web3.js';
|
|
3
|
+
export interface CommonCoinflowProps {
|
|
4
|
+
merchantId: string;
|
|
5
|
+
env?: CoinflowEnvs;
|
|
6
|
+
loaderBackground?: string;
|
|
7
|
+
blockchain: CoinflowBlockchain;
|
|
8
|
+
}
|
|
9
|
+
export interface CoinflowSolanaHistoryProps extends CommonCoinflowProps {
|
|
10
|
+
wallet: SolanaWalletContextState;
|
|
11
|
+
connection: Connection;
|
|
12
|
+
blockchain: 'solana';
|
|
13
|
+
}
|
|
14
|
+
export interface CoinflowNearHistoryProps extends CommonCoinflowProps {
|
|
15
|
+
wallet: NearWallet;
|
|
16
|
+
blockchain: 'near';
|
|
17
|
+
}
|
|
18
|
+
export interface CoinflowEthHistoryProps extends CommonCoinflowProps {
|
|
19
|
+
wallet: EthWallet;
|
|
20
|
+
blockchain: 'eth';
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommonCoinflowProps.js","sourceRoot":"","sources":["../../src/CommonCoinflowProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.useEthIFrameMessageHandlers = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
function useEthIFrameMessageHandlers(_a) {
|
|
7
|
+
var _this = this;
|
|
8
|
+
var wallet = _a.wallet;
|
|
9
|
+
var handleSignMessage = (0, react_1.useCallback)(function (_a) {
|
|
10
|
+
var message = _a.data;
|
|
11
|
+
return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
12
|
+
var signedMessage;
|
|
13
|
+
return tslib_1.__generator(this, function (_b) {
|
|
14
|
+
switch (_b.label) {
|
|
15
|
+
case 0: return [4 /*yield*/, wallet.signMessage(message)];
|
|
16
|
+
case 1:
|
|
17
|
+
signedMessage = _b.sent();
|
|
18
|
+
if (!signedMessage)
|
|
19
|
+
throw new Error('Wallet did not sign');
|
|
20
|
+
return [2 /*return*/, signedMessage];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}, [wallet]);
|
|
25
|
+
var handleSendTransaction = (0, react_1.useCallback)(function (_a) {
|
|
26
|
+
var data = _a.data;
|
|
27
|
+
return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
28
|
+
var transaction, hash;
|
|
29
|
+
return tslib_1.__generator(this, function (_b) {
|
|
30
|
+
switch (_b.label) {
|
|
31
|
+
case 0:
|
|
32
|
+
transaction = JSON.parse(Buffer.from(data, 'base64').toString());
|
|
33
|
+
return [4 /*yield*/, wallet.sendTransaction(transaction)];
|
|
34
|
+
case 1:
|
|
35
|
+
hash = (_b.sent()).hash;
|
|
36
|
+
return [2 /*return*/, hash];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}, [wallet]);
|
|
41
|
+
return {
|
|
42
|
+
handleSendTransaction: handleSendTransaction,
|
|
43
|
+
handleSignMessage: handleSignMessage
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.useEthIFrameMessageHandlers = useEthIFrameMessageHandlers;
|
|
47
|
+
//# sourceMappingURL=EthIFrameMessageHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EthIFrameMessageHandlers.js","sourceRoot":"","sources":["../../src/EthIFrameMessageHandlers.ts"],"names":[],"mappings":";;;;AAAA,+BAAkC;AAIlC,SAAgB,2BAA2B,CAAC,EAI3C;IAJD,iBA2BC;QA1BC,MAAM,YAAA;IAIN,IAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,UAAO,EAA2B;YAApB,OAAO,UAAA;;;;;4BACG,qBAAM,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAA;;wBAAjD,aAAa,GAAG,SAAiC;wBACvD,IAAI,CAAC,aAAa;4BAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;wBAC3D,sBAAO,aAAa,EAAC;;;;KACtB,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,IAAM,qBAAqB,GAAG,IAAA,mBAAW,EACvC,UAAO,EAAkB;YAAjB,IAAI,UAAA;;;;;;wBACJ,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;wBACxD,qBAAM,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,EAAA;;wBAAjD,IAAI,GAAI,CAAA,SAAyC,CAAA,KAA7C;wBACX,sBAAO,IAAI,EAAC;;;;KACb,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO;QACL,qBAAqB,uBAAA;QACrB,iBAAiB,mBAAA;KAClB,CAAC;AACJ,CAAC;AA3BD,kEA2BC"}
|
|
@@ -16,7 +16,7 @@ function useSolanaIFrameMessageHandlers(_a) {
|
|
|
16
16
|
switch (_b.label) {
|
|
17
17
|
case 0:
|
|
18
18
|
if (!wallet.signMessage)
|
|
19
|
-
throw new Error('Wallet does not support message signing');
|
|
19
|
+
throw new Error('Wallet does not support message signing');
|
|
20
20
|
return [4 /*yield*/, wallet.signMessage(bs58_1["default"].decode(data))];
|
|
21
21
|
case 1:
|
|
22
22
|
signature = _b.sent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaIFrameMessageHandlers.js","sourceRoot":"","sources":["../../src/SolanaIFrameMessageHandlers.ts"],"names":[],"mappings":";;;;AAAA,+BAAkC;AAClC,sDAA0B;AAC1B,2CAKyB;AAkBzB,SAAgB,8BAA8B,CAAC,EAKrB;IAL1B,iBAoHC;QAnHC,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,cAAc,oBAAA,EACd,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAEf,IAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,UAAO,EAAkB;YAAjB,IAAI,UAAA;;;;;;wBACV,IAAI,CAAC,MAAM,CAAC,WAAW;4BACrB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"SolanaIFrameMessageHandlers.js","sourceRoot":"","sources":["../../src/SolanaIFrameMessageHandlers.ts"],"names":[],"mappings":";;;;AAAA,+BAAkC;AAClC,sDAA0B;AAC1B,2CAKyB;AAkBzB,SAAgB,8BAA8B,CAAC,EAKrB;IAL1B,iBAoHC;QAnHC,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,cAAc,oBAAA,EACd,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAEf,IAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,UAAO,EAAkB;YAAjB,IAAI,UAAA;;;;;;wBACV,IAAI,CAAC,MAAM,CAAC,WAAW;4BACrB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;wBAE3C,qBAAM,MAAM,CAAC,WAAW,CAAC,iBAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAA;;wBAAzD,SAAS,GAAG,SAA6C;wBAC/D,sBAAO,iBAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC;;;;KACjC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,IAAM,oBAAoB,GAAG,IAAA,mBAAW,EACtC,UAAO,EAAsC;;;;;oBAC3C,IAAI,CAAC,MAAM,CAAC,eAAe;wBACzB,MAAM,IAAI,KAAK,CAAC,0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AAC,SAAS,CAAC,QAAQ,EAAE;4BAAxB,CAAwB,CACzB,CAAC;4BACF,IAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAC5C,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAC5B,CAAC;4BACF,IAAI,UAAU;gCAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;wBACzC,CAAC,CAAC;wBACF,IAAI,cAAc,EAAE;4BAClB,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;yBACvC;wBAEyB,qBAAM,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,EAAA;;wBAApD,iBAAiB,GAAG,SAAgC;wBAC1D,sBAAO,iBAAM,CAAC,MAAM,CAClB,iBAAiB,CAAC,SAAS,CAAC;gCAC1B,oBAAoB,EAAE,KAAK;gCAC3B,gBAAgB,EAAE,KAAK;6BACxB,CAAC,CACH,EAAC;;;;KACH,EACD,CAAC,cAAc,EAAE,MAAM,CAAC,CACzB,CAAC;IAEF,OAAO;QACL,qBAAqB,uBAAA;QACrB,qBAAqB,uBAAA;QACrB,iBAAiB,mBAAA;KAClB,CAAC;AACJ,CAAC;AApHD,wEAoHC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CoinflowBlockchain, CoinflowEnvs } from './CoinflowUtils';
|
|
3
|
-
|
|
3
|
+
interface CoinflowIFrameProps {
|
|
4
4
|
walletPubkey: string;
|
|
5
5
|
IFrameRef: React.RefObject<HTMLIFrameElement>;
|
|
6
|
-
env?: CoinflowEnvs;
|
|
7
6
|
route: string;
|
|
8
7
|
amount?: number;
|
|
9
8
|
transaction?: string;
|
|
@@ -11,6 +10,8 @@ type CoinflowIFrameProps = {
|
|
|
11
10
|
webhookInfo?: object;
|
|
12
11
|
token?: string;
|
|
13
12
|
email?: string;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
env?: CoinflowEnvs;
|
|
14
|
+
loaderBackground?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function CoinflowIFrame({ walletPubkey, IFrameRef, env, route, transaction, amount, blockchain, webhookInfo, token, email, loaderBackground, }: CoinflowIFrameProps): JSX.Element;
|
|
16
17
|
export {};
|