@dynamic-labs/utils 2.0.0 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
 
2
+ ### [2.0.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0...v2.0.1) (2024-04-18)
3
+
4
+
5
+ ### Features
6
+
7
+ * add redirectUri to farcaster connect ([#5373](https://github.com/dynamic-labs/DynamicAuth/issues/5373)) ([#5383](https://github.com/dynamic-labs/DynamicAuth/issues/5383)) ([d031d7e](https://github.com/dynamic-labs/DynamicAuth/commit/d031d7ee5705de5ec83ef328f03633d5f3524786))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * copy and ui fixes ([#5367](https://github.com/dynamic-labs/DynamicAuth/issues/5367)) ([e39ea97](https://github.com/dynamic-labs/DynamicAuth/commit/e39ea97d98de6b7087c24f2326a5fdc07ab9c8c3))
13
+ * bitcoin connector improvements
14
+ * solana package improvements ([#5360](https://github.com/dynamic-labs/DynamicAuth/issues/5360)) ([#5385](https://github.com/dynamic-labs/DynamicAuth/issues/5385)) ([9010bce](https://github.com/dynamic-labs/DynamicAuth/commit/9010bcebb4b0f2d293d517347187d38accbac0d3))
15
+
2
16
  ## [2.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2024-04-15)
3
17
 
4
18
  ## [2.0.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.30...v2.0.0-alpha.31) (2024-04-11)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,8 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "tldts": "6.0.16",
30
- "@dynamic-labs/logger": "2.0.0",
31
- "@dynamic-labs/types": "2.0.0"
30
+ "@dynamic-labs/logger": "2.0.1",
31
+ "@dynamic-labs/types": "2.0.1",
32
+ "buffer": "6.0.3"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "viem": "^2.7.6"
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var _ = require('buffer/');
4
+
5
+ /* eslint-disable */
6
+ /**
7
+ * @walletconnect/client and @walletconnect/qrcode-modal use `global` and `Buffer`, respectively.
8
+ * This issue is captured here: https://github.com/WalletConnect/walletconnect-monorepo/issues/341
9
+ * Here are some GH issues of others facing the same problem:
10
+ * * https://github.com/WalletConnect/walletconnect-monorepo/issues/734
11
+ * * https://github.com/WalletConnect/walletconnect-monorepo/issues/748
12
+ */
13
+ if (typeof window !== 'undefined') {
14
+ window.global = globalThis;
15
+ if (!window.Buffer && typeof _.Buffer === 'undefined') {
16
+ Object.assign(window, { Buffer: _.Buffer });
17
+ }
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Buffer } from 'buffer/index.js';
2
+
3
+ /* eslint-disable */
4
+ /**
5
+ * @walletconnect/client and @walletconnect/qrcode-modal use `global` and `Buffer`, respectively.
6
+ * This issue is captured here: https://github.com/WalletConnect/walletconnect-monorepo/issues/341
7
+ * Here are some GH issues of others facing the same problem:
8
+ * * https://github.com/WalletConnect/walletconnect-monorepo/issues/734
9
+ * * https://github.com/WalletConnect/walletconnect-monorepo/issues/748
10
+ */
11
+ if (typeof window !== 'undefined') {
12
+ window.global = globalThis;
13
+ if (!window.Buffer && typeof Buffer === 'undefined') {
14
+ Object.assign(window, { Buffer });
15
+ }
16
+ }
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('./bufferPollyfill.cjs');
6
+
5
7
  const bufferToBase64 = (buf) => {
6
8
  const binstr = Array.prototype.map
7
9
  .call(buf, (ch) => String.fromCharCode(ch))
@@ -1 +1,2 @@
1
+ import './bufferPollyfill';
1
2
  export declare const bufferToBase64: (buf: Uint8Array) => string;
@@ -1,3 +1,5 @@
1
+ import './bufferPollyfill.js';
2
+
1
3
  const bufferToBase64 = (buf) => {
2
4
  const binstr = Array.prototype.map
3
5
  .call(buf, (ch) => String.fromCharCode(ch))
@@ -52,7 +52,7 @@ const mapChain = (network) => {
52
52
  }
53
53
  : undefined,
54
54
  id: network.chainId,
55
- name: network.vanityName || network.chainName,
55
+ name: network.vanityName || network.name || network.chainName,
56
56
  nativeCurrency: network.nativeCurrency,
57
57
  rpcUrls: {
58
58
  default: { http: network.rpcUrls },
@@ -28,7 +28,7 @@ const mapChain = (network) => {
28
28
  }
29
29
  : undefined,
30
30
  id: network.chainId,
31
- name: network.vanityName || network.chainName,
31
+ name: network.vanityName || network.name || network.chainName,
32
32
  nativeCurrency: network.nativeCurrency,
33
33
  rpcUrls: {
34
34
  default: { http: network.rpcUrls },
@@ -7,6 +7,7 @@ require('../errors/TransactionGasCannotBeSponsoredError.cjs');
7
7
  require('../logger/logger.cjs');
8
8
  var isMobile = require('../isMobile.cjs');
9
9
  require('../../_virtual/_tslib.cjs');
10
+ require('../bufferPollyfill.cjs');
10
11
  require('viem/chains');
11
12
  require('tldts');
12
13
 
@@ -3,6 +3,7 @@ import '../errors/TransactionGasCannotBeSponsoredError.js';
3
3
  import '../logger/logger.js';
4
4
  import { isSamsungBrowser } from '../isMobile.js';
5
5
  import '../../_virtual/_tslib.js';
6
+ import '../bufferPollyfill.js';
6
7
  import 'viem/chains';
7
8
  import 'tldts';
8
9
 
@@ -6,12 +6,13 @@ var _tslib = require('../_virtual/_tslib.cjs');
6
6
  require('./errors/InsufficientFundsError.cjs');
7
7
  require('./errors/TransactionGasCannotBeSponsoredError.cjs');
8
8
  require('./logger/logger.cjs');
9
+ require('./bufferPollyfill.cjs');
9
10
  var sleep = require('./sleep/sleep.cjs');
10
11
  require('viem/chains');
11
12
  require('tldts');
12
13
 
13
14
  const FALLBACK_UNDEFINED = 'FALLBACK_UNDEFINED';
14
- const retryableFn = (fn, options = {}) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
15
+ const retryableFn = (fn_1, ...args_1) => _tslib.__awaiter(void 0, [fn_1, ...args_1], void 0, function* (fn, options = {}) {
15
16
  const { maxRetries = 3, currentRetry = 0, timeoutMs = 100, fallbackValue = new Error('Max retries reached'), retryStrategy = 'timeout-only', retryIntervalMs = 0, logger, } = options;
16
17
  logger === null || logger === void 0 ? void 0 : logger.debug('Configured retryableFn with options: ', {
17
18
  currentRetry,
@@ -2,12 +2,13 @@ import { __awaiter } from '../_virtual/_tslib.js';
2
2
  import './errors/InsufficientFundsError.js';
3
3
  import './errors/TransactionGasCannotBeSponsoredError.js';
4
4
  import './logger/logger.js';
5
+ import './bufferPollyfill.js';
5
6
  import { sleep } from './sleep/sleep.js';
6
7
  import 'viem/chains';
7
8
  import 'tldts';
8
9
 
9
10
  const FALLBACK_UNDEFINED = 'FALLBACK_UNDEFINED';
10
- const retryableFn = (fn, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
11
+ const retryableFn = (fn_1, ...args_1) => __awaiter(void 0, [fn_1, ...args_1], void 0, function* (fn, options = {}) {
11
12
  const { maxRetries = 3, currentRetry = 0, timeoutMs = 100, fallbackValue = new Error('Max retries reached'), retryStrategy = 'timeout-only', retryIntervalMs = 0, logger, } = options;
12
13
  logger === null || logger === void 0 ? void 0 : logger.debug('Configured retryableFn with options: ', {
13
14
  currentRetry,
@@ -5,4 +5,4 @@
5
5
  * @param {() => Promise<T> | T} callback A function that might throw an error.
6
6
  * @returns {Promise<[T | undefined, E | undefined]>} A tuple with either the result or the error.
7
7
  */
8
- export declare const runSafe: <T, E>(callback: () => T | Promise<T>) => Promise<[T | undefined, E | undefined]>;
8
+ export declare const runSafe: <T, E>(callback: () => Promise<T> | T) => Promise<[T | undefined, E | undefined]>;