@frak-labs/core-sdk 0.0.5 → 0.0.6

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.cjs CHANGED
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunkIVQL5N55_cjs = require('./chunk-IVQL5N55.cjs');
4
- var chunkPO6YSB4Q_cjs = require('./chunk-PO6YSB4Q.cjs');
3
+ var chunk7YDJDVXY_cjs = require('./chunk-7YDJDVXY.cjs');
4
+ var chunk665P7NO4_cjs = require('./chunk-665P7NO4.cjs');
5
5
 
6
6
  // src/utils/constants.ts
7
7
  var BACKUP_KEY = "nexus-wallet-backup";
8
8
 
9
9
  // src/clients/DebugInfo.ts
10
10
  var DebugInfoGatherer = class _DebugInfoGatherer {
11
+ config;
12
+ iframe;
13
+ isSetupDone = false;
14
+ lastResponse = null;
15
+ lastRequest = null;
11
16
  constructor(config, iframe) {
12
- chunkPO6YSB4Q_cjs.__publicField(this, "config");
13
- chunkPO6YSB4Q_cjs.__publicField(this, "iframe");
14
- chunkPO6YSB4Q_cjs.__publicField(this, "isSetupDone", false);
15
- chunkPO6YSB4Q_cjs.__publicField(this, "lastResponse", null);
16
- chunkPO6YSB4Q_cjs.__publicField(this, "lastRequest", null);
17
17
  this.config = config;
18
18
  this.iframe = iframe;
19
19
  this.lastRequest = null;
@@ -46,14 +46,13 @@ var DebugInfoGatherer = class _DebugInfoGatherer {
46
46
  * Extract information from the iframe status
47
47
  */
48
48
  getIframeStatus() {
49
- var _a;
50
49
  if (!this.iframe) {
51
50
  return null;
52
51
  }
53
52
  return {
54
53
  loading: this.iframe.hasAttribute("loading"),
55
54
  url: this.iframe.src,
56
- readyState: ((_a = this.iframe.contentDocument) == null ? undefined : _a.readyState) ? this.iframe.contentDocument.readyState === "complete" ? 1 : 0 : -1,
55
+ readyState: this.iframe.contentDocument?.readyState ? this.iframe.contentDocument.readyState === "complete" ? 1 : 0 : -1,
57
56
  contentWindow: !!this.iframe.contentWindow,
58
57
  isConnected: this.iframe.isConnected
59
58
  };
@@ -75,7 +74,7 @@ var DebugInfoGatherer = class _DebugInfoGatherer {
75
74
  const iframeStatus = this.getIframeStatus();
76
75
  const navigatorInfo = this.getNavigatorInfo();
77
76
  let formattedError = "Unknown";
78
- if (error instanceof chunkIVQL5N55_cjs.FrakRpcError) {
77
+ if (error instanceof chunk7YDJDVXY_cjs.FrakRpcError) {
79
78
  formattedError = `FrakRpcError: ${error.code} '${error.message}'`;
80
79
  } else if (error instanceof Error) {
81
80
  formattedError = error.message;
@@ -139,9 +138,8 @@ function createIFrameChannelManager() {
139
138
  function createIFrameLifecycleManager({
140
139
  iframe
141
140
  }) {
142
- const isConnectedDeferred = new chunkIVQL5N55_cjs.Deferred();
141
+ const isConnectedDeferred = new chunk7YDJDVXY_cjs.Deferred();
143
142
  const handler = async (messageEvent) => {
144
- var _a;
145
143
  switch (messageEvent.iframeLifecycle) {
146
144
  // Resolve the isConnected promise
147
145
  case "connected":
@@ -162,17 +160,14 @@ function createIFrameLifecycleManager({
162
160
  // Change iframe visibility
163
161
  case "show":
164
162
  case "hide":
165
- chunkIVQL5N55_cjs.changeIframeVisibility({
163
+ chunk7YDJDVXY_cjs.changeIframeVisibility({
166
164
  iframe,
167
165
  isVisible: messageEvent.iframeLifecycle === "show"
168
166
  });
169
167
  break;
170
168
  // Handshake handling
171
169
  case "handshake": {
172
- console.log("Received handshake event", {
173
- token: messageEvent.data.token
174
- });
175
- (_a = iframe.contentWindow) == null ? undefined : _a.postMessage(
170
+ iframe.contentWindow?.postMessage(
176
171
  {
177
172
  clientLifecycle: "handshake-response",
178
173
  data: {
@@ -201,14 +196,14 @@ function createIFrameMessageHandler({
201
196
  debugInfo
202
197
  }) {
203
198
  if (typeof window === "undefined") {
204
- throw new chunkIVQL5N55_cjs.FrakRpcError(
205
- chunkIVQL5N55_cjs.RpcErrorCodes.configError,
199
+ throw new chunk7YDJDVXY_cjs.FrakRpcError(
200
+ chunk7YDJDVXY_cjs.RpcErrorCodes.configError,
206
201
  "iframe client should be used in the browser"
207
202
  );
208
203
  }
209
204
  if (!iframe.contentWindow) {
210
- throw new chunkIVQL5N55_cjs.FrakRpcError(
211
- chunkIVQL5N55_cjs.RpcErrorCodes.configError,
205
+ throw new chunk7YDJDVXY_cjs.FrakRpcError(
206
+ chunk7YDJDVXY_cjs.RpcErrorCodes.configError,
212
207
  "The iframe does not have a product window"
213
208
  );
214
209
  }
@@ -267,12 +262,11 @@ function createIFrameFrakClient({
267
262
  config,
268
263
  iframe
269
264
  }) {
270
- var _a;
271
265
  const channelManager = createIFrameChannelManager();
272
266
  const lifecycleManager = createIFrameLifecycleManager({ iframe });
273
267
  const debugInfo = new DebugInfoGatherer(config, iframe);
274
268
  const messageHandler = createIFrameMessageHandler({
275
- frakWalletUrl: (_a = config == null ? undefined : config.walletUrl) != null ? _a : "https://wallet.frak.id",
269
+ frakWalletUrl: config?.walletUrl ?? "https://wallet.frak.id",
276
270
  iframe,
277
271
  channelManager,
278
272
  iframeLifecycleManager: lifecycleManager,
@@ -281,21 +275,20 @@ function createIFrameFrakClient({
281
275
  const request = async (args) => {
282
276
  const isConnected = await lifecycleManager.isConnected;
283
277
  if (!isConnected) {
284
- throw new chunkIVQL5N55_cjs.FrakRpcError(
285
- chunkIVQL5N55_cjs.RpcErrorCodes.clientNotConnected,
278
+ throw new chunk7YDJDVXY_cjs.FrakRpcError(
279
+ chunk7YDJDVXY_cjs.RpcErrorCodes.clientNotConnected,
286
280
  "The iframe provider isn't connected yet"
287
281
  );
288
282
  }
289
- const result = new chunkIVQL5N55_cjs.Deferred();
283
+ const result = new chunk7YDJDVXY_cjs.Deferred();
290
284
  const channelId = channelManager.createChannel(async (message) => {
291
- var _a2;
292
- const decompressed = await chunkIVQL5N55_cjs.decompressDataAndCheckHash(message.data);
285
+ const decompressed = await chunk7YDJDVXY_cjs.decompressDataAndCheckHash(message.data);
293
286
  if (decompressed.error) {
294
287
  result.reject(
295
- new chunkIVQL5N55_cjs.FrakRpcError(
288
+ new chunk7YDJDVXY_cjs.FrakRpcError(
296
289
  decompressed.error.code,
297
290
  decompressed.error.message,
298
- (_a2 = decompressed.error) == null ? undefined : _a2.data
291
+ decompressed.error?.data
299
292
  )
300
293
  );
301
294
  } else {
@@ -303,7 +296,7 @@ function createIFrameFrakClient({
303
296
  }
304
297
  channelManager.removeChannel(channelId);
305
298
  });
306
- const compressedMessage = await chunkIVQL5N55_cjs.hashAndCompressData(args);
299
+ const compressedMessage = await chunk7YDJDVXY_cjs.hashAndCompressData(args);
307
300
  messageHandler.sendEvent({
308
301
  id: channelId,
309
302
  topic: args.method,
@@ -314,20 +307,20 @@ function createIFrameFrakClient({
314
307
  const listenerRequest = async (args, callback) => {
315
308
  const isConnected = await lifecycleManager.isConnected;
316
309
  if (!isConnected) {
317
- throw new chunkIVQL5N55_cjs.FrakRpcError(
318
- chunkIVQL5N55_cjs.RpcErrorCodes.clientNotConnected,
310
+ throw new chunk7YDJDVXY_cjs.FrakRpcError(
311
+ chunk7YDJDVXY_cjs.RpcErrorCodes.clientNotConnected,
319
312
  "The iframe provider isn't connected yet"
320
313
  );
321
314
  }
322
315
  const channelId = channelManager.createChannel(async (message) => {
323
- const decompressed = await chunkIVQL5N55_cjs.decompressDataAndCheckHash(message.data);
316
+ const decompressed = await chunk7YDJDVXY_cjs.decompressDataAndCheckHash(message.data);
324
317
  if (decompressed.result) {
325
318
  callback(decompressed.result);
326
319
  } else {
327
- throw new chunkIVQL5N55_cjs.InternalError("No valid result in the response");
320
+ throw new chunk7YDJDVXY_cjs.InternalError("No valid result in the response");
328
321
  }
329
322
  });
330
- const compressedMessage = await chunkIVQL5N55_cjs.hashAndCompressData(args);
323
+ const compressedMessage = await chunk7YDJDVXY_cjs.hashAndCompressData(args);
331
324
  messageHandler.sendEvent({
332
325
  id: channelId,
333
326
  topic: args.method,
@@ -415,7 +408,7 @@ async function postConnectionSetup({
415
408
  async function setupClient({
416
409
  config
417
410
  }) {
418
- const iframe = await chunkIVQL5N55_cjs.createIframe({
411
+ const iframe = await chunk7YDJDVXY_cjs.createIframe({
419
412
  config
420
413
  });
421
414
  if (!iframe) {
@@ -437,59 +430,59 @@ async function setupClient({
437
430
 
438
431
  Object.defineProperty(exports, "ClientNotFound", {
439
432
  enumerable: true,
440
- get: function () { return chunkIVQL5N55_cjs.ClientNotFound; }
433
+ get: function () { return chunk7YDJDVXY_cjs.ClientNotFound; }
441
434
  });
442
435
  Object.defineProperty(exports, "Deferred", {
443
436
  enumerable: true,
444
- get: function () { return chunkIVQL5N55_cjs.Deferred; }
437
+ get: function () { return chunk7YDJDVXY_cjs.Deferred; }
445
438
  });
446
439
  Object.defineProperty(exports, "FrakContextManager", {
447
440
  enumerable: true,
448
- get: function () { return chunkIVQL5N55_cjs.FrakContextManager; }
441
+ get: function () { return chunk7YDJDVXY_cjs.FrakContextManager; }
449
442
  });
450
443
  Object.defineProperty(exports, "FrakRpcError", {
451
444
  enumerable: true,
452
- get: function () { return chunkIVQL5N55_cjs.FrakRpcError; }
445
+ get: function () { return chunk7YDJDVXY_cjs.FrakRpcError; }
453
446
  });
454
447
  Object.defineProperty(exports, "RpcErrorCodes", {
455
448
  enumerable: true,
456
- get: function () { return chunkIVQL5N55_cjs.RpcErrorCodes; }
449
+ get: function () { return chunk7YDJDVXY_cjs.RpcErrorCodes; }
457
450
  });
458
451
  Object.defineProperty(exports, "baseIframeProps", {
459
452
  enumerable: true,
460
- get: function () { return chunkIVQL5N55_cjs.baseIframeProps; }
453
+ get: function () { return chunk7YDJDVXY_cjs.baseIframeProps; }
461
454
  });
462
455
  Object.defineProperty(exports, "compressJson", {
463
456
  enumerable: true,
464
- get: function () { return chunkIVQL5N55_cjs.compressJson; }
457
+ get: function () { return chunk7YDJDVXY_cjs.compressJson; }
465
458
  });
466
459
  Object.defineProperty(exports, "createIframe", {
467
460
  enumerable: true,
468
- get: function () { return chunkIVQL5N55_cjs.createIframe; }
461
+ get: function () { return chunk7YDJDVXY_cjs.createIframe; }
469
462
  });
470
463
  Object.defineProperty(exports, "decompressDataAndCheckHash", {
471
464
  enumerable: true,
472
- get: function () { return chunkIVQL5N55_cjs.decompressDataAndCheckHash; }
465
+ get: function () { return chunk7YDJDVXY_cjs.decompressDataAndCheckHash; }
473
466
  });
474
467
  Object.defineProperty(exports, "decompressJson", {
475
468
  enumerable: true,
476
- get: function () { return chunkIVQL5N55_cjs.decompressJson; }
469
+ get: function () { return chunk7YDJDVXY_cjs.decompressJson; }
477
470
  });
478
471
  Object.defineProperty(exports, "hashAndCompressData", {
479
472
  enumerable: true,
480
- get: function () { return chunkIVQL5N55_cjs.hashAndCompressData; }
473
+ get: function () { return chunk7YDJDVXY_cjs.hashAndCompressData; }
481
474
  });
482
475
  Object.defineProperty(exports, "interactionTypes", {
483
476
  enumerable: true,
484
- get: function () { return chunkPO6YSB4Q_cjs.interactionTypes; }
477
+ get: function () { return chunk665P7NO4_cjs.interactionTypes; }
485
478
  });
486
479
  Object.defineProperty(exports, "productTypes", {
487
480
  enumerable: true,
488
- get: function () { return chunkPO6YSB4Q_cjs.productTypes; }
481
+ get: function () { return chunk665P7NO4_cjs.productTypes; }
489
482
  });
490
483
  Object.defineProperty(exports, "productTypesMask", {
491
484
  enumerable: true,
492
- get: function () { return chunkPO6YSB4Q_cjs.productTypesMask; }
485
+ get: function () { return chunk665P7NO4_cjs.productTypesMask; }
493
486
  });
494
487
  exports.DebugInfoGatherer = DebugInfoGatherer;
495
488
  exports.createIFrameFrakClient = createIFrameFrakClient;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FrakWalletSdkConfig, a as FrakClient, I as IFrameEvent, b as FrakContext } from './context-C7RkT8hA.cjs';
2
- export { C as ClientLifecycleEvent, D as DisplayEmbededWalletParamsType, j as DisplayModalParamsType, E as EmbededViewAction, H as ExtractedParametersFromRpc, J as ExtractedReturnTypeFromRpc, y as FinalActionType, x as FinalModalStepType, e as FullInteractionTypesKey, G as GetProductInformationReturnType, B as IFrameLifecycleEvent, A as IFrameRpcEvent, f as IFrameRpcSchema, z as IFrameTransport, d as InteractionTypesKey, g as LoggedInEmbededView, L as LoggedOutEmbededView, n as LoginModalStepType, h as ModalRpcMetadata, k as ModalRpcStepsInput, l as ModalRpcStepsResultType, m as ModalStepMetadata, M as ModalStepTypes, w as OpenInteractionSessionModalStepType, v as OpenInteractionSessionReturnType, O as OpenSsoParamsType, P as ProductTypesKey, R as RpcResponse, t as SendTransactionModalStepType, u as SendTransactionReturnType, s as SendTransactionTxType, o as SiweAuthenticateModalStepType, r as SiweAuthenticateReturnType, q as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, i as interactionTypes, p as productTypes, c as productTypesMask } from './context-C7RkT8hA.cjs';
1
+ import { F as FrakWalletSdkConfig, a as FrakClient, I as IFrameEvent, b as FrakContext } from './context-D7aZDKLT.cjs';
2
+ export { C as ClientLifecycleEvent, D as DisplayEmbededWalletParamsType, j as DisplayModalParamsType, E as EmbededViewAction, H as ExtractedParametersFromRpc, J as ExtractedReturnTypeFromRpc, y as FinalActionType, x as FinalModalStepType, e as FullInteractionTypesKey, G as GetProductInformationReturnType, B as IFrameLifecycleEvent, A as IFrameRpcEvent, f as IFrameRpcSchema, z as IFrameTransport, d as InteractionTypesKey, g as LoggedInEmbededView, L as LoggedOutEmbededView, n as LoginModalStepType, h as ModalRpcMetadata, k as ModalRpcStepsInput, l as ModalRpcStepsResultType, m as ModalStepMetadata, M as ModalStepTypes, w as OpenInteractionSessionModalStepType, v as OpenInteractionSessionReturnType, O as OpenSsoParamsType, P as ProductTypesKey, R as RpcResponse, t as SendTransactionModalStepType, u as SendTransactionReturnType, s as SendTransactionTxType, o as SiweAuthenticateModalStepType, r as SiweAuthenticateReturnType, q as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, i as interactionTypes, p as productTypes, c as productTypesMask } from './context-D7aZDKLT.cjs';
3
3
  export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from './interaction-CTQ5-kqe.cjs';
4
4
  import 'viem';
5
5
  import 'viem/chains';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FrakWalletSdkConfig, a as FrakClient, I as IFrameEvent, b as FrakContext } from './context-CJ5ByAXa.js';
2
- export { C as ClientLifecycleEvent, D as DisplayEmbededWalletParamsType, j as DisplayModalParamsType, E as EmbededViewAction, H as ExtractedParametersFromRpc, J as ExtractedReturnTypeFromRpc, y as FinalActionType, x as FinalModalStepType, e as FullInteractionTypesKey, G as GetProductInformationReturnType, B as IFrameLifecycleEvent, A as IFrameRpcEvent, f as IFrameRpcSchema, z as IFrameTransport, d as InteractionTypesKey, g as LoggedInEmbededView, L as LoggedOutEmbededView, n as LoginModalStepType, h as ModalRpcMetadata, k as ModalRpcStepsInput, l as ModalRpcStepsResultType, m as ModalStepMetadata, M as ModalStepTypes, w as OpenInteractionSessionModalStepType, v as OpenInteractionSessionReturnType, O as OpenSsoParamsType, P as ProductTypesKey, R as RpcResponse, t as SendTransactionModalStepType, u as SendTransactionReturnType, s as SendTransactionTxType, o as SiweAuthenticateModalStepType, r as SiweAuthenticateReturnType, q as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, i as interactionTypes, p as productTypes, c as productTypesMask } from './context-CJ5ByAXa.js';
1
+ import { F as FrakWalletSdkConfig, a as FrakClient, I as IFrameEvent, b as FrakContext } from './context-rDsQbSgB.js';
2
+ export { C as ClientLifecycleEvent, D as DisplayEmbededWalletParamsType, j as DisplayModalParamsType, E as EmbededViewAction, H as ExtractedParametersFromRpc, J as ExtractedReturnTypeFromRpc, y as FinalActionType, x as FinalModalStepType, e as FullInteractionTypesKey, G as GetProductInformationReturnType, B as IFrameLifecycleEvent, A as IFrameRpcEvent, f as IFrameRpcSchema, z as IFrameTransport, d as InteractionTypesKey, g as LoggedInEmbededView, L as LoggedOutEmbededView, n as LoginModalStepType, h as ModalRpcMetadata, k as ModalRpcStepsInput, l as ModalRpcStepsResultType, m as ModalStepMetadata, M as ModalStepTypes, w as OpenInteractionSessionModalStepType, v as OpenInteractionSessionReturnType, O as OpenSsoParamsType, P as ProductTypesKey, R as RpcResponse, t as SendTransactionModalStepType, u as SendTransactionReturnType, s as SendTransactionTxType, o as SiweAuthenticateModalStepType, r as SiweAuthenticateReturnType, q as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, i as interactionTypes, p as productTypes, c as productTypesMask } from './context-rDsQbSgB.js';
3
3
  export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from './interaction-CTQ5-kqe.js';
4
4
  import 'viem';
5
5
  import 'viem/chains';
package/dist/index.js CHANGED
@@ -1,19 +1,18 @@
1
- import { createIframe, FrakRpcError, Deferred, RpcErrorCodes, decompressDataAndCheckHash, hashAndCompressData, InternalError, changeIframeVisibility } from './chunk-XDZMP74U.js';
2
- export { ClientNotFound, Deferred, FrakContextManager, FrakRpcError, RpcErrorCodes, baseIframeProps, compressJson, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData } from './chunk-XDZMP74U.js';
3
- import { __publicField } from './chunk-GDH3M5ZC.js';
4
- export { interactionTypes, productTypes, productTypesMask } from './chunk-GDH3M5ZC.js';
1
+ import { createIframe, FrakRpcError, RpcErrorCodes, Deferred, decompressDataAndCheckHash, hashAndCompressData, InternalError, changeIframeVisibility } from './chunk-GTBCSNLF.js';
2
+ export { ClientNotFound, Deferred, FrakContextManager, FrakRpcError, RpcErrorCodes, baseIframeProps, compressJson, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData } from './chunk-GTBCSNLF.js';
3
+ export { interactionTypes, productTypes, productTypesMask } from './chunk-U2NTN5QZ.js';
5
4
 
6
5
  // src/utils/constants.ts
7
6
  var BACKUP_KEY = "nexus-wallet-backup";
8
7
 
9
8
  // src/clients/DebugInfo.ts
10
9
  var DebugInfoGatherer = class _DebugInfoGatherer {
10
+ config;
11
+ iframe;
12
+ isSetupDone = false;
13
+ lastResponse = null;
14
+ lastRequest = null;
11
15
  constructor(config, iframe) {
12
- __publicField(this, "config");
13
- __publicField(this, "iframe");
14
- __publicField(this, "isSetupDone", false);
15
- __publicField(this, "lastResponse", null);
16
- __publicField(this, "lastRequest", null);
17
16
  this.config = config;
18
17
  this.iframe = iframe;
19
18
  this.lastRequest = null;
@@ -46,14 +45,13 @@ var DebugInfoGatherer = class _DebugInfoGatherer {
46
45
  * Extract information from the iframe status
47
46
  */
48
47
  getIframeStatus() {
49
- var _a;
50
48
  if (!this.iframe) {
51
49
  return null;
52
50
  }
53
51
  return {
54
52
  loading: this.iframe.hasAttribute("loading"),
55
53
  url: this.iframe.src,
56
- readyState: ((_a = this.iframe.contentDocument) == null ? undefined : _a.readyState) ? this.iframe.contentDocument.readyState === "complete" ? 1 : 0 : -1,
54
+ readyState: this.iframe.contentDocument?.readyState ? this.iframe.contentDocument.readyState === "complete" ? 1 : 0 : -1,
57
55
  contentWindow: !!this.iframe.contentWindow,
58
56
  isConnected: this.iframe.isConnected
59
57
  };
@@ -141,7 +139,6 @@ function createIFrameLifecycleManager({
141
139
  }) {
142
140
  const isConnectedDeferred = new Deferred();
143
141
  const handler = async (messageEvent) => {
144
- var _a;
145
142
  switch (messageEvent.iframeLifecycle) {
146
143
  // Resolve the isConnected promise
147
144
  case "connected":
@@ -169,10 +166,7 @@ function createIFrameLifecycleManager({
169
166
  break;
170
167
  // Handshake handling
171
168
  case "handshake": {
172
- console.log("Received handshake event", {
173
- token: messageEvent.data.token
174
- });
175
- (_a = iframe.contentWindow) == null ? undefined : _a.postMessage(
169
+ iframe.contentWindow?.postMessage(
176
170
  {
177
171
  clientLifecycle: "handshake-response",
178
172
  data: {
@@ -267,12 +261,11 @@ function createIFrameFrakClient({
267
261
  config,
268
262
  iframe
269
263
  }) {
270
- var _a;
271
264
  const channelManager = createIFrameChannelManager();
272
265
  const lifecycleManager = createIFrameLifecycleManager({ iframe });
273
266
  const debugInfo = new DebugInfoGatherer(config, iframe);
274
267
  const messageHandler = createIFrameMessageHandler({
275
- frakWalletUrl: (_a = config == null ? undefined : config.walletUrl) != null ? _a : "https://wallet.frak.id",
268
+ frakWalletUrl: config?.walletUrl ?? "https://wallet.frak.id",
276
269
  iframe,
277
270
  channelManager,
278
271
  iframeLifecycleManager: lifecycleManager,
@@ -288,14 +281,13 @@ function createIFrameFrakClient({
288
281
  }
289
282
  const result = new Deferred();
290
283
  const channelId = channelManager.createChannel(async (message) => {
291
- var _a2;
292
284
  const decompressed = await decompressDataAndCheckHash(message.data);
293
285
  if (decompressed.error) {
294
286
  result.reject(
295
287
  new FrakRpcError(
296
288
  decompressed.error.code,
297
289
  decompressed.error.message,
298
- (_a2 = decompressed.error) == null ? undefined : _a2.data
290
+ decompressed.error?.data
299
291
  )
300
292
  );
301
293
  } else {
@@ -1,26 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var chunkZDGHKI3S_cjs = require('../chunk-ZDGHKI3S.cjs');
3
+ var chunkPHVGCFDX_cjs = require('../chunk-PHVGCFDX.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "PressInteractionEncoder", {
8
8
  enumerable: true,
9
- get: function () { return chunkZDGHKI3S_cjs.PressInteractionEncoder; }
9
+ get: function () { return chunkPHVGCFDX_cjs.PressInteractionEncoder; }
10
10
  });
11
11
  Object.defineProperty(exports, "PurchaseInteractionEncoder", {
12
12
  enumerable: true,
13
- get: function () { return chunkZDGHKI3S_cjs.PurchaseInteractionEncoder; }
13
+ get: function () { return chunkPHVGCFDX_cjs.PurchaseInteractionEncoder; }
14
14
  });
15
15
  Object.defineProperty(exports, "ReferralInteractionEncoder", {
16
16
  enumerable: true,
17
- get: function () { return chunkZDGHKI3S_cjs.ReferralInteractionEncoder; }
17
+ get: function () { return chunkPHVGCFDX_cjs.ReferralInteractionEncoder; }
18
18
  });
19
19
  Object.defineProperty(exports, "RetailInteractionEncoder", {
20
20
  enumerable: true,
21
- get: function () { return chunkZDGHKI3S_cjs.RetailInteractionEncoder; }
21
+ get: function () { return chunkPHVGCFDX_cjs.RetailInteractionEncoder; }
22
22
  });
23
23
  Object.defineProperty(exports, "WebShopInteractionEncoder", {
24
24
  enumerable: true,
25
- get: function () { return chunkZDGHKI3S_cjs.WebShopInteractionEncoder; }
25
+ get: function () { return chunkPHVGCFDX_cjs.WebShopInteractionEncoder; }
26
26
  });
@@ -1 +1 @@
1
- export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder, RetailInteractionEncoder, WebShopInteractionEncoder } from '../chunk-RMOFMRZR.js';
1
+ export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder, RetailInteractionEncoder, WebShopInteractionEncoder } from '../chunk-VE6URIIJ.js';
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "0.0.5",
14
+ "version": "0.0.6",
15
15
  "description": "Core SDK of the Frak wallet, low level library to interact directly with the frak ecosystem.",
16
16
  "repository": {
17
17
  "url": "https://github.com/frak-id/wallet",
@@ -91,14 +91,12 @@
91
91
  "devDependencies": {
92
92
  "@arethetypeswrong/cli": "^0.17.3",
93
93
  "@types/node": "^22",
94
- "tsup": "^8.3.5",
94
+ "browserslist": "^4.24.4",
95
+ "browserslist-to-esbuild": "^2.1.1",
96
+ "tsup": "^8.3.6",
95
97
  "typescript": "^5"
96
98
  },
97
99
  "browserslist": [
98
- "chrome 67",
99
- "edge 79",
100
- "firefox 68",
101
- "opera 54",
102
- "safari 14"
100
+ "extends @frak-labs/browserslist-config"
103
101
  ]
104
102
  }