@portal-hq/connect 4.3.1 → 4.5.1

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.
@@ -310,7 +310,7 @@ class PortalConnect {
310
310
  this.emit('portal_connectError', message.data);
311
311
  break;
312
312
  default:
313
- console.log(`Received unsupported event "${message.event}". Ignoring.`);
313
+ utils_1.sdkLogger.debug(`[PortalConnect] Received unsupported event "${message.event}". Ignoring.`);
314
314
  break;
315
315
  }
316
316
  });
@@ -335,11 +335,13 @@ class PortalConnect {
335
335
  }
336
336
  });
337
337
  // Pass the request along to the provider
338
+ const traceId = (0, utils_1.generateTraceId)();
338
339
  yield this.provider.request({
339
340
  method,
340
341
  params,
341
342
  chainId: `${utils_1.CHAIN_NAMESPACES.EIP155}:${chainId}`,
342
343
  connect: this,
344
+ options: { traceId },
343
345
  });
344
346
  });
345
347
  }
package/lib/esm/index.js CHANGED
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { Provider } from '@portal-hq/provider';
11
- import { CHAIN_NAMESPACES, DEFAULT_HOSTS, } from '@portal-hq/utils';
11
+ import { CHAIN_NAMESPACES, DEFAULT_HOSTS, generateTraceId, sdkLogger, } from '@portal-hq/utils';
12
12
  class PortalConnect {
13
13
  get address() {
14
14
  return this.provider.address;
@@ -307,7 +307,7 @@ class PortalConnect {
307
307
  this.emit('portal_connectError', message.data);
308
308
  break;
309
309
  default:
310
- console.log(`Received unsupported event "${message.event}". Ignoring.`);
310
+ sdkLogger.debug(`[PortalConnect] Received unsupported event "${message.event}". Ignoring.`);
311
311
  break;
312
312
  }
313
313
  });
@@ -332,11 +332,13 @@ class PortalConnect {
332
332
  }
333
333
  });
334
334
  // Pass the request along to the provider
335
+ const traceId = generateTraceId();
335
336
  yield this.provider.request({
336
337
  method,
337
338
  params,
338
339
  chainId: `${CHAIN_NAMESPACES.EIP155}:${chainId}`,
339
340
  connect: this,
341
+ options: { traceId },
340
342
  });
341
343
  });
342
344
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/connect",
3
- "version": "4.3.1",
3
+ "version": "4.5.1",
4
4
  "main": "lib/commonjs/index",
5
5
  "module": "lib/esm/index",
6
6
  "source": "src/index",
@@ -18,6 +18,9 @@
18
18
  "prepare:esm": "tsc --outDir lib/esm --module es2015 --target es2015",
19
19
  "test": "jest"
20
20
  },
21
+ "dependencies": {
22
+ "@portal-hq/utils": "^4.5.1"
23
+ },
21
24
  "devDependencies": {
22
25
  "@babel/preset-typescript": "^7.18.6",
23
26
  "@types/jest": "^29.2.0",
@@ -32,5 +35,5 @@
32
35
  "react": "*",
33
36
  "react-native": "*"
34
37
  },
35
- "gitHead": "0cfb3fc21c050a54e73044a87b92ac22f9e2edb7"
38
+ "gitHead": "7f010a0c86c95b2d28daa1b6640519bb9a22920a"
36
39
  }
package/src/index.ts CHANGED
@@ -7,6 +7,8 @@ import {
7
7
  IPortalProvider,
8
8
  CHAIN_NAMESPACES,
9
9
  DEFAULT_HOSTS,
10
+ generateTraceId,
11
+ sdkLogger,
10
12
  } from '@portal-hq/utils'
11
13
 
12
14
  import type {
@@ -387,8 +389,8 @@ class PortalConnect {
387
389
  this.emit('portal_connectError', message.data as ErrorResult)
388
390
  break
389
391
  default:
390
- console.log(
391
- `Received unsupported event "${message.event}". Ignoring.`,
392
+ sdkLogger.debug(
393
+ `[PortalConnect] Received unsupported event "${message.event}". Ignoring.`,
392
394
  )
393
395
  break
394
396
  }
@@ -426,11 +428,13 @@ class PortalConnect {
426
428
  )
427
429
 
428
430
  // Pass the request along to the provider
431
+ const traceId = generateTraceId()
429
432
  await this.provider.request({
430
433
  method,
431
434
  params,
432
435
  chainId: `${CHAIN_NAMESPACES.EIP155}:${chainId}`,
433
436
  connect: this,
437
+ options: { traceId },
434
438
  })
435
439
  }
436
440