@coinflowlabs/react 4.5.0 → 4.5.2
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 +8 -0
- package/build/cjs/CoinflowWithdrawHistory.d.ts +3 -3
- package/build/cjs/CoinflowWithdrawHistory.js.map +1 -1
- package/build/cjs/common/CoinflowLibMessageHandlers.d.ts +4 -4
- package/build/cjs/common/CoinflowLibMessageHandlers.js +82 -30
- package/build/cjs/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/cjs/common/CoinflowTypes.d.ts +39 -13
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +2 -15
- package/build/cjs/common/CoinflowUtils.js +3 -106
- package/build/cjs/common/CoinflowUtils.js.map +1 -1
- package/build/esm/CoinflowWithdrawHistory.d.ts +3 -3
- package/build/esm/CoinflowWithdrawHistory.js +2 -2
- package/build/esm/CoinflowWithdrawHistory.js.map +1 -1
- package/build/esm/common/CoinflowLibMessageHandlers.d.ts +4 -4
- package/build/esm/common/CoinflowLibMessageHandlers.js +82 -30
- package/build/esm/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/esm/common/CoinflowTypes.d.ts +39 -13
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +2 -15
- package/build/esm/common/CoinflowUtils.js +3 -106
- package/build/esm/common/CoinflowUtils.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { CoinflowIFrame } from './CoinflowIFrame';
|
|
3
|
-
import React, { useMemo } from
|
|
4
|
-
import { getWalletPubkey, getHandlers } from
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { getWalletPubkey, getHandlers, } from './common';
|
|
5
5
|
export function CoinflowWithdrawHistory(props) {
|
|
6
6
|
var iframeProps = useMemo(function () {
|
|
7
7
|
var walletPubkey = getWalletPubkey(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAEL,eAAe,EAEf,WAAW,GAEZ,MAAM,UAAU,CAAC;AAElB,MAAM,UAAU,uBAAuB,CAAC,KAA2B;IACjE,IAAM,WAAW,GAAG,OAAO,CAAsB;QAC/C,IAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5C,6BACK,KAAK,KACR,YAAY,cAAA,EACZ,KAAK,EAAE,4BAAqB,KAAK,CAAC,UAAU,CAAE,EAC9C,WAAW,EAAE,SAAS,IACtB;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAM,eAAe,GAAG,OAAO,CAAwB;QACrD,6BACK,WAAW,CAAC,KAAK,CAAC,KACrB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,IAC5C;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,oBAAC,cAAc,eAAK,WAAW,EAAM,eAAe,EAAI,CAAC;AAClE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoinflowPurchaseProps,
|
|
1
|
+
import { CoinflowPurchaseProps, OnSuccessMethod } from './CoinflowTypes';
|
|
2
2
|
export type WalletCall = {
|
|
3
3
|
method: IFrameMessageMethods;
|
|
4
4
|
data: string;
|
|
@@ -24,9 +24,9 @@ declare enum IFrameMessageMethods {
|
|
|
24
24
|
SendTransaction = "sendTransaction",
|
|
25
25
|
HeightChange = "heightChange",
|
|
26
26
|
Success = "success",
|
|
27
|
-
|
|
27
|
+
Loaded = "loaded"
|
|
28
28
|
}
|
|
29
|
-
export declare function getWalletPubkey(input:
|
|
29
|
+
export declare function getWalletPubkey(input: CoinflowPurchaseProps): string | null | undefined;
|
|
30
30
|
export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers): Promise<string> | void;
|
|
31
|
-
export declare function getHandlers(props:
|
|
31
|
+
export declare function getHandlers(props: CoinflowPurchaseProps): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
32
32
|
export {};
|
|
@@ -8,20 +8,28 @@ var IFrameMessageMethods;
|
|
|
8
8
|
IFrameMessageMethods["SendTransaction"] = "sendTransaction";
|
|
9
9
|
IFrameMessageMethods["HeightChange"] = "heightChange";
|
|
10
10
|
IFrameMessageMethods["Success"] = "success";
|
|
11
|
-
IFrameMessageMethods["
|
|
11
|
+
IFrameMessageMethods["Loaded"] = "loaded";
|
|
12
12
|
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
13
13
|
export function getWalletPubkey(input) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
var wallet;
|
|
15
|
+
if ('signer' in input &&
|
|
16
|
+
typeof input.signer === 'object' &&
|
|
17
|
+
input.signer &&
|
|
18
|
+
'wallet' in input.signer)
|
|
19
|
+
wallet = input.signer.wallet;
|
|
20
|
+
else if ('wallet' in input && input.wallet)
|
|
21
|
+
wallet = input.wallet;
|
|
22
|
+
if (!wallet)
|
|
23
|
+
return;
|
|
24
|
+
if (typeof wallet === 'string')
|
|
25
|
+
return wallet;
|
|
26
|
+
if (typeof wallet === 'object') {
|
|
27
|
+
if ('publicKey' in wallet)
|
|
28
|
+
return wallet.publicKey ? wallet.publicKey.toString() : undefined;
|
|
29
|
+
if ('address' in wallet)
|
|
30
|
+
return wallet.address ? wallet.address : undefined;
|
|
31
|
+
if ('accountId' in wallet)
|
|
32
|
+
return wallet.accountId ? wallet.accountId : undefined;
|
|
25
33
|
}
|
|
26
34
|
return null;
|
|
27
35
|
}
|
|
@@ -57,32 +65,78 @@ export function handleIFrameMessage(rawMessage, handlers) {
|
|
|
57
65
|
return;
|
|
58
66
|
handlers.onSuccess(walletCall.info);
|
|
59
67
|
return;
|
|
68
|
+
case IFrameMessageMethods.Loaded:
|
|
69
|
+
return;
|
|
60
70
|
}
|
|
61
71
|
console.warn("Didn't expect to get here, handleIFrameMessage method:".concat(method, " is not one of ").concat(Object.values(IFrameMessageMethods)));
|
|
62
72
|
}
|
|
63
73
|
export function getHandlers(props) {
|
|
64
|
-
|
|
74
|
+
var chain;
|
|
75
|
+
var wallet;
|
|
76
|
+
if ('signer' in props &&
|
|
77
|
+
typeof props.signer === 'object' &&
|
|
78
|
+
props.signer &&
|
|
79
|
+
'blockchain' in props.signer &&
|
|
80
|
+
'wallet' in props.signer) {
|
|
81
|
+
chain = props.signer.blockchain;
|
|
82
|
+
wallet = props.signer.wallet;
|
|
83
|
+
}
|
|
84
|
+
else if ('blockchain' in props && props.blockchain) {
|
|
85
|
+
chain = props.blockchain;
|
|
86
|
+
wallet = props.wallet;
|
|
87
|
+
}
|
|
88
|
+
if (!chain) {
|
|
65
89
|
return {
|
|
66
90
|
handleSendTransaction: function () {
|
|
67
|
-
throw new Error('handleSendTransaction Not Implemented
|
|
91
|
+
throw new Error('handleSendTransaction Not Implemented');
|
|
68
92
|
},
|
|
69
93
|
handleSignMessage: function () {
|
|
70
|
-
throw new Error('handleSendTransaction Not Implemented
|
|
94
|
+
throw new Error('handleSendTransaction Not Implemented');
|
|
71
95
|
},
|
|
72
96
|
handleSignTransaction: function () {
|
|
73
|
-
throw new Error('handleSendTransaction Not Implemented
|
|
97
|
+
throw new Error('handleSendTransaction Not Implemented');
|
|
74
98
|
},
|
|
75
99
|
onSuccess: props.onSuccess,
|
|
76
100
|
};
|
|
77
101
|
}
|
|
78
|
-
return CoinflowUtils.byBlockchain(
|
|
79
|
-
solana: function () {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
return CoinflowUtils.byBlockchain(chain, {
|
|
103
|
+
solana: function () {
|
|
104
|
+
return getSolanaWalletHandlers({
|
|
105
|
+
wallet: wallet,
|
|
106
|
+
onSuccess: props.onSuccess,
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
near: function () {
|
|
110
|
+
return getNearWalletHandlers({
|
|
111
|
+
wallet: wallet,
|
|
112
|
+
onSuccess: props.onSuccess,
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
eth: function () {
|
|
116
|
+
return getEvmWalletHandlers({
|
|
117
|
+
wallet: wallet,
|
|
118
|
+
onSuccess: props.onSuccess,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
polygon: function () {
|
|
122
|
+
return getEvmWalletHandlers({
|
|
123
|
+
wallet: wallet,
|
|
124
|
+
onSuccess: props.onSuccess,
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
base: function () {
|
|
128
|
+
return getEvmWalletHandlers({
|
|
129
|
+
wallet: wallet,
|
|
130
|
+
onSuccess: props.onSuccess,
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
arbitrum: function () {
|
|
134
|
+
return getEvmWalletHandlers({
|
|
135
|
+
wallet: wallet,
|
|
136
|
+
onSuccess: props.onSuccess,
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
user: function () { return getSessionKeyHandlers(props); },
|
|
86
140
|
})();
|
|
87
141
|
}
|
|
88
142
|
function getSolanaWalletHandlers(_a) {
|
|
@@ -157,7 +211,6 @@ function getSolanaTransaction(data) {
|
|
|
157
211
|
function getNearWalletHandlers(_a) {
|
|
158
212
|
var _this = this;
|
|
159
213
|
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
160
|
-
var nearWallet = wallet;
|
|
161
214
|
return {
|
|
162
215
|
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
163
216
|
var action, executionOutcome, transactionResult;
|
|
@@ -165,7 +218,7 @@ function getNearWalletHandlers(_a) {
|
|
|
165
218
|
switch (_a.label) {
|
|
166
219
|
case 0:
|
|
167
220
|
action = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
168
|
-
return [4 /*yield*/,
|
|
221
|
+
return [4 /*yield*/, wallet.signAndSendTransaction(action)];
|
|
169
222
|
case 1:
|
|
170
223
|
executionOutcome = _a.sent();
|
|
171
224
|
if (!executionOutcome)
|
|
@@ -181,7 +234,6 @@ function getNearWalletHandlers(_a) {
|
|
|
181
234
|
function getEvmWalletHandlers(_a) {
|
|
182
235
|
var _this = this;
|
|
183
236
|
var wallet = _a.wallet, onSuccess = _a.onSuccess;
|
|
184
|
-
var evmWallet = wallet;
|
|
185
237
|
return {
|
|
186
238
|
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
187
239
|
var tx, hash;
|
|
@@ -189,7 +241,7 @@ function getEvmWalletHandlers(_a) {
|
|
|
189
241
|
switch (_a.label) {
|
|
190
242
|
case 0:
|
|
191
243
|
tx = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
192
|
-
return [4 /*yield*/,
|
|
244
|
+
return [4 /*yield*/, wallet.sendTransaction(tx)];
|
|
193
245
|
case 1:
|
|
194
246
|
hash = (_a.sent()).hash;
|
|
195
247
|
return [2 /*return*/, hash];
|
|
@@ -198,13 +250,13 @@ function getEvmWalletHandlers(_a) {
|
|
|
198
250
|
}); },
|
|
199
251
|
handleSignMessage: function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
200
252
|
return __generator(this, function (_a) {
|
|
201
|
-
return [2 /*return*/,
|
|
253
|
+
return [2 /*return*/, wallet.signMessage(message)];
|
|
202
254
|
});
|
|
203
255
|
}); },
|
|
204
256
|
onSuccess: onSuccess,
|
|
205
257
|
};
|
|
206
258
|
}
|
|
207
|
-
function
|
|
259
|
+
function getSessionKeyHandlers(_a) {
|
|
208
260
|
var _this = this;
|
|
209
261
|
var onSuccess = _a.onSuccess;
|
|
210
262
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";AASA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAoB9C,IAAK,oBAOJ;AAPD,WAAK,oBAAoB;IACvB,mDAA2B,CAAA;IAC3B,2DAAmC,CAAA;IACnC,2DAAmC,CAAA;IACnC,qDAA6B,CAAA;IAC7B,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;AACnB,CAAC,EAPI,oBAAoB,KAApB,oBAAoB,QAOxB;AAED,MAAM,UAAU,eAAe,CAC7B,KAA4B;IAE5B,IAAI,MAA+B,CAAC;IACpC,IACE,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,CAAC,MAAM;QACZ,QAAQ,IAAI,KAAK,CAAC,MAAM;QAExB,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAqB,CAAC;SACzC,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM;QAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAElE,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,IAAI,OAAO,M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MAAM,YAAA,EACN,SAAS,eAAA;IAKT,OAAO;QACL,qBAAqB,EAAE,UAAO,WAAmB;;;;;wBACzC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;wBACtD,qBAAM,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,EAAA;;wBAAxC,IAAI,GAAI,CAAA,SAAgC,CAAA,KAApC;wBACX,sBAAO,IAAI,EAAC;;;aACb;QACD,iBAAiB,EAAE,UAAO,OAAe;;gBACvC,sBAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAC;;aACpC;QACD,SAAS,WAAA;KACV,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,EAEY;IAF3C,iBAYC;QAXC,SAAS,eAAA;IAKT,OAAO;QACL,qBAAqB,EAAE;;gBACrB,sBAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAC;;aAC5B;QACD,SAAS,WAAA;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -97,12 +97,17 @@ export interface CoinflowSolanaHistoryProps extends CoinflowTypes {
|
|
|
97
97
|
connection: Connection;
|
|
98
98
|
blockchain: 'solana';
|
|
99
99
|
}
|
|
100
|
+
export interface CoinflowSessionKeyHistoryProps extends CoinflowTypes {
|
|
101
|
+
sessionKey: string;
|
|
102
|
+
blockchain?: undefined;
|
|
103
|
+
}
|
|
100
104
|
export interface CoinflowNearHistoryProps extends CoinflowTypes {
|
|
101
105
|
wallet: NearWallet;
|
|
102
106
|
blockchain: 'near';
|
|
103
107
|
}
|
|
104
108
|
export interface CoinflowEvmHistoryProps extends CoinflowTypes {
|
|
105
109
|
wallet: EthWallet;
|
|
110
|
+
blockchain: 'eth' | 'polygon' | 'base' | 'arbitrum';
|
|
106
111
|
}
|
|
107
112
|
export interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {
|
|
108
113
|
blockchain: 'eth';
|
|
@@ -116,7 +121,7 @@ export interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {
|
|
|
116
121
|
export interface CoinflowArbitrumHistoryProps extends CoinflowEvmHistoryProps {
|
|
117
122
|
blockchain: 'arbitrum';
|
|
118
123
|
}
|
|
119
|
-
export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps;
|
|
124
|
+
export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps | CoinflowSessionKeyHistoryProps;
|
|
120
125
|
/** Transactions **/
|
|
121
126
|
export type NearFtTransferCallAction = {
|
|
122
127
|
methodName: 'ft_transfer_call';
|
|
@@ -126,7 +131,7 @@ export type NearFtTransferCallAction = {
|
|
|
126
131
|
};
|
|
127
132
|
type Bytes = ArrayLike<number>;
|
|
128
133
|
type BytesLike = Bytes | string;
|
|
129
|
-
type RawProductData =
|
|
134
|
+
type RawProductData = any;
|
|
130
135
|
/** Purchase **/
|
|
131
136
|
export type ChargebackProtectionData = ChargebackProtectionItem[];
|
|
132
137
|
export interface ChargebackProtectionItem {
|
|
@@ -158,7 +163,9 @@ export declare enum ThreeDsChallengePreference {
|
|
|
158
163
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
159
164
|
amount?: number | string;
|
|
160
165
|
onSuccess?: OnSuccessMethod;
|
|
161
|
-
webhookInfo?:
|
|
166
|
+
webhookInfo?: {
|
|
167
|
+
[key: string]: any;
|
|
168
|
+
};
|
|
162
169
|
email?: string;
|
|
163
170
|
chargebackProtectionData?: ChargebackProtectionData;
|
|
164
171
|
planCode?: string;
|
|
@@ -167,6 +174,12 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
167
174
|
customerInfo?: CustomerInfo;
|
|
168
175
|
settlementType?: SettlementType;
|
|
169
176
|
authOnly?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* The DeviceID gotten from the Coinflow SDK:
|
|
179
|
+
* https://docs.coinflow.cash/docs/implement-chargeback-protection#how-to-add-chargeback-protection
|
|
180
|
+
*
|
|
181
|
+
* window?.nSureSDK?.getDeviceId()
|
|
182
|
+
*/
|
|
170
183
|
deviceId?: string;
|
|
171
184
|
jwtToken?: string;
|
|
172
185
|
/**
|
|
@@ -183,6 +196,7 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
183
196
|
*/
|
|
184
197
|
origins?: string[];
|
|
185
198
|
threeDsChallengePreference?: ThreeDsChallengePreference;
|
|
199
|
+
destinationAuthKey?: string;
|
|
186
200
|
}
|
|
187
201
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
188
202
|
wallet: SolanaWallet;
|
|
@@ -252,33 +266,45 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
252
266
|
*/
|
|
253
267
|
origins?: string[];
|
|
254
268
|
}
|
|
255
|
-
export
|
|
269
|
+
export type WalletTypes = SolanaWallet | NearWallet | EthWallet;
|
|
270
|
+
export interface SolanaWalletProps {
|
|
256
271
|
wallet: SolanaWallet;
|
|
257
272
|
connection: Connection;
|
|
258
273
|
blockchain: 'solana';
|
|
259
274
|
}
|
|
260
|
-
export
|
|
275
|
+
export type CoinflowSolanaWithdrawProps = CoinflowCommonWithdrawProps & SolanaWalletProps;
|
|
276
|
+
export interface NearWalletProps {
|
|
261
277
|
wallet: NearWallet;
|
|
262
278
|
blockchain: 'near';
|
|
263
279
|
}
|
|
264
|
-
export
|
|
280
|
+
export type CoinflowNearWithdrawProps = CoinflowCommonWithdrawProps & NearWalletProps;
|
|
281
|
+
interface EvmWalletProps {
|
|
265
282
|
wallet: EthWallet;
|
|
266
283
|
usePermit?: boolean;
|
|
267
284
|
}
|
|
268
|
-
|
|
285
|
+
type CoinflowEvmWithdrawProps = CoinflowCommonWithdrawProps & EvmWalletProps;
|
|
286
|
+
export interface EthWalletProps {
|
|
269
287
|
blockchain: 'eth';
|
|
270
|
-
usePermit?: boolean;
|
|
271
288
|
}
|
|
272
|
-
export
|
|
289
|
+
export type CoinflowEthWithdrawProps = CoinflowEvmWithdrawProps & EthWalletProps;
|
|
290
|
+
export interface PolygonWalletProps {
|
|
273
291
|
blockchain: 'polygon';
|
|
274
292
|
}
|
|
275
|
-
export
|
|
293
|
+
export type CoinflowPolygonWithdrawProps = CoinflowEvmWithdrawProps & PolygonWalletProps;
|
|
294
|
+
export interface BaseWalletProps {
|
|
276
295
|
blockchain: 'base';
|
|
277
296
|
}
|
|
278
|
-
export
|
|
297
|
+
export type CoinflowBaseWithdrawProps = CoinflowEvmWithdrawProps & BaseWalletProps;
|
|
298
|
+
export interface ArbitrumWalletProps {
|
|
279
299
|
blockchain: 'arbitrum';
|
|
280
300
|
}
|
|
281
|
-
export type
|
|
301
|
+
export type CoinflowArbitrumWithdrawProps = CoinflowEvmWithdrawProps & ArbitrumWalletProps;
|
|
302
|
+
export interface CoinflowSessionKeyWithdrawProps extends CoinflowCommonWithdrawProps {
|
|
303
|
+
sessionKey: string;
|
|
304
|
+
signer: SolanaWalletProps | NearWalletProps | EthWalletProps | PolygonWalletProps | BaseWalletProps | ArbitrumWalletProps;
|
|
305
|
+
blockchain?: undefined;
|
|
306
|
+
}
|
|
307
|
+
export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps | CoinflowBaseWithdrawProps | CoinflowArbitrumWithdrawProps | CoinflowSessionKeyWithdrawProps;
|
|
282
308
|
export interface CommonEvmRedeem {
|
|
283
309
|
waitForHash?: boolean;
|
|
284
310
|
}
|
|
@@ -316,7 +342,7 @@ export interface TokenRedeem extends CommonEvmRedeem {
|
|
|
316
342
|
destination: string;
|
|
317
343
|
}
|
|
318
344
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem;
|
|
319
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
345
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token' | 'destinationAuthKey'> {
|
|
320
346
|
walletPubkey: string | null | undefined;
|
|
321
347
|
sessionKey?: string;
|
|
322
348
|
route: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AA+ND,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,2DAA6B,CAAA;IAC7B,qDAAuB,CAAA;AACzB,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAySD,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps
|
|
1
|
+
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps } from './CoinflowTypes';
|
|
2
2
|
export declare class CoinflowUtils {
|
|
3
3
|
env: CoinflowEnvs;
|
|
4
4
|
url: string;
|
|
5
5
|
constructor(env?: CoinflowEnvs);
|
|
6
6
|
getNSurePartnerId(merchantId: string): Promise<string | undefined>;
|
|
7
|
-
getCreditBalance(publicKey: string, merchantId: string, blockchain: 'solana' | 'near'): Promise<{
|
|
8
|
-
cents: number;
|
|
9
|
-
}>;
|
|
10
7
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
11
8
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
12
|
-
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, amount, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, }: CoinflowIFrameProps): string;
|
|
9
|
+
static getCoinflowUrl({ walletPubkey, sessionKey, route, routePrefix, env, amount, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, destinationAuthKey, }: CoinflowIFrameProps): string;
|
|
13
10
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
14
11
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
15
12
|
solana: T;
|
|
@@ -20,14 +17,4 @@ export declare class CoinflowUtils {
|
|
|
20
17
|
arbitrum: T;
|
|
21
18
|
user: T;
|
|
22
19
|
}): T;
|
|
23
|
-
static getWalletFromUserId({ userId, merchantId, env, }: {
|
|
24
|
-
userId: string;
|
|
25
|
-
merchantId: string;
|
|
26
|
-
env: CoinflowEnvs;
|
|
27
|
-
}): Promise<SolanaWallet>;
|
|
28
|
-
static getWalletFromEmail({ email, merchantId, env, }: {
|
|
29
|
-
email: string;
|
|
30
|
-
merchantId: string;
|
|
31
|
-
env: CoinflowEnvs;
|
|
32
|
-
}): Promise<SolanaWallet>;
|
|
33
20
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __generator } from "tslib";
|
|
2
2
|
import { web3, base58 } from './SolanaPeerDeps';
|
|
3
3
|
import LZString from 'lz-string';
|
|
4
|
-
import { Keypair, Transaction } from '@solana/web3.js';
|
|
5
|
-
import { sign } from 'tweetnacl';
|
|
6
4
|
var CoinflowUtils = /** @class */ (function () {
|
|
7
5
|
function CoinflowUtils(env) {
|
|
8
6
|
this.env = env !== null && env !== void 0 ? env : 'prod';
|
|
@@ -26,28 +24,6 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
26
24
|
});
|
|
27
25
|
});
|
|
28
26
|
};
|
|
29
|
-
CoinflowUtils.prototype.getCreditBalance = function (publicKey, merchantId, blockchain) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31
|
-
var response, credits;
|
|
32
|
-
return __generator(this, function (_a) {
|
|
33
|
-
switch (_a.label) {
|
|
34
|
-
case 0: return [4 /*yield*/, fetch(this.url + "/api/customer/balances/".concat(merchantId), {
|
|
35
|
-
method: 'GET',
|
|
36
|
-
headers: {
|
|
37
|
-
'x-coinflow-auth-wallet': publicKey,
|
|
38
|
-
'x-coinflow-auth-blockchain': blockchain,
|
|
39
|
-
},
|
|
40
|
-
})];
|
|
41
|
-
case 1:
|
|
42
|
-
response = _a.sent();
|
|
43
|
-
return [4 /*yield*/, response.json()];
|
|
44
|
-
case 2:
|
|
45
|
-
credits = (_a.sent()).credits;
|
|
46
|
-
return [2 /*return*/, credits];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
27
|
CoinflowUtils.getCoinflowBaseUrl = function (env) {
|
|
52
28
|
if (!env || env === 'prod')
|
|
53
29
|
return 'https://coinflow.cash';
|
|
@@ -64,7 +40,7 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
64
40
|
};
|
|
65
41
|
CoinflowUtils.getCoinflowUrl = function (_a) {
|
|
66
42
|
var _b;
|
|
67
|
-
var walletPubkey = _a.walletPubkey, sessionKey = _a.sessionKey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, _c = _a.blockchain, blockchain = _c === void 0 ? 'solana' : _c, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, nearDeposit = _a.nearDeposit, chargebackProtectionData = _a.chargebackProtectionData, merchantCss = _a.merchantCss, color = _a.color, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, token = _a.token, tokens = _a.tokens, planCode = _a.planCode, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme, usePermit = _a.usePermit, transactionSigner = _a.transactionSigner, authOnly = _a.authOnly, deviceId = _a.deviceId, jwtToken = _a.jwtToken, origins = _a.origins, threeDsChallengePreference = _a.threeDsChallengePreference, supportEmail = _a.supportEmail;
|
|
43
|
+
var walletPubkey = _a.walletPubkey, sessionKey = _a.sessionKey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, _c = _a.blockchain, blockchain = _c === void 0 ? 'solana' : _c, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, nearDeposit = _a.nearDeposit, chargebackProtectionData = _a.chargebackProtectionData, merchantCss = _a.merchantCss, color = _a.color, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, token = _a.token, tokens = _a.tokens, planCode = _a.planCode, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme, usePermit = _a.usePermit, transactionSigner = _a.transactionSigner, authOnly = _a.authOnly, deviceId = _a.deviceId, jwtToken = _a.jwtToken, origins = _a.origins, threeDsChallengePreference = _a.threeDsChallengePreference, supportEmail = _a.supportEmail, destinationAuthKey = _a.destinationAuthKey;
|
|
68
44
|
var prefix = routePrefix
|
|
69
45
|
? "/".concat(routePrefix, "/").concat(blockchain)
|
|
70
46
|
: "/".concat(blockchain);
|
|
@@ -158,6 +134,8 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
158
134
|
url.searchParams.append('origins', LZString.compressToEncodedURIComponent(JSON.stringify(origins)));
|
|
159
135
|
if (threeDsChallengePreference)
|
|
160
136
|
url.searchParams.append('threeDsChallengePreference', threeDsChallengePreference);
|
|
137
|
+
if (destinationAuthKey)
|
|
138
|
+
url.searchParams.append('destinationAuthKey', destinationAuthKey);
|
|
161
139
|
return url.toString();
|
|
162
140
|
};
|
|
163
141
|
CoinflowUtils.getTransaction = function (props) {
|
|
@@ -234,87 +212,6 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
234
212
|
throw new Error('blockchain not supported!');
|
|
235
213
|
}
|
|
236
214
|
};
|
|
237
|
-
CoinflowUtils.getWalletFromUserId = function (_a) {
|
|
238
|
-
return __awaiter(this, arguments, void 0, function (_b) {
|
|
239
|
-
var userId = _b.userId, merchantId = _b.merchantId, env = _b.env;
|
|
240
|
-
return __generator(this, function (_c) {
|
|
241
|
-
return [2 /*return*/, this.getWalletFromEmail({
|
|
242
|
-
email: userId,
|
|
243
|
-
merchantId: merchantId,
|
|
244
|
-
env: env,
|
|
245
|
-
})];
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
CoinflowUtils.getWalletFromEmail = function (_a) {
|
|
250
|
-
return __awaiter(this, arguments, void 0, function (_b) {
|
|
251
|
-
var buffer, crypto, hash, seed, keypair;
|
|
252
|
-
var _this = this;
|
|
253
|
-
var email = _b.email, merchantId = _b.merchantId, env = _b.env;
|
|
254
|
-
return __generator(this, function (_c) {
|
|
255
|
-
switch (_c.label) {
|
|
256
|
-
case 0:
|
|
257
|
-
buffer = new TextEncoder().encode(email);
|
|
258
|
-
crypto = window.crypto.subtle;
|
|
259
|
-
return [4 /*yield*/, crypto.digest('SHA-256', buffer)];
|
|
260
|
-
case 1:
|
|
261
|
-
hash = _c.sent();
|
|
262
|
-
seed = new Uint8Array(hash);
|
|
263
|
-
keypair = Keypair.fromSeed(seed);
|
|
264
|
-
return [2 /*return*/, {
|
|
265
|
-
publicKey: keypair.publicKey,
|
|
266
|
-
signMessage: function (message) {
|
|
267
|
-
return Promise.resolve(sign.detached(message, keypair.secretKey));
|
|
268
|
-
},
|
|
269
|
-
signTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
270
|
-
return __generator(this, function (_a) {
|
|
271
|
-
if (transaction instanceof Transaction) {
|
|
272
|
-
transaction.sign(keypair);
|
|
273
|
-
return [2 /*return*/, transaction];
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
transaction.sign([keypair]);
|
|
277
|
-
return [2 /*return*/, transaction];
|
|
278
|
-
}
|
|
279
|
-
return [2 /*return*/];
|
|
280
|
-
});
|
|
281
|
-
}); },
|
|
282
|
-
sendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
283
|
-
var coinflowBaseUrl, options, signature;
|
|
284
|
-
return __generator(this, function (_a) {
|
|
285
|
-
switch (_a.label) {
|
|
286
|
-
case 0:
|
|
287
|
-
if (transaction instanceof Transaction) {
|
|
288
|
-
transaction.sign(keypair);
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
transaction.sign([keypair]);
|
|
292
|
-
}
|
|
293
|
-
coinflowBaseUrl = this.getCoinflowApiUrl(env);
|
|
294
|
-
options = {
|
|
295
|
-
method: 'POST',
|
|
296
|
-
headers: {
|
|
297
|
-
'content-type': 'application/json',
|
|
298
|
-
'x-coinflow-auth-wallet': keypair.publicKey.toString(),
|
|
299
|
-
'x-coinflow-auth-blockchain': 'solana',
|
|
300
|
-
},
|
|
301
|
-
body: JSON.stringify({
|
|
302
|
-
merchantId: merchantId,
|
|
303
|
-
signedTransaction: base58 === null || base58 === void 0 ? void 0 : base58.encode(transaction.serialize()),
|
|
304
|
-
}),
|
|
305
|
-
};
|
|
306
|
-
return [4 /*yield*/, fetch(coinflowBaseUrl + '/api/utils/send-coinflow-tx', options).then(function (res) { return res.json(); })];
|
|
307
|
-
case 1:
|
|
308
|
-
signature = (_a.sent()).signature;
|
|
309
|
-
return [2 /*return*/, signature];
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}); },
|
|
313
|
-
}];
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
};
|
|
318
215
|
return CoinflowUtils;
|
|
319
216
|
}());
|
|
320
217
|
export { CoinflowUtils };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../../src/common/CoinflowUtils.ts"],"names":[],"mappings":";AAOA,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,WAAW,EAAuB,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;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,I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