@coinflowlabs/react 2.1.1 → 2.2.1
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 +3 -3
- package/build/cjs/CoinflowIFrame.js +1 -1
- package/build/cjs/CoinflowIFrame.js.map +1 -1
- package/build/cjs/CoinflowPurchase.d.ts +4 -58
- package/build/cjs/CoinflowPurchase.js +8 -7
- package/build/cjs/CoinflowPurchase.js.map +1 -1
- package/build/cjs/CoinflowPurchaseHistory.d.ts +3 -3
- package/build/cjs/CoinflowPurchaseHistory.js +13 -12
- package/build/cjs/CoinflowPurchaseHistory.js.map +1 -1
- package/build/cjs/CoinflowTypes.d.ts +169 -0
- package/build/cjs/{CommonCoinflowProps.js → CoinflowTypes.js} +1 -1
- package/build/cjs/CoinflowTypes.js.map +1 -0
- package/build/cjs/CoinflowUtils.d.ts +3 -41
- package/build/cjs/CoinflowUtils.js +16 -1
- package/build/cjs/CoinflowUtils.js.map +1 -1
- package/build/cjs/CoinflowWithdraw.d.ts +3 -29
- package/build/cjs/CoinflowWithdraw.js +8 -7
- package/build/cjs/CoinflowWithdraw.js.map +1 -1
- package/build/cjs/CoinflowWithdrawHistory.d.ts +3 -3
- package/build/cjs/CoinflowWithdrawHistory.js +8 -7
- package/build/cjs/CoinflowWithdrawHistory.js.map +1 -1
- package/build/cjs/index.d.ts +2 -1
- package/build/cjs/index.js +2 -1
- package/build/cjs/index.js.map +1 -1
- package/build/{esm → cjs/wallet}/EthIFrameMessageHandlers.d.ts +1 -3
- package/build/cjs/wallet/EthIFrameMessageHandlers.js.map +1 -0
- package/build/cjs/{NearIFrameMessageHandlers.d.ts → wallet/NearIFrameMessageHandlers.d.ts} +1 -1
- package/build/cjs/wallet/NearIFrameMessageHandlers.js.map +1 -0
- package/build/cjs/wallet/SocketService.d.ts +5 -0
- package/build/cjs/wallet/SocketService.js +42 -0
- package/build/cjs/wallet/SocketService.js.map +1 -0
- package/build/cjs/{SolanaIFrameMessageHandlers.d.ts → wallet/SolanaIFrameMessageHandlers.d.ts} +1 -1
- package/build/cjs/wallet/SolanaIFrameMessageHandlers.js.map +1 -0
- package/build/{esm → cjs/wallet}/useIframeWallet.d.ts +5 -3
- package/build/cjs/{useIframeWallet.js → wallet/useIframeWallet.js} +20 -11
- package/build/cjs/wallet/useIframeWallet.js.map +1 -0
- package/build/esm/CoinflowIFrame.d.ts +3 -3
- package/build/esm/CoinflowIFrame.js +1 -1
- package/build/esm/CoinflowIFrame.js.map +1 -1
- package/build/esm/CoinflowPurchase.d.ts +4 -58
- package/build/esm/CoinflowPurchase.js +9 -8
- package/build/esm/CoinflowPurchase.js.map +1 -1
- package/build/esm/CoinflowPurchaseHistory.d.ts +3 -3
- package/build/esm/CoinflowPurchaseHistory.js +13 -12
- package/build/esm/CoinflowPurchaseHistory.js.map +1 -1
- package/build/esm/CoinflowTypes.d.ts +169 -0
- package/build/esm/CoinflowTypes.js +2 -0
- package/build/esm/CoinflowTypes.js.map +1 -0
- package/build/esm/CoinflowUtils.d.ts +3 -41
- package/build/esm/CoinflowUtils.js +16 -1
- package/build/esm/CoinflowUtils.js.map +1 -1
- package/build/esm/CoinflowWithdraw.d.ts +3 -29
- package/build/esm/CoinflowWithdraw.js +8 -7
- package/build/esm/CoinflowWithdraw.js.map +1 -1
- package/build/esm/CoinflowWithdrawHistory.d.ts +3 -3
- package/build/esm/CoinflowWithdrawHistory.js +8 -7
- package/build/esm/CoinflowWithdrawHistory.js.map +1 -1
- package/build/esm/index.d.ts +2 -1
- package/build/esm/index.js +2 -1
- package/build/esm/index.js.map +1 -1
- package/build/{cjs → esm/wallet}/EthIFrameMessageHandlers.d.ts +1 -3
- package/build/esm/wallet/EthIFrameMessageHandlers.js.map +1 -0
- package/build/esm/{NearIFrameMessageHandlers.d.ts → wallet/NearIFrameMessageHandlers.d.ts} +1 -1
- package/build/esm/wallet/NearIFrameMessageHandlers.js.map +1 -0
- package/build/esm/wallet/SocketService.d.ts +5 -0
- package/build/esm/wallet/SocketService.js +34 -0
- package/build/esm/wallet/SocketService.js.map +1 -0
- package/build/esm/{SolanaIFrameMessageHandlers.d.ts → wallet/SolanaIFrameMessageHandlers.d.ts} +1 -1
- package/build/esm/wallet/SolanaIFrameMessageHandlers.js.map +1 -0
- package/build/{cjs → esm/wallet}/useIframeWallet.d.ts +5 -3
- package/build/esm/{useIframeWallet.js → wallet/useIframeWallet.js} +20 -11
- package/build/esm/wallet/useIframeWallet.js.map +1 -0
- package/package.json +13 -8
- package/build/cjs/CommonCoinflowProps.d.ts +0 -43
- package/build/cjs/CommonCoinflowProps.js.map +0 -1
- package/build/cjs/EthIFrameMessageHandlers.js.map +0 -1
- package/build/cjs/NearIFrameMessageHandlers.js.map +0 -1
- package/build/cjs/SolanaIFrameMessageHandlers.js.map +0 -1
- package/build/cjs/useIframeWallet.js.map +0 -1
- package/build/esm/CommonCoinflowProps.d.ts +0 -43
- package/build/esm/CommonCoinflowProps.js +0 -2
- package/build/esm/CommonCoinflowProps.js.map +0 -1
- package/build/esm/EthIFrameMessageHandlers.js.map +0 -1
- package/build/esm/NearIFrameMessageHandlers.js.map +0 -1
- package/build/esm/SolanaIFrameMessageHandlers.js.map +0 -1
- package/build/esm/useIframeWallet.js.map +0 -1
- /package/build/cjs/{EthIFrameMessageHandlers.js → wallet/EthIFrameMessageHandlers.js} +0 -0
- /package/build/cjs/{NearIFrameMessageHandlers.js → wallet/NearIFrameMessageHandlers.js} +0 -0
- /package/build/cjs/{SolanaIFrameMessageHandlers.js → wallet/SolanaIFrameMessageHandlers.js} +0 -0
- /package/build/esm/{EthIFrameMessageHandlers.js → wallet/EthIFrameMessageHandlers.js} +0 -0
- /package/build/esm/{NearIFrameMessageHandlers.js → wallet/NearIFrameMessageHandlers.js} +0 -0
- /package/build/esm/{SolanaIFrameMessageHandlers.js → wallet/SolanaIFrameMessageHandlers.js} +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { CoinflowIFrameProps } from './
|
|
3
|
-
export declare function CoinflowIFrame(props: CoinflowIFrameProps): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CoinflowIFrameProps } from './CoinflowTypes';
|
|
3
|
+
export declare function CoinflowIFrame(props: CoinflowIFrameProps): React.JSX.Element;
|
|
@@ -17,7 +17,7 @@ function CoinflowIFrame(props) {
|
|
|
17
17
|
height: '100%',
|
|
18
18
|
opacity: 0,
|
|
19
19
|
transition: 'opacity 300ms linear',
|
|
20
|
-
}, title: "withdraw", frameBorder: "0", src: url })); }, [IFrameRef, url]);
|
|
20
|
+
}, title: "withdraw", frameBorder: "0", src: url })); }, [IFrameRef, handleHeightChange, url]);
|
|
21
21
|
}
|
|
22
22
|
exports.CoinflowIFrame = CoinflowIFrame;
|
|
23
23
|
//# sourceMappingURL=CoinflowIFrame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowIFrame.js","sourceRoot":"","sources":["../../src/CoinflowIFrame.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AACrC,iDAA8C;AAG9C,SAAgB,cAAc,CAAC,KAA0B;IACvD,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,GAA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+1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
1
|
+
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../../src/CoinflowPurchase.tsx"],"names":[],"mappings":";;;;AAAA,qDAAqC;AACrC,mDAAgD;AAChD,oFAAoF;AACpF,iDAEyB;AACzB,4DAAyD;AACzD,gFAAgF;AAQhF,8EAA8E;AAE9E,SAAgB,gBAAgB,CAC9B,KAA2B;IAE3B,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;AAZD,4CAYC;AAED,SAAS,sBAAsB,CAAC,KAAkC;;IAChE,IAAM,QAAQ,GAAG,IAAA,4DAA8B,EAAC,KAAK,CAAC,CAAC;IAChD,IAAA,MAAM,GAAoF,KAAK,OAAzF,EAAE,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AC,CAAC;IACrE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAEjC,IAAM,WAAW,yCACZ,KAAK,KACR,YAAY,EAAE,MAAM,CAAC,OAAO,EAC5B,SAAS,WAAA,EACT,WAAW,EAAE,cAAc,EAC3B,KAAK,EAAE,oBAAa,KAAK,CAAC,UAAU,CAAE,GACvC,CAAA;IACD,OAAO,CACL,8BAAC,+BAAc,uBAAK,WAAW,EAAG,CACnC,CAAC;AACJ,CAAC;AAtBD,0DAsBC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
export declare function CoinflowPurchaseHistory(props:
|
|
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 (!((
|
|
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 (!((
|
|
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: (
|
|
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,
|
|
1
|
+
{"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../../src/CoinflowPurchaseHistory.tsx"],"names":[],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E,SAAS,CAAC,UAA7D,CAA8D;IAE9E,IAAI,CAAC,CAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,SAAS,CAAA;QAAE,OAAO,IAAI,CAAC;IAE1C,IAAM,WAAW,yCACZ,KAAK,KACR,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EACpC,SAAS,WAAA,EACT,KAAK,EAAE,4BAAqB,KAAK,CAAC,UAAU,CAAE,GAC/C,CAAC;IACF,OAAO,CACL,8BAAC,+BAAc,uBAAK,WAAW,EAAG,CACnC,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAkC;;IAChE,IAAM,QAAQ,GAAG,IAAA,sDAA2B,EAAC,KAAK,CAAC,CAAC;IAC7C,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,OAAO,CAAC,UAA3D,CAA4D;IAE5E,IAAI,CAAC,CAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,OAAO,CAAA;QAAE,OAAO,IAAI,CAAC;IAExC,IAAM,WAAW,yCACZ,KAAK,KACR,YAAY,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,OAAO,EACnC,SAAS,WAAA,EACT,KAAK,EAAE,4BAAqB,KAAK,CAAC,UAAU,CAAE,GAC/C,CAAC;IACF,OAAO,CACL,8BAAC,+BAAc,uBAAK,WAAW,EAAI,CACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Connection } from '@solana/web3.js';
|
|
3
|
+
import { PublicKey, Signer, Transaction } 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
|
+
bankAccountLinkRedirect?: string;
|
|
81
|
+
additionalWallets?: {
|
|
82
|
+
wallet: string;
|
|
83
|
+
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
86
|
+
/** Transactions **/
|
|
87
|
+
export type NearFtTransferCallAction = {
|
|
88
|
+
methodName: 'ft_transfer_call';
|
|
89
|
+
args: object;
|
|
90
|
+
gas: string;
|
|
91
|
+
deposit: string;
|
|
92
|
+
};
|
|
93
|
+
type BigNumberish = object | bigint | string | number;
|
|
94
|
+
type Bytes = ArrayLike<number>;
|
|
95
|
+
type BytesLike = Bytes | string;
|
|
96
|
+
export type EvmTransaction = {
|
|
97
|
+
to: string;
|
|
98
|
+
from?: string;
|
|
99
|
+
nonce?: BigNumberish;
|
|
100
|
+
gasLimit?: BigNumberish;
|
|
101
|
+
gasPrice?: BigNumberish;
|
|
102
|
+
data?: BytesLike;
|
|
103
|
+
value?: BigNumberish;
|
|
104
|
+
chainId?: number;
|
|
105
|
+
type?: number;
|
|
106
|
+
maxPriorityFeePerGas?: BigNumberish;
|
|
107
|
+
maxFeePerGas?: BigNumberish;
|
|
108
|
+
customData?: Record<string, any>;
|
|
109
|
+
ccipReadEnabled?: boolean;
|
|
110
|
+
};
|
|
111
|
+
/** Purchase **/
|
|
112
|
+
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
113
|
+
amount?: number;
|
|
114
|
+
onSuccess?: OnSuccessMethod;
|
|
115
|
+
webhookInfo?: object;
|
|
116
|
+
email?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
119
|
+
wallet: SolanaWallet;
|
|
120
|
+
transaction?: Transaction;
|
|
121
|
+
partialSigners?: Signer[];
|
|
122
|
+
debugTx?: boolean;
|
|
123
|
+
connection: Connection;
|
|
124
|
+
blockchain: 'solana';
|
|
125
|
+
token?: PublicKey | string;
|
|
126
|
+
supportsVersionedTransactions?: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
129
|
+
wallet: NearWallet;
|
|
130
|
+
blockchain: 'near';
|
|
131
|
+
action?: NearFtTransferCallAction;
|
|
132
|
+
}
|
|
133
|
+
export interface CoinflowPolygonPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
134
|
+
transaction?: EvmTransaction;
|
|
135
|
+
wallet: EthWallet;
|
|
136
|
+
blockchain: 'polygon';
|
|
137
|
+
}
|
|
138
|
+
export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowNearPurchaseProps | CoinflowPolygonPurchaseProps;
|
|
139
|
+
/** Withdraw **/
|
|
140
|
+
export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
141
|
+
onSuccess?: OnSuccessMethod;
|
|
142
|
+
token?: string;
|
|
143
|
+
amount?: number;
|
|
144
|
+
email?: string;
|
|
145
|
+
bankAccountLinkRedirect?: string;
|
|
146
|
+
additionalWallets?: {
|
|
147
|
+
wallet: string;
|
|
148
|
+
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
149
|
+
}[];
|
|
150
|
+
}
|
|
151
|
+
export interface CoinflowSolanaWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
152
|
+
wallet: SolanaWallet;
|
|
153
|
+
connection: Connection;
|
|
154
|
+
blockchain: 'solana';
|
|
155
|
+
}
|
|
156
|
+
export interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
157
|
+
wallet: NearWallet;
|
|
158
|
+
blockchain: 'near';
|
|
159
|
+
}
|
|
160
|
+
export interface CoinflowEthWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
161
|
+
wallet: Omit<EthWallet, 'signMessage'>;
|
|
162
|
+
blockchain: 'eth';
|
|
163
|
+
}
|
|
164
|
+
export interface CoinflowPolygonWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
165
|
+
wallet: Omit<EthWallet, 'signMessage'>;
|
|
166
|
+
blockchain: 'polygon';
|
|
167
|
+
}
|
|
168
|
+
export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps;
|
|
169
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../src/CoinflowTypes.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
import type { Transaction } from '@solana/web3.js';
|
|
2
|
-
import
|
|
3
|
-
import type { Wallet } from '@near-wallet-selector/core';
|
|
4
|
-
import { CoinflowIFrameProps } from './CommonCoinflowProps';
|
|
5
|
-
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon';
|
|
6
|
-
export type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';
|
|
7
|
-
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
8
|
-
export type SolanaWallet = PartialBy<Pick<WalletContextState, 'wallet' | 'signTransaction' | 'publicKey' | 'sendTransaction'>, 'wallet' | 'signTransaction'>;
|
|
9
|
-
export type NearWallet = {
|
|
10
|
-
accountId: string;
|
|
11
|
-
} & Pick<Wallet, 'signAndSendTransaction'>;
|
|
12
|
-
type Bytes = ArrayLike<number>;
|
|
13
|
-
type BytesLike = Bytes | string;
|
|
14
|
-
type AccessList = Array<{
|
|
15
|
-
address: string;
|
|
16
|
-
storageKeys: Array<string>;
|
|
17
|
-
}>;
|
|
18
|
-
type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
19
|
-
export type EthWallet = {
|
|
20
|
-
address: string | null | undefined;
|
|
21
|
-
sendTransaction: (transaction: {
|
|
22
|
-
to: string;
|
|
23
|
-
from?: string;
|
|
24
|
-
nonce?: Bytes | bigint | string | number;
|
|
25
|
-
gasLimit?: Bytes | bigint | string | number;
|
|
26
|
-
gasPrice?: Bytes | bigint | string | number;
|
|
27
|
-
data?: BytesLike;
|
|
28
|
-
value?: Bytes | bigint | string | number;
|
|
29
|
-
chainId?: number;
|
|
30
|
-
type?: number;
|
|
31
|
-
accessList?: AccessListish;
|
|
32
|
-
maxPriorityFeePerGas?: Bytes | bigint | string | number;
|
|
33
|
-
maxFeePerGas?: Bytes | bigint | string | number;
|
|
34
|
-
customData?: Record<string, any>;
|
|
35
|
-
ccipReadEnabled?: boolean;
|
|
36
|
-
}) => Promise<{
|
|
37
|
-
hash: string;
|
|
38
|
-
}>;
|
|
39
|
-
signMessage: (message: string) => Promise<string>;
|
|
40
|
-
};
|
|
2
|
+
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, SolanaWallet } from './CoinflowTypes';
|
|
41
3
|
export declare class CoinflowUtils {
|
|
42
4
|
env: CoinflowEnvs;
|
|
43
5
|
url: string;
|
|
@@ -45,7 +7,8 @@ export declare class CoinflowUtils {
|
|
|
45
7
|
getFeePayer(merchantId: string): Promise<string>;
|
|
46
8
|
getCreditBalance(publicKey: string, blockchain: 'solana' | 'near'): Promise<number>;
|
|
47
9
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
48
|
-
static
|
|
10
|
+
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
11
|
+
static getCoinflowUrl({ walletPubkey, route, env, amount, transaction, blockchain, supportsVersionedTransactions, webhookInfo, token, email, loaderBackground, handleHeightChange, useSocket, bankAccountLinkRedirect, additionalWallets, }: CoinflowIFrameProps): string;
|
|
49
12
|
static serializeSolanaTransaction(transaction: Transaction | undefined): string | undefined;
|
|
50
13
|
static solanaWalletSupportsVersionedTransactions(wallet: SolanaWallet): boolean;
|
|
51
14
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
@@ -55,4 +18,3 @@ export declare class CoinflowUtils {
|
|
|
55
18
|
polygon: T;
|
|
56
19
|
}): T;
|
|
57
20
|
}
|
|
58
|
-
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, handleHeightChange = _a.handleHeightChange;
|
|
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, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets;
|
|
57
64
|
var url = new URL("/".concat(blockchain) + route, CoinflowUtils.getCoinflowBaseUrl(env));
|
|
58
65
|
url.searchParams.append('pubkey', walletPubkey);
|
|
59
66
|
if (transaction) {
|
|
@@ -80,6 +87,14 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
80
87
|
if (handleHeightChange) {
|
|
81
88
|
url.searchParams.append('useHeightChange', 'true');
|
|
82
89
|
}
|
|
90
|
+
if (useSocket) {
|
|
91
|
+
url.searchParams.append('useSocket', 'true');
|
|
92
|
+
}
|
|
93
|
+
if (bankAccountLinkRedirect) {
|
|
94
|
+
url.searchParams.append('bankAccountLinkRedirect', bankAccountLinkRedirect);
|
|
95
|
+
}
|
|
96
|
+
if (additionalWallets)
|
|
97
|
+
url.searchParams.append('additionalWallets', JSON.stringify(additionalWallets));
|
|
83
98
|
return url.toString();
|
|
84
99
|
};
|
|
85
100
|
CoinflowUtils.serializeSolanaTransaction = function (transaction) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/CoinflowUtils.ts"],"names":[],"mappings":";;;;AACA,sDAA0B;AAG1B;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,CAAC,IAAI,EAAE,EAAA;;wBAA5B,IAAI,GAAG,SAAqB;wBAClC,sBAAO,IAAI,CAAC,iBAAiB,EAAC;;;;KAC/B;IAEK,wCAAgB,GAAtB,UACE,SAAiB,EACjB,UAA6B;;;;;4BAEZ,qBAAM,KAAK,CAC1B,IAAI,CAAC,GAAG,GAAG,wBAAiB,SAAS,cAAI,UAAU,CAAE,CACtD,EAAA;;wBAFK,QAAQ,GAAG,SAEhB;wBACiB,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wBAAhC,OAAO,GAAI,CAAA,SAAqB,CAAA,QAAzB;wBACd,sBAAO,OAAO,EAAC;;;;KAChB;IAEM,gCAAkB,GAAzB,UAA0B,GAAkB;QAC1C,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,uBAAuB,CAAC;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,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,AAtJD,IAsJC;AAtJY,sCAAa"}
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
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;
|
|
@@ -5,10 +5,10 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
var CoinflowIFrame_1 = require("./CoinflowIFrame");
|
|
7
7
|
var CoinflowUtils_1 = require("./CoinflowUtils");
|
|
8
|
-
var useIframeWallet_1 = require("./useIframeWallet");
|
|
9
|
-
var SolanaIFrameMessageHandlers_1 = require("./SolanaIFrameMessageHandlers");
|
|
10
|
-
var NearIFrameMessageHandlers_1 = require("./NearIFrameMessageHandlers");
|
|
11
|
-
var EthIFrameMessageHandlers_1 = require("./EthIFrameMessageHandlers");
|
|
8
|
+
var useIframeWallet_1 = require("./wallet/useIframeWallet");
|
|
9
|
+
var SolanaIFrameMessageHandlers_1 = require("./wallet/SolanaIFrameMessageHandlers");
|
|
10
|
+
var NearIFrameMessageHandlers_1 = require("./wallet/NearIFrameMessageHandlers");
|
|
11
|
+
var EthIFrameMessageHandlers_1 = require("./wallet/EthIFrameMessageHandlers");
|
|
12
12
|
function CoinflowWithdraw(props) {
|
|
13
13
|
return CoinflowUtils_1.CoinflowUtils.byBlockchain(props.blockchain, {
|
|
14
14
|
solana: (react_1.default.createElement(CoinflowSolanaWithdraw, tslib_1.__assign({}, props))),
|
|
@@ -19,9 +19,10 @@ function CoinflowWithdraw(props) {
|
|
|
19
19
|
}
|
|
20
20
|
exports.CoinflowWithdraw = CoinflowWithdraw;
|
|
21
21
|
function CoinflowSolanaWithdraw(props) {
|
|
22
|
+
var _a;
|
|
22
23
|
var handlers = (0, SolanaIFrameMessageHandlers_1.useSolanaIFrameMessageHandlers)(props);
|
|
23
|
-
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
|
|
24
24
|
var wallet = props.wallet;
|
|
25
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, (_a = wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString()).IFrameRef;
|
|
25
26
|
if (!wallet.publicKey)
|
|
26
27
|
return null;
|
|
27
28
|
var walletPubkey = wallet.publicKey.toString();
|
|
@@ -30,8 +31,8 @@ function CoinflowSolanaWithdraw(props) {
|
|
|
30
31
|
}
|
|
31
32
|
function CoinflowNearWithdraw(props) {
|
|
32
33
|
var handlers = (0, NearIFrameMessageHandlers_1.useNearIFrameMessageHandlers)(props);
|
|
33
|
-
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
|
|
34
34
|
var wallet = props.wallet;
|
|
35
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, wallet.accountId).IFrameRef;
|
|
35
36
|
if (!wallet)
|
|
36
37
|
return null;
|
|
37
38
|
var walletPubkey = wallet.accountId;
|
|
@@ -40,8 +41,8 @@ function CoinflowNearWithdraw(props) {
|
|
|
40
41
|
}
|
|
41
42
|
function CoinflowEthWithdraw(props) {
|
|
42
43
|
var handlers = (0, EthIFrameMessageHandlers_1.useEthIFrameMessageHandlers)(props);
|
|
43
|
-
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props).IFrameRef;
|
|
44
44
|
var wallet = props.wallet;
|
|
45
|
+
var IFrameRef = (0, useIframeWallet_1.useIframeWallet)(handlers, props, wallet.address).IFrameRef;
|
|
45
46
|
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.address))
|
|
46
47
|
return null;
|
|
47
48
|
var walletPubkey = wallet.address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;
|
|
1
|
+
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAC1B,mDAAgD;AAChD,iDAEyB;AACzB,4DAAyD;AACzD,oFAAoF;AACpF,gFAAgF;AAMhF,8EAA8E;AAE9E,SAAgB,gBAAgB,CAC9B,KAA4B;IAE5B,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,GAAG,EAAE,8BAAC,mBAAmB,uBAAM,KAAkC,EAAI;QACrE,OAAO,EAAE,CACP,8BAAC,mBAAmB,uBAAM,KAAsC,EAAI,CACrE;KACF,CAAC,CAAC;AACL,CAAC;AAbD,4CAaC;AAED,SAAS,sBAAsB,CAAC,KAAkC;;IAChE,IAAM,QAAQ,GAAG,IAAA,4DAA8B,EAAC,KAAK,CAAC,CAAC;IAChD,IAAA,MAAM,GAAI,KAAK,OAAT,CAAU;IAChB,IAAA,SAAS,GAAI,IAAA,iCAAe,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAA,MAAM,CAAC,SAAS,0CAAE,QAAQ,EAAE,CAAC,UAAlE,CAAmE;IAEnF,IAAI,CAAC,MAAM,CAAC,SAAS;QA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