@chipi-stack/backend 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,710 @@
1
+ import { isValidApiKey, ChipiAuthError, validateErrorResponse, ChipiApiError, validateApiResponse, handleApiError, ChipiTransactionError, API_ENDPOINTS, formatAmount, STARKNET_NETWORKS, CONTRACT_ADDRESSES } from '@chipi-stack/shared';
2
+ import { RpcProvider, stark, ec, CairoCustomEnum, CairoOption, CairoOptionVariant, CallData, hash, Account, num } from 'starknet';
3
+ import CryptoJS2 from 'crypto-js';
4
+
5
+ // src/chipi-sdk.ts
6
+ var ChipiClient = class {
7
+ constructor(config) {
8
+ if (!isValidApiKey(config.apiPublicKey)) {
9
+ throw new ChipiAuthError("Invalid API key format");
10
+ }
11
+ this.apiPublicKey = config.apiPublicKey;
12
+ this.environment = config.environment || "production";
13
+ this.baseUrl = this.getBaseUrl();
14
+ }
15
+ /**
16
+ * Get the API public key (for internal SDK use)
17
+ */
18
+ getApiPublicKey() {
19
+ return this.apiPublicKey;
20
+ }
21
+ getBaseUrl() {
22
+ if (this.environment === "development") {
23
+ return "http://localhost:3000/v1";
24
+ }
25
+ return "https://api.chipipay.com/v1";
26
+ }
27
+ getHeaders(bearerToken) {
28
+ const headers = {
29
+ "Content-Type": "application/json",
30
+ "x-api-key": this.apiPublicKey
31
+ };
32
+ if (bearerToken) {
33
+ headers["Authorization"] = `Bearer ${bearerToken}`;
34
+ }
35
+ return headers;
36
+ }
37
+ async get(endpoint, params, bearerToken) {
38
+ try {
39
+ const url = new URL(`${this.baseUrl}${endpoint}`);
40
+ if (params) {
41
+ Object.entries(params).forEach(([key, value]) => {
42
+ if (value !== void 0 && value !== null) {
43
+ url.searchParams.append(key, String(value));
44
+ }
45
+ });
46
+ }
47
+ const response = await fetch(url.toString(), {
48
+ method: "GET",
49
+ headers: this.getHeaders(bearerToken)
50
+ });
51
+ const rawData = await response.json();
52
+ if (!response.ok) {
53
+ const errorData = validateErrorResponse(rawData);
54
+ throw new ChipiApiError(
55
+ errorData.message,
56
+ errorData.code || `HTTP_${response.status}`,
57
+ response.status
58
+ );
59
+ }
60
+ return {
61
+ success: true,
62
+ data: validateApiResponse(rawData)
63
+ };
64
+ } catch (error) {
65
+ throw handleApiError(error);
66
+ }
67
+ }
68
+ async post(endpoint, body, bearerToken) {
69
+ try {
70
+ const response = await fetch(`${this.baseUrl}${endpoint}`, {
71
+ method: "POST",
72
+ headers: this.getHeaders(bearerToken),
73
+ body: body ? JSON.stringify(body) : void 0
74
+ });
75
+ const rawData = await response.json();
76
+ if (!response.ok) {
77
+ const errorData = validateErrorResponse(rawData);
78
+ throw new ChipiApiError(
79
+ errorData.message,
80
+ errorData.code || `HTTP_${response.status}`,
81
+ response.status
82
+ );
83
+ }
84
+ return {
85
+ success: true,
86
+ data: validateApiResponse(rawData)
87
+ };
88
+ } catch (error) {
89
+ throw handleApiError(error);
90
+ }
91
+ }
92
+ async put(endpoint, body, bearerToken) {
93
+ try {
94
+ const response = await fetch(`${this.baseUrl}${endpoint}`, {
95
+ method: "PUT",
96
+ headers: this.getHeaders(bearerToken),
97
+ body: body ? JSON.stringify(body) : void 0
98
+ });
99
+ const rawData = await response.json();
100
+ if (!response.ok) {
101
+ const errorData = validateErrorResponse(rawData);
102
+ throw new ChipiApiError(
103
+ errorData.message,
104
+ errorData.code || `HTTP_${response.status}`,
105
+ response.status
106
+ );
107
+ }
108
+ return {
109
+ success: true,
110
+ data: validateApiResponse(rawData)
111
+ };
112
+ } catch (error) {
113
+ throw handleApiError(error);
114
+ }
115
+ }
116
+ async delete(endpoint, bearerToken) {
117
+ try {
118
+ const response = await fetch(`${this.baseUrl}${endpoint}`, {
119
+ method: "DELETE",
120
+ headers: this.getHeaders(bearerToken)
121
+ });
122
+ const rawData = await response.json();
123
+ if (!response.ok) {
124
+ const errorData = validateErrorResponse(rawData);
125
+ throw new ChipiApiError(
126
+ errorData.message,
127
+ errorData.code || `HTTP_${response.status}`,
128
+ response.status
129
+ );
130
+ }
131
+ return {
132
+ success: true,
133
+ data: validateApiResponse(rawData)
134
+ };
135
+ } catch (error) {
136
+ throw handleApiError(error);
137
+ }
138
+ }
139
+ };
140
+ var ChipiWallets = class {
141
+ constructor(client) {
142
+ this.client = client;
143
+ this.encryptPrivateKey = (privateKey, password) => {
144
+ if (!privateKey || !password) {
145
+ throw new Error("Private key and password are required");
146
+ }
147
+ return CryptoJS2.AES.encrypt(privateKey, password).toString();
148
+ };
149
+ }
150
+ /**
151
+ * Prepare wallet creation data
152
+ */
153
+ // async prepareWalletCreation(
154
+ // params: Omit<PrepareWalletCreationParams, 'apiPublicKey'>
155
+ // ): Promise<PrepareWalletCreationResponse> {
156
+ // const response = await this.client.post<PrepareWalletCreationResponse>(
157
+ // `${API_ENDPOINTS.CHIPI_WALLETS}/prepare-creation`,
158
+ // params
159
+ // );
160
+ // return response.data!;
161
+ // }
162
+ /**
163
+ * Create a new wallet
164
+ */
165
+ // async createWallet(
166
+ // params: Omit<CreateWalletParams, 'apiPublicKey' | 'nodeUrl'>,
167
+ // nodeUrl?: string
168
+ // ): Promise<CreateWalletResponse> {
169
+ // const response = await this.client.post<CreateWalletResponse>(
170
+ // API_ENDPOINTS.CHIPI_WALLETS,
171
+ // {
172
+ // ...params,
173
+ // nodeUrl,
174
+ // },
175
+ // params.bearerToken
176
+ // );
177
+ // return response.data!;
178
+ // }
179
+ async createWallet(params) {
180
+ try {
181
+ const { encryptKey, apiPublicKey, bearerToken, nodeUrl, backendUrl } = params;
182
+ const provider = new RpcProvider({ nodeUrl });
183
+ const privateKeyAX = stark.randomAddress();
184
+ const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKeyAX);
185
+ const accountClassHash = "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f";
186
+ const axSigner = new CairoCustomEnum({
187
+ Starknet: { pubkey: starkKeyPubAX }
188
+ });
189
+ const axGuardian = new CairoOption(CairoOptionVariant.None);
190
+ const AXConstructorCallData = CallData.compile({
191
+ owner: axSigner,
192
+ guardian: axGuardian
193
+ });
194
+ const publicKey = hash.calculateContractAddressFromHash(
195
+ starkKeyPubAX,
196
+ accountClassHash,
197
+ AXConstructorCallData,
198
+ 0
199
+ );
200
+ const account = new Account(provider, publicKey, privateKeyAX);
201
+ console.log("apiPublicKey", apiPublicKey);
202
+ const typeDataResponse = await fetch(`${backendUrl}/chipi-wallets/prepare-creation`, {
203
+ method: "POST",
204
+ headers: {
205
+ "Content-Type": "application/json",
206
+ "Authorization": `Bearer ${bearerToken}`,
207
+ "x-api-key": apiPublicKey
208
+ },
209
+ body: JSON.stringify({
210
+ publicKey
211
+ })
212
+ });
213
+ const { typeData, accountClassHash: accountClassHashResponse } = await typeDataResponse.json();
214
+ const userSignature = await account.signMessage(typeData);
215
+ const deploymentData = {
216
+ class_hash: accountClassHashResponse,
217
+ salt: starkKeyPubAX,
218
+ unique: `${num.toHex(0)}`,
219
+ calldata: AXConstructorCallData.map((value) => num.toHex(value))
220
+ };
221
+ const encryptedPrivateKey = this.encryptPrivateKey(privateKeyAX, encryptKey);
222
+ const executeTransactionResponse = await fetch(`${backendUrl}/chipi-wallets`, {
223
+ method: "POST",
224
+ headers: {
225
+ "Content-Type": "application/json",
226
+ "Authorization": `Bearer ${bearerToken}`,
227
+ "x-api-key": apiPublicKey
228
+ },
229
+ body: JSON.stringify({
230
+ apiPublicKey,
231
+ publicKey,
232
+ userSignature: {
233
+ r: userSignature.r.toString(),
234
+ s: userSignature.s.toString(),
235
+ recovery: userSignature.recovery
236
+ },
237
+ typeData,
238
+ encryptedPrivateKey,
239
+ deploymentData: {
240
+ ...deploymentData,
241
+ salt: `${deploymentData.salt}`,
242
+ calldata: deploymentData.calldata.map((data) => `${data}`)
243
+ }
244
+ })
245
+ });
246
+ const executeTransaction = await executeTransactionResponse.json();
247
+ if (executeTransaction.success) {
248
+ return {
249
+ success: true,
250
+ txHash: executeTransaction.txHash,
251
+ walletPublicKey: executeTransaction.walletPublicKey,
252
+ wallet: executeTransaction.wallet
253
+ };
254
+ } else {
255
+ return {
256
+ success: false,
257
+ txHash: "",
258
+ walletPublicKey: "",
259
+ wallet: {
260
+ publicKey: "",
261
+ encryptedPrivateKey: ""
262
+ }
263
+ };
264
+ }
265
+ } catch (error) {
266
+ console.error("Error detallado:", error);
267
+ if (error instanceof Error && error.message.includes("SSL")) {
268
+ throw new Error(
269
+ "Error de conexi\xF3n SSL. Intenta usando NODE_TLS_REJECT_UNAUTHORIZED=0 o verifica la URL del RPC"
270
+ );
271
+ }
272
+ throw new ChipiTransactionError(
273
+ `Failed to create wallet: ${error instanceof Error ? error.message : "Unknown error"}`,
274
+ "WALLET_CREATION_FAILED"
275
+ );
276
+ }
277
+ }
278
+ /**
279
+ * Create a custodial merchant wallet
280
+ */
281
+ async createCustodialWallet(params, orgId) {
282
+ const response = await this.client.post(
283
+ `${API_ENDPOINTS.CHIPI_WALLETS}/merchant`,
284
+ {
285
+ ...params,
286
+ orgId
287
+ }
288
+ );
289
+ return response.data;
290
+ }
291
+ /**
292
+ * Get merchant wallet by API key and chain
293
+ */
294
+ async getMerchantWallet(params) {
295
+ const response = await this.client.get(
296
+ `${API_ENDPOINTS.CHIPI_WALLETS}/merchant`,
297
+ {
298
+ apiKeyId: params.apiKeyId,
299
+ chain: params.chain
300
+ }
301
+ );
302
+ return response.data;
303
+ }
304
+ /**
305
+ * Get wallets for an organization
306
+ */
307
+ async getWallets(query) {
308
+ const response = await this.client.get(
309
+ API_ENDPOINTS.CHIPI_WALLETS,
310
+ query
311
+ );
312
+ return response.data;
313
+ }
314
+ };
315
+ var encryptPrivateKey = (privateKey, password) => {
316
+ if (!privateKey || !password) {
317
+ throw new Error("Private key and password are required");
318
+ }
319
+ return CryptoJS2.AES.encrypt(privateKey, password).toString();
320
+ };
321
+ var decryptPrivateKey = (encryptedPrivateKey, password) => {
322
+ if (!encryptedPrivateKey || !password) {
323
+ console.error("Encrypted private key and password are required");
324
+ return null;
325
+ }
326
+ try {
327
+ const bytes = CryptoJS2.AES.decrypt(encryptedPrivateKey, password);
328
+ const decrypted = bytes.toString(CryptoJS2.enc.Utf8);
329
+ if (!decrypted) {
330
+ return null;
331
+ }
332
+ return decrypted;
333
+ } catch (error) {
334
+ console.error("Decryption failed:", error);
335
+ return null;
336
+ }
337
+ };
338
+
339
+ // src/gasless.ts
340
+ var executePaymasterTransaction = async (params) => {
341
+ try {
342
+ const { encryptKey, wallet, calls, apiPublicKey, bearerToken, backendUrl } = params;
343
+ const privateKeyDecrypted = decryptPrivateKey(
344
+ wallet.encryptedPrivateKey,
345
+ encryptKey
346
+ );
347
+ if (!privateKeyDecrypted) {
348
+ throw new Error("Failed to decrypt private key");
349
+ }
350
+ const provider = new RpcProvider({
351
+ nodeUrl: "https://cloud.argent-api.com/v1/starknet/mainnet/rpc/v0.7"
352
+ });
353
+ const account = new Account(
354
+ provider,
355
+ wallet.publicKey,
356
+ privateKeyDecrypted
357
+ );
358
+ const typeDataResponse = await fetch(`${backendUrl}/transactions/prepare-typed-data`, {
359
+ method: "POST",
360
+ headers: {
361
+ "Content-Type": "application/json",
362
+ "Authorization": `Bearer ${bearerToken}`,
363
+ "X-API-Key": apiPublicKey
364
+ },
365
+ body: JSON.stringify({
366
+ publicKey: wallet.publicKey,
367
+ calls,
368
+ accountClassHash: "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f"
369
+ })
370
+ });
371
+ if (!typeDataResponse.ok) {
372
+ const errorText = await typeDataResponse.text();
373
+ throw new Error(`Error en la API: ${errorText}`);
374
+ }
375
+ const typeData = await typeDataResponse.json();
376
+ const userSignature = await account.signMessage(typeData);
377
+ const executeTransaction = await fetch(`${backendUrl}/transactions/execute-sponsored-transaction`, {
378
+ method: "POST",
379
+ headers: {
380
+ "Content-Type": "application/json",
381
+ "Authorization": `Bearer ${bearerToken}`,
382
+ "X-API-Key": apiPublicKey
383
+ },
384
+ body: JSON.stringify({
385
+ publicKey: wallet.publicKey,
386
+ typeData,
387
+ userSignature: {
388
+ r: userSignature.r.toString(),
389
+ s: userSignature.s.toString(),
390
+ recovery: userSignature.recovery
391
+ }
392
+ })
393
+ });
394
+ if (!executeTransaction.ok) {
395
+ const errorText = await executeTransaction.text();
396
+ throw new Error(`Error en la API de ejecuci\xF3n: ${errorText}`);
397
+ }
398
+ const result = await executeTransaction.json();
399
+ if (!result.transactionHash) {
400
+ throw new Error("La respuesta no contiene el hash de la transacci\xF3n");
401
+ }
402
+ return result.transactionHash;
403
+ } catch (error) {
404
+ console.error("Error sending transaction with paymaster", error);
405
+ throw error;
406
+ }
407
+ };
408
+
409
+ // src/transactions.ts
410
+ var ChipiTransactions = class {
411
+ constructor(client) {
412
+ this.client = client;
413
+ }
414
+ /**
415
+ * Execute a gasless transaction using paymaster
416
+ */
417
+ async executeTransaction(params) {
418
+ return executePaymasterTransaction({
419
+ ...params,
420
+ apiPublicKey: this.client.getApiPublicKey(),
421
+ backendUrl: this.client.baseUrl
422
+ });
423
+ }
424
+ /**
425
+ * Transfer tokens
426
+ */
427
+ async transfer(params) {
428
+ const formattedAmount = formatAmount(params.amount, params.decimals);
429
+ return this.executeTransaction({
430
+ encryptKey: params.encryptKey,
431
+ wallet: params.wallet,
432
+ bearerToken: params.bearerToken,
433
+ calls: [
434
+ {
435
+ contractAddress: params.contractAddress,
436
+ entrypoint: "transfer",
437
+ calldata: [
438
+ params.recipient,
439
+ formattedAmount,
440
+ "0x0"
441
+ ]
442
+ }
443
+ ]
444
+ });
445
+ }
446
+ /**
447
+ * Approve token spending
448
+ */
449
+ async approve(params) {
450
+ const formattedAmount = formatAmount(params.amount, params.decimals);
451
+ return this.executeTransaction({
452
+ encryptKey: params.encryptKey,
453
+ wallet: params.wallet,
454
+ bearerToken: params.bearerToken,
455
+ calls: [
456
+ {
457
+ contractAddress: params.contractAddress,
458
+ entrypoint: "approve",
459
+ calldata: [
460
+ params.spender,
461
+ formattedAmount,
462
+ "0x0"
463
+ ]
464
+ }
465
+ ]
466
+ });
467
+ }
468
+ /**
469
+ * Call any contract method
470
+ */
471
+ async callAnyContract(params) {
472
+ return this.executeTransaction({
473
+ encryptKey: params.encryptKey,
474
+ wallet: params.wallet,
475
+ bearerToken: params.bearerToken,
476
+ calls: params.calls
477
+ });
478
+ }
479
+ };
480
+ var ChipiSkus = class {
481
+ constructor(client) {
482
+ this.client = client;
483
+ }
484
+ /**
485
+ * Find available SKUs
486
+ */
487
+ async findSkus(params = {}) {
488
+ const response = await this.client.get(
489
+ API_ENDPOINTS.SKUS,
490
+ {
491
+ categories: params.categories
492
+ }
493
+ );
494
+ return response.data;
495
+ }
496
+ /**
497
+ * Get SKU by ID
498
+ */
499
+ async getSku(skuId) {
500
+ const response = await this.client.get(
501
+ `${API_ENDPOINTS.SKUS}/${skuId}`
502
+ );
503
+ return response.data;
504
+ }
505
+ /**
506
+ * Create a SKU transaction
507
+ */
508
+ async createSkuTransaction(params) {
509
+ const response = await this.client.post(
510
+ API_ENDPOINTS.SKU_TRANSACTIONS,
511
+ params
512
+ );
513
+ return response.data;
514
+ }
515
+ /**
516
+ * Get SKU transaction by ID
517
+ */
518
+ async getSkuTransaction(transactionId) {
519
+ const response = await this.client.get(
520
+ `${API_ENDPOINTS.SKU_TRANSACTIONS}/${transactionId}`
521
+ );
522
+ return response.data;
523
+ }
524
+ /**
525
+ * Get SKU transactions for a wallet
526
+ */
527
+ async getSkuTransactionsByWallet(walletAddress, params = {}) {
528
+ const response = await this.client.get(
529
+ API_ENDPOINTS.SKU_TRANSACTIONS,
530
+ {
531
+ walletAddress,
532
+ ...params
533
+ }
534
+ );
535
+ return response.data;
536
+ }
537
+ /**
538
+ * Purchase a SKU
539
+ * This is a convenience method that combines finding a SKU and creating a transaction
540
+ */
541
+ async purchaseSku(params) {
542
+ const sku = await this.getSku(params.skuId);
543
+ const transaction = await this.createSkuTransaction({
544
+ walletAddress: params.walletAddress,
545
+ skuId: params.skuId,
546
+ chain: params.chain,
547
+ chainToken: params.chainToken,
548
+ mxnAmount: params.mxnAmount,
549
+ reference: params.reference,
550
+ transactionHash: params.transactionHash
551
+ });
552
+ return {
553
+ sku,
554
+ transaction
555
+ };
556
+ }
557
+ };
558
+
559
+ // src/chipi-sdk.ts
560
+ var ChipiSDK = class {
561
+ constructor(config) {
562
+ this.client = new ChipiClient(config);
563
+ this.nodeUrl = config.nodeUrl || STARKNET_NETWORKS.MAINNET;
564
+ this.wallets = new ChipiWallets(this.client);
565
+ this.transactions = new ChipiTransactions(this.client);
566
+ this.skus = new ChipiSkus(this.client);
567
+ this.executeTransaction = this.executeTransaction.bind(this);
568
+ this.transfer = this.transfer.bind(this);
569
+ this.approve = this.approve.bind(this);
570
+ this.stakeVesuUsdc = this.stakeVesuUsdc.bind(this);
571
+ this.withdrawVesuUsdc = this.withdrawVesuUsdc.bind(this);
572
+ this.callAnyContract = this.callAnyContract.bind(this);
573
+ this.createWallet = this.createWallet.bind(this);
574
+ }
575
+ /**
576
+ * Execute a gasless transaction
577
+ */
578
+ async executeTransaction(input) {
579
+ return this.transactions.executeTransaction(input);
580
+ }
581
+ /**
582
+ * Transfer tokens
583
+ */
584
+ async transfer(params) {
585
+ const { encryptKey, wallet, contractAddress, recipient, amount, decimals, bearerToken } = params;
586
+ const formattedAmount = formatAmount(amount, decimals);
587
+ return this.executeTransaction({
588
+ encryptKey,
589
+ wallet,
590
+ bearerToken,
591
+ calls: [
592
+ {
593
+ contractAddress,
594
+ entrypoint: "transfer",
595
+ calldata: [
596
+ recipient,
597
+ formattedAmount,
598
+ "0x0"
599
+ ]
600
+ }
601
+ ]
602
+ });
603
+ }
604
+ /**
605
+ * Approve token spending
606
+ */
607
+ async approve(params) {
608
+ const { encryptKey, wallet, contractAddress, spender, amount, decimals, bearerToken } = params;
609
+ return this.executeTransaction({
610
+ encryptKey,
611
+ wallet,
612
+ bearerToken,
613
+ calls: [
614
+ {
615
+ contractAddress,
616
+ entrypoint: "approve",
617
+ calldata: [
618
+ spender,
619
+ formatAmount(amount, decimals),
620
+ "0x0"
621
+ ]
622
+ }
623
+ ]
624
+ });
625
+ }
626
+ /**
627
+ * Stake USDC in Vesu protocol
628
+ */
629
+ async stakeVesuUsdc(params) {
630
+ const { encryptKey, wallet, amount, receiverWallet, bearerToken } = params;
631
+ const formattedAmount = formatAmount(amount, 6);
632
+ return this.executeTransaction({
633
+ encryptKey,
634
+ wallet,
635
+ bearerToken,
636
+ calls: [
637
+ {
638
+ contractAddress: CONTRACT_ADDRESSES.USDC_MAINNET,
639
+ entrypoint: "approve",
640
+ calldata: [
641
+ CONTRACT_ADDRESSES.VESU_USDC_MAINNET,
642
+ formattedAmount,
643
+ "0x0"
644
+ ]
645
+ },
646
+ {
647
+ contractAddress: CONTRACT_ADDRESSES.VESU_USDC_MAINNET,
648
+ entrypoint: "deposit",
649
+ calldata: [
650
+ formattedAmount,
651
+ "0x0",
652
+ receiverWallet
653
+ ]
654
+ }
655
+ ]
656
+ });
657
+ }
658
+ /**
659
+ * Withdraw USDC from Vesu protocol
660
+ */
661
+ async withdrawVesuUsdc(params) {
662
+ const { encryptKey, wallet, amount, recipient, bearerToken } = params;
663
+ const formattedAmount = formatAmount(amount, 6);
664
+ return this.executeTransaction({
665
+ encryptKey,
666
+ wallet,
667
+ bearerToken,
668
+ calls: [
669
+ {
670
+ contractAddress: CONTRACT_ADDRESSES.VESU_USDC_MAINNET,
671
+ entrypoint: "withdraw",
672
+ calldata: [
673
+ formattedAmount,
674
+ recipient,
675
+ "0x0"
676
+ ]
677
+ }
678
+ ]
679
+ });
680
+ }
681
+ /**
682
+ * Call any contract method
683
+ */
684
+ async callAnyContract(params) {
685
+ const { encryptKey, wallet, calls, bearerToken } = params;
686
+ return this.executeTransaction({
687
+ encryptKey,
688
+ wallet,
689
+ bearerToken,
690
+ calls
691
+ });
692
+ }
693
+ /**
694
+ * Create a new wallet
695
+ */
696
+ async createWallet(params) {
697
+ const { encryptKey, bearerToken } = params;
698
+ return this.wallets.createWallet({
699
+ encryptKey,
700
+ apiPublicKey: this.client.getApiPublicKey(),
701
+ bearerToken,
702
+ nodeUrl: this.nodeUrl,
703
+ backendUrl: this.client.baseUrl
704
+ });
705
+ }
706
+ };
707
+
708
+ export { ChipiClient, ChipiSDK, ChipiSkus, ChipiTransactions, ChipiWallets, decryptPrivateKey, encryptPrivateKey };
709
+ //# sourceMappingURL=index.mjs.map
710
+ //# sourceMappingURL=index.mjs.map