@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
|
@@ -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 {};
|
|
@@ -49,8 +49,15 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
49
49
|
return 'http://localhost:3000';
|
|
50
50
|
return "https://".concat(env, ".coinflow.cash");
|
|
51
51
|
};
|
|
52
|
+
CoinflowUtils.getCoinflowApiUrl = function (env) {
|
|
53
|
+
if (!env || env === 'prod')
|
|
54
|
+
return 'https://api.coinflow.cash';
|
|
55
|
+
if (env === 'local')
|
|
56
|
+
return 'http://localhost:5000';
|
|
57
|
+
return "https://api-".concat(env, ".coinflow.cash");
|
|
58
|
+
};
|
|
52
59
|
CoinflowUtils.getCoinflowUrl = function (_a) {
|
|
53
|
-
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;
|
|
60
|
+
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;
|
|
54
61
|
var url = new URL("/".concat(blockchain) + route, CoinflowUtils.getCoinflowBaseUrl(env));
|
|
55
62
|
url.searchParams.append('pubkey', walletPubkey);
|
|
56
63
|
if (transaction) {
|
|
@@ -77,6 +84,14 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
77
84
|
if (handleHeightChange) {
|
|
78
85
|
url.searchParams.append('useHeightChange', 'true');
|
|
79
86
|
}
|
|
87
|
+
if (useSocket) {
|
|
88
|
+
url.searchParams.append('useSocket', 'true');
|
|
89
|
+
}
|
|
90
|
+
if (bankAccountLinkRedirect) {
|
|
91
|
+
url.searchParams.append('bankAccountLinkRedirect', bankAccountLinkRedirect);
|
|
92
|
+
}
|
|
93
|
+
if (additionalWallets)
|
|
94
|
+
url.searchParams.append('additionalWallets', JSON.stringify(additionalWallets));
|
|
80
95
|
return url.toString();
|
|
81
96
|
};
|
|
82
97
|
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,OAAO,MAAM,MAAM,MAAM,CAAC;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,c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AC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAEM,wCAA0B,GAAjC,UACE,WAAoC;QAEpC,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QAEnC,IAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC;YACzC,oBAAoB,EAAE,KAAK;YAC3B,gBAAgB,EAAE,KAAK;SACxB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC,YAA0B,CAAC,CAAC;IACnD,CAAC;IAEM,uDAAyC,GAAhD,UACE,MAAoB;;QAEpB,OAAO,CAAC,CAAC,CAAA,MAAA,MAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,OAAO,0CAAE,4BAA4B,0CAAE,GAAG,CAAC,CAAC,CAAC,CAAA,CAAC;IACxE,CAAC;IAEM,0BAAY,GAAnB,UACE,UAA8B,EAC9B,IAA+C;QAE/C,QAAQ,UAAU,EAAE;YAClB,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,MAAM,CAAC;YACrB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB,KAAK,KAAK;gBACR,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;oBACxB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAClE,OAAO,IAAI,CAAC,GAAG,CAAC;YAClB;gBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAChD;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAtJD,IAsJC"}
|
|
@@ -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;
|
|
@@ -2,10 +2,10 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CoinflowIFrame } from './CoinflowIFrame';
|
|
4
4
|
import { CoinflowUtils, } from './CoinflowUtils';
|
|
5
|
-
import { useIframeWallet } from './useIframeWallet';
|
|
6
|
-
import { useSolanaIFrameMessageHandlers } from './SolanaIFrameMessageHandlers';
|
|
7
|
-
import { useNearIFrameMessageHandlers } from './NearIFrameMessageHandlers';
|
|
8
|
-
import { useEthIFrameMessageHandlers } from './EthIFrameMessageHandlers';
|
|
5
|
+
import { useIframeWallet } from './wallet/useIframeWallet';
|
|
6
|
+
import { useSolanaIFrameMessageHandlers } from './wallet/SolanaIFrameMessageHandlers';
|
|
7
|
+
import { useNearIFrameMessageHandlers } from './wallet/NearIFrameMessageHandlers';
|
|
8
|
+
import { useEthIFrameMessageHandlers } from './wallet/EthIFrameMessageHandlers';
|
|
9
9
|
export function CoinflowWithdraw(props) {
|
|
10
10
|
return CoinflowUtils.byBlockchain(props.blockchain, {
|
|
11
11
|
solana: (React.createElement(CoinflowSolanaWithdraw, __assign({}, props))),
|
|
@@ -15,9 +15,10 @@ export function CoinflowWithdraw(props) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
function CoinflowSolanaWithdraw(props) {
|
|
18
|
+
var _a;
|
|
18
19
|
var handlers = useSolanaIFrameMessageHandlers(props);
|
|
19
|
-
var IFrameRef = useIframeWallet(handlers, props).IFrameRef;
|
|
20
20
|
var wallet = props.wallet;
|
|
21
|
+
var IFrameRef = useIframeWallet(handlers, props, (_a = wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString()).IFrameRef;
|
|
21
22
|
if (!wallet.publicKey)
|
|
22
23
|
return null;
|
|
23
24
|
var walletPubkey = wallet.publicKey.toString();
|
|
@@ -26,8 +27,8 @@ function CoinflowSolanaWithdraw(props) {
|
|
|
26
27
|
}
|
|
27
28
|
function CoinflowNearWithdraw(props) {
|
|
28
29
|
var handlers = useNearIFrameMessageHandlers(props);
|
|
29
|
-
var IFrameRef = useIframeWallet(handlers, props).IFrameRef;
|
|
30
30
|
var wallet = props.wallet;
|
|
31
|
+
var IFrameRef = useIframeWallet(handlers, props, wallet.accountId).IFrameRef;
|
|
31
32
|
if (!wallet)
|
|
32
33
|
return null;
|
|
33
34
|
var walletPubkey = wallet.accountId;
|
|
@@ -36,8 +37,8 @@ function CoinflowNearWithdraw(props) {
|
|
|
36
37
|
}
|
|
37
38
|
function CoinflowEthWithdraw(props) {
|
|
38
39
|
var handlers = useEthIFrameMessageHandlers(props);
|
|
39
|
-
var IFrameRef = useIframeWallet(handlers, props).IFrameRef;
|
|
40
40
|
var wallet = props.wallet;
|
|
41
|
+
var IFrameRef = useIframeWallet(handlers, props, wallet.address).IFrameRef;
|
|
41
42
|
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.address))
|
|
42
43
|
return null;
|
|
43
44
|
var walletPubkey = wallet.address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,8BAA8B,EAAC,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAC,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAMhF,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAE9E,MAAM,UAAU,gBAAgB,CAC9B,KAA4B;IAE5B,OAAO,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,oBAAC,sBAAsB,eAAM,KAAqC,EAAI,CACvE;QACD,IAAI,EAAE,oBAAC,oBAAoB,eAAM,KAAmC,EAAI;QACxE,GAAG,EAAE,oBAAC,mBAAmB,eAAM,KAAkC,EAAI;QACrE,OAAO,EAAE,CACP,oBAAC,mBAAmB,eAAM,KAAsC,EAAI,CACrE;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAkC;;IAChE,IAAM,QAAQ,GAAG,8BA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EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,UAApD,CAAqD;IAErE,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA;QAAE,OAAO,IAAI,CAAC;IAClC,IAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAEpC,IAAM,WAAW,yBACZ,KAAK,KACR,YAAY,cAAA,EACZ,SAAS,WAAA,EACT,KAAK,EAAE,oBAAa,KAAK,CAAC,UAAU,CAAE,GACvC,CAAC;IACF,OAAO,CACL,oBAAC,cAAc,eAAK,WAAW,EAAG,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { CoinflowNearHistoryProps, CoinflowSolanaHistoryProps, CoinflowEthHistoryProps, CoinflowPolygonHistoryProps } from './
|
|
3
|
-
export declare function CoinflowWithdrawHistory(props: CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowEthHistoryProps | CoinflowPolygonHistoryProps): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CoinflowNearHistoryProps, CoinflowSolanaHistoryProps, CoinflowEthHistoryProps, CoinflowPolygonHistoryProps } from './CoinflowTypes';
|
|
3
|
+
export declare function CoinflowWithdrawHistory(props: CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowEthHistoryProps | CoinflowPolygonHistoryProps): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { CoinflowUtils } from './CoinflowUtils';
|
|
3
|
-
import { useIframeWallet } from './useIframeWallet';
|
|
3
|
+
import { useIframeWallet } from './wallet/useIframeWallet';
|
|
4
4
|
import { CoinflowIFrame } from './CoinflowIFrame';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { useSolanaIFrameMessageHandlers } from './SolanaIFrameMessageHandlers';
|
|
7
|
-
import { useNearIFrameMessageHandlers } from './NearIFrameMessageHandlers';
|
|
8
|
-
import { useEthIFrameMessageHandlers } from './EthIFrameMessageHandlers';
|
|
6
|
+
import { useSolanaIFrameMessageHandlers } from './wallet/SolanaIFrameMessageHandlers';
|
|
7
|
+
import { useNearIFrameMessageHandlers } from './wallet/NearIFrameMessageHandlers';
|
|
8
|
+
import { useEthIFrameMessageHandlers } from './wallet/EthIFrameMessageHandlers';
|
|
9
9
|
export function CoinflowWithdrawHistory(props) {
|
|
10
10
|
return CoinflowUtils.byBlockchain(props.blockchain, {
|
|
11
11
|
solana: (React.createElement(SolanaWithdrawHistory, __assign({}, props))),
|
|
@@ -15,9 +15,10 @@ export function CoinflowWithdrawHistory(props) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
function SolanaWithdrawHistory(props) {
|
|
18
|
+
var _a;
|
|
18
19
|
var handlers = useSolanaIFrameMessageHandlers(props);
|
|
19
|
-
var IFrameRef = useIframeWallet(handlers, props).IFrameRef;
|
|
20
20
|
var wallet = props.wallet;
|
|
21
|
+
var IFrameRef = useIframeWallet(handlers, props, (_a = wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString()).IFrameRef;
|
|
21
22
|
if (!wallet.publicKey)
|
|
22
23
|
return null;
|
|
23
24
|
var walletPubkey = wallet.publicKey.toString();
|
|
@@ -26,8 +27,8 @@ function SolanaWithdrawHistory(props) {
|
|
|
26
27
|
}
|
|
27
28
|
function NearWithdrawHistory(props) {
|
|
28
29
|
var handlers = useNearIFrameMessageHandlers(props);
|
|
29
|
-
var IFrameRef = useIframeWallet(handlers, props).IFrameRef;
|
|
30
30
|
var wallet = props.wallet;
|
|
31
|
+
var IFrameRef = useIframeWallet(handlers, props, wallet.accountId).IFrameRef;
|
|
31
32
|
if (!wallet)
|
|
32
33
|
return null;
|
|
33
34
|
var walletPubkey = wallet.accountId;
|
|
@@ -36,8 +37,8 @@ function NearWithdrawHistory(props) {
|
|
|
36
37
|
}
|
|
37
38
|
function EthWithdrawHistory(props) {
|
|
38
39
|
var handlers = useEthIFrameMessageHandlers(props);
|
|
39
|
-
var IFrameRef = useIframeWallet(handlers, props).IFrameRef;
|
|
40
40
|
var wallet = props.wallet;
|
|
41
|
+
var IFrameRef = useIframeWallet(handlers, props, wallet.address).IFrameRef;
|
|
41
42
|
if (!(wallet === null || wallet === void 0 ? void 0 : wallet.address))
|
|
42
43
|
return null;
|
|
43
44
|
var iframeProps = __assign(__assign({}, props), { walletPubkey: wallet.address, IFrameRef: IFrameRef, route: "/history/withdraw/".concat(props.merchantId) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,eAAe,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,8BAA8B,EAAC,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAC,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAOhF,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAE9E,MAAM,UAAU,uBAAuB,CACrC,KAI+B;IAE/B,OAAO,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE;QAClD,MAAM,EAAE,CACN,oBAAC,qBAAqB,eAAM,KAAoC,EAAI,CACrE;QACD,IAAI,EAAE,oBAAC,mBAAmB,eAAM,KAAkC,EAAI;QACtE,GAAG,EAAE,oBAAC,kBAAk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,SAAS,kBAAkB,CAAC,KAA4D;IACtF,IAAM,QAAQ,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAA,MAAM,GAAI,KAAK,OAAT,CAAU;IAChB,IAAA,SAAS,GAAI,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,UAApD,CAAqD;IAErE,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA;QAAE,OAAO,IAAI,CAAC;IAElC,IAAM,WAAW,yBACZ,KAAK,KACR,YAAY,EAAE,MAAM,CAAC,OAAO,EAC5B,SAAS,WAAA,EACT,KAAK,EAAE,4BAAqB,KAAK,CAAC,UAAU,CAAE,GAC/C,CAAC;IACF,OAAO,CACL,oBAAC,cAAc,eAAK,WAAW,EAAI,CACpC,CAAC;AACJ,CAAC"}
|
package/build/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './CoinflowWithdraw';
|
|
2
2
|
export * from './CoinflowPurchase';
|
|
3
3
|
export * from './CoinflowUtils';
|
|
4
|
-
export * from './useIframeWallet';
|
|
4
|
+
export * from './wallet/useIframeWallet';
|
|
5
5
|
export * from './CoinflowIFrame';
|
|
6
6
|
export * from './CoinflowPurchaseHistory';
|
|
7
7
|
export * from './CoinflowWithdrawHistory';
|
|
8
|
+
export * from './CoinflowTypes';
|
package/build/esm/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './CoinflowWithdraw';
|
|
2
2
|
export * from './CoinflowPurchase';
|
|
3
3
|
export * from './CoinflowUtils';
|
|
4
|
-
export * from './useIframeWallet';
|
|
4
|
+
export * from './wallet/useIframeWallet';
|
|
5
5
|
export * from './CoinflowIFrame';
|
|
6
6
|
export * from './CoinflowPurchaseHistory';
|
|
7
7
|
export * from './CoinflowWithdrawHistory';
|
|
8
|
+
export * from './CoinflowTypes';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { IFrameMessageHandlers } from './SolanaIFrameMessageHandlers';
|
|
2
|
-
import { EthWallet } from '
|
|
3
|
-
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
2
|
+
import { EthWallet, PartialBy } from '../CoinflowTypes';
|
|
4
3
|
export declare function useEthIFrameMessageHandlers({ wallet, }: {
|
|
5
4
|
wallet: PartialBy<EthWallet, 'signMessage'>;
|
|
6
5
|
}): IFrameMessageHandlers;
|
|
7
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EthIFrameMessageHandlers.js","sourceRoot":"","sources":["../../../src/wallet/EthIFrameMessageHandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAIlC,MAAM,UAAU,2BAA2B,CAAC,EAI3C;IAJD,iBA6BC;QA5BC,MAAM,YAAA;IAIN,IAAM,qBAAqB,GAAG,WAAW,CACvC,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,IAAM,iBAAiB,GAAG,WAAW,CACnC,UAAO,EAAkB;YAAjB,IAAI,UAAA;;;;;wBACV,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;wBACjC,IAAI,CAAC,MAAM,CAAC,WAAW;4BACrB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;wBAEvD,qBAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAA;4BAArC,sBAAO,SAA8B,EAAC;;;;KACvC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO;QACL,qBAAqB,uBAAA;QACrB,iBAAiB,mBAAA;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IFrameMessageHandlers } from './SolanaIFrameMessageHandlers';
|
|
2
|
-
import { NearWallet } from '
|
|
2
|
+
import { NearWallet } from '../CoinflowTypes';
|
|
3
3
|
export declare function useNearIFrameMessageHandlers({ wallet, }: {
|
|
4
4
|
wallet: NearWallet;
|
|
5
5
|
}): IFrameMessageHandlers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NearIFrameMessageHandlers.js","sourceRoot":"","sources":["../../../src/wallet/NearIFrameMessageHandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAIlC,MAAM,UAAU,4BAA4B,CAAC,EAI5C;IAJD,iBAmBC;QAlBC,MAAM,YAAA;IAIN,IAAM,qBAAqB,GAAG,WAAW,CACvC,UAAO,EAAkB;YAAjB,IAAI,UAAA;;;;;;wBACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;wBACzC,qBAAM,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAA;;wBAA9D,gBAAgB,GAAG,SAA2C;wBACpE,IAAI,CAAC,gBAAgB;4BAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;wBAC/C,iBAAiB,GAAI,gBAAgB,YAApB,CAAqB;wBAC1D,sBAAO,iBAAiB,CAAC,IAAI,EAAC;;;;KAC/B,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO;QACL,qBAAqB,uBAAA;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoinflowEnvs } from '../CoinflowTypes';
|
|
2
|
+
export declare const initiateSocket: (walletPubkey: string, env?: CoinflowEnvs) => void;
|
|
3
|
+
export declare const disconnectSocket: () => void;
|
|
4
|
+
export declare const subscribeToChat: (cb: (message: string) => void) => void;
|
|
5
|
+
export declare const sendWebsocketMessage: (message: string) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import io from 'socket.io-client';
|
|
2
|
+
import { CoinflowUtils } from '../CoinflowUtils';
|
|
3
|
+
var socket;
|
|
4
|
+
export var initiateSocket = function (walletPubkey, env) {
|
|
5
|
+
if (!env)
|
|
6
|
+
env = 'prod';
|
|
7
|
+
var url = CoinflowUtils.getCoinflowApiUrl(env);
|
|
8
|
+
socket = io(url, {
|
|
9
|
+
auth: {
|
|
10
|
+
wallet: walletPubkey,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
socket.on('connect', function () {
|
|
14
|
+
console.log('Connected!');
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export var disconnectSocket = function () {
|
|
18
|
+
console.log('Disconnecting socket...');
|
|
19
|
+
if (socket)
|
|
20
|
+
socket.disconnect();
|
|
21
|
+
socket = undefined;
|
|
22
|
+
};
|
|
23
|
+
export var subscribeToChat = function (cb) {
|
|
24
|
+
if (!socket)
|
|
25
|
+
return;
|
|
26
|
+
socket.on('message', function (msg) {
|
|
27
|
+
cb(msg);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export var sendWebsocketMessage = function (message) {
|
|
31
|
+
if (socket)
|
|
32
|
+
socket.emit('message', message);
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=SocketService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocketService.js","sourceRoot":"","sources":["../../../src/wallet/SocketService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAG/C,IAAI,MAA0B,CAAC;AAE/B,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,YAAoB,EAAE,GAAkB;IACrE,IAAI,CAAC,GAAG;QAAE,GAAG,GAAG,MAAM,CAAC;IACvB,IAAM,GAAG,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE;QACf,IAAI,EAAE;YACJ,MAAM,EAAE,YAAY;SACrB;KACF,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE;QACnB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAA;AACD,MAAM,CAAC,IAAM,gBAAgB,GAAG;IAC9B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,IAAG,MAAM;QAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC/B,MAAM,GAAG,SAAS,CAAC;AACrB,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,EAA6B;IAC3D,IAAI,CAAC,MA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D,CAAC,CAAC;yBACpE;wBAEK,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;wBAChC,IAAI,cAAc,EAAE;4BAClB,cAAc,CAAC,OAAO,CAAC,UAAA,MAAM,IAAI,OAAA,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,EAAzB,CAAyB,CAAC,CAAC;yBAC7D;wBAEyB,qBAAM,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,EAAA;;wBAApD,iBAAiB,GAAG,SAAgC;wBAC1D,sBAAO,MAAM,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;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IFrameMessageHandlers } from './SolanaIFrameMessageHandlers';
|
|
3
|
-
|
|
4
|
-
export declare function useIframeWallet({ handleSignTransaction, handleSendTransaction, handleSignMessage, }: IFrameMessageHandlers, { onSuccess, handleHeightChange }: {
|
|
3
|
+
import { CoinflowEnvs, OnSuccessMethod } from '../CoinflowTypes';
|
|
4
|
+
export declare function useIframeWallet({ handleSignTransaction, handleSendTransaction, handleSignMessage, }: IFrameMessageHandlers, { onSuccess, handleHeightChange, useSocket, env }: {
|
|
5
5
|
onSuccess?: OnSuccessMethod;
|
|
6
6
|
handleHeightChange?: (height: string) => void;
|
|
7
|
-
|
|
7
|
+
useSocket?: boolean;
|
|
8
|
+
env?: CoinflowEnvs;
|
|
9
|
+
}, walletPubkey: string | null | undefined): {
|
|
8
10
|
IFrameRef: import("react").MutableRefObject<HTMLIFrameElement | null>;
|
|
9
11
|
};
|