@dynamic-labs/utils 1.1.0-alpha.6 → 1.1.0-alpha.8

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,33 @@
1
1
 
2
+ ## [1.1.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.7...v1.1.0-alpha.8) (2024-01-03)
3
+
4
+
5
+ ### Features
6
+
7
+ * add new sdk view section for text ([#4280](https://github.com/dynamic-labs/DynamicAuth/issues/4280)) ([457ae38](https://github.com/dynamic-labs/DynamicAuth/commit/457ae38cd2be8dae078f40b54ffc4704299d4ed9))
8
+ * add new setShowLinkNewWalletModal method ([f46447a](https://github.com/dynamic-labs/DynamicAuth/commit/f46447ab606f4fdbf55e5fef21dd98f8f2650e90))
9
+ * add pk export for hd wallets ([#4266](https://github.com/dynamic-labs/DynamicAuth/issues/4266)) ([44aac69](https://github.com/dynamic-labs/DynamicAuth/commit/44aac69580ed44e66eab971f87cb6061a3fadc90))
10
+ * add starknet support for sopelia ([#4248](https://github.com/dynamic-labs/DynamicAuth/issues/4248)) ([f9a0980](https://github.com/dynamic-labs/DynamicAuth/commit/f9a0980c3cd2d6d95c5dd17b179fbd0931f08b1a))
11
+ * enable hardware wallet for solana wallets ([#4275](https://github.com/dynamic-labs/DynamicAuth/issues/4275)) ([704b380](https://github.com/dynamic-labs/DynamicAuth/commit/704b380186618a5a5793e88f36ccbe84b59a2e4a))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * phantom solana not connecting on mobile ([#4284](https://github.com/dynamic-labs/DynamicAuth/issues/4284)) ([6ad75f1](https://github.com/dynamic-labs/DynamicAuth/commit/6ad75f152896459f5cf658227f998c246b6a572b))
17
+ * use bitcoin payment address for onramp ([#4273](https://github.com/dynamic-labs/DynamicAuth/issues/4273)) ([a2f54e8](https://github.com/dynamic-labs/DynamicAuth/commit/a2f54e812a11a91ee488eca64f14b5eeea1a8874))
18
+
19
+ ## [1.1.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.6...v1.1.0-alpha.7) (2023-12-28)
20
+
21
+
22
+ ### Features
23
+
24
+ * better coinbase deeplinking ux ([#4164](https://github.com/dynamic-labs/DynamicAuth/issues/4164)) ([5252608](https://github.com/dynamic-labs/DynamicAuth/commit/525260851900a33a52f129def338963400344205))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * don't prompt for connect when selecting bitcoin wallet if already connected ([#4265](https://github.com/dynamic-labs/DynamicAuth/issues/4265)) ([adef402](https://github.com/dynamic-labs/DynamicAuth/commit/adef402ef94270a17fab896a8585a7f2eacd3681))
30
+
2
31
  ## [1.1.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.5...v1.1.0-alpha.6) (2023-12-27)
3
32
 
4
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "1.1.0-alpha.6",
3
+ "version": "1.1.0-alpha.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -29,7 +29,7 @@
29
29
  "viem": "^1.19.13"
30
30
  },
31
31
  "dependencies": {
32
- "@dynamic-labs/logger": "1.1.0-alpha.6",
33
- "@dynamic-labs/types": "1.1.0-alpha.6"
32
+ "@dynamic-labs/logger": "1.1.0-alpha.8",
33
+ "@dynamic-labs/types": "1.1.0-alpha.8"
34
34
  }
35
35
  }
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('../errors/TransactionGasCannotBeSponsoredError.cjs');
6
+ require('../errors/InsufficientFundsError.cjs');
7
+ require('../logger/logger.cjs');
8
+ var isMobile = require('../isMobile.cjs');
9
+ require('viem/chains');
10
+
11
+ const handleMobileWalletRedirect = ({ nativeLink, universalLink, }) => {
12
+ const url = encodeURIComponent(window.location.toString());
13
+ const ref = encodeURIComponent(window.location.origin);
14
+ // samsung browser only supports native links, not universal links
15
+ if (isMobile.isSamsungBrowser()) {
16
+ window.location.assign(`${nativeLink}/${url}?ref=${ref}`);
17
+ }
18
+ else {
19
+ window.location.assign(`${universalLink}/${url}?ref=${ref}`);
20
+ }
21
+ };
22
+
23
+ exports.handleMobileWalletRedirect = handleMobileWalletRedirect;
@@ -0,0 +1,4 @@
1
+ export declare const handleMobileWalletRedirect: ({ nativeLink, universalLink, }: {
2
+ nativeLink: string;
3
+ universalLink: string;
4
+ }) => void;
@@ -0,0 +1,19 @@
1
+ import '../errors/TransactionGasCannotBeSponsoredError.js';
2
+ import '../errors/InsufficientFundsError.js';
3
+ import '../logger/logger.js';
4
+ import { isSamsungBrowser } from '../isMobile.js';
5
+ import 'viem/chains';
6
+
7
+ const handleMobileWalletRedirect = ({ nativeLink, universalLink, }) => {
8
+ const url = encodeURIComponent(window.location.toString());
9
+ const ref = encodeURIComponent(window.location.origin);
10
+ // samsung browser only supports native links, not universal links
11
+ if (isSamsungBrowser()) {
12
+ window.location.assign(`${nativeLink}/${url}?ref=${ref}`);
13
+ }
14
+ else {
15
+ window.location.assign(`${universalLink}/${url}?ref=${ref}`);
16
+ }
17
+ };
18
+
19
+ export { handleMobileWalletRedirect };
@@ -0,0 +1 @@
1
+ export * from './handleMobileWalletRedirect';
package/src/index.cjs CHANGED
@@ -34,6 +34,7 @@ var getOrMapViemChain = require('./getOrMapViemChain.cjs');
34
34
  var retryableFn = require('./retryableFn.cjs');
35
35
  var wrapMethodWithCallback = require('./wrapMethodWithCallback/wrapMethodWithCallback.cjs');
36
36
  var DeferredPromise = require('./DeferredPromise/DeferredPromise.cjs');
37
+ var handleMobileWalletRedirect = require('./handleMobileWalletRedirect/handleMobileWalletRedirect.cjs');
37
38
 
38
39
 
39
40
 
@@ -83,3 +84,4 @@ exports.FALLBACK_UNDEFINED = retryableFn.FALLBACK_UNDEFINED;
83
84
  exports.retryableFn = retryableFn.retryableFn;
84
85
  exports.wrapMethodWithCallback = wrapMethodWithCallback.wrapMethodWithCallback;
85
86
  exports.DeferredPromise = DeferredPromise.DeferredPromise;
87
+ exports.handleMobileWalletRedirect = handleMobileWalletRedirect.handleMobileWalletRedirect;
package/src/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export * from './getOrMapViemChain';
13
13
  export * from './retryableFn';
14
14
  export * from './wrapMethodWithCallback';
15
15
  export * from './DeferredPromise';
16
+ export * from './handleMobileWalletRedirect';
package/src/index.js CHANGED
@@ -30,3 +30,4 @@ export { getChain, getOrMapViemChain, mapChain } from './getOrMapViemChain.js';
30
30
  export { FALLBACK_UNDEFINED, retryableFn } from './retryableFn.js';
31
31
  export { wrapMethodWithCallback } from './wrapMethodWithCallback/wrapMethodWithCallback.js';
32
32
  export { DeferredPromise } from './DeferredPromise/DeferredPromise.js';
33
+ export { handleMobileWalletRedirect } from './handleMobileWalletRedirect/handleMobileWalletRedirect.js';