@coinflowlabs/angular 0.1.1 → 0.1.3
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 +3 -18
- package/esm2022/lib/coinflow-iframe.component.mjs +4 -4
- package/esm2022/lib/coinflow-purchase-history.component.mjs +4 -4
- package/esm2022/lib/coinflow-purchase-protection.component.mjs +4 -4
- package/esm2022/lib/coinflow-purchase.component.mjs +4 -4
- package/esm2022/lib/coinflow-withdraw-history.component.mjs +4 -4
- package/esm2022/lib/coinflow-withdraw.component.mjs +4 -4
- package/esm2022/lib/common/CoinflowLibMessageHandlers.mjs +20 -11
- package/esm2022/lib/common/CoinflowTypes.mjs +8 -1
- package/esm2022/lib/common/CoinflowUtils.mjs +10 -13
- package/fesm2022/coinflowlabs-angular.mjs +53 -40
- package/fesm2022/coinflowlabs-angular.mjs.map +1 -1
- package/lib/common/CoinflowLibMessageHandlers.d.ts +13 -3
- package/lib/common/CoinflowTypes.d.ts +33 -9
- package/lib/common/CoinflowUtils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -17,6 +17,13 @@ var MerchantStyle;
|
|
|
17
17
|
MerchantStyle["Sharp"] = "sharp";
|
|
18
18
|
MerchantStyle["Pill"] = "pill";
|
|
19
19
|
})(MerchantStyle || (MerchantStyle = {}));
|
|
20
|
+
var CardType;
|
|
21
|
+
(function (CardType) {
|
|
22
|
+
CardType["VISA"] = "VISA";
|
|
23
|
+
CardType["MASTERCARD"] = "MSTR";
|
|
24
|
+
CardType["AMEX"] = "AMEX";
|
|
25
|
+
CardType["DISCOVER"] = "DISC";
|
|
26
|
+
})(CardType || (CardType = {}));
|
|
20
27
|
|
|
21
28
|
// This works in angular, but not react
|
|
22
29
|
// let web3: typeof import('@solana/web3.js') | undefined;
|
|
@@ -76,7 +83,7 @@ class CoinflowUtils {
|
|
|
76
83
|
return 'http://localhost:5000';
|
|
77
84
|
return `https://api-${env}.coinflow.cash`;
|
|
78
85
|
}
|
|
79
|
-
static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain,
|
|
86
|
+
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, }) {
|
|
80
87
|
const prefix = routePrefix
|
|
81
88
|
? `/${routePrefix}/${blockchain}`
|
|
82
89
|
: `/${blockchain}`;
|
|
@@ -88,9 +95,6 @@ class CoinflowUtils {
|
|
|
88
95
|
if (amount) {
|
|
89
96
|
url.searchParams.append('amount', amount.toString());
|
|
90
97
|
}
|
|
91
|
-
if (supportsVersionedTransactions) {
|
|
92
|
-
url.searchParams.append('supportsVersionedTransactions', 'true');
|
|
93
|
-
}
|
|
94
98
|
if (webhookInfo) {
|
|
95
99
|
url.searchParams.append('webhookInfo', LZString.compressToEncodedURIComponent(JSON.stringify(webhookInfo)));
|
|
96
100
|
}
|
|
@@ -164,6 +168,8 @@ class CoinflowUtils {
|
|
|
164
168
|
url.searchParams.append('authOnly', 'true');
|
|
165
169
|
if (jwtToken)
|
|
166
170
|
url.searchParams.append('jwtToken', jwtToken);
|
|
171
|
+
if (origins)
|
|
172
|
+
url.searchParams.append('origins', LZString.compressToEncodedURIComponent(JSON.stringify(origins)));
|
|
167
173
|
return url.toString();
|
|
168
174
|
}
|
|
169
175
|
static getTransaction(props) {
|
|
@@ -176,14 +182,12 @@ class CoinflowUtils {
|
|
|
176
182
|
throw new Error('@solana/web3.js dependency is required for Solana');
|
|
177
183
|
if (!base58)
|
|
178
184
|
throw new Error('bs58 dependency is required for Solana');
|
|
179
|
-
if (transaction
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return base58.encode(transaction.serialize());
|
|
186
|
-
return undefined;
|
|
185
|
+
if (!transaction)
|
|
186
|
+
return undefined;
|
|
187
|
+
return base58.encode(transaction.serialize({
|
|
188
|
+
requireAllSignatures: false,
|
|
189
|
+
verifySignatures: false,
|
|
190
|
+
}));
|
|
187
191
|
},
|
|
188
192
|
polygon: () => {
|
|
189
193
|
if (!('transaction' in props))
|
|
@@ -235,6 +239,7 @@ var IFrameMessageMethods;
|
|
|
235
239
|
IFrameMessageMethods["SignTransaction"] = "signTransaction";
|
|
236
240
|
IFrameMessageMethods["SendTransaction"] = "sendTransaction";
|
|
237
241
|
IFrameMessageMethods["HeightChange"] = "heightChange";
|
|
242
|
+
IFrameMessageMethods["Success"] = "success";
|
|
238
243
|
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
239
244
|
function getWalletPubkey({ wallet, }) {
|
|
240
245
|
if ('publicKey' in wallet) {
|
|
@@ -275,19 +280,24 @@ function handleIFrameMessage(rawMessage, handlers) {
|
|
|
275
280
|
if (!handlers.handleHeightChange)
|
|
276
281
|
return;
|
|
277
282
|
return handlers.handleHeightChange(data);
|
|
283
|
+
case IFrameMessageMethods.Success:
|
|
284
|
+
if (!handlers.onSuccess)
|
|
285
|
+
return;
|
|
286
|
+
handlers.onSuccess(walletCall.info);
|
|
287
|
+
return;
|
|
278
288
|
}
|
|
279
289
|
console.warn(`Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`);
|
|
280
290
|
}
|
|
281
|
-
function getHandlers(
|
|
282
|
-
return CoinflowUtils.byBlockchain(blockchain, {
|
|
283
|
-
solana: () => getSolanaWalletHandlers(
|
|
284
|
-
near: () => getNearWalletHandlers(
|
|
285
|
-
eth: () => getEvmWalletHandlers(
|
|
286
|
-
polygon: () => getEvmWalletHandlers(
|
|
287
|
-
base: () => getEvmWalletHandlers(
|
|
291
|
+
function getHandlers(props) {
|
|
292
|
+
return CoinflowUtils.byBlockchain(props.blockchain, {
|
|
293
|
+
solana: () => getSolanaWalletHandlers(props),
|
|
294
|
+
near: () => getNearWalletHandlers(props),
|
|
295
|
+
eth: () => getEvmWalletHandlers(props),
|
|
296
|
+
polygon: () => getEvmWalletHandlers(props),
|
|
297
|
+
base: () => getEvmWalletHandlers(props),
|
|
288
298
|
})();
|
|
289
299
|
}
|
|
290
|
-
function getSolanaWalletHandlers({ wallet, }) {
|
|
300
|
+
function getSolanaWalletHandlers({ wallet, onSuccess, }) {
|
|
291
301
|
return {
|
|
292
302
|
handleSendTransaction: async (transaction) => {
|
|
293
303
|
const tx = getSolanaTransaction(transaction);
|
|
@@ -317,6 +327,7 @@ function getSolanaWalletHandlers({ wallet, }) {
|
|
|
317
327
|
verifySignatures: false,
|
|
318
328
|
}));
|
|
319
329
|
},
|
|
330
|
+
onSuccess,
|
|
320
331
|
};
|
|
321
332
|
}
|
|
322
333
|
function getSolanaTransaction(data) {
|
|
@@ -330,7 +341,7 @@ function getSolanaTransaction(data) {
|
|
|
330
341
|
return web3.Transaction.from(parsedUInt8Array);
|
|
331
342
|
return vtx;
|
|
332
343
|
}
|
|
333
|
-
function getNearWalletHandlers({ wallet, }) {
|
|
344
|
+
function getNearWalletHandlers({ wallet, onSuccess, }) {
|
|
334
345
|
const nearWallet = wallet;
|
|
335
346
|
return {
|
|
336
347
|
handleSendTransaction: async (transaction) => {
|
|
@@ -341,9 +352,10 @@ function getNearWalletHandlers({ wallet, }) {
|
|
|
341
352
|
const { transaction: transactionResult } = executionOutcome;
|
|
342
353
|
return transactionResult.hash;
|
|
343
354
|
},
|
|
355
|
+
onSuccess,
|
|
344
356
|
};
|
|
345
357
|
}
|
|
346
|
-
function getEvmWalletHandlers({ wallet, }) {
|
|
358
|
+
function getEvmWalletHandlers({ wallet, onSuccess, }) {
|
|
347
359
|
const evmWallet = wallet;
|
|
348
360
|
return {
|
|
349
361
|
handleSendTransaction: async (transaction) => {
|
|
@@ -354,6 +366,7 @@ function getEvmWalletHandlers({ wallet, }) {
|
|
|
354
366
|
handleSignMessage: async (message) => {
|
|
355
367
|
return evmWallet.signMessage(message);
|
|
356
368
|
},
|
|
369
|
+
onSuccess,
|
|
357
370
|
};
|
|
358
371
|
}
|
|
359
372
|
|
|
@@ -381,8 +394,8 @@ class CoinflowIFrameComponent {
|
|
|
381
394
|
return;
|
|
382
395
|
this.iframe.nativeElement.contentWindow.postMessage(message, '*');
|
|
383
396
|
}
|
|
384
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
385
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
397
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowIFrameComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
398
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: CoinflowIFrameComponent, isStandalone: true, selector: "lib-coinflow-iframe", inputs: { iframeProps: "iframeProps", messageHandlers: "messageHandlers" }, host: { listeners: { "window:message": "onPostMessage($event)" } }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true }], ngImport: i0, template: ` <iframe
|
|
386
399
|
width="100%"
|
|
387
400
|
height="100%"
|
|
388
401
|
#iframe
|
|
@@ -393,7 +406,7 @@ class CoinflowIFrameComponent {
|
|
|
393
406
|
[src]="dynamicUrl"
|
|
394
407
|
></iframe>`, isInline: true }); }
|
|
395
408
|
}
|
|
396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
409
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowIFrameComponent, decorators: [{
|
|
397
410
|
type: Component,
|
|
398
411
|
args: [{
|
|
399
412
|
selector: 'lib-coinflow-iframe',
|
|
@@ -435,10 +448,10 @@ class CoinflowPurchaseComponent {
|
|
|
435
448
|
transaction: CoinflowUtils.getTransaction(this.purchaseProps),
|
|
436
449
|
};
|
|
437
450
|
}
|
|
438
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
439
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
451
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowPurchaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
452
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: CoinflowPurchaseComponent, isStandalone: true, selector: "lib-coinflow-purchase", inputs: { purchaseProps: "purchaseProps" }, ngImport: i0, template: ' <lib-coinflow-iframe ng-if="iframeProps && messageHandlers" [iframeProps]="iframeProps!" [messageHandlers]="messageHandlers!"></lib-coinflow-iframe> ', isInline: true, dependencies: [{ kind: "component", type: CoinflowIFrameComponent, selector: "lib-coinflow-iframe", inputs: ["iframeProps", "messageHandlers"] }] }); }
|
|
440
453
|
}
|
|
441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowPurchaseComponent, decorators: [{
|
|
442
455
|
type: Component,
|
|
443
456
|
args: [{
|
|
444
457
|
selector: 'lib-coinflow-purchase',
|
|
@@ -451,10 +464,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
451
464
|
}] } });
|
|
452
465
|
|
|
453
466
|
class CoinflowPurchaseHistoryComponent {
|
|
454
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
455
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
467
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowPurchaseHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
468
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: CoinflowPurchaseHistoryComponent, isStandalone: true, selector: "lib-coinflow-purchase-history", ngImport: i0, template: ' <p>coinflow-purchase-history works!</p> ', isInline: true }); }
|
|
456
469
|
}
|
|
457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowPurchaseHistoryComponent, decorators: [{
|
|
458
471
|
type: Component,
|
|
459
472
|
args: [{
|
|
460
473
|
selector: 'lib-coinflow-purchase-history',
|
|
@@ -465,10 +478,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
465
478
|
}] });
|
|
466
479
|
|
|
467
480
|
class CoinflowPurchaseProtectionComponent {
|
|
468
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
469
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
481
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowPurchaseProtectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
482
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: CoinflowPurchaseProtectionComponent, isStandalone: true, selector: "lib-coinflow-purchase-protection", ngImport: i0, template: ' <p>coinflow-purchase-protection works!</p> ', isInline: true }); }
|
|
470
483
|
}
|
|
471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowPurchaseProtectionComponent, decorators: [{
|
|
472
485
|
type: Component,
|
|
473
486
|
args: [{
|
|
474
487
|
selector: 'lib-coinflow-purchase-protection',
|
|
@@ -491,10 +504,10 @@ class CoinflowWithdrawComponent {
|
|
|
491
504
|
transaction: undefined,
|
|
492
505
|
};
|
|
493
506
|
}
|
|
494
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
495
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
507
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowWithdrawComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
508
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: CoinflowWithdrawComponent, isStandalone: true, selector: "lib-coinflow-withdraw", inputs: { withdrawProps: "withdrawProps" }, ngImport: i0, template: ' <lib-coinflow-iframe ng-if="iframeProps && messageHandlers" [iframeProps]="iframeProps!" [messageHandlers]="messageHandlers!"></lib-coinflow-iframe> ', isInline: true, dependencies: [{ kind: "component", type: CoinflowIFrameComponent, selector: "lib-coinflow-iframe", inputs: ["iframeProps", "messageHandlers"] }] }); }
|
|
496
509
|
}
|
|
497
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowWithdrawComponent, decorators: [{
|
|
498
511
|
type: Component,
|
|
499
512
|
args: [{
|
|
500
513
|
selector: 'lib-coinflow-withdraw',
|
|
@@ -507,10 +520,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
507
520
|
}] } });
|
|
508
521
|
|
|
509
522
|
class CoinflowWithdrawHistoryComponent {
|
|
510
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
511
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowWithdrawHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
524
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: CoinflowWithdrawHistoryComponent, isStandalone: true, selector: "lib-coinflow-withdraw-history", ngImport: i0, template: ' <p>coinflow-withdraw-history works!</p> ', isInline: true }); }
|
|
512
525
|
}
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: CoinflowWithdrawHistoryComponent, decorators: [{
|
|
514
527
|
type: Component,
|
|
515
528
|
args: [{
|
|
516
529
|
selector: 'lib-coinflow-withdraw-history',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinflowlabs-angular.mjs","sources":["../../../projects/coinflowlabs/src/lib/common/CoinflowTypes.ts","../../../projects/coinflowlabs/src/lib/common/SolanaPeerDeps.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowUtils.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowLibMessageHandlers.ts","../../../projects/coinflowlabs/src/lib/coinflow-iframe.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-history.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-protection.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw-history.component.ts","../../../projects/coinflowlabs/src/public-api.ts","../../../projects/coinflowlabs/src/coinflowlabs-angular.ts"],"sourcesContent":["import type {\n Connection,\n VersionedTransaction,\n PublicKey,\n Signer,\n Transaction,\n} from '@solana/web3.js';\n\nexport enum SettlementType {\n Credits = 'Credits',\n USDC = 'USDC',\n Bank = 'Bank',\n}\n\nexport enum MerchantStyle {\n Rounded = 'rounded',\n Sharp = 'sharp',\n Pill = 'pill',\n}\n\nexport type MerchantTheme = {\n primary?: string;\n background?: string;\n backgroundAccent?: string;\n backgroundAccent2?: string;\n textColor?: string;\n textColorAccent?: string;\n textColorAction?: string;\n font?: string;\n style?: MerchantStyle;\n};\n\nexport interface CustomerInfo {\n name?: string;\n verificationId?: string;\n displayName?: string;\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n ip?: string;\n lat?: string;\n lng?: string;\n}\n\n/** Coinflow Types **/\nexport type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';\nexport type CoinflowEnvs = 'prod' | 'staging' | 'sandbox' | 'local';\n\nexport interface CoinflowTypes {\n merchantId: string;\n env?: CoinflowEnvs;\n loaderBackground?: string;\n blockchain: CoinflowBlockchain;\n handleHeightChange?: (height: string) => void;\n theme?: MerchantTheme;\n}\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport type OnSuccessMethod = (params: string) => void | Promise<void>;\n\n/** Wallets **/\nexport interface SolanaWallet {\n publicKey: PublicKey | null;\n signTransaction?: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<T>;\n sendTransaction: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<string>;\n signMessage?: (message: Uint8Array) => Promise<Uint8Array>;\n}\n\nexport interface NearWallet {\n accountId: string;\n signAndSendTransaction: (transaction: unknown) => Promise<{\n transaction: {hash: string};\n }>;\n}\n\ntype AccessList = Array<{address: string; storageKeys: Array<string>}>;\ntype AccessListish =\n | AccessList\n | Array<[string, Array<string>]>\n | Record<string, Array<string>>;\n\nexport type EthWallet = {\n address: string | null | undefined;\n sendTransaction: (transaction: {\n to: string;\n from?: string;\n nonce?: Bytes | bigint | string | number;\n\n gasLimit?: Bytes | bigint | string | number;\n gasPrice?: Bytes | bigint | string | number;\n\n data?: BytesLike;\n value?: Bytes | bigint | string | number;\n chainId?: number;\n\n type?: number;\n accessList?: AccessListish;\n\n maxPriorityFeePerGas?: Bytes | bigint | string | number;\n maxFeePerGas?: Bytes | bigint | string | number;\n\n customData?: Record<string, any>;\n ccipReadEnabled?: boolean;\n }) => Promise<{hash: string}>;\n signMessage: (message: string) => Promise<string>;\n};\n\n/** History **/\nexport interface CoinflowSolanaHistoryProps extends CoinflowTypes {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearHistoryProps extends CoinflowTypes {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmHistoryProps extends CoinflowTypes {\n wallet: EthWallet;\n}\n\nexport interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowPolygonHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'base';\n}\n\nexport type CoinflowHistoryProps =\n | CoinflowSolanaHistoryProps\n | CoinflowNearHistoryProps\n | CoinflowPolygonHistoryProps\n | CoinflowEthHistoryProps\n | CoinflowBaseHistoryProps;\n\n/** Transactions **/\n\nexport type NearFtTransferCallAction = {\n methodName: 'ft_transfer_call';\n args: object;\n gas: string;\n deposit: string;\n};\n\ntype Bytes = ArrayLike<number>;\ntype BytesLike = Bytes | string;\n\n/** Purchase **/\n\nexport type ChargebackProtectionData = ChargebackProtectionItem[];\n\nexport interface ChargebackProtectionItem {\n /**\n * The name of the product\n */\n productName: string;\n /**\n * The product type. Possible values include: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp\n */\n productType:\n | 'inGameProduct'\n | 'gameOfSkill'\n | 'dataStorage'\n | 'computingResources'\n | 'sportsTicket'\n | 'eSportsTicket'\n | 'musicTicket'\n | 'conferenceTicket'\n | 'virtualSportsTicket'\n | 'virtualESportsTicket'\n | 'virtualMusicTicket'\n | 'virtualConferenceTicket'\n | 'alcohol'\n | 'DLC'\n | 'subscription'\n | 'fundACause'\n | 'realEstate'\n | 'computingContract'\n | 'digitalArt'\n | 'topUp'\n | 'ownershipContract';\n /**\n * The item's list price\n */\n /**\n * The number of units sold\n */\n quantity: number;\n /**\n * Any additional data that the store can provide on the product, e.g. description, link to image, etc.\n */\n rawProductData?: {[key: string]: any};\n}\n\nexport interface CoinflowCommonPurchaseProps extends CoinflowTypes {\n amount?: number | string;\n onSuccess?: OnSuccessMethod;\n webhookInfo?: object;\n email?: string;\n chargebackProtectionData?: ChargebackProtectionData;\n planCode?: string;\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n customerInfo?: CustomerInfo;\n settlementType?: SettlementType;\n authOnly?: boolean;\n deviceId?: string;\n jwtToken?: string;\n}\n\nexport interface CoinflowSolanaPurchaseProps\n extends CoinflowCommonPurchaseProps {\n wallet: SolanaWallet;\n transaction?: Transaction | VersionedTransaction;\n partialSigners?: Signer[];\n debugTx?: boolean;\n connection: Connection;\n blockchain: 'solana';\n token?: PublicKey | string;\n supportsVersionedTransactions?: boolean;\n rent?: {lamports: string | number};\n nativeSolToConvert?: {lamports: string | number};\n}\n\nexport interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {\n wallet: NearWallet;\n blockchain: 'near';\n action?: NearFtTransferCallAction;\n nearDeposit?: string;\n}\n\nexport interface CoinflowEvmPurchaseProps extends CoinflowCommonPurchaseProps {\n transaction?: EvmTransactionData;\n token?: string;\n wallet: EthWallet;\n}\n\nexport interface CoinflowPolygonPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowEthPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowBasePurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'base';\n}\n\nexport type CoinflowPurchaseProps =\n | CoinflowSolanaPurchaseProps\n | CoinflowNearPurchaseProps\n | CoinflowPolygonPurchaseProps\n | CoinflowEthPurchaseProps\n | CoinflowBasePurchaseProps;\n\n/** Withdraw **/\n\nexport interface CoinflowCommonWithdrawProps extends CoinflowTypes {\n onSuccess?: OnSuccessMethod;\n tokens?: string[];\n lockDefaultToken?: boolean;\n amount?: number;\n email?: string;\n bankAccountLinkRedirect?: string;\n additionalWallets?: {\n wallet: string;\n blockchain: 'solana' | 'eth' | 'near' | 'polygon';\n }[];\n supportsVersionedTransactions?: boolean;\n lockAmount?: boolean;\n transactionSigner?: string;\n}\n\nexport interface CoinflowSolanaWithdrawProps\n extends CoinflowCommonWithdrawProps {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: EthWallet;\n usePermit?: boolean;\n}\n\nexport interface CoinflowEthWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'eth';\n usePermit?: boolean;\n}\n\nexport interface CoinflowPolygonWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'base';\n}\n\nexport type CoinflowWithdrawProps =\n | CoinflowSolanaWithdrawProps\n | CoinflowNearWithdrawProps\n | CoinflowEthWithdrawProps\n | CoinflowPolygonWithdrawProps\n | CoinflowBaseWithdrawProps;\n\nexport interface CommonEvmRedeem {\n waitForHash?: boolean;\n}\n\nexport interface NormalRedeem extends CommonEvmRedeem {\n transaction: {to: string; data: string};\n}\n\nexport interface KnownTokenIdRedeem extends NormalRedeem {\n nftContract: string;\n nftId: string;\n}\n\nexport interface SafeMintRedeem extends NormalRedeem {\n type: 'safeMint';\n nftContract?: string;\n}\n\nexport interface ReturnedTokenIdRedeem extends NormalRedeem {\n type: 'returned';\n nftContract?: string;\n}\n\ntype ReservoirNftIdItem = Omit<KnownTokenIdRedeem, keyof NormalRedeem>;\ninterface ReservoirOrderIdItem {\n orderId: string;\n}\ntype ReservoirItem = ReservoirNftIdItem | ReservoirOrderIdItem;\ntype ReservoirItems = ReservoirItem | ReservoirItem[];\n\nexport interface ReservoirRedeem extends CommonEvmRedeem {\n type: 'reservoir';\n items: ReservoirItems;\n}\n\nexport type EvmTransactionData =\n | SafeMintRedeem\n | ReturnedTokenIdRedeem\n | ReservoirRedeem\n | KnownTokenIdRedeem\n | NormalRedeem;\n\nexport interface CoinflowIFrameProps\n extends Omit<CoinflowTypes, 'merchantId'>,\n Pick<\n CoinflowCommonPurchaseProps,\n | 'chargebackProtectionData'\n | 'webhookInfo'\n | 'amount'\n | 'customerInfo'\n | 'settlementType'\n | 'email'\n | 'planCode'\n | 'deviceId'\n | 'jwtToken'\n >,\n Pick<\n CoinflowCommonWithdrawProps,\n | 'bankAccountLinkRedirect'\n | 'additionalWallets'\n | 'transactionSigner'\n | 'lockAmount'\n | 'lockDefaultToken'\n >,\n Pick<CoinflowEvmPurchaseProps, 'authOnly'>,\n Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {\n walletPubkey: string | null | undefined;\n route: string;\n routePrefix?: string;\n transaction?: string;\n tokens?: string[] | PublicKey[];\n supportsVersionedTransactions?: boolean;\n nearDeposit?: string;\n merchantCss?: string;\n color?: 'white' | 'black';\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n theme?: MerchantTheme;\n usePermit?: boolean;\n}\n","// This works in angular, but not react\n// let web3: typeof import('@solana/web3.js') | undefined;\n// let base58: typeof import('bs58') | undefined;\n//\n// try {\n// web3 = require('@solana/web3.js');\n// base58 = require('bs58');\n// } catch (e) {}\n//\n// export {web3, base58};\n\n// This works in react, but not angular\nimport * as SolanaWeb3Js from '@solana/web3.js';\nimport base58Imported from 'bs58';\n\nconst web3: typeof SolanaWeb3Js | undefined = SolanaWeb3Js;\nconst base58: typeof base58Imported | undefined = base58Imported;\nexport {web3, base58};\n","import {\n CoinflowBlockchain,\n CoinflowEnvs,\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n} from './CoinflowTypes';\nimport {web3, base58} from './SolanaPeerDeps';\nimport LZString from 'lz-string';\n\nexport class CoinflowUtils {\n env: CoinflowEnvs;\n url: string;\n\n constructor(env?: CoinflowEnvs) {\n this.env = env ?? 'prod';\n if (this.env === 'prod') this.url = 'https://api.coinflow.cash';\n else if (this.env === 'local') this.url = 'http://localhost:5000';\n else this.url = `https://api-${this.env}.coinflow.cash`;\n }\n\n async getNSurePartnerId(merchantId: string): Promise<string | undefined> {\n return fetch(this.url + `/merchant/view/${merchantId}`)\n .then(response => response.json())\n .then(\n (json: {\n nSurePartnerId: string | undefined;\n nSureSettings: {nSurePartnerId: string | undefined};\n }) => json.nSureSettings?.nSurePartnerId || json.nSurePartnerId\n )\n .catch(e => {\n console.error(e);\n return undefined;\n });\n }\n\n async getCreditBalance(\n publicKey: string,\n merchantId: string,\n blockchain: 'solana' | 'near'\n ): Promise<{cents: number}> {\n const response = await fetch(\n this.url + `/api/customer/balances/${merchantId}`,\n {\n method: 'GET',\n headers: {\n 'x-coinflow-auth-wallet': publicKey,\n 'x-coinflow-auth-blockchain': blockchain,\n },\n }\n );\n const {credits} = await response.json();\n return credits;\n }\n\n static getCoinflowBaseUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://coinflow.cash';\n if (env === 'local') return 'http://localhost:3000';\n\n return `https://${env}.coinflow.cash`;\n }\n\n static getCoinflowApiUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://api.coinflow.cash';\n if (env === 'local') return 'http://localhost:5000';\n\n return `https://api-${env}.coinflow.cash`;\n }\n\n static getCoinflowUrl({\n walletPubkey,\n route,\n routePrefix,\n env,\n amount,\n transaction,\n blockchain,\n supportsVersionedTransactions,\n webhookInfo,\n email,\n loaderBackground,\n handleHeightChange,\n bankAccountLinkRedirect,\n additionalWallets,\n nearDeposit,\n chargebackProtectionData,\n merchantCss,\n color,\n rent,\n lockDefaultToken,\n token,\n tokens,\n planCode,\n disableApplePay,\n disableGooglePay,\n customerInfo,\n settlementType,\n lockAmount,\n nativeSolToConvert,\n theme,\n usePermit,\n transactionSigner,\n authOnly,\n deviceId,\n jwtToken,\n }: CoinflowIFrameProps): string {\n const prefix = routePrefix\n ? `/${routePrefix}/${blockchain}`\n : `/${blockchain}`;\n const url = new URL(prefix + route, CoinflowUtils.getCoinflowBaseUrl(env));\n url.searchParams.append('pubkey', walletPubkey!);\n\n if (transaction) {\n url.searchParams.append('transaction', transaction);\n }\n if (amount) {\n url.searchParams.append('amount', amount.toString());\n }\n\n if (supportsVersionedTransactions) {\n url.searchParams.append('supportsVersionedTransactions', 'true');\n }\n\n if (webhookInfo) {\n url.searchParams.append(\n 'webhookInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(webhookInfo))\n );\n }\n\n if (theme) {\n url.searchParams.append(\n 'theme',\n LZString.compressToEncodedURIComponent(JSON.stringify(theme))\n );\n }\n\n if (customerInfo) {\n url.searchParams.append(\n 'customerInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(customerInfo))\n );\n }\n\n if (email) {\n url.searchParams.append('email', email);\n }\n\n if (token) {\n url.searchParams.append('token', token.toString());\n }\n\n if (tokens) {\n url.searchParams.append('tokens', tokens.toString());\n }\n\n if (loaderBackground) {\n url.searchParams.append('loaderBackground', loaderBackground);\n }\n\n if (handleHeightChange) {\n url.searchParams.append('useHeightChange', 'true');\n }\n\n if (bankAccountLinkRedirect) {\n url.searchParams.append(\n 'bankAccountLinkRedirect',\n bankAccountLinkRedirect\n );\n }\n\n if (additionalWallets)\n url.searchParams.append(\n 'additionalWallets',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(additionalWallets)\n )\n );\n\n if (nearDeposit) url.searchParams.append('nearDeposit', nearDeposit);\n\n if (chargebackProtectionData)\n url.searchParams.append(\n 'chargebackProtectionData',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(chargebackProtectionData)\n )\n );\n if (deviceId) {\n url.searchParams.append('deviceId', deviceId);\n } else {\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const deviceId = window?.nSureSDK?.getDeviceId();\n if (deviceId) url.searchParams.append('deviceId', deviceId);\n }\n }\n\n if (merchantCss) url.searchParams.append('merchantCss', merchantCss);\n if (color) url.searchParams.append('color', color);\n if (rent) url.searchParams.append('rent', rent.lamports.toString());\n if (nativeSolToConvert)\n url.searchParams.append(\n 'nativeSolToConvert',\n nativeSolToConvert.lamports.toString()\n );\n if (lockDefaultToken) url.searchParams.append('lockDefaultToken', 'true');\n if (planCode) url.searchParams.append('planCode', planCode);\n\n if (disableApplePay) url.searchParams.append('disableApplePay', 'true');\n if (disableGooglePay) url.searchParams.append('disableGooglePay', 'true');\n if (settlementType)\n url.searchParams.append('settlementType', settlementType);\n\n if (lockAmount) url.searchParams.append('lockAmount', 'true');\n\n if (usePermit === false) url.searchParams.append('usePermit', 'false');\n if (transactionSigner)\n url.searchParams.append('transactionSigner', transactionSigner);\n if (authOnly === true) url.searchParams.append('authOnly', 'true');\n if (jwtToken) url.searchParams.append('jwtToken', jwtToken);\n\n return url.toString();\n }\n\n static getTransaction(props: CoinflowPurchaseProps): string | undefined {\n return this.byBlockchain<() => string | undefined>(props.blockchain, {\n solana: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n if (!web3)\n throw new Error('@solana/web3.js dependency is required for Solana');\n if (!base58) throw new Error('bs58 dependency is required for Solana');\n if (transaction instanceof web3.Transaction)\n return base58.encode(\n transaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n\n if (transaction instanceof web3.VersionedTransaction)\n return base58.encode(transaction.serialize());\n\n return undefined;\n },\n polygon: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n eth: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n base: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n near: () => {\n if (!('action' in props)) return undefined;\n const {action} = props;\n return LZString.compressToEncodedURIComponent(JSON.stringify(action));\n },\n })();\n }\n\n static byBlockchain<T>(\n blockchain: CoinflowBlockchain,\n args: {solana: T; near: T; eth: T; polygon: T; base: T}\n ): T {\n switch (blockchain) {\n case 'solana':\n return args.solana;\n case 'near':\n return args.near;\n case 'polygon':\n return args.polygon;\n case 'eth':\n return args.eth;\n case 'base':\n return args.base;\n default:\n throw new Error('blockchain not supported!');\n }\n }\n}\n","import {\n CoinflowPurchaseProps,\n EthWallet,\n NearWallet,\n SolanaWallet,\n} from './CoinflowTypes';\nimport {CoinflowUtils} from './CoinflowUtils';\nimport type {Transaction, VersionedTransaction} from '@solana/web3.js';\nimport {web3, base58} from './SolanaPeerDeps';\n\nexport type WalletCall = {method: IFrameMessageMethods; data: string};\n\nexport interface IFrameMessageHandlers {\n handleSendTransaction: (transaction: string) => Promise<string>;\n handleSignMessage?: (message: string) => Promise<string>;\n handleSignTransaction?: (transaction: string) => Promise<string>;\n handleHeightChange?: (height: string) => void;\n}\n\nenum IFrameMessageMethods {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n SendTransaction = 'sendTransaction',\n HeightChange = 'heightChange',\n}\n\nexport function getWalletPubkey({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined {\n if ('publicKey' in wallet) {\n return wallet.publicKey!.toString();\n }\n\n if ('address' in wallet) {\n return wallet.address;\n }\n\n if ('accountId' in wallet) {\n return wallet.accountId;\n }\n\n return null;\n}\n\nexport function handleIFrameMessage(\n rawMessage: string,\n handlers: IFrameMessageHandlers\n): Promise<string> | void {\n let walletCall: WalletCall;\n try {\n walletCall = JSON.parse(rawMessage);\n if (!('method' in walletCall) || !('data' in walletCall)) return;\n } catch (e) {\n console.error('handleIFrameMessage JSON parse', e);\n return;\n }\n\n const {data, method} = walletCall;\n switch (method) {\n case IFrameMessageMethods.SignMessage:\n if (!handlers.handleSignMessage) return;\n return handlers.handleSignMessage(data);\n case IFrameMessageMethods.SignTransaction:\n if (!handlers.handleSignTransaction) return;\n return handlers.handleSignTransaction(data);\n case IFrameMessageMethods.SendTransaction:\n return handlers.handleSendTransaction(data);\n case IFrameMessageMethods.HeightChange:\n if (!handlers.handleHeightChange) return;\n return handlers.handleHeightChange(data);\n }\n\n console.warn(\n `Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`\n );\n}\n\nexport function getHandlers({\n wallet,\n blockchain,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n return CoinflowUtils.byBlockchain(blockchain, {\n solana: () => getSolanaWalletHandlers({wallet}),\n near: () => getNearWalletHandlers({wallet}),\n eth: () => getEvmWalletHandlers({wallet}),\n polygon: () => getEvmWalletHandlers({wallet}),\n base: () => getEvmWalletHandlers({wallet}),\n })();\n}\n\nfunction getSolanaWalletHandlers({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = getSolanaTransaction(transaction);\n return await (wallet as SolanaWallet).sendTransaction(tx);\n },\n handleSignMessage: async (message: string) => {\n const signMessage = (wallet as SolanaWallet).signMessage;\n if (!signMessage) {\n throw new Error('signMessage is not supported by this wallet');\n }\n\n const signedMessage = await signMessage(\n new TextEncoder().encode(message)\n );\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(signedMessage);\n },\n handleSignTransaction: async (transaction: string) => {\n const signTransaction = (wallet as SolanaWallet).signTransaction;\n if (!signTransaction) {\n throw new Error('signTransaction is not supported by this wallet');\n }\n const tx = getSolanaTransaction(transaction);\n const signedTransaction = await signTransaction(tx);\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(\n signedTransaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n },\n };\n}\n\nfunction getSolanaTransaction(\n data: string\n): Transaction | VersionedTransaction {\n if (!web3)\n throw new Error(\n '@solana/web3.js is not defined. Please install @solana/web3.js into your project'\n );\n\n if (!base58)\n throw new Error(\n 'bs58 is not defined. Please install bs58 into your project'\n );\n\n const parsedUInt8Array = base58.decode(data);\n const vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);\n if (vtx.version === 'legacy') return web3.Transaction.from(parsedUInt8Array);\n return vtx;\n}\n\nfunction getNearWalletHandlers({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const nearWallet = wallet as NearWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const action = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const executionOutcome = await nearWallet.signAndSendTransaction(action);\n if (!executionOutcome) throw new Error('Transaction did not send');\n const {transaction: transactionResult} = executionOutcome;\n return transactionResult.hash;\n },\n };\n}\n\nfunction getEvmWalletHandlers({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const evmWallet = wallet as EthWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const {hash} = await evmWallet.sendTransaction(tx);\n return hash;\n },\n handleSignMessage: async (message: string) => {\n return evmWallet.signMessage(message);\n },\n };\n}\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n ViewChild,\n} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowUtils,\n IFrameMessageHandlers,\n handleIFrameMessage,\n} from './common';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\n@Component({\n selector: 'lib-coinflow-iframe',\n standalone: true,\n imports: [],\n template: ` <iframe\n width=\"100%\"\n height=\"100%\"\n #iframe\n scrolling=\"{{ iframeProps?.handleHeightChange ? 'no' : 'yes' }}\"\n allow=\"payment;camera\"\n title=\"withdraw\"\n frameBorder=\"0\"\n [src]=\"dynamicUrl\"\n ></iframe>`,\n})\nexport class CoinflowIFrameComponent {\n @Input() iframeProps!: CoinflowIFrameProps;\n @Input() messageHandlers!: IFrameMessageHandlers;\n\n dynamicUrl?: SafeResourceUrl;\n @ViewChild('iframe') iframe?: ElementRef<HTMLIFrameElement>;\n\n constructor(private sanitizer: DomSanitizer) {}\n\n ngOnInit() {\n const coinflowUrl = CoinflowUtils.getCoinflowUrl(this.iframeProps);\n this.dynamicUrl =\n this.sanitizer.bypassSecurityTrustResourceUrl(coinflowUrl);\n }\n\n @HostListener('window:message', ['$event']) onPostMessage(event: any) {\n if (\n !event.origin.includes(\n CoinflowUtils.getCoinflowBaseUrl(this.iframeProps.env)\n )\n )\n return;\n\n const promise = handleIFrameMessage(event.data, this.messageHandlers);\n if (!promise) return;\n promise\n .then(this.sendMessage.bind(this))\n .catch(e => this.sendMessage('ERROR ' + e.message));\n }\n\n sendMessage(message: string) {\n if (!this.iframe || !this.iframe.nativeElement) return;\n this.iframe.nativeElement.contentWindow!.postMessage(message, '*');\n }\n}\n","import {Component, Input} from '@angular/core';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\nimport {\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n CoinflowUtils,\n} from './common';\n\n@Component({\n selector: 'lib-coinflow-purchase',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowPurchaseComponent {\n @Input() purchaseProps!: CoinflowPurchaseProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.purchaseProps);\n this.messageHandlers = getHandlers(this.purchaseProps);\n this.messageHandlers.handleHeightChange =\n this.purchaseProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.purchaseProps,\n walletPubkey,\n route: `/purchase/${this.purchaseProps?.merchantId}`,\n transaction: CoinflowUtils.getTransaction(this.purchaseProps),\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-history works!</p> ',\n})\nexport class CoinflowPurchaseHistoryComponent {}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-protection',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-protection works!</p> ',\n})\nexport class CoinflowPurchaseProtectionComponent {}\n","import {Component, Input} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowWithdrawProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n} from './common';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\n\n@Component({\n selector: 'lib-coinflow-withdraw',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowWithdrawComponent {\n @Input() withdrawProps!: CoinflowWithdrawProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.withdrawProps);\n this.messageHandlers = getHandlers(this.withdrawProps);\n this.messageHandlers.handleHeightChange =\n this.withdrawProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.withdrawProps,\n walletPubkey,\n route: `/withdraw/${this.withdrawProps?.merchantId}`,\n transaction: undefined,\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-withdraw-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-withdraw-history works!</p> ',\n})\nexport class CoinflowWithdrawHistoryComponent {}\n","/*\n * Public API Surface of coinflowlabs\n */\n\nexport * from './lib/coinflow-iframe.component';\nexport * from './lib/coinflow-purchase.component';\nexport * from './lib/coinflow-purchase-history.component';\nexport * from './lib/coinflow-purchase-protection.component';\nexport * from './lib/coinflow-withdraw.component';\nexport * from './lib/coinflow-withdraw-history.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAQA,IAAY,cAIX,CAAA;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA,CAAA;AAED,IAAY,aAIX,CAAA;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,aAA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EAAE;AACX,oBAAA,QAAQ,EAAE,2CAA2C;AACtD,iBAAA,CAAA;;;ACPD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"coinflowlabs-angular.mjs","sources":["../../../projects/coinflowlabs/src/lib/common/CoinflowTypes.ts","../../../projects/coinflowlabs/src/lib/common/SolanaPeerDeps.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowUtils.ts","../../../projects/coinflowlabs/src/lib/common/CoinflowLibMessageHandlers.ts","../../../projects/coinflowlabs/src/lib/coinflow-iframe.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-history.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-purchase-protection.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw.component.ts","../../../projects/coinflowlabs/src/lib/coinflow-withdraw-history.component.ts","../../../projects/coinflowlabs/src/public-api.ts","../../../projects/coinflowlabs/src/coinflowlabs-angular.ts"],"sourcesContent":["import type {\n Connection,\n VersionedTransaction,\n PublicKey,\n Signer,\n Transaction,\n} from '@solana/web3.js';\n\nexport enum SettlementType {\n Credits = 'Credits',\n USDC = 'USDC',\n Bank = 'Bank',\n}\n\nexport enum MerchantStyle {\n Rounded = 'rounded',\n Sharp = 'sharp',\n Pill = 'pill',\n}\n\nexport type MerchantTheme = {\n primary?: string;\n background?: string;\n backgroundAccent?: string;\n backgroundAccent2?: string;\n textColor?: string;\n textColorAccent?: string;\n textColorAction?: string;\n font?: string;\n style?: MerchantStyle;\n};\n\nexport interface CustomerInfo {\n name?: string;\n verificationId?: string;\n displayName?: string;\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n ip?: string;\n lat?: string;\n lng?: string;\n}\n\n/** Coinflow Types **/\nexport type CoinflowBlockchain = 'solana' | 'near' | 'eth' | 'polygon' | 'base';\nexport type CoinflowEnvs =\n | 'prod'\n | 'staging'\n | 'staging-live'\n | 'sandbox'\n | 'local';\n\nexport interface CoinflowTypes {\n merchantId: string;\n env?: CoinflowEnvs;\n loaderBackground?: string;\n blockchain: CoinflowBlockchain;\n handleHeightChange?: (height: string) => void;\n theme?: MerchantTheme;\n}\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport type OnSuccessMethod = (\n args:\n | {\n paymentId: string;\n hash?: string | undefined;\n }\n | string\n) => void | Promise<void>;\n\n/** Wallets **/\nexport interface SolanaWallet {\n publicKey: PublicKey | null;\n signTransaction?: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<T>;\n sendTransaction: <T extends Transaction | VersionedTransaction>(\n transaction: T\n ) => Promise<string>;\n signMessage?: (message: Uint8Array) => Promise<Uint8Array>;\n}\n\nexport interface NearWallet {\n accountId: string;\n signAndSendTransaction: (transaction: unknown) => Promise<{\n transaction: {hash: string};\n }>;\n}\n\ntype AccessList = Array<{address: string; storageKeys: Array<string>}>;\ntype AccessListish =\n | AccessList\n | Array<[string, Array<string>]>\n | Record<string, Array<string>>;\n\nexport type EthWallet = {\n address: string | null | undefined;\n sendTransaction: (transaction: {\n to: string;\n from?: string;\n nonce?: Bytes | bigint | string | number;\n\n gasLimit?: Bytes | bigint | string | number;\n gasPrice?: Bytes | bigint | string | number;\n\n data?: BytesLike;\n value?: Bytes | bigint | string | number;\n chainId?: number;\n\n type?: number;\n accessList?: AccessListish;\n\n maxPriorityFeePerGas?: Bytes | bigint | string | number;\n maxFeePerGas?: Bytes | bigint | string | number;\n\n customData?: Record<string, any>;\n ccipReadEnabled?: boolean;\n }) => Promise<{hash: string}>;\n signMessage: (message: string) => Promise<string>;\n};\n\n/** History **/\nexport interface CoinflowSolanaHistoryProps extends CoinflowTypes {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearHistoryProps extends CoinflowTypes {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmHistoryProps extends CoinflowTypes {\n wallet: EthWallet;\n}\n\nexport interface CoinflowEthHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowPolygonHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseHistoryProps extends CoinflowEvmHistoryProps {\n blockchain: 'base';\n}\n\nexport type CoinflowHistoryProps =\n | CoinflowSolanaHistoryProps\n | CoinflowNearHistoryProps\n | CoinflowPolygonHistoryProps\n | CoinflowEthHistoryProps\n | CoinflowBaseHistoryProps;\n\n/** Transactions **/\n\nexport type NearFtTransferCallAction = {\n methodName: 'ft_transfer_call';\n args: object;\n gas: string;\n deposit: string;\n};\n\ntype Bytes = ArrayLike<number>;\ntype BytesLike = Bytes | string;\n\ntype RawProductData = Record<string, string | number | boolean | object>;\n\n/** Purchase **/\n\nexport type ChargebackProtectionData = ChargebackProtectionItem[];\n\nexport interface ChargebackProtectionItem {\n /**\n * The name of the product\n */\n productName: string;\n /**\n * The product type. Possible values include: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp\n */\n productType:\n | 'inGameProduct'\n | 'gameOfSkill'\n | 'dataStorage'\n | 'computingResources'\n | 'sportsTicket'\n | 'eSportsTicket'\n | 'musicTicket'\n | 'conferenceTicket'\n | 'virtualSportsTicket'\n | 'virtualESportsTicket'\n | 'virtualMusicTicket'\n | 'virtualConferenceTicket'\n | 'alcohol'\n | 'DLC'\n | 'subscription'\n | 'fundACause'\n | 'realEstate'\n | 'computingContract'\n | 'digitalArt'\n | 'topUp'\n | 'ownershipContract';\n /**\n * The item's list price\n */\n /**\n * The number of units sold\n */\n quantity: number;\n /**\n * Any additional data that the store can provide on the product, e.g. description, link to image, etc.\n */\n rawProductData?: RawProductData;\n}\n\nexport interface CoinflowCommonPurchaseProps extends CoinflowTypes {\n amount?: number | string;\n onSuccess?: OnSuccessMethod;\n webhookInfo?: object;\n email?: string;\n chargebackProtectionData?: ChargebackProtectionData;\n planCode?: string;\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n customerInfo?: CustomerInfo;\n settlementType?: SettlementType;\n authOnly?: boolean;\n deviceId?: string;\n jwtToken?: string;\n /**\n * If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.\n *\n * Example:\n * Primary origin that will be interacting with the Coinflow iFrame: foo.com\n * Subsequent origins that will render foo.com: bar.com\n * The origin array would then be: [https://foo.com,https://bar.com]\n */\n origins?: string[];\n}\n\nexport interface CoinflowSolanaPurchaseProps\n extends CoinflowCommonPurchaseProps {\n wallet: SolanaWallet;\n transaction?: Transaction | VersionedTransaction;\n partialSigners?: Signer[];\n debugTx?: boolean;\n connection: Connection;\n blockchain: 'solana';\n token?: PublicKey | string;\n rent?: {lamports: string | number};\n nativeSolToConvert?: {lamports: string | number};\n}\n\nexport interface CoinflowNearPurchaseProps extends CoinflowCommonPurchaseProps {\n wallet: NearWallet;\n blockchain: 'near';\n action?: NearFtTransferCallAction;\n nearDeposit?: string;\n}\n\nexport interface CoinflowEvmPurchaseProps extends CoinflowCommonPurchaseProps {\n transaction?: EvmTransactionData;\n token?: string;\n wallet: EthWallet;\n}\n\nexport interface CoinflowPolygonPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowEthPurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'eth';\n}\n\nexport interface CoinflowBasePurchaseProps extends CoinflowEvmPurchaseProps {\n blockchain: 'base';\n}\n\nexport type CoinflowPurchaseProps =\n | CoinflowSolanaPurchaseProps\n | CoinflowNearPurchaseProps\n | CoinflowPolygonPurchaseProps\n | CoinflowEthPurchaseProps\n | CoinflowBasePurchaseProps;\n\n/** Withdraw **/\n\nexport interface CoinflowCommonWithdrawProps extends CoinflowTypes {\n onSuccess?: OnSuccessMethod;\n tokens?: string[];\n lockDefaultToken?: boolean;\n amount?: number;\n email?: string;\n bankAccountLinkRedirect?: string;\n additionalWallets?: {\n wallet: string;\n blockchain: 'solana' | 'eth' | 'near' | 'polygon';\n }[];\n lockAmount?: boolean;\n transactionSigner?: string;\n /**\n * If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.\n *\n * Example:\n * Primary origin that will be interacting with the Coinflow iFrame: foo.com\n * Subsequent origins that will render foo.com: bar.com\n * The origin array would then be: [https://foo.com,https://bar.com]\n */\n origins?: string[];\n}\n\nexport interface CoinflowSolanaWithdrawProps\n extends CoinflowCommonWithdrawProps {\n wallet: SolanaWallet;\n connection: Connection;\n blockchain: 'solana';\n}\n\nexport interface CoinflowNearWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: NearWallet;\n blockchain: 'near';\n}\n\nexport interface CoinflowEvmWithdrawProps extends CoinflowCommonWithdrawProps {\n wallet: EthWallet;\n usePermit?: boolean;\n}\n\nexport interface CoinflowEthWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'eth';\n usePermit?: boolean;\n}\n\nexport interface CoinflowPolygonWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'polygon';\n}\n\nexport interface CoinflowBaseWithdrawProps extends CoinflowEvmWithdrawProps {\n blockchain: 'base';\n}\n\nexport type CoinflowWithdrawProps =\n | CoinflowSolanaWithdrawProps\n | CoinflowNearWithdrawProps\n | CoinflowEthWithdrawProps\n | CoinflowPolygonWithdrawProps\n | CoinflowBaseWithdrawProps;\n\nexport interface CommonEvmRedeem {\n waitForHash?: boolean;\n}\n\nexport interface NormalRedeem extends CommonEvmRedeem {\n transaction: {to: string; data: string};\n}\n\nexport interface KnownTokenIdRedeem extends NormalRedeem {\n nftContract: string;\n nftId: string;\n}\n\nexport interface SafeMintRedeem extends NormalRedeem {\n type: 'safeMint';\n nftContract?: string;\n}\n\nexport interface ReturnedTokenIdRedeem extends NormalRedeem {\n type: 'returned';\n nftContract?: string;\n}\n\ntype ReservoirNftIdItem = Omit<KnownTokenIdRedeem, keyof NormalRedeem>;\ninterface ReservoirOrderIdItem {\n orderId: string;\n}\ntype ReservoirItem = ReservoirNftIdItem | ReservoirOrderIdItem;\ntype ReservoirItems = ReservoirItem | ReservoirItem[];\n\nexport interface ReservoirRedeem extends CommonEvmRedeem {\n type: 'reservoir';\n items: ReservoirItems;\n taker?: string;\n}\n\nexport type EvmTransactionData =\n | SafeMintRedeem\n | ReturnedTokenIdRedeem\n | ReservoirRedeem\n | KnownTokenIdRedeem\n | NormalRedeem;\n\nexport interface CoinflowIFrameProps\n extends Omit<CoinflowTypes, 'merchantId'>,\n Pick<\n CoinflowCommonPurchaseProps,\n | 'chargebackProtectionData'\n | 'webhookInfo'\n | 'amount'\n | 'customerInfo'\n | 'settlementType'\n | 'email'\n | 'planCode'\n | 'deviceId'\n | 'jwtToken'\n | 'origins'\n >,\n Pick<\n CoinflowCommonWithdrawProps,\n | 'bankAccountLinkRedirect'\n | 'additionalWallets'\n | 'transactionSigner'\n | 'lockAmount'\n | 'lockDefaultToken'\n | 'origins'\n >,\n Pick<CoinflowEvmPurchaseProps, 'authOnly'>,\n Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {\n walletPubkey: string | null | undefined;\n route: string;\n routePrefix?: string;\n transaction?: string;\n tokens?: string[] | PublicKey[];\n nearDeposit?: string;\n merchantCss?: string;\n color?: 'white' | 'black';\n disableApplePay?: boolean;\n disableGooglePay?: boolean;\n theme?: MerchantTheme;\n usePermit?: boolean;\n}\n\nexport enum CardType {\n VISA = 'VISA',\n MASTERCARD = 'MSTR',\n AMEX = 'AMEX',\n DISCOVER = 'DISC',\n}\n","// This works in angular, but not react\n// let web3: typeof import('@solana/web3.js') | undefined;\n// let base58: typeof import('bs58') | undefined;\n//\n// try {\n// web3 = require('@solana/web3.js');\n// base58 = require('bs58');\n// } catch (e) {}\n//\n// export {web3, base58};\n\n// This works in react, but not angular\nimport * as SolanaWeb3Js from '@solana/web3.js';\nimport base58Imported from 'bs58';\n\nconst web3: typeof SolanaWeb3Js | undefined = SolanaWeb3Js;\nconst base58: typeof base58Imported | undefined = base58Imported;\nexport {web3, base58};\n","import {\n CoinflowBlockchain,\n CoinflowEnvs,\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n} from './CoinflowTypes';\nimport {web3, base58} from './SolanaPeerDeps';\nimport LZString from 'lz-string';\nimport type {Transaction, VersionedTransaction} from '@solana/web3.js';\n\nexport class CoinflowUtils {\n env: CoinflowEnvs;\n url: string;\n\n constructor(env?: CoinflowEnvs) {\n this.env = env ?? 'prod';\n if (this.env === 'prod') this.url = 'https://api.coinflow.cash';\n else if (this.env === 'local') this.url = 'http://localhost:5000';\n else this.url = `https://api-${this.env}.coinflow.cash`;\n }\n\n async getNSurePartnerId(merchantId: string): Promise<string | undefined> {\n return fetch(this.url + `/merchant/view/${merchantId}`)\n .then(response => response.json())\n .then(\n (json: {\n nSurePartnerId: string | undefined;\n nSureSettings: {nSurePartnerId: string | undefined};\n }) => json.nSureSettings?.nSurePartnerId || json.nSurePartnerId\n )\n .catch(e => {\n console.error(e);\n return undefined;\n });\n }\n\n async getCreditBalance(\n publicKey: string,\n merchantId: string,\n blockchain: 'solana' | 'near'\n ): Promise<{cents: number}> {\n const response = await fetch(\n this.url + `/api/customer/balances/${merchantId}`,\n {\n method: 'GET',\n headers: {\n 'x-coinflow-auth-wallet': publicKey,\n 'x-coinflow-auth-blockchain': blockchain,\n },\n }\n );\n const {credits} = await response.json();\n return credits;\n }\n\n static getCoinflowBaseUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://coinflow.cash';\n if (env === 'local') return 'http://localhost:3000';\n\n return `https://${env}.coinflow.cash`;\n }\n\n static getCoinflowApiUrl(env?: CoinflowEnvs): string {\n if (!env || env === 'prod') return 'https://api.coinflow.cash';\n if (env === 'local') return 'http://localhost:5000';\n\n return `https://api-${env}.coinflow.cash`;\n }\n\n static getCoinflowUrl({\n walletPubkey,\n route,\n routePrefix,\n env,\n amount,\n transaction,\n blockchain,\n webhookInfo,\n email,\n loaderBackground,\n handleHeightChange,\n bankAccountLinkRedirect,\n additionalWallets,\n nearDeposit,\n chargebackProtectionData,\n merchantCss,\n color,\n rent,\n lockDefaultToken,\n token,\n tokens,\n planCode,\n disableApplePay,\n disableGooglePay,\n customerInfo,\n settlementType,\n lockAmount,\n nativeSolToConvert,\n theme,\n usePermit,\n transactionSigner,\n authOnly,\n deviceId,\n jwtToken,\n origins,\n }: CoinflowIFrameProps): string {\n const prefix = routePrefix\n ? `/${routePrefix}/${blockchain}`\n : `/${blockchain}`;\n const url = new URL(prefix + route, CoinflowUtils.getCoinflowBaseUrl(env));\n url.searchParams.append('pubkey', walletPubkey!);\n\n if (transaction) {\n url.searchParams.append('transaction', transaction);\n }\n if (amount) {\n url.searchParams.append('amount', amount.toString());\n }\n\n if (webhookInfo) {\n url.searchParams.append(\n 'webhookInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(webhookInfo))\n );\n }\n\n if (theme) {\n url.searchParams.append(\n 'theme',\n LZString.compressToEncodedURIComponent(JSON.stringify(theme))\n );\n }\n\n if (customerInfo) {\n url.searchParams.append(\n 'customerInfo',\n LZString.compressToEncodedURIComponent(JSON.stringify(customerInfo))\n );\n }\n\n if (email) {\n url.searchParams.append('email', email);\n }\n\n if (token) {\n url.searchParams.append('token', token.toString());\n }\n\n if (tokens) {\n url.searchParams.append('tokens', tokens.toString());\n }\n\n if (loaderBackground) {\n url.searchParams.append('loaderBackground', loaderBackground);\n }\n\n if (handleHeightChange) {\n url.searchParams.append('useHeightChange', 'true');\n }\n\n if (bankAccountLinkRedirect) {\n url.searchParams.append(\n 'bankAccountLinkRedirect',\n bankAccountLinkRedirect\n );\n }\n\n if (additionalWallets)\n url.searchParams.append(\n 'additionalWallets',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(additionalWallets)\n )\n );\n\n if (nearDeposit) url.searchParams.append('nearDeposit', nearDeposit);\n\n if (chargebackProtectionData)\n url.searchParams.append(\n 'chargebackProtectionData',\n LZString.compressToEncodedURIComponent(\n JSON.stringify(chargebackProtectionData)\n )\n );\n if (deviceId) {\n url.searchParams.append('deviceId', deviceId);\n } else {\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const deviceId = window?.nSureSDK?.getDeviceId();\n if (deviceId) url.searchParams.append('deviceId', deviceId);\n }\n }\n\n if (merchantCss) url.searchParams.append('merchantCss', merchantCss);\n if (color) url.searchParams.append('color', color);\n if (rent) url.searchParams.append('rent', rent.lamports.toString());\n if (nativeSolToConvert)\n url.searchParams.append(\n 'nativeSolToConvert',\n nativeSolToConvert.lamports.toString()\n );\n if (lockDefaultToken) url.searchParams.append('lockDefaultToken', 'true');\n if (planCode) url.searchParams.append('planCode', planCode);\n\n if (disableApplePay) url.searchParams.append('disableApplePay', 'true');\n if (disableGooglePay) url.searchParams.append('disableGooglePay', 'true');\n if (settlementType)\n url.searchParams.append('settlementType', settlementType);\n\n if (lockAmount) url.searchParams.append('lockAmount', 'true');\n\n if (usePermit === false) url.searchParams.append('usePermit', 'false');\n if (transactionSigner)\n url.searchParams.append('transactionSigner', transactionSigner);\n if (authOnly === true) url.searchParams.append('authOnly', 'true');\n if (jwtToken) url.searchParams.append('jwtToken', jwtToken);\n if (origins)\n url.searchParams.append(\n 'origins',\n LZString.compressToEncodedURIComponent(JSON.stringify(origins))\n );\n\n return url.toString();\n }\n\n static getTransaction(props: CoinflowPurchaseProps): string | undefined {\n return this.byBlockchain<() => string | undefined>(props.blockchain, {\n solana: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n if (!web3)\n throw new Error('@solana/web3.js dependency is required for Solana');\n if (!base58) throw new Error('bs58 dependency is required for Solana');\n if (!transaction) return undefined;\n return base58.encode(\n (transaction as VersionedTransaction | Transaction).serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n },\n polygon: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n eth: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n base: () => {\n if (!('transaction' in props)) return undefined;\n const {transaction} = props;\n return LZString.compressToEncodedURIComponent(\n JSON.stringify(transaction)\n );\n },\n near: () => {\n if (!('action' in props)) return undefined;\n const {action} = props;\n return LZString.compressToEncodedURIComponent(JSON.stringify(action));\n },\n })();\n }\n\n static byBlockchain<T>(\n blockchain: CoinflowBlockchain,\n args: {solana: T; near: T; eth: T; polygon: T; base: T}\n ): T {\n switch (blockchain) {\n case 'solana':\n return args.solana;\n case 'near':\n return args.near;\n case 'polygon':\n return args.polygon;\n case 'eth':\n return args.eth;\n case 'base':\n return args.base;\n default:\n throw new Error('blockchain not supported!');\n }\n }\n}\n","import {\n CoinflowPurchaseProps,\n EthWallet,\n NearWallet,\n OnSuccessMethod,\n SolanaWallet,\n} from './CoinflowTypes';\nimport {CoinflowUtils} from './CoinflowUtils';\nimport type {Transaction, VersionedTransaction} from '@solana/web3.js';\nimport {web3, base58} from './SolanaPeerDeps';\n\nexport type WalletCall =\n | {method: IFrameMessageMethods; data: string}\n | SuccessWalletCall;\n\ntype SuccessWalletCall = {\n method: IFrameMessageMethods.Success;\n data: string;\n info: {paymentId: string; hash?: string};\n};\n\nexport interface IFrameMessageHandlers {\n handleSendTransaction: (transaction: string) => Promise<string>;\n handleSignMessage?: (message: string) => Promise<string>;\n handleSignTransaction?: (transaction: string) => Promise<string>;\n handleHeightChange?: (height: string) => void;\n onSuccess: OnSuccessMethod | undefined;\n}\n\nenum IFrameMessageMethods {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n SendTransaction = 'sendTransaction',\n HeightChange = 'heightChange',\n Success = 'success',\n}\n\nexport function getWalletPubkey({\n wallet,\n}: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined {\n if ('publicKey' in wallet) {\n return wallet.publicKey!.toString();\n }\n\n if ('address' in wallet) {\n return wallet.address;\n }\n\n if ('accountId' in wallet) {\n return wallet.accountId;\n }\n\n return null;\n}\n\nexport function handleIFrameMessage(\n rawMessage: string,\n handlers: IFrameMessageHandlers\n): Promise<string> | void {\n let walletCall: WalletCall;\n try {\n walletCall = JSON.parse(rawMessage);\n if (!('method' in walletCall) || !('data' in walletCall)) return;\n } catch (e) {\n console.error('handleIFrameMessage JSON parse', e);\n return;\n }\n\n const {data, method} = walletCall;\n switch (method) {\n case IFrameMessageMethods.SignMessage:\n if (!handlers.handleSignMessage) return;\n return handlers.handleSignMessage(data);\n case IFrameMessageMethods.SignTransaction:\n if (!handlers.handleSignTransaction) return;\n return handlers.handleSignTransaction(data);\n case IFrameMessageMethods.SendTransaction:\n return handlers.handleSendTransaction(data);\n case IFrameMessageMethods.HeightChange:\n if (!handlers.handleHeightChange) return;\n return handlers.handleHeightChange(data);\n case IFrameMessageMethods.Success:\n if (!handlers.onSuccess) return;\n handlers.onSuccess((walletCall as SuccessWalletCall).info);\n return;\n }\n\n console.warn(\n `Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`\n );\n}\n\nexport function getHandlers(\n props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess'>\n): Omit<IFrameMessageHandlers, 'handleHeightChange'> {\n return CoinflowUtils.byBlockchain(props.blockchain, {\n solana: () => getSolanaWalletHandlers(props),\n near: () => getNearWalletHandlers(props),\n eth: () => getEvmWalletHandlers(props),\n polygon: () => getEvmWalletHandlers(props),\n base: () => getEvmWalletHandlers(props),\n })();\n}\n\nfunction getSolanaWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = getSolanaTransaction(transaction);\n return await (wallet as SolanaWallet).sendTransaction(tx);\n },\n handleSignMessage: async (message: string) => {\n const signMessage = (wallet as SolanaWallet).signMessage;\n if (!signMessage) {\n throw new Error('signMessage is not supported by this wallet');\n }\n\n const signedMessage = await signMessage(\n new TextEncoder().encode(message)\n );\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(signedMessage);\n },\n handleSignTransaction: async (transaction: string) => {\n const signTransaction = (wallet as SolanaWallet).signTransaction;\n if (!signTransaction) {\n throw new Error('signTransaction is not supported by this wallet');\n }\n const tx = getSolanaTransaction(transaction);\n const signedTransaction = await signTransaction(tx);\n if (!base58) throw new Error('bs58 dependency is required');\n return base58.encode(\n signedTransaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n },\n onSuccess,\n };\n}\n\nfunction getSolanaTransaction(\n data: string\n): Transaction | VersionedTransaction {\n if (!web3)\n throw new Error(\n '@solana/web3.js is not defined. Please install @solana/web3.js into your project'\n );\n\n if (!base58)\n throw new Error(\n 'bs58 is not defined. Please install bs58 into your project'\n );\n\n const parsedUInt8Array = base58.decode(data);\n const vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);\n if (vtx.version === 'legacy') return web3.Transaction.from(parsedUInt8Array);\n return vtx;\n}\n\nfunction getNearWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const nearWallet = wallet as NearWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const action = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const executionOutcome = await nearWallet.signAndSendTransaction(action);\n if (!executionOutcome) throw new Error('Transaction did not send');\n const {transaction: transactionResult} = executionOutcome;\n return transactionResult.hash;\n },\n onSuccess,\n };\n}\n\nfunction getEvmWalletHandlers({\n wallet,\n onSuccess,\n}: Pick<CoinflowPurchaseProps, 'wallet' | 'onSuccess'>): Omit<\n IFrameMessageHandlers,\n 'handleHeightChange'\n> {\n const evmWallet = wallet as EthWallet;\n return {\n handleSendTransaction: async (transaction: string) => {\n const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());\n const {hash} = await evmWallet.sendTransaction(tx);\n return hash;\n },\n handleSignMessage: async (message: string) => {\n return evmWallet.signMessage(message);\n },\n onSuccess,\n };\n}\n","import {\n Component,\n ElementRef,\n HostListener,\n Input,\n ViewChild,\n} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowUtils,\n IFrameMessageHandlers,\n handleIFrameMessage,\n} from './common';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\n@Component({\n selector: 'lib-coinflow-iframe',\n standalone: true,\n imports: [],\n template: ` <iframe\n width=\"100%\"\n height=\"100%\"\n #iframe\n scrolling=\"{{ iframeProps?.handleHeightChange ? 'no' : 'yes' }}\"\n allow=\"payment;camera\"\n title=\"withdraw\"\n frameBorder=\"0\"\n [src]=\"dynamicUrl\"\n ></iframe>`,\n})\nexport class CoinflowIFrameComponent {\n @Input() iframeProps!: CoinflowIFrameProps;\n @Input() messageHandlers!: IFrameMessageHandlers;\n\n dynamicUrl?: SafeResourceUrl;\n @ViewChild('iframe') iframe?: ElementRef<HTMLIFrameElement>;\n\n constructor(private sanitizer: DomSanitizer) {}\n\n ngOnInit() {\n const coinflowUrl = CoinflowUtils.getCoinflowUrl(this.iframeProps);\n this.dynamicUrl =\n this.sanitizer.bypassSecurityTrustResourceUrl(coinflowUrl);\n }\n\n @HostListener('window:message', ['$event']) onPostMessage(event: any) {\n if (\n !event.origin.includes(\n CoinflowUtils.getCoinflowBaseUrl(this.iframeProps.env)\n )\n )\n return;\n\n const promise = handleIFrameMessage(event.data, this.messageHandlers);\n if (!promise) return;\n promise\n .then(this.sendMessage.bind(this))\n .catch(e => this.sendMessage('ERROR ' + e.message));\n }\n\n sendMessage(message: string) {\n if (!this.iframe || !this.iframe.nativeElement) return;\n this.iframe.nativeElement.contentWindow!.postMessage(message, '*');\n }\n}\n","import {Component, Input} from '@angular/core';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\nimport {\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n CoinflowUtils,\n} from './common';\n\n@Component({\n selector: 'lib-coinflow-purchase',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowPurchaseComponent {\n @Input() purchaseProps!: CoinflowPurchaseProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.purchaseProps);\n this.messageHandlers = getHandlers(this.purchaseProps);\n this.messageHandlers.handleHeightChange =\n this.purchaseProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.purchaseProps,\n walletPubkey,\n route: `/purchase/${this.purchaseProps?.merchantId}`,\n transaction: CoinflowUtils.getTransaction(this.purchaseProps),\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-history works!</p> ',\n})\nexport class CoinflowPurchaseHistoryComponent {}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-purchase-protection',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-purchase-protection works!</p> ',\n})\nexport class CoinflowPurchaseProtectionComponent {}\n","import {Component, Input} from '@angular/core';\nimport {\n CoinflowIFrameProps,\n CoinflowWithdrawProps,\n IFrameMessageHandlers,\n getHandlers,\n getWalletPubkey,\n} from './common';\nimport {CoinflowIFrameComponent} from './coinflow-iframe.component';\n\n@Component({\n selector: 'lib-coinflow-withdraw',\n standalone: true,\n imports: [CoinflowIFrameComponent],\n template:\n ' <lib-coinflow-iframe ng-if=\"iframeProps && messageHandlers\" [iframeProps]=\"iframeProps!\" [messageHandlers]=\"messageHandlers!\"></lib-coinflow-iframe> ',\n})\nexport class CoinflowWithdrawComponent {\n @Input() withdrawProps!: CoinflowWithdrawProps;\n iframeProps?: CoinflowIFrameProps;\n messageHandlers?: IFrameMessageHandlers;\n\n ngOnInit() {\n const walletPubkey = getWalletPubkey(this.withdrawProps);\n this.messageHandlers = getHandlers(this.withdrawProps);\n this.messageHandlers.handleHeightChange =\n this.withdrawProps.handleHeightChange;\n\n this.iframeProps = {\n ...this.withdrawProps,\n walletPubkey,\n route: `/withdraw/${this.withdrawProps?.merchantId}`,\n transaction: undefined,\n };\n }\n}\n","import {Component} from '@angular/core';\n\n@Component({\n selector: 'lib-coinflow-withdraw-history',\n standalone: true,\n imports: [],\n template: ' <p>coinflow-withdraw-history works!</p> ',\n})\nexport class CoinflowWithdrawHistoryComponent {}\n","/*\n * Public API Surface of coinflowlabs\n */\n\nexport * from './lib/coinflow-iframe.component';\nexport * from './lib/coinflow-purchase.component';\nexport * from './lib/coinflow-purchase-history.component';\nexport * from './lib/coinflow-purchase-protection.component';\nexport * from './lib/coinflow-withdraw.component';\nexport * from './lib/coinflow-withdraw-history.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAQA,IAAY,cAIX,CAAA;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA,CAAA;AAED,IAAY,aAIX,CAAA;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACn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CVK,gCAAgC,CAAA;+GAAhC,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAhC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gCAAgC,yFAFjC,2CAA2C,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAE1C,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAN5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,+BAA+B;AACzC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,QAAQ,EAAE,2CAA2C;AACtD,iBAAA,CAAA;;;ACPD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import { CoinflowPurchaseProps } from './CoinflowTypes';
|
|
1
|
+
import { CoinflowPurchaseProps, OnSuccessMethod } from './CoinflowTypes';
|
|
2
2
|
export type WalletCall = {
|
|
3
3
|
method: IFrameMessageMethods;
|
|
4
4
|
data: string;
|
|
5
|
+
} | SuccessWalletCall;
|
|
6
|
+
type SuccessWalletCall = {
|
|
7
|
+
method: IFrameMessageMethods.Success;
|
|
8
|
+
data: string;
|
|
9
|
+
info: {
|
|
10
|
+
paymentId: string;
|
|
11
|
+
hash?: string;
|
|
12
|
+
};
|
|
5
13
|
};
|
|
6
14
|
export interface IFrameMessageHandlers {
|
|
7
15
|
handleSendTransaction: (transaction: string) => Promise<string>;
|
|
8
16
|
handleSignMessage?: (message: string) => Promise<string>;
|
|
9
17
|
handleSignTransaction?: (transaction: string) => Promise<string>;
|
|
10
18
|
handleHeightChange?: (height: string) => void;
|
|
19
|
+
onSuccess: OnSuccessMethod | undefined;
|
|
11
20
|
}
|
|
12
21
|
declare enum IFrameMessageMethods {
|
|
13
22
|
SignMessage = "signMessage",
|
|
14
23
|
SignTransaction = "signTransaction",
|
|
15
24
|
SendTransaction = "sendTransaction",
|
|
16
|
-
HeightChange = "heightChange"
|
|
25
|
+
HeightChange = "heightChange",
|
|
26
|
+
Success = "success"
|
|
17
27
|
}
|
|
18
28
|
export declare function getWalletPubkey({ wallet, }: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined;
|
|
19
29
|
export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers): Promise<string> | void;
|
|
20
|
-
export declare function getHandlers(
|
|
30
|
+
export declare function getHandlers(props: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain' | 'onSuccess'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
21
31
|
export {};
|