@dynamic-labs/multi-wallet 3.0.0-alpha.3 → 3.0.0-alpha.5
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 +32 -0
- package/package.json +7 -9
- package/src/utils/message.cjs +1 -19
- package/src/utils/message.d.ts +0 -1
- package/src/utils/message.js +3 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-06-14)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* remove viem dependency from non-evm packages (#5508)
|
|
8
|
+
* move rpc providers into their own packages (#5981)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add in-app browser navigation support for sats-connect ([#5988](https://github.com/dynamic-labs/DynamicAuth/issues/5988)) ([be27d2d](https://github.com/dynamic-labs/DynamicAuth/commit/be27d2d4030bbe2157e879497d8e6a00b4a3e404))
|
|
13
|
+
* move rpc providers into their own packages ([#5981](https://github.com/dynamic-labs/DynamicAuth/issues/5981)) ([d7a62d6](https://github.com/dynamic-labs/DynamicAuth/commit/d7a62d60e79dfa6d6651b0fa103e90b6f8a9ccf3))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* embedded solana wallets can send SPL tokens and estimate gas ([#5982](https://github.com/dynamic-labs/DynamicAuth/issues/5982)) ([36623eb](https://github.com/dynamic-labs/DynamicAuth/commit/36623eb99d1d1dfebfd8b6f3194eeff31e7de2bf))
|
|
19
|
+
* improve logic related to turnkey and emailVerifcation ([#5946](https://github.com/dynamic-labs/DynamicAuth/issues/5946)) ([dd0b2dc](https://github.com/dynamic-labs/DynamicAuth/commit/dd0b2dc6d93a8bbbcb6eef88732e62b747005bb3))
|
|
20
|
+
* show linked wallets with unavailable providers in user wallets list ([#5992](https://github.com/dynamic-labs/DynamicAuth/issues/5992)) ([996079c](https://github.com/dynamic-labs/DynamicAuth/commit/996079ced360651c7b1eb5273548e0548f6f9f3a))
|
|
21
|
+
* switch network modal not closing after switching to a supported network ([#5979](https://github.com/dynamic-labs/DynamicAuth/issues/5979)) ([f239952](https://github.com/dynamic-labs/DynamicAuth/commit/f2399523dd82bb28046992cac4582688b688bdc0))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
* remove viem dependency from non-evm packages ([#5508](https://github.com/dynamic-labs/DynamicAuth/issues/5508)) ([0299dc3](https://github.com/dynamic-labs/DynamicAuth/commit/0299dc3cbb611182d763e9a89d1270c2e2f32df5))
|
|
25
|
+
|
|
26
|
+
## [3.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-06-12)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* cache getGenesisHash call to prevent over calling ([#5966](https://github.com/dynamic-labs/DynamicAuth/issues/5966)) ([b4d542f](https://github.com/dynamic-labs/DynamicAuth/commit/b4d542f0a85f5ba8c5b8f02f287caee45b4b6feb))
|
|
32
|
+
* handle raw messages in embedded wallet sign message modal ([#5815](https://github.com/dynamic-labs/DynamicAuth/issues/5815)) ([9adc289](https://github.com/dynamic-labs/DynamicAuth/commit/9adc28993b57c1c7f03c4ce6d500288dcf60881e))
|
|
33
|
+
|
|
2
34
|
## [3.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-06-11)
|
|
3
35
|
|
|
4
36
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/multi-wallet",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@dynamic-labs/sdk-api-core": "0.0.461",
|
|
11
11
|
"tslib": "2.4.1",
|
|
12
|
-
"@dynamic-labs/rpc-providers": "3.0.0-alpha.
|
|
13
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
14
|
-
"@dynamic-labs/utils": "3.0.0-alpha.
|
|
15
|
-
"@dynamic-labs/wallet-book": "3.0.0-alpha.
|
|
16
|
-
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.
|
|
12
|
+
"@dynamic-labs/rpc-providers": "3.0.0-alpha.5",
|
|
13
|
+
"@dynamic-labs/types": "3.0.0-alpha.5",
|
|
14
|
+
"@dynamic-labs/utils": "3.0.0-alpha.5",
|
|
15
|
+
"@dynamic-labs/wallet-book": "3.0.0-alpha.5",
|
|
16
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@walletconnect/types": "2.10.6"
|
|
@@ -37,7 +37,5 @@
|
|
|
37
37
|
},
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
|
-
"peerDependencies": {
|
|
41
|
-
"viem": "^2.7.6"
|
|
42
|
-
}
|
|
40
|
+
"peerDependencies": {}
|
|
43
41
|
}
|
package/src/utils/message.cjs
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var viem = require('viem');
|
|
7
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
7
|
|
|
9
8
|
const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, publicKey, issuedAt = new Date().toISOString(), statement, requestId, resources, }) => {
|
|
@@ -25,9 +24,7 @@ const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, public
|
|
|
25
24
|
// for more context on format and fields, please see:
|
|
26
25
|
// https://docs.login.xyz/general-information/siwe-overview/eip-4361
|
|
27
26
|
const header = `${domain} wants you to sign in with your ${blockchainName} account:`;
|
|
28
|
-
|
|
29
|
-
const messageAddress = getEip55Address(publicKey, chainId);
|
|
30
|
-
const prefix = [header, messageAddress].join('\n');
|
|
27
|
+
const prefix = [header, publicKey].join('\n');
|
|
31
28
|
// If there is a statement, we want to add a gap between the prefix and the statement
|
|
32
29
|
// two times '\n', first to move statement to next line and second to add a gap between prefix and statement
|
|
33
30
|
const prefixWithStatementGap = statement ? '\n\n' : '\n';
|
|
@@ -49,20 +46,5 @@ const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, public
|
|
|
49
46
|
const suffix = suffixFields.join('\n');
|
|
50
47
|
return [prefixWithStatement, suffix].join('\n');
|
|
51
48
|
};
|
|
52
|
-
// The SIWE parser library used to validate signed messages for EVM/Ethereum
|
|
53
|
-
// checks that an address is in EIP55 format, so make sure we do that here.
|
|
54
|
-
// see: https://eips.ethereum.org/EIPS/eip-55
|
|
55
|
-
const getEip55Address = (publicKey, chainId) => {
|
|
56
|
-
try {
|
|
57
|
-
if (chainId) {
|
|
58
|
-
return viem.getAddress(publicKey);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
walletConnectorCore.logger.debug(`Error getting checksum, returning default ${publicKey}`);
|
|
63
|
-
}
|
|
64
|
-
return publicKey;
|
|
65
|
-
};
|
|
66
49
|
|
|
67
50
|
exports.generateMessageToSign = generateMessageToSign;
|
|
68
|
-
exports.getEip55Address = getEip55Address;
|
package/src/utils/message.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export interface MessageParameters {
|
|
|
12
12
|
uri: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const generateMessageToSign: ({ blockchain, domain, chainId, nonce, uri, publicKey, issuedAt, statement, requestId, resources, }: MessageParameters) => string;
|
|
15
|
-
export declare const getEip55Address: (publicKey: string, chainId?: number | string) => string;
|
package/src/utils/message.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import {
|
|
3
|
-
import { getChainInfo, logger } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
|
|
5
4
|
const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, publicKey, issuedAt = new Date().toISOString(), statement, requestId, resources, }) => {
|
|
6
5
|
var _a, _b;
|
|
@@ -21,9 +20,7 @@ const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, public
|
|
|
21
20
|
// for more context on format and fields, please see:
|
|
22
21
|
// https://docs.login.xyz/general-information/siwe-overview/eip-4361
|
|
23
22
|
const header = `${domain} wants you to sign in with your ${blockchainName} account:`;
|
|
24
|
-
|
|
25
|
-
const messageAddress = getEip55Address(publicKey, chainId);
|
|
26
|
-
const prefix = [header, messageAddress].join('\n');
|
|
23
|
+
const prefix = [header, publicKey].join('\n');
|
|
27
24
|
// If there is a statement, we want to add a gap between the prefix and the statement
|
|
28
25
|
// two times '\n', first to move statement to next line and second to add a gap between prefix and statement
|
|
29
26
|
const prefixWithStatementGap = statement ? '\n\n' : '\n';
|
|
@@ -45,19 +42,5 @@ const generateMessageToSign = ({ blockchain, domain, chainId, nonce, uri, public
|
|
|
45
42
|
const suffix = suffixFields.join('\n');
|
|
46
43
|
return [prefixWithStatement, suffix].join('\n');
|
|
47
44
|
};
|
|
48
|
-
// The SIWE parser library used to validate signed messages for EVM/Ethereum
|
|
49
|
-
// checks that an address is in EIP55 format, so make sure we do that here.
|
|
50
|
-
// see: https://eips.ethereum.org/EIPS/eip-55
|
|
51
|
-
const getEip55Address = (publicKey, chainId) => {
|
|
52
|
-
try {
|
|
53
|
-
if (chainId) {
|
|
54
|
-
return getAddress(publicKey);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
logger.debug(`Error getting checksum, returning default ${publicKey}`);
|
|
59
|
-
}
|
|
60
|
-
return publicKey;
|
|
61
|
-
};
|
|
62
45
|
|
|
63
|
-
export { generateMessageToSign
|
|
46
|
+
export { generateMessageToSign };
|