@coinflowlabs/angular 0.0.3 → 0.0.4
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/ng-package.json +7 -0
- package/package.json +9 -17
- package/src/lib/coinflow-iframe.component.ts +63 -0
- package/src/lib/coinflow-purchase-history.component.ts +9 -0
- package/src/lib/coinflow-purchase-protection.component.ts +9 -0
- package/src/lib/coinflow-purchase.component.ts +37 -0
- package/src/lib/coinflow-withdraw-history.component.ts +9 -0
- package/src/lib/coinflow-withdraw.component.ts +36 -0
- package/src/lib/common/CoinflowLibMessageHandlers.ts +188 -0
- package/src/lib/common/CoinflowTypes.ts +403 -0
- package/src/lib/common/CoinflowUtils.ts +269 -0
- package/{public-api.d.ts → src/public-api.ts} +4 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/coinflowlabs-angular.mjs +0 -5
- package/esm2022/lib/coinflow-iframe.component.mjs +0 -67
- package/esm2022/lib/coinflow-purchase-history.component.mjs +0 -16
- package/esm2022/lib/coinflow-purchase-protection.component.mjs +0 -16
- package/esm2022/lib/coinflow-purchase.component.mjs +0 -32
- package/esm2022/lib/coinflow-withdraw-history.component.mjs +0 -16
- package/esm2022/lib/coinflow-withdraw.component.mjs +0 -32
- package/esm2022/lib/common/CoinflowLibMessageHandlers.mjs +0 -127
- package/esm2022/lib/common/CoinflowTypes.mjs +0 -13
- package/esm2022/lib/common/CoinflowUtils.mjs +0 -173
- package/esm2022/lib/common/index.mjs +0 -4
- package/esm2022/public-api.mjs +0 -10
- package/fesm2022/coinflowlabs-angular.mjs +0 -486
- package/fesm2022/coinflowlabs-angular.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/coinflow-iframe.component.d.ts +0 -17
- package/lib/coinflow-purchase-history.component.d.ts +0 -5
- package/lib/coinflow-purchase-protection.component.d.ts +0 -5
- package/lib/coinflow-purchase.component.d.ts +0 -10
- package/lib/coinflow-withdraw-history.component.d.ts +0 -5
- package/lib/coinflow-withdraw.component.d.ts +0 -10
- package/lib/common/CoinflowLibMessageHandlers.d.ts +0 -21
- package/lib/common/CoinflowTypes.d.ts +0 -287
- package/lib/common/CoinflowUtils.d.ts +0 -21
- /package/{lib/common/index.d.ts → src/lib/common/index.ts} +0 -0
|
@@ -1,486 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, ViewChild, HostListener } from '@angular/core';
|
|
3
|
-
import * as web3 from '@solana/web3.js';
|
|
4
|
-
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
5
|
-
import base58 from 'bs58';
|
|
6
|
-
import * as i1 from '@angular/platform-browser';
|
|
7
|
-
|
|
8
|
-
var SettlementType;
|
|
9
|
-
(function (SettlementType) {
|
|
10
|
-
SettlementType["Credits"] = "Credits";
|
|
11
|
-
SettlementType["USDC"] = "USDC";
|
|
12
|
-
SettlementType["Bank"] = "Bank";
|
|
13
|
-
})(SettlementType || (SettlementType = {}));
|
|
14
|
-
var MerchantStyle;
|
|
15
|
-
(function (MerchantStyle) {
|
|
16
|
-
MerchantStyle["Rounded"] = "rounded";
|
|
17
|
-
MerchantStyle["Sharp"] = "sharp";
|
|
18
|
-
MerchantStyle["Pill"] = "pill";
|
|
19
|
-
})(MerchantStyle || (MerchantStyle = {}));
|
|
20
|
-
|
|
21
|
-
class CoinflowUtils {
|
|
22
|
-
constructor(env) {
|
|
23
|
-
this.env = env ?? 'prod';
|
|
24
|
-
if (this.env === 'prod')
|
|
25
|
-
this.url = 'https://api.coinflow.cash';
|
|
26
|
-
else if (this.env === 'local')
|
|
27
|
-
this.url = 'http://localhost:5000';
|
|
28
|
-
else
|
|
29
|
-
this.url = `https://api-${this.env}.coinflow.cash`;
|
|
30
|
-
}
|
|
31
|
-
async getNSurePartnerId(merchantId) {
|
|
32
|
-
return fetch(this.url + `/merchant/view/${merchantId}`)
|
|
33
|
-
.then(response => response.json())
|
|
34
|
-
.then((json) => json.nSureSettings?.nSurePartnerId || json.nSurePartnerId)
|
|
35
|
-
.catch(e => {
|
|
36
|
-
console.error(e);
|
|
37
|
-
return undefined;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
async getCreditBalance(publicKey, merchantId, blockchain) {
|
|
41
|
-
const response = await fetch(this.url + `/api/customer/balances/${merchantId}`, {
|
|
42
|
-
method: 'GET',
|
|
43
|
-
headers: {
|
|
44
|
-
'x-coinflow-auth-wallet': publicKey,
|
|
45
|
-
'x-coinflow-auth-blockchain': blockchain,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
const { credits } = await response.json();
|
|
49
|
-
return credits;
|
|
50
|
-
}
|
|
51
|
-
static getCoinflowBaseUrl(env) {
|
|
52
|
-
if (!env || env === 'prod')
|
|
53
|
-
return 'https://coinflow.cash';
|
|
54
|
-
if (env === 'local')
|
|
55
|
-
return 'http://localhost:3000';
|
|
56
|
-
return `https://${env}.coinflow.cash`;
|
|
57
|
-
}
|
|
58
|
-
static getCoinflowApiUrl(env) {
|
|
59
|
-
if (!env || env === 'prod')
|
|
60
|
-
return 'https://api.coinflow.cash';
|
|
61
|
-
if (env === 'local')
|
|
62
|
-
return 'http://localhost:5000';
|
|
63
|
-
return `https://api-${env}.coinflow.cash`;
|
|
64
|
-
}
|
|
65
|
-
static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain, supportsVersionedTransactions, 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, }) {
|
|
66
|
-
const prefix = routePrefix
|
|
67
|
-
? `/${routePrefix}/${blockchain}`
|
|
68
|
-
: `/${blockchain}`;
|
|
69
|
-
const url = new URL(prefix + route, CoinflowUtils.getCoinflowBaseUrl(env));
|
|
70
|
-
url.searchParams.append('pubkey', walletPubkey);
|
|
71
|
-
if (transaction) {
|
|
72
|
-
url.searchParams.append('transaction', transaction);
|
|
73
|
-
}
|
|
74
|
-
if (amount) {
|
|
75
|
-
url.searchParams.append('amount', amount.toString());
|
|
76
|
-
}
|
|
77
|
-
if (supportsVersionedTransactions) {
|
|
78
|
-
url.searchParams.append('supportsVersionedTransactions', 'true');
|
|
79
|
-
}
|
|
80
|
-
if (webhookInfo) {
|
|
81
|
-
url.searchParams.append('webhookInfo', Buffer.from(JSON.stringify(webhookInfo)).toString('base64'));
|
|
82
|
-
}
|
|
83
|
-
if (theme) {
|
|
84
|
-
url.searchParams.append('theme', Buffer.from(JSON.stringify(theme)).toString('base64'));
|
|
85
|
-
}
|
|
86
|
-
if (customerInfo) {
|
|
87
|
-
url.searchParams.append('customerInfo', Buffer.from(JSON.stringify(customerInfo)).toString('base64'));
|
|
88
|
-
}
|
|
89
|
-
if (email) {
|
|
90
|
-
url.searchParams.append('email', email);
|
|
91
|
-
}
|
|
92
|
-
if (token) {
|
|
93
|
-
url.searchParams.append('token', token.toString());
|
|
94
|
-
}
|
|
95
|
-
if (tokens) {
|
|
96
|
-
url.searchParams.append('tokens', tokens.toString());
|
|
97
|
-
}
|
|
98
|
-
if (loaderBackground) {
|
|
99
|
-
url.searchParams.append('loaderBackground', loaderBackground);
|
|
100
|
-
}
|
|
101
|
-
if (handleHeightChange) {
|
|
102
|
-
url.searchParams.append('useHeightChange', 'true');
|
|
103
|
-
}
|
|
104
|
-
if (bankAccountLinkRedirect) {
|
|
105
|
-
url.searchParams.append('bankAccountLinkRedirect', bankAccountLinkRedirect);
|
|
106
|
-
}
|
|
107
|
-
if (additionalWallets)
|
|
108
|
-
url.searchParams.append('additionalWallets', JSON.stringify(additionalWallets));
|
|
109
|
-
if (nearDeposit)
|
|
110
|
-
url.searchParams.append('nearDeposit', nearDeposit);
|
|
111
|
-
if (chargebackProtectionData)
|
|
112
|
-
url.searchParams.append('chargebackProtectionData', JSON.stringify(chargebackProtectionData));
|
|
113
|
-
if (deviceId) {
|
|
114
|
-
url.searchParams.append('deviceId', deviceId);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
if (typeof window !== 'undefined') {
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
119
|
-
// @ts-ignore
|
|
120
|
-
const deviceId = window?.nSureSDK?.getDeviceId();
|
|
121
|
-
if (deviceId)
|
|
122
|
-
url.searchParams.append('deviceId', deviceId);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (merchantCss)
|
|
126
|
-
url.searchParams.append('merchantCss', merchantCss);
|
|
127
|
-
if (color)
|
|
128
|
-
url.searchParams.append('color', color);
|
|
129
|
-
if (rent)
|
|
130
|
-
url.searchParams.append('rent', rent.lamports.toString());
|
|
131
|
-
if (nativeSolToConvert)
|
|
132
|
-
url.searchParams.append('nativeSolToConvert', nativeSolToConvert.lamports.toString());
|
|
133
|
-
if (lockDefaultToken)
|
|
134
|
-
url.searchParams.append('lockDefaultToken', 'true');
|
|
135
|
-
if (planCode)
|
|
136
|
-
url.searchParams.append('planCode', planCode);
|
|
137
|
-
if (disableApplePay)
|
|
138
|
-
url.searchParams.append('disableApplePay', 'true');
|
|
139
|
-
if (disableGooglePay)
|
|
140
|
-
url.searchParams.append('disableGooglePay', 'true');
|
|
141
|
-
if (settlementType)
|
|
142
|
-
url.searchParams.append('settlementType', settlementType);
|
|
143
|
-
if (lockAmount)
|
|
144
|
-
url.searchParams.append('lockAmount', 'true');
|
|
145
|
-
if (usePermit === false)
|
|
146
|
-
url.searchParams.append('usePermit', 'false');
|
|
147
|
-
if (transactionSigner)
|
|
148
|
-
url.searchParams.append('transactionSigner', transactionSigner);
|
|
149
|
-
if (authOnly === true)
|
|
150
|
-
url.searchParams.append('authOnly', 'true');
|
|
151
|
-
return url.toString();
|
|
152
|
-
}
|
|
153
|
-
static getTransaction(props) {
|
|
154
|
-
if ('transaction' in props) {
|
|
155
|
-
const { transaction } = props;
|
|
156
|
-
if (transaction instanceof Transaction) {
|
|
157
|
-
return base58.encode(transaction.serialize({
|
|
158
|
-
requireAllSignatures: false,
|
|
159
|
-
verifySignatures: false,
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
if (transaction instanceof VersionedTransaction) {
|
|
163
|
-
return base58.encode(transaction.serialize());
|
|
164
|
-
}
|
|
165
|
-
return btoa(JSON.stringify(transaction));
|
|
166
|
-
}
|
|
167
|
-
if ('action' in props) {
|
|
168
|
-
return btoa(JSON.stringify(props.action));
|
|
169
|
-
}
|
|
170
|
-
return undefined;
|
|
171
|
-
}
|
|
172
|
-
static byBlockchain(blockchain, args) {
|
|
173
|
-
switch (blockchain) {
|
|
174
|
-
case 'solana':
|
|
175
|
-
return args.solana;
|
|
176
|
-
case 'near':
|
|
177
|
-
return args.near;
|
|
178
|
-
case 'polygon':
|
|
179
|
-
return args.polygon;
|
|
180
|
-
case 'eth':
|
|
181
|
-
if (args.eth === undefined)
|
|
182
|
-
throw new Error('blockchain not supported for this operation!');
|
|
183
|
-
return args.eth;
|
|
184
|
-
case 'base':
|
|
185
|
-
return args.base;
|
|
186
|
-
default:
|
|
187
|
-
throw new Error('blockchain not supported!');
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
var IFrameMessageMethods;
|
|
193
|
-
(function (IFrameMessageMethods) {
|
|
194
|
-
IFrameMessageMethods["SignMessage"] = "signMessage";
|
|
195
|
-
IFrameMessageMethods["SignTransaction"] = "signTransaction";
|
|
196
|
-
IFrameMessageMethods["SendTransaction"] = "sendTransaction";
|
|
197
|
-
IFrameMessageMethods["HeightChange"] = "heightChange";
|
|
198
|
-
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
199
|
-
function getWalletPubkey({ wallet, }) {
|
|
200
|
-
if ('publicKey' in wallet) {
|
|
201
|
-
return wallet.publicKey.toString();
|
|
202
|
-
}
|
|
203
|
-
if ('address' in wallet) {
|
|
204
|
-
return wallet.address;
|
|
205
|
-
}
|
|
206
|
-
if ('accountId' in wallet) {
|
|
207
|
-
return wallet.accountId;
|
|
208
|
-
}
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
211
|
-
function handleIFrameMessage(rawMessage, handlers) {
|
|
212
|
-
let walletCall;
|
|
213
|
-
try {
|
|
214
|
-
walletCall = JSON.parse(rawMessage);
|
|
215
|
-
if (!('method' in walletCall) || !('data' in walletCall))
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
catch (e) {
|
|
219
|
-
console.error('handleIFrameMessage JSON parse', e);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
const { data, method } = walletCall;
|
|
223
|
-
switch (method) {
|
|
224
|
-
case IFrameMessageMethods.SignMessage:
|
|
225
|
-
if (!handlers.handleSignMessage)
|
|
226
|
-
return;
|
|
227
|
-
return handlers.handleSignMessage(data);
|
|
228
|
-
case IFrameMessageMethods.SignTransaction:
|
|
229
|
-
if (!handlers.handleSignTransaction)
|
|
230
|
-
return;
|
|
231
|
-
return handlers.handleSignTransaction(data);
|
|
232
|
-
case IFrameMessageMethods.SendTransaction:
|
|
233
|
-
return handlers.handleSendTransaction(data);
|
|
234
|
-
case IFrameMessageMethods.HeightChange:
|
|
235
|
-
if (!handlers.handleHeightChange)
|
|
236
|
-
return;
|
|
237
|
-
return handlers.handleHeightChange(data);
|
|
238
|
-
}
|
|
239
|
-
console.warn(`Didn't expect to get here, handleIFrameMessage method:${method} is not one of ${Object.values(IFrameMessageMethods)}`);
|
|
240
|
-
}
|
|
241
|
-
function getHandlers({ wallet, blockchain, }) {
|
|
242
|
-
return CoinflowUtils.byBlockchain(blockchain, {
|
|
243
|
-
solana: () => getSolanaWalletHandlers({ wallet }),
|
|
244
|
-
near: () => getNearWalletHandlers({ wallet }),
|
|
245
|
-
eth: () => getEvmWalletHandlers({ wallet }),
|
|
246
|
-
polygon: () => getEvmWalletHandlers({ wallet }),
|
|
247
|
-
base: () => getEvmWalletHandlers({ wallet }),
|
|
248
|
-
})();
|
|
249
|
-
}
|
|
250
|
-
function getSolanaWalletHandlers({ wallet, }) {
|
|
251
|
-
return {
|
|
252
|
-
handleSendTransaction: async (transaction) => {
|
|
253
|
-
const tx = getSolanaTransaction(transaction);
|
|
254
|
-
return wallet.sendTransaction(tx);
|
|
255
|
-
},
|
|
256
|
-
handleSignMessage: async (message) => {
|
|
257
|
-
const signMessage = wallet.signMessage;
|
|
258
|
-
if (!signMessage) {
|
|
259
|
-
throw new Error('signMessage is not supported by this wallet');
|
|
260
|
-
}
|
|
261
|
-
const signedMessage = await signMessage(new TextEncoder().encode(message));
|
|
262
|
-
return base58.encode(signedMessage);
|
|
263
|
-
},
|
|
264
|
-
handleSignTransaction: async (transaction) => {
|
|
265
|
-
const signTransaction = wallet.signTransaction;
|
|
266
|
-
if (!signTransaction) {
|
|
267
|
-
throw new Error('signTransaction is not supported by this wallet');
|
|
268
|
-
}
|
|
269
|
-
const tx = getSolanaTransaction(transaction);
|
|
270
|
-
const signedTransaction = await signTransaction(tx);
|
|
271
|
-
return base58.encode(signedTransaction.serialize({
|
|
272
|
-
requireAllSignatures: false,
|
|
273
|
-
verifySignatures: false,
|
|
274
|
-
}));
|
|
275
|
-
},
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
function getSolanaTransaction(data) {
|
|
279
|
-
if (!web3)
|
|
280
|
-
throw new Error('@solana/web3.js is not defined. Please install @solana/web3.js into your project');
|
|
281
|
-
if (!base58)
|
|
282
|
-
throw new Error('bs58 is not defined. Please install bs58 into your project');
|
|
283
|
-
const parsedUInt8Array = base58.decode(data);
|
|
284
|
-
const vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);
|
|
285
|
-
if (vtx.version === 'legacy')
|
|
286
|
-
return web3.Transaction.from(parsedUInt8Array);
|
|
287
|
-
return vtx;
|
|
288
|
-
}
|
|
289
|
-
function getNearWalletHandlers({ wallet, }) {
|
|
290
|
-
const nearWallet = wallet;
|
|
291
|
-
return {
|
|
292
|
-
handleSendTransaction: async (transaction) => {
|
|
293
|
-
const action = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
294
|
-
const executionOutcome = await nearWallet.signAndSendTransaction(action);
|
|
295
|
-
if (!executionOutcome)
|
|
296
|
-
throw new Error('Transaction did not send');
|
|
297
|
-
const { transaction: transactionResult } = executionOutcome;
|
|
298
|
-
return transactionResult.hash;
|
|
299
|
-
},
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function getEvmWalletHandlers({ wallet, }) {
|
|
303
|
-
const evmWallet = wallet;
|
|
304
|
-
return {
|
|
305
|
-
handleSendTransaction: async (transaction) => {
|
|
306
|
-
const tx = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
307
|
-
const { hash } = await evmWallet.sendTransaction(tx);
|
|
308
|
-
return hash;
|
|
309
|
-
},
|
|
310
|
-
handleSignMessage: async (message) => {
|
|
311
|
-
return evmWallet.signMessage(message);
|
|
312
|
-
},
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
class CoinflowIFrameComponent {
|
|
317
|
-
constructor(sanitizer) {
|
|
318
|
-
this.sanitizer = sanitizer;
|
|
319
|
-
}
|
|
320
|
-
ngOnInit() {
|
|
321
|
-
const coinflowUrl = CoinflowUtils.getCoinflowUrl(this.iframeProps);
|
|
322
|
-
this.dynamicUrl =
|
|
323
|
-
this.sanitizer.bypassSecurityTrustResourceUrl(coinflowUrl);
|
|
324
|
-
}
|
|
325
|
-
onPostMessage(event) {
|
|
326
|
-
if (!event.origin.includes(CoinflowUtils.getCoinflowBaseUrl(this.iframeProps.env)))
|
|
327
|
-
return;
|
|
328
|
-
const promise = handleIFrameMessage(event.data, this.messageHandlers);
|
|
329
|
-
if (!promise)
|
|
330
|
-
return;
|
|
331
|
-
promise.then(this.sendMessage.bind(this));
|
|
332
|
-
}
|
|
333
|
-
sendMessage(message) {
|
|
334
|
-
if (!this.iframe || !this.iframe.nativeElement)
|
|
335
|
-
return;
|
|
336
|
-
this.iframe.nativeElement.contentWindow.postMessage(message, '*');
|
|
337
|
-
}
|
|
338
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowIFrameComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
339
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", 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
|
|
340
|
-
width="100%"
|
|
341
|
-
height="100%"
|
|
342
|
-
#iframe
|
|
343
|
-
scrolling="{{ iframeProps?.handleHeightChange ? 'no' : 'yes' }}"
|
|
344
|
-
allow="payment;camera"
|
|
345
|
-
title="withdraw"
|
|
346
|
-
frameBorder="0"
|
|
347
|
-
[src]="dynamicUrl"
|
|
348
|
-
></iframe>`, isInline: true }); }
|
|
349
|
-
}
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowIFrameComponent, decorators: [{
|
|
351
|
-
type: Component,
|
|
352
|
-
args: [{
|
|
353
|
-
selector: 'lib-coinflow-iframe',
|
|
354
|
-
standalone: true,
|
|
355
|
-
imports: [],
|
|
356
|
-
template: ` <iframe
|
|
357
|
-
width="100%"
|
|
358
|
-
height="100%"
|
|
359
|
-
#iframe
|
|
360
|
-
scrolling="{{ iframeProps?.handleHeightChange ? 'no' : 'yes' }}"
|
|
361
|
-
allow="payment;camera"
|
|
362
|
-
title="withdraw"
|
|
363
|
-
frameBorder="0"
|
|
364
|
-
[src]="dynamicUrl"
|
|
365
|
-
></iframe>`,
|
|
366
|
-
}]
|
|
367
|
-
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { iframeProps: [{
|
|
368
|
-
type: Input
|
|
369
|
-
}], messageHandlers: [{
|
|
370
|
-
type: Input
|
|
371
|
-
}], iframe: [{
|
|
372
|
-
type: ViewChild,
|
|
373
|
-
args: ['iframe']
|
|
374
|
-
}], onPostMessage: [{
|
|
375
|
-
type: HostListener,
|
|
376
|
-
args: ['window:message', ['$event']]
|
|
377
|
-
}] } });
|
|
378
|
-
|
|
379
|
-
class CoinflowPurchaseComponent {
|
|
380
|
-
ngOnInit() {
|
|
381
|
-
const walletPubkey = getWalletPubkey(this.purchaseProps);
|
|
382
|
-
this.messageHandlers = getHandlers(this.purchaseProps);
|
|
383
|
-
this.messageHandlers.handleHeightChange =
|
|
384
|
-
this.purchaseProps.handleHeightChange;
|
|
385
|
-
this.iframeProps = {
|
|
386
|
-
...this.purchaseProps,
|
|
387
|
-
walletPubkey,
|
|
388
|
-
route: `/purchase/${this.purchaseProps?.merchantId}`,
|
|
389
|
-
transaction: CoinflowUtils.getTransaction(this.purchaseProps),
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowPurchaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
393
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", 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"] }] }); }
|
|
394
|
-
}
|
|
395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowPurchaseComponent, decorators: [{
|
|
396
|
-
type: Component,
|
|
397
|
-
args: [{
|
|
398
|
-
selector: 'lib-coinflow-purchase',
|
|
399
|
-
standalone: true,
|
|
400
|
-
imports: [CoinflowIFrameComponent],
|
|
401
|
-
template: ' <lib-coinflow-iframe ng-if="iframeProps && messageHandlers" [iframeProps]="iframeProps!" [messageHandlers]="messageHandlers!"></lib-coinflow-iframe> ',
|
|
402
|
-
}]
|
|
403
|
-
}], propDecorators: { purchaseProps: [{
|
|
404
|
-
type: Input
|
|
405
|
-
}] } });
|
|
406
|
-
|
|
407
|
-
class CoinflowPurchaseHistoryComponent {
|
|
408
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowPurchaseHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
409
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: CoinflowPurchaseHistoryComponent, isStandalone: true, selector: "lib-coinflow-purchase-history", ngImport: i0, template: ' <p>coinflow-purchase-history works!</p> ', isInline: true }); }
|
|
410
|
-
}
|
|
411
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowPurchaseHistoryComponent, decorators: [{
|
|
412
|
-
type: Component,
|
|
413
|
-
args: [{
|
|
414
|
-
selector: 'lib-coinflow-purchase-history',
|
|
415
|
-
standalone: true,
|
|
416
|
-
imports: [],
|
|
417
|
-
template: ' <p>coinflow-purchase-history works!</p> ',
|
|
418
|
-
}]
|
|
419
|
-
}] });
|
|
420
|
-
|
|
421
|
-
class CoinflowPurchaseProtectionComponent {
|
|
422
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowPurchaseProtectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
423
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: CoinflowPurchaseProtectionComponent, isStandalone: true, selector: "lib-coinflow-purchase-protection", ngImport: i0, template: ' <p>coinflow-purchase-protection works!</p> ', isInline: true }); }
|
|
424
|
-
}
|
|
425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowPurchaseProtectionComponent, decorators: [{
|
|
426
|
-
type: Component,
|
|
427
|
-
args: [{
|
|
428
|
-
selector: 'lib-coinflow-purchase-protection',
|
|
429
|
-
standalone: true,
|
|
430
|
-
imports: [],
|
|
431
|
-
template: ' <p>coinflow-purchase-protection works!</p> ',
|
|
432
|
-
}]
|
|
433
|
-
}] });
|
|
434
|
-
|
|
435
|
-
class CoinflowWithdrawComponent {
|
|
436
|
-
ngOnInit() {
|
|
437
|
-
const walletPubkey = getWalletPubkey(this.withdrawProps);
|
|
438
|
-
this.messageHandlers = getHandlers(this.withdrawProps);
|
|
439
|
-
this.messageHandlers.handleHeightChange =
|
|
440
|
-
this.withdrawProps.handleHeightChange;
|
|
441
|
-
this.iframeProps = {
|
|
442
|
-
...this.withdrawProps,
|
|
443
|
-
walletPubkey,
|
|
444
|
-
route: `/withdraw/${this.withdrawProps?.merchantId}`,
|
|
445
|
-
transaction: undefined,
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowWithdrawComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
449
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", 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"] }] }); }
|
|
450
|
-
}
|
|
451
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowWithdrawComponent, decorators: [{
|
|
452
|
-
type: Component,
|
|
453
|
-
args: [{
|
|
454
|
-
selector: 'lib-coinflow-withdraw',
|
|
455
|
-
standalone: true,
|
|
456
|
-
imports: [CoinflowIFrameComponent],
|
|
457
|
-
template: ' <lib-coinflow-iframe ng-if="iframeProps && messageHandlers" [iframeProps]="iframeProps!" [messageHandlers]="messageHandlers!"></lib-coinflow-iframe> ',
|
|
458
|
-
}]
|
|
459
|
-
}], propDecorators: { withdrawProps: [{
|
|
460
|
-
type: Input
|
|
461
|
-
}] } });
|
|
462
|
-
|
|
463
|
-
class CoinflowWithdrawHistoryComponent {
|
|
464
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowWithdrawHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
465
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.2", type: CoinflowWithdrawHistoryComponent, isStandalone: true, selector: "lib-coinflow-withdraw-history", ngImport: i0, template: ' <p>coinflow-withdraw-history works!</p> ', isInline: true }); }
|
|
466
|
-
}
|
|
467
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: CoinflowWithdrawHistoryComponent, decorators: [{
|
|
468
|
-
type: Component,
|
|
469
|
-
args: [{
|
|
470
|
-
selector: 'lib-coinflow-withdraw-history',
|
|
471
|
-
standalone: true,
|
|
472
|
-
imports: [],
|
|
473
|
-
template: ' <p>coinflow-withdraw-history works!</p> ',
|
|
474
|
-
}]
|
|
475
|
-
}] });
|
|
476
|
-
|
|
477
|
-
/*
|
|
478
|
-
* Public API Surface of coinflowlabs
|
|
479
|
-
*/
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Generated bundle index. Do not edit.
|
|
483
|
-
*/
|
|
484
|
-
|
|
485
|
-
export { CoinflowIFrameComponent, CoinflowPurchaseComponent, CoinflowPurchaseHistoryComponent, CoinflowPurchaseProtectionComponent, CoinflowWithdrawComponent, CoinflowWithdrawHistoryComponent };
|
|
486
|
-
//# sourceMappingURL=coinflowlabs-angular.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coinflowlabs-angular.mjs","sources":["../../../projects/coinflowlabs/src/lib/common/CoinflowTypes.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 {Connection, VersionedTransaction} from '@solana/web3.js';\nimport {PublicKey, Signer, Transaction} 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;\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}\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 >,\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","import {\n CoinflowBlockchain,\n CoinflowEnvs,\n CoinflowIFrameProps,\n CoinflowPurchaseProps,\n} from './CoinflowTypes';\nimport {Transaction, VersionedTransaction} from '@solana/web3.js';\nimport base58 from 'bs58';\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 }: 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 Buffer.from(JSON.stringify(webhookInfo)).toString('base64')\n );\n }\n\n if (theme) {\n url.searchParams.append(\n 'theme',\n Buffer.from(JSON.stringify(theme)).toString('base64')\n );\n }\n\n if (customerInfo) {\n url.searchParams.append(\n 'customerInfo',\n Buffer.from(JSON.stringify(customerInfo)).toString('base64')\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 JSON.stringify(additionalWallets)\n );\n\n if (nearDeposit) url.searchParams.append('nearDeposit', nearDeposit);\n\n if (chargebackProtectionData)\n url.searchParams.append(\n 'chargebackProtectionData',\n JSON.stringify(chargebackProtectionData)\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\n return url.toString();\n }\n\n static getTransaction(props: CoinflowPurchaseProps): string | undefined {\n if ('transaction' in props) {\n const {transaction} = props;\n if (transaction instanceof Transaction) {\n return base58.encode(\n transaction.serialize({\n requireAllSignatures: false,\n verifySignatures: false,\n })\n );\n }\n\n if (transaction instanceof VersionedTransaction) {\n return base58.encode(transaction.serialize());\n }\n\n return btoa(JSON.stringify(transaction));\n }\n\n if ('action' in props) {\n return btoa(JSON.stringify(props.action));\n }\n\n return undefined;\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 if (args.eth === undefined)\n throw new Error('blockchain not supported for this operation!');\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 {Transaction, VersionedTransaction} from '@solana/web3.js';\nimport * as web3 from '@solana/web3.js';\nimport base58 from 'bs58';\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 (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 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 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.then(this.sendMessage.bind(this));\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":";;;;;;;AAGA,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,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,GAIxB,EAAA,CAAA,CAAA;;MCJY,aAAa,CAAA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AAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,uBAAuB,CAAC;AAClC,oBAAA,QAAQ,EACN,yJAAyJ;AAC5J,iBAAA,CAAA;8BAEU,aAAa,EAAA,CAAA;sBAArB,KAAK;;;MCVK,gCAAgC,CAAA;8GAAhC,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,QAAA,EAAA,IAAA,EAAA,gCAAgC,yFAFjC,2CAA2C,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;2FAE1C,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;;;;"}
|
package/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
-
import { CoinflowIFrameProps, IFrameMessageHandlers } from './common';
|
|
3
|
-
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class CoinflowIFrameComponent {
|
|
6
|
-
private sanitizer;
|
|
7
|
-
iframeProps: CoinflowIFrameProps;
|
|
8
|
-
messageHandlers: IFrameMessageHandlers;
|
|
9
|
-
dynamicUrl?: SafeResourceUrl;
|
|
10
|
-
iframe?: ElementRef<HTMLIFrameElement>;
|
|
11
|
-
constructor(sanitizer: DomSanitizer);
|
|
12
|
-
ngOnInit(): void;
|
|
13
|
-
onPostMessage(event: any): void;
|
|
14
|
-
sendMessage(message: string): void;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowIFrameComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowIFrameComponent, "lib-coinflow-iframe", never, { "iframeProps": { "alias": "iframeProps"; "required": false; }; "messageHandlers": { "alias": "messageHandlers"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class CoinflowPurchaseHistoryComponent {
|
|
3
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowPurchaseHistoryComponent, never>;
|
|
4
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowPurchaseHistoryComponent, "lib-coinflow-purchase-history", never, {}, {}, never, never, true, never>;
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class CoinflowPurchaseProtectionComponent {
|
|
3
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowPurchaseProtectionComponent, never>;
|
|
4
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowPurchaseProtectionComponent, "lib-coinflow-purchase-protection", never, {}, {}, never, never, true, never>;
|
|
5
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CoinflowIFrameProps, CoinflowPurchaseProps, IFrameMessageHandlers } from './common';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class CoinflowPurchaseComponent {
|
|
4
|
-
purchaseProps: CoinflowPurchaseProps;
|
|
5
|
-
iframeProps?: CoinflowIFrameProps;
|
|
6
|
-
messageHandlers?: IFrameMessageHandlers;
|
|
7
|
-
ngOnInit(): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CoinflowPurchaseComponent, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CoinflowPurchaseComponent, "lib-coinflow-purchase", never, { "purchaseProps": { "alias": "purchaseProps"; "required": false; }; }, {}, never, never, true, never>;
|
|
10
|
-
}
|