@coinflowlabs/react-native 3.1.6 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/build/common/CoinflowLibMessageHandlers.js +1 -0
- package/build/common/CoinflowLibMessageHandlers.js.map +1 -1
- package/build/common/CoinflowTypes.d.ts +26 -7
- package/build/common/CoinflowTypes.js +6 -0
- package/build/common/CoinflowTypes.js.map +1 -1
- package/build/common/CoinflowUtils.d.ts +13 -2
- package/build/common/CoinflowUtils.js +94 -1
- package/build/common/CoinflowUtils.js.map +1 -1
- package/build/common/card-form/TokenEx.d.ts +154 -0
- package/build/common/card-form/TokenEx.js +12 -0
- package/build/common/card-form/TokenEx.js.map +1 -0
- package/build/common/card-form/tokenexHelpers.d.ts +28 -0
- package/build/common/card-form/tokenexHelpers.js +210 -0
- package/build/common/card-form/tokenexHelpers.js.map +1 -0
- package/build/common/index.d.ts +2 -0
- package/build/common/index.js +2 -0
- package/build/common/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ export function getHandlers(props) {
|
|
|
64
64
|
eth: function () { return getEvmWalletHandlers(props); },
|
|
65
65
|
polygon: function () { return getEvmWalletHandlers(props); },
|
|
66
66
|
base: function () { return getEvmWalletHandlers(props); },
|
|
67
|
+
arbitrum: function () { return getEvmWalletHandlers(props); },
|
|
67
68
|
})();
|
|
68
69
|
}
|
|
69
70
|
function getSolanaWalletHandlers(_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";AAOA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAoB9C,IAAK,oBAMJ;AAND,WAAK,oBAAoB;IACvB,mDAA2B,C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,SAAS,eAAA;IAKT,IAAM,SAAS,GAAG,MAAmB,CAAC;IACtC,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,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC,EAAA;;wBAA3C,IAAI,GAAI,CAAA,SAAmC,CAAA,KAAvC;wBACX,sBAAO,IAAI,EAAC;;;aACb;QACD,iBAAiB,EAAE,UAAO,OAAe;;gBACvC,sBAAO,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,EAAC;;aACvC;QACD,SAAS,WAAA;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -34,7 +34,7 @@ export interface CustomerInfo {
|
|
|
34
34
|
lng?: string;
|
|
35
35
|
}
|
|
36
36
|
/** Coinflow Types **/
|
|
37
|
-
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';
|
|
37
|
+
export type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base' | 'arbitrum';
|
|
38
38
|
export type CoinflowEnvs = 'prod' | 'staging' | 'staging-live' | 'sandbox' | 'local';
|
|
39
39
|
export interface CoinflowTypes {
|
|
40
40
|
merchantId: string;
|
|
@@ -113,7 +113,10 @@ export interface CoinflowPolygonHistoryProps extends CoinflowEvmHistoryProps {
|
|
|
113
113
|
export interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {
|
|
114
114
|
blockchain: 'base';
|
|
115
115
|
}
|
|
116
|
-
export
|
|
116
|
+
export interface CoinflowArbitrumHistoryProps extends CoinflowEvmHistoryProps {
|
|
117
|
+
blockchain: 'arbitrum';
|
|
118
|
+
}
|
|
119
|
+
export type CoinflowHistoryProps = CoinflowSolanaHistoryProps | CoinflowNearHistoryProps | CoinflowPolygonHistoryProps | CoinflowEthHistoryProps | CoinflowBaseHistoryProps | CoinflowArbitrumHistoryProps;
|
|
117
120
|
/** Transactions **/
|
|
118
121
|
export type NearFtTransferCallAction = {
|
|
119
122
|
methodName: 'ft_transfer_call';
|
|
@@ -147,6 +150,11 @@ export interface ChargebackProtectionItem {
|
|
|
147
150
|
*/
|
|
148
151
|
rawProductData?: RawProductData;
|
|
149
152
|
}
|
|
153
|
+
export declare enum ThreeDsChallengePreference {
|
|
154
|
+
NoPreference = "NoPreference",
|
|
155
|
+
Frictionless = "Frictionless",
|
|
156
|
+
Challenge = "Challenge"
|
|
157
|
+
}
|
|
150
158
|
export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
151
159
|
amount?: number | string;
|
|
152
160
|
onSuccess?: OnSuccessMethod;
|
|
@@ -170,6 +178,7 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
170
178
|
* The origin array would then be: [https://foo.com,https://bar.com]
|
|
171
179
|
*/
|
|
172
180
|
origins?: string[];
|
|
181
|
+
threeDsChallengePreference?: ThreeDsChallengePreference;
|
|
173
182
|
}
|
|
174
183
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
175
184
|
wallet: SolanaWallet;
|
|
@@ -206,7 +215,10 @@ export interface CoinflowEthPurchaseProps extends CoinflowEvmPurchaseProps {
|
|
|
206
215
|
export interface CoinflowBasePurchaseProps extends CoinflowEvmPurchaseProps {
|
|
207
216
|
blockchain: 'base';
|
|
208
217
|
}
|
|
209
|
-
export
|
|
218
|
+
export interface CoinflowArbitrumPurchaseProps extends CoinflowEvmPurchaseProps {
|
|
219
|
+
blockchain: 'arbitrum';
|
|
220
|
+
}
|
|
221
|
+
export type CoinflowPurchaseProps = CoinflowSolanaPurchaseProps | CoinflowNearPurchaseProps | CoinflowPolygonPurchaseProps | CoinflowEthPurchaseProps | CoinflowBasePurchaseProps | CoinflowArbitrumPurchaseProps;
|
|
210
222
|
/** Withdraw **/
|
|
211
223
|
export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
212
224
|
onSuccess?: OnSuccessMethod;
|
|
@@ -217,7 +229,7 @@ export interface CoinflowCommonWithdrawProps extends CoinflowTypes {
|
|
|
217
229
|
bankAccountLinkRedirect?: string;
|
|
218
230
|
additionalWallets?: {
|
|
219
231
|
wallet: string;
|
|
220
|
-
blockchain: 'solana' | 'eth' | 'near' | 'polygon';
|
|
232
|
+
blockchain: 'solana' | 'eth' | 'near' | 'polygon' | 'base' | 'arbitrum';
|
|
221
233
|
}[];
|
|
222
234
|
lockAmount?: boolean;
|
|
223
235
|
transactionSigner?: string;
|
|
@@ -254,7 +266,10 @@ export interface CoinflowPolygonWithdrawProps extends CoinflowEvmWithdrawProps {
|
|
|
254
266
|
export interface CoinflowBaseWithdrawProps extends CoinflowEvmWithdrawProps {
|
|
255
267
|
blockchain: 'base';
|
|
256
268
|
}
|
|
257
|
-
export
|
|
269
|
+
export interface CoinflowArbitrumWithdrawProps extends CoinflowEvmWithdrawProps {
|
|
270
|
+
blockchain: 'arbitrum';
|
|
271
|
+
}
|
|
272
|
+
export type CoinflowWithdrawProps = CoinflowSolanaWithdrawProps | CoinflowNearWithdrawProps | CoinflowEthWithdrawProps | CoinflowPolygonWithdrawProps | CoinflowBaseWithdrawProps | CoinflowArbitrumWithdrawProps;
|
|
258
273
|
export interface CommonEvmRedeem {
|
|
259
274
|
waitForHash?: boolean;
|
|
260
275
|
}
|
|
@@ -287,8 +302,12 @@ export interface ReservoirRedeem extends CommonEvmRedeem {
|
|
|
287
302
|
items: ReservoirItems;
|
|
288
303
|
taker?: string;
|
|
289
304
|
}
|
|
290
|
-
export
|
|
291
|
-
|
|
305
|
+
export interface TokenRedeem extends CommonEvmRedeem {
|
|
306
|
+
type: 'token';
|
|
307
|
+
destination: string;
|
|
308
|
+
}
|
|
309
|
+
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem;
|
|
310
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
292
311
|
walletPubkey: string | null | undefined;
|
|
293
312
|
route: string;
|
|
294
313
|
routePrefix?: string;
|
|
@@ -10,6 +10,12 @@ export var MerchantStyle;
|
|
|
10
10
|
MerchantStyle["Sharp"] = "sharp";
|
|
11
11
|
MerchantStyle["Pill"] = "pill";
|
|
12
12
|
})(MerchantStyle || (MerchantStyle = {}));
|
|
13
|
+
export var ThreeDsChallengePreference;
|
|
14
|
+
(function (ThreeDsChallengePreference) {
|
|
15
|
+
ThreeDsChallengePreference["NoPreference"] = "NoPreference";
|
|
16
|
+
ThreeDsChallengePreference["Frictionless"] = "Frictionless";
|
|
17
|
+
ThreeDsChallengePreference["Challenge"] = "Challenge";
|
|
18
|
+
})(ThreeDsChallengePreference || (ThreeDsChallengePreference = {}));
|
|
13
19
|
export var CardType;
|
|
14
20
|
(function (CardType) {
|
|
15
21
|
CardType["VISA"] = "VISA";
|
|
@@ -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;AAuND,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,2DAA6B,CAAA;IAC7B,qDAAuB,CAAA;AACzB,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AA8OD,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,4 +1,4 @@
|
|
|
1
|
-
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps } from './CoinflowTypes';
|
|
1
|
+
import { CoinflowBlockchain, CoinflowEnvs, CoinflowIFrameProps, CoinflowPurchaseProps, SolanaWallet } from './CoinflowTypes';
|
|
2
2
|
export declare class CoinflowUtils {
|
|
3
3
|
env: CoinflowEnvs;
|
|
4
4
|
url: string;
|
|
@@ -9,7 +9,7 @@ export declare class CoinflowUtils {
|
|
|
9
9
|
}>;
|
|
10
10
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
11
11
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
12
|
-
static getCoinflowUrl({ walletPubkey, 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, }: CoinflowIFrameProps): string;
|
|
12
|
+
static getCoinflowUrl({ walletPubkey, 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, }: CoinflowIFrameProps): string;
|
|
13
13
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
14
14
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
15
15
|
solana: T;
|
|
@@ -17,5 +17,16 @@ export declare class CoinflowUtils {
|
|
|
17
17
|
eth: T;
|
|
18
18
|
polygon: T;
|
|
19
19
|
base: T;
|
|
20
|
+
arbitrum: T;
|
|
20
21
|
}): T;
|
|
22
|
+
static getWalletFromUserId({ userId, merchantId, env, }: {
|
|
23
|
+
userId: string;
|
|
24
|
+
merchantId: string;
|
|
25
|
+
env: CoinflowEnvs;
|
|
26
|
+
}): Promise<SolanaWallet>;
|
|
27
|
+
static getWalletFromEmail({ email, merchantId, env, }: {
|
|
28
|
+
email: string;
|
|
29
|
+
merchantId: string;
|
|
30
|
+
env: CoinflowEnvs;
|
|
31
|
+
}): Promise<SolanaWallet>;
|
|
21
32
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
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';
|
|
4
6
|
var CoinflowUtils = /** @class */ (function () {
|
|
5
7
|
function CoinflowUtils(env) {
|
|
6
8
|
this.env = env !== null && env !== void 0 ? env : 'prod';
|
|
@@ -62,7 +64,7 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
62
64
|
};
|
|
63
65
|
CoinflowUtils.getCoinflowUrl = function (_a) {
|
|
64
66
|
var _b;
|
|
65
|
-
var walletPubkey = _a.walletPubkey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, 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;
|
|
67
|
+
var walletPubkey = _a.walletPubkey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, 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;
|
|
66
68
|
var prefix = routePrefix
|
|
67
69
|
? "/".concat(routePrefix, "/").concat(blockchain)
|
|
68
70
|
: "/".concat(blockchain);
|
|
@@ -149,6 +151,8 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
149
151
|
url.searchParams.append('jwtToken', jwtToken);
|
|
150
152
|
if (origins)
|
|
151
153
|
url.searchParams.append('origins', LZString.compressToEncodedURIComponent(JSON.stringify(origins)));
|
|
154
|
+
if (threeDsChallengePreference)
|
|
155
|
+
url.searchParams.append('threeDsChallengePreference', threeDsChallengePreference);
|
|
152
156
|
return url.toString();
|
|
153
157
|
};
|
|
154
158
|
CoinflowUtils.getTransaction = function (props) {
|
|
@@ -186,6 +190,12 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
186
190
|
var transaction = props.transaction;
|
|
187
191
|
return LZString.compressToEncodedURIComponent(JSON.stringify(transaction));
|
|
188
192
|
},
|
|
193
|
+
arbitrum: function () {
|
|
194
|
+
if (!('transaction' in props))
|
|
195
|
+
return undefined;
|
|
196
|
+
var transaction = props.transaction;
|
|
197
|
+
return LZString.compressToEncodedURIComponent(JSON.stringify(transaction));
|
|
198
|
+
},
|
|
189
199
|
near: function () {
|
|
190
200
|
if (!('action' in props))
|
|
191
201
|
return undefined;
|
|
@@ -206,10 +216,93 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
206
216
|
return args.eth;
|
|
207
217
|
case 'base':
|
|
208
218
|
return args.base;
|
|
219
|
+
case 'arbitrum':
|
|
220
|
+
return args.arbitrum;
|
|
209
221
|
default:
|
|
210
222
|
throw new Error('blockchain not supported!');
|
|
211
223
|
}
|
|
212
224
|
};
|
|
225
|
+
CoinflowUtils.getWalletFromUserId = function (_a) {
|
|
226
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
227
|
+
var userId = _b.userId, merchantId = _b.merchantId, env = _b.env;
|
|
228
|
+
return __generator(this, function (_c) {
|
|
229
|
+
return [2 /*return*/, this.getWalletFromEmail({
|
|
230
|
+
email: userId,
|
|
231
|
+
merchantId: merchantId,
|
|
232
|
+
env: env,
|
|
233
|
+
})];
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
CoinflowUtils.getWalletFromEmail = function (_a) {
|
|
238
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
239
|
+
var buffer, crypto, hash, seed, keypair;
|
|
240
|
+
var _this = this;
|
|
241
|
+
var email = _b.email, merchantId = _b.merchantId, env = _b.env;
|
|
242
|
+
return __generator(this, function (_c) {
|
|
243
|
+
switch (_c.label) {
|
|
244
|
+
case 0:
|
|
245
|
+
buffer = new TextEncoder().encode(email);
|
|
246
|
+
crypto = window.crypto.subtle;
|
|
247
|
+
return [4 /*yield*/, crypto.digest('SHA-256', buffer)];
|
|
248
|
+
case 1:
|
|
249
|
+
hash = _c.sent();
|
|
250
|
+
seed = new Uint8Array(hash);
|
|
251
|
+
keypair = Keypair.fromSeed(seed);
|
|
252
|
+
return [2 /*return*/, {
|
|
253
|
+
publicKey: keypair.publicKey,
|
|
254
|
+
signMessage: function (message) {
|
|
255
|
+
return Promise.resolve(sign.detached(message, keypair.secretKey));
|
|
256
|
+
},
|
|
257
|
+
signTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
258
|
+
return __generator(this, function (_a) {
|
|
259
|
+
if (transaction instanceof Transaction) {
|
|
260
|
+
transaction.sign(keypair);
|
|
261
|
+
return [2 /*return*/, transaction];
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
transaction.sign([keypair]);
|
|
265
|
+
return [2 /*return*/, transaction];
|
|
266
|
+
}
|
|
267
|
+
return [2 /*return*/];
|
|
268
|
+
});
|
|
269
|
+
}); },
|
|
270
|
+
sendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
271
|
+
var coinflowBaseUrl, options, signature;
|
|
272
|
+
return __generator(this, function (_a) {
|
|
273
|
+
switch (_a.label) {
|
|
274
|
+
case 0:
|
|
275
|
+
if (transaction instanceof Transaction) {
|
|
276
|
+
transaction.sign(keypair);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
transaction.sign([keypair]);
|
|
280
|
+
}
|
|
281
|
+
coinflowBaseUrl = this.getCoinflowApiUrl(env);
|
|
282
|
+
options = {
|
|
283
|
+
method: 'POST',
|
|
284
|
+
headers: {
|
|
285
|
+
'content-type': 'application/json',
|
|
286
|
+
'x-coinflow-auth-wallet': keypair.publicKey.toString(),
|
|
287
|
+
'x-coinflow-auth-blockchain': 'solana',
|
|
288
|
+
},
|
|
289
|
+
body: JSON.stringify({
|
|
290
|
+
merchantId: merchantId,
|
|
291
|
+
signedTransaction: base58 === null || base58 === void 0 ? void 0 : base58.encode(transaction.serialize()),
|
|
292
|
+
}),
|
|
293
|
+
};
|
|
294
|
+
return [4 /*yield*/, fetch(coinflowBaseUrl + '/api/utils/send-coinflow-tx', options).then(function (res) { return res.json(); })];
|
|
295
|
+
case 1:
|
|
296
|
+
signature = (_a.sent()).signature;
|
|
297
|
+
return [2 /*return*/, signature];
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}); },
|
|
301
|
+
}];
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
};
|
|
213
306
|
return CoinflowUtils;
|
|
214
307
|
}());
|
|
215
308
|
export { CoinflowUtils };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowUtils.js","sourceRoot":"","sources":["../../src/common/CoinflowUtils.ts"],"names":[],"mappings":";
|
|
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,IAAI,CAAC,GAAG,GAAG,uBAAuB,CAAC;;YAC7D,IAAI,CAAC,GAAG,GAAG,sBAAe,IAAI,CAAC,GAAG,mBAAgB,CAAC;IAC1D,CAAC;IAEK,yCAAiB,GAAvB,UAAwB,UAAkB;;;gBACxC,sBAAO,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,yBAAkB,UAAU,CAAE,CAAC;yBACpD,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,EAAE,EAAf,CAAe,CAAC;yBACjC,IAAI,CACH,UAAC,IAGA,YAAK,OAAA,CAAA,MAAA,IAAI,CAAC,aAAa,0CAAE,cAAc,KAAI,IAAI,CAAC,cAAc,CAAA,EAAA,CAChE;yBACA,KAAK,CAAC,UAAA,CAAC;wBACN,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBACjB,OAAO,SAAS,CAAC;oBACnB,CAAC,C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AAQ,EAAE;wDACtD,4BAA4B,EAAE,QAAQ;qDACvC;oDACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wDACnB,UAAU,YAAA;wDACV,iBAAiB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;qDAC3D,CAAC;iDACH,CAAC;gDAEkB,qBAAM,KAAK,CAC7B,eAAe,GAAG,6BAA6B,EAC/C,OAAO,CACR,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC,EAAA;;gDAHlB,SAAS,GAAI,CAAA,SAGK,CAAA,UAHT;gDAIhB,sBAAO,SAAS,EAAC;;;qCAClB;6BACF,EAAC;;;;KACH;IACH,oBAAC;AAAD,CAAC,AAtXD,IAsXC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { CardType, CoinflowEnvs } from '../CoinflowTypes';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
export declare const TokenExCardNumberIframeId = "tokenExCardNumber";
|
|
4
|
+
export declare const TokenExCvvContainerID = "tokenExCardCvv";
|
|
5
|
+
export interface TokenExIframe extends ReturnType<typeof TokenEx.Iframe> {
|
|
6
|
+
tokenize: () => Promise<TokenizationResponse>;
|
|
7
|
+
}
|
|
8
|
+
export declare const CARD_TYPE_MAPPING: Record<CardType, string>;
|
|
9
|
+
export interface TokenExIFrameConfiguration {
|
|
10
|
+
origin: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
tokenExID: string;
|
|
13
|
+
tokenScheme: string;
|
|
14
|
+
authenticationKey: string;
|
|
15
|
+
pci: true;
|
|
16
|
+
token?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CardFormInputStyles {
|
|
19
|
+
base: CSSProperties | string;
|
|
20
|
+
placeholder?: CSSProperties | string;
|
|
21
|
+
focus?: CSSProperties | string;
|
|
22
|
+
error?: CSSProperties | string;
|
|
23
|
+
}
|
|
24
|
+
export type CoinflowCardTokenResponse = {
|
|
25
|
+
token: string;
|
|
26
|
+
};
|
|
27
|
+
export interface CoinflowCardNumberInputProps {
|
|
28
|
+
env: CoinflowEnvs;
|
|
29
|
+
css: CardFormInputStyles & {
|
|
30
|
+
cvv: CardFormInputStyles;
|
|
31
|
+
};
|
|
32
|
+
debug?: boolean;
|
|
33
|
+
origins?: string[];
|
|
34
|
+
font?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CoinflowCvvOnlyInputProps {
|
|
37
|
+
token: string;
|
|
38
|
+
cardType: CardType;
|
|
39
|
+
env: CoinflowEnvs;
|
|
40
|
+
css: CardFormInputStyles & {
|
|
41
|
+
cvv: CardFormInputStyles;
|
|
42
|
+
};
|
|
43
|
+
debug?: boolean;
|
|
44
|
+
origins?: string[];
|
|
45
|
+
font?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface TokenizationResponse {
|
|
48
|
+
cardType: string;
|
|
49
|
+
cvvIncluded: true;
|
|
50
|
+
firstSix: string;
|
|
51
|
+
lastFour: string;
|
|
52
|
+
referenceNumber: string;
|
|
53
|
+
token: string;
|
|
54
|
+
tokenHMAC: string;
|
|
55
|
+
}
|
|
56
|
+
declare global {
|
|
57
|
+
namespace TokenEx {
|
|
58
|
+
interface FraudServicesConfig {
|
|
59
|
+
useKount?: boolean;
|
|
60
|
+
kount?: {
|
|
61
|
+
merchantId?: string;
|
|
62
|
+
mode?: string;
|
|
63
|
+
anId?: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
interface Config {
|
|
67
|
+
debug?: boolean;
|
|
68
|
+
enablePrettyFormat?: boolean;
|
|
69
|
+
maskInput?: boolean;
|
|
70
|
+
enableValidateOnBlur?: boolean;
|
|
71
|
+
enableAriaRequired?: boolean;
|
|
72
|
+
pci?: boolean;
|
|
73
|
+
cvvOnly?: boolean;
|
|
74
|
+
allowUnknownCardTypes?: boolean;
|
|
75
|
+
enableAutoComplete?: boolean;
|
|
76
|
+
returnAutoCompleteValues?: boolean;
|
|
77
|
+
returnKhash?: boolean;
|
|
78
|
+
returnWhash?: boolean;
|
|
79
|
+
enforceLuhnCompliance?: boolean;
|
|
80
|
+
use3DS?: boolean;
|
|
81
|
+
enableValidateOnKeyUp?: boolean;
|
|
82
|
+
enableValidateOnCvvKeyUp?: boolean;
|
|
83
|
+
expiresInSeconds?: number;
|
|
84
|
+
useExtendedBIN?: boolean;
|
|
85
|
+
inlineIframeJavaScript?: boolean;
|
|
86
|
+
iframeVersion?: number;
|
|
87
|
+
authenticationKey?: string;
|
|
88
|
+
origin?: string;
|
|
89
|
+
tokenExID?: string;
|
|
90
|
+
timestamp?: string;
|
|
91
|
+
tokenScheme?: string;
|
|
92
|
+
token?: string;
|
|
93
|
+
customDataLabel?: string;
|
|
94
|
+
customCvvDataLabel?: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
cvvTitle?: string;
|
|
97
|
+
inputTitle?: string;
|
|
98
|
+
cvvInputTitle?: string;
|
|
99
|
+
cardMaxLengths?: {
|
|
100
|
+
visa?: number;
|
|
101
|
+
mastercard?: number;
|
|
102
|
+
americanExpress?: number;
|
|
103
|
+
discover?: number;
|
|
104
|
+
jcb?: number;
|
|
105
|
+
diners?: number;
|
|
106
|
+
};
|
|
107
|
+
fraudServices?: FraudServicesConfig;
|
|
108
|
+
threeDSMethodNotificationUrl?: string;
|
|
109
|
+
customDataTypes?: string | object;
|
|
110
|
+
cvvContainerID?: string;
|
|
111
|
+
cvvPlaceholder?: string;
|
|
112
|
+
cardType?: string;
|
|
113
|
+
forterSiteId?: string;
|
|
114
|
+
forterUsername?: string;
|
|
115
|
+
customRegEx?: string;
|
|
116
|
+
placeholder?: string;
|
|
117
|
+
inputType?: string;
|
|
118
|
+
inputMode?: string;
|
|
119
|
+
font?: string;
|
|
120
|
+
cvv?: boolean;
|
|
121
|
+
styles: {
|
|
122
|
+
base: string;
|
|
123
|
+
focus: string;
|
|
124
|
+
error: string;
|
|
125
|
+
placeholder: string;
|
|
126
|
+
cvv: {
|
|
127
|
+
base: string;
|
|
128
|
+
focus: string;
|
|
129
|
+
placeholder: string;
|
|
130
|
+
error: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
interface IframeAPI {
|
|
135
|
+
load(): void;
|
|
136
|
+
on: (event: string, callback: (data?: any) => void) => void;
|
|
137
|
+
tokenize(): void;
|
|
138
|
+
validate(): void;
|
|
139
|
+
reset(): void;
|
|
140
|
+
blur(): void;
|
|
141
|
+
cvvBlur(): void;
|
|
142
|
+
focus(): void;
|
|
143
|
+
cvvFocus(): void;
|
|
144
|
+
remove(): void;
|
|
145
|
+
toggleMask(): void;
|
|
146
|
+
toggleCvvMask(): void;
|
|
147
|
+
setPAN(pan: string): void;
|
|
148
|
+
binLookup(): void;
|
|
149
|
+
validateConfig(): void;
|
|
150
|
+
setFraudServicesRequestDetails(data: string): void;
|
|
151
|
+
}
|
|
152
|
+
function Iframe(containerID: string, configuration: Config): IframeAPI;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Type definitions for TokenEx iframe integration
|
|
2
|
+
var _a;
|
|
3
|
+
import { CardType } from '../CoinflowTypes';
|
|
4
|
+
export var TokenExCardNumberIframeId = 'tokenExCardNumber';
|
|
5
|
+
export var TokenExCvvContainerID = 'tokenExCardCvv';
|
|
6
|
+
export var CARD_TYPE_MAPPING = (_a = {},
|
|
7
|
+
_a[CardType.VISA] = 'visa',
|
|
8
|
+
_a[CardType.MASTERCARD] = 'masterCard',
|
|
9
|
+
_a[CardType.AMEX] = 'americanExpress',
|
|
10
|
+
_a[CardType.DISCOVER] = 'discover',
|
|
11
|
+
_a);
|
|
12
|
+
//# sourceMappingURL=TokenEx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenEx.js","sourceRoot":"","sources":["../../../src/common/card-form/TokenEx.ts"],"names":[],"mappings":"AAAA,kDAAkD;;AAElD,OAAO,EAAC,QAAQ,EAAe,MAAM,kBAAkB,CAAC;AAGxD,MAAM,CAAC,IAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAC7D,MAAM,CAAC,IAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAKtD,MAAM,CAAC,IAAM,iBAAiB;IAC5B,GAAC,QAAQ,CAAC,IAAI,IAAG,MAAM;IACvB,GAAC,QAAQ,CAAC,UAAU,IAAG,YAAY;IACnC,GAAC,QAAQ,CAAC,IAAI,IAAG,iBAAiB;IAClC,GAAC,QAAQ,CAAC,QAAQ,IAAG,UAAU;OAChC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TokenExIframe, TokenExIFrameConfiguration } from './TokenEx';
|
|
2
|
+
import { CardType, CoinflowEnvs } from '../CoinflowTypes';
|
|
3
|
+
export interface DoInitializeTokenExIframeArgs {
|
|
4
|
+
css: string;
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
font?: string;
|
|
7
|
+
origins: string[] | undefined;
|
|
8
|
+
tokenExScriptLoaded: boolean;
|
|
9
|
+
env: CoinflowEnvs;
|
|
10
|
+
setCachedToken: (s: string | undefined) => void;
|
|
11
|
+
setLoaded: (b: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface DoInitializeCvvOnlyTokenExIframeArgs extends DoInitializeTokenExIframeArgs {
|
|
14
|
+
token: string;
|
|
15
|
+
cardType: CardType;
|
|
16
|
+
}
|
|
17
|
+
export declare function getIframeConfig({ token, origins, env, }: {
|
|
18
|
+
token?: string;
|
|
19
|
+
origins: string[] | undefined;
|
|
20
|
+
env: CoinflowEnvs;
|
|
21
|
+
}): Promise<TokenExIFrameConfiguration>;
|
|
22
|
+
export declare function setTokenExScriptTag({ env, setTokenExScriptLoaded, }: {
|
|
23
|
+
env: CoinflowEnvs;
|
|
24
|
+
setTokenExScriptLoaded: (b: boolean) => void;
|
|
25
|
+
}): void;
|
|
26
|
+
export declare function doInitializeCvvOnlyTokenExIframe(args: DoInitializeCvvOnlyTokenExIframeArgs): Promise<TokenExIframe | undefined>;
|
|
27
|
+
export declare function doInitializeTokenExIframe(args: DoInitializeTokenExIframeArgs): Promise<TokenExIframe | undefined>;
|
|
28
|
+
export declare function doInitializeTokenExCardOnlyIframe(args: DoInitializeTokenExIframeArgs): Promise<TokenExIframe | undefined>;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator, __spreadArray } from "tslib";
|
|
2
|
+
import { TokenExCvvContainerID, CARD_TYPE_MAPPING, TokenExCardNumberIframeId, } from './TokenEx';
|
|
3
|
+
import { CoinflowUtils } from '../CoinflowUtils';
|
|
4
|
+
export function getIframeConfig(_a) {
|
|
5
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
6
|
+
var _this = this;
|
|
7
|
+
var token = _b.token, origins = _b.origins, env = _b.env;
|
|
8
|
+
return __generator(this, function (_c) {
|
|
9
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
10
|
+
fetch(new CoinflowUtils(env).url + '/api/checkout/authentication-key', {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
headers: {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
origins: __spreadArray(__spreadArray([], (origins !== null && origins !== void 0 ? origins : []), true), [window.location.origin], false),
|
|
17
|
+
token: token,
|
|
18
|
+
}),
|
|
19
|
+
})
|
|
20
|
+
.then(function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
21
|
+
var _a;
|
|
22
|
+
return __generator(this, function (_b) {
|
|
23
|
+
switch (_b.label) {
|
|
24
|
+
case 0:
|
|
25
|
+
_a = resolve;
|
|
26
|
+
return [4 /*yield*/, res.json()];
|
|
27
|
+
case 1:
|
|
28
|
+
_a.apply(void 0, [(_b.sent())]);
|
|
29
|
+
return [2 /*return*/];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}); })
|
|
33
|
+
.catch(function (e) { return reject(e); });
|
|
34
|
+
})];
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function setTokenExScriptTag(_a) {
|
|
39
|
+
var env = _a.env, setTokenExScriptLoaded = _a.setTokenExScriptLoaded;
|
|
40
|
+
var scriptTagId = 'tokenex-script';
|
|
41
|
+
if (document.head.querySelector("#".concat(scriptTagId)))
|
|
42
|
+
return;
|
|
43
|
+
var sdkScriptTag = document.createElement('script');
|
|
44
|
+
sdkScriptTag.src =
|
|
45
|
+
env === 'prod'
|
|
46
|
+
? 'https://htp.tokenex.com/iframe/iframe-v3.min.js'
|
|
47
|
+
: 'https://test-htp.tokenex.com/iframe/iframe-v3.min.js';
|
|
48
|
+
sdkScriptTag.id = scriptTagId;
|
|
49
|
+
document.head.appendChild(sdkScriptTag);
|
|
50
|
+
document.getElementById(scriptTagId).addEventListener('load', function () {
|
|
51
|
+
console.log('Setting tokenExScriptLoaded to true!');
|
|
52
|
+
setTokenExScriptLoaded(true);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function loadIframe(_a) {
|
|
56
|
+
var _this = this;
|
|
57
|
+
var iframe = _a.iframe, setCachedToken = _a.setCachedToken, setLoaded = _a.setLoaded;
|
|
58
|
+
var tokenize = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
switch (_a.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
iframe.tokenize();
|
|
63
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
64
|
+
iframe.on('tokenize', function (data) {
|
|
65
|
+
setCachedToken(data.token);
|
|
66
|
+
resolve(data);
|
|
67
|
+
});
|
|
68
|
+
iframe.on('validate', function (data) {
|
|
69
|
+
// noinspection PointlessBooleanExpressionJS
|
|
70
|
+
var isInvalid = !data.isValid || data.isCvvValid === false;
|
|
71
|
+
if (isInvalid)
|
|
72
|
+
reject(data);
|
|
73
|
+
});
|
|
74
|
+
})];
|
|
75
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}); };
|
|
79
|
+
iframe.on('change', function () { return setCachedToken(undefined); });
|
|
80
|
+
iframe.on('cvvChange', function () { return setCachedToken(undefined); });
|
|
81
|
+
iframe.on('load', function () {
|
|
82
|
+
setTimeout(function () { return setLoaded(true); }, 350);
|
|
83
|
+
var el = document.querySelector('#tx_iframe_tokenExCardNumber');
|
|
84
|
+
if (el) {
|
|
85
|
+
// noinspection JSDeprecatedSymbols
|
|
86
|
+
el.scrolling = 'no';
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
iframe.on('focus', function () {
|
|
90
|
+
iframe.focus();
|
|
91
|
+
});
|
|
92
|
+
iframe.on('cvvFocus', function () {
|
|
93
|
+
iframe.cvvFocus();
|
|
94
|
+
});
|
|
95
|
+
setLoaded(false);
|
|
96
|
+
iframe.load();
|
|
97
|
+
return __assign(__assign({}, iframe), { tokenize: tokenize });
|
|
98
|
+
}
|
|
99
|
+
export function doInitializeCvvOnlyTokenExIframe(args) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
+
var token, cardType;
|
|
102
|
+
return __generator(this, function (_a) {
|
|
103
|
+
switch (_a.label) {
|
|
104
|
+
case 0:
|
|
105
|
+
token = args.token, cardType = args.cardType;
|
|
106
|
+
return [4 /*yield*/, doInitialize(TokenExCvvContainerID, args, {
|
|
107
|
+
cvvOnly: true,
|
|
108
|
+
cvv: true,
|
|
109
|
+
cvvContainerID: TokenExCvvContainerID,
|
|
110
|
+
placeholder: 'CVV',
|
|
111
|
+
token: token,
|
|
112
|
+
cardType: CARD_TYPE_MAPPING[cardType],
|
|
113
|
+
})];
|
|
114
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
export function doInitializeTokenExIframe(args) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0: return [4 /*yield*/, doInitialize(TokenExCardNumberIframeId, args, {
|
|
124
|
+
cvv: true,
|
|
125
|
+
cvvContainerID: TokenExCvvContainerID,
|
|
126
|
+
cvvPlaceholder: 'CVV',
|
|
127
|
+
})];
|
|
128
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
export function doInitializeTokenExCardOnlyIframe(args) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0: return [4 /*yield*/, doInitialize(TokenExCardNumberIframeId, args, { cvv: false })];
|
|
138
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function doInitialize(id_1, _a, configOverrides_1) {
|
|
144
|
+
return __awaiter(this, arguments, void 0, function (id, _b, configOverrides) {
|
|
145
|
+
var iframeConfig, styles, config, iframe;
|
|
146
|
+
var tokenExScriptLoaded = _b.tokenExScriptLoaded, origins = _b.origins, env = _b.env, css = _b.css, debug = _b.debug, font = _b.font, setCachedToken = _b.setCachedToken, setLoaded = _b.setLoaded;
|
|
147
|
+
return __generator(this, function (_c) {
|
|
148
|
+
switch (_c.label) {
|
|
149
|
+
case 0:
|
|
150
|
+
if (!tokenExScriptLoaded && typeof TokenEx === 'undefined') {
|
|
151
|
+
console.warn('Warning Unable to load TokenEx on first attempt waiting for load event from document.head.script#tokenex-script');
|
|
152
|
+
return [2 /*return*/];
|
|
153
|
+
}
|
|
154
|
+
return [4 /*yield*/, getIframeConfig({
|
|
155
|
+
token: configOverrides.token,
|
|
156
|
+
origins: origins,
|
|
157
|
+
env: env,
|
|
158
|
+
})];
|
|
159
|
+
case 1:
|
|
160
|
+
iframeConfig = _c.sent();
|
|
161
|
+
styles = getStyles(css).styles;
|
|
162
|
+
config = __assign(__assign(__assign({}, iframeConfig), { placeholder: '0000 0000 0000 0000', enablePrettyFormat: true, styles: styles, font: font, debug: debug !== null && debug !== void 0 ? debug : false }), configOverrides);
|
|
163
|
+
iframe = TokenEx.Iframe(id, config);
|
|
164
|
+
return [2 /*return*/, loadIframe({ iframe: iframe, setCachedToken: setCachedToken, setLoaded: setLoaded })];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function getStyles(s) {
|
|
170
|
+
var _a, _b, _c;
|
|
171
|
+
var css = JSON.parse(s);
|
|
172
|
+
var styles = {
|
|
173
|
+
base: CSSPropertiesToComponent(css.base),
|
|
174
|
+
focus: CSSPropertiesToComponent(css.focus),
|
|
175
|
+
error: CSSPropertiesToComponent(css.error),
|
|
176
|
+
placeholder: CSSPropertiesToComponent(css.placeholder),
|
|
177
|
+
cvv: {
|
|
178
|
+
base: CSSPropertiesToComponent((_a = css.cvv) === null || _a === void 0 ? void 0 : _a.base),
|
|
179
|
+
focus: CSSPropertiesToComponent((_b = css.cvv) === null || _b === void 0 ? void 0 : _b.focus),
|
|
180
|
+
error: CSSPropertiesToComponent((_c = css.cvv) === null || _c === void 0 ? void 0 : _c.error),
|
|
181
|
+
placeholder: CSSPropertiesToComponent(css === null || css === void 0 ? void 0 : css.placeholder),
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
return { styles: styles };
|
|
185
|
+
}
|
|
186
|
+
function CSSPropertiesToComponent(dict) {
|
|
187
|
+
if (!dict)
|
|
188
|
+
return '';
|
|
189
|
+
if (typeof dict === 'string')
|
|
190
|
+
return dict;
|
|
191
|
+
var str = '';
|
|
192
|
+
var _loop_1 = function (key, value) {
|
|
193
|
+
var clo = '';
|
|
194
|
+
key.split('').forEach(function (lt) {
|
|
195
|
+
if (lt.toUpperCase() === lt) {
|
|
196
|
+
clo += '-' + lt.toLowerCase();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
clo += lt;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
str += clo + ':' + value + ';';
|
|
203
|
+
};
|
|
204
|
+
for (var _i = 0, _a = Object.entries(dict); _i < _a.length; _i++) {
|
|
205
|
+
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
206
|
+
_loop_1(key, value);
|
|
207
|
+
}
|
|
208
|
+
return str;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=tokenexHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenexHelpers.js","sourceRoot":"","sources":["../../../src/common/card-form/tokenexHelpers.ts"],"names":[],"mappings":";AACA,OAAO,EAEL,qBAAqB,EAGrB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAoB/C,MAAM,UAAgB,eAAe;wDAAC,EAQrC;;YAPC,KAAK,WAAA,EACL,OAAO,aAAA,EACP,GAAG,SAAA;;YAMH,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;oBACjC,KAAK,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,kCAAkC,EAAE;wBACrE,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE;4BACP,cAAc,EAAE,kBAAkB;yBACnC;wBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACnB,OAAO,kCAAM,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC,UAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAC;4BACrD,KAAK,OAAA;yBACN,CAAC;qBACH,CAAC;yBACC,IAAI,CAAC,UAAM,GAAG;;;;;oCACb,KAAA,OAAO,CAAA;oCAAE,qBAAM,GAAG,CAAC,IAAI,EAAE,EA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AC;AAClB,CAAC;AAED,SAAS,wBAAwB,CAC/B,IAAwC;IAExC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE1C,IAAI,GAAG,GAAG,EAAE,CAAC;4BACD,GAAG,EAAE,KAAK;QACpB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAA,EAAE;YACtB,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC;gBAC5B,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,GAAG,IAAI,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC;;IATjC,KAA2B,UAAoB,EAApB,KAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAApB,cAAoB,EAApB,IAAoB;QAApC,IAAA,WAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;gBAAV,GAAG,EAAE,KAAK;KAUrB;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/build/common/index.d.ts
CHANGED
package/build/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "React Native Component for Coinflow",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"react-native-get-random-values": "^1.11.0",
|
|
37
37
|
"bs58": "^6.0.0",
|
|
38
38
|
"bn.js": "^5.2.1",
|
|
39
|
-
"@solana/web3.js": "^1.
|
|
39
|
+
"@solana/web3.js": "^1.95.3",
|
|
40
40
|
"lz-string": "^1.5.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/react": "^18.2.64",
|
|
44
44
|
"eslint-config-react-app": "^7.0.1",
|
|
45
|
-
"typescript": "^5.5.
|
|
45
|
+
"typescript": "^5.5.4",
|
|
46
46
|
"@solana/wallet-adapter-react": "^0.15.32",
|
|
47
47
|
"@near-wallet-selector/core": "^8.9.3"
|
|
48
48
|
},
|