@dynamic-labs/wallet-connector-core 2.3.9 → 2.4.0
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 +20 -0
- package/package.json +6 -6
- package/src/index.cjs +2 -0
- package/src/index.js +1 -1
- package/src/utils/getChainInfo/getChainInfo.cjs +21 -0
- package/src/utils/getChainInfo/getChainInfo.d.ts +6 -0
- package/src/utils/getChainInfo/getChainInfo.js +20 -1
- package/src/utils/getChainInfo/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.4.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.10...v2.4.0) (2024-08-17)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add chain display value override to the dynamic props ([bf57738](https://github.com/dynamic-labs/DynamicAuth/commit/bf577387d52ef0748e958b519218c3da6ddbbc64))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* display QR code when selecting wallet connect ([#6605](https://github.com/dynamic-labs/DynamicAuth/issues/6605)) ([#6615](https://github.com/dynamic-labs/DynamicAuth/issues/6615)) ([61d51c0](https://github.com/dynamic-labs/DynamicAuth/commit/61d51c0c40f71a26e171da82f4a78028990ddc21))
|
|
13
|
+
* fix jwt length when signing with embedded wallets ([#6638](https://github.com/dynamic-labs/DynamicAuth/issues/6638))
|
|
14
|
+
|
|
15
|
+
### [2.3.10](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.9...v2.3.10) (2024-08-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* twitter should no longer rely polling for oauth flow ([#6606](https://github.com/dynamic-labs/DynamicAuth/issues/6606)) ([38906ab](https://github.com/dynamic-labs/DynamicAuth/commit/38906ab02b41fd02d7993e229072290d046dbc0e))
|
|
21
|
+
|
|
2
22
|
### [2.3.9](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.8...v2.3.9) (2024-08-13)
|
|
3
23
|
|
|
4
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-connector-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@dynamic-labs/sdk-api-core": "0.0.497"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@dynamic-labs/logger": "2.
|
|
33
|
-
"@dynamic-labs/rpc-providers": "2.
|
|
34
|
-
"@dynamic-labs/types": "2.
|
|
35
|
-
"@dynamic-labs/utils": "2.
|
|
36
|
-
"@dynamic-labs/wallet-book": "2.
|
|
32
|
+
"@dynamic-labs/logger": "2.4.0",
|
|
33
|
+
"@dynamic-labs/rpc-providers": "2.4.0",
|
|
34
|
+
"@dynamic-labs/types": "2.4.0",
|
|
35
|
+
"@dynamic-labs/utils": "2.4.0",
|
|
36
|
+
"@dynamic-labs/wallet-book": "2.4.0",
|
|
37
37
|
"eventemitter3": "5.0.1"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/index.cjs
CHANGED
|
@@ -40,6 +40,8 @@ exports.socialProviders = WalletConnector.socialProviders;
|
|
|
40
40
|
exports.logger = logger.logger;
|
|
41
41
|
exports.ProviderLookup = ProviderLookup.ProviderLookup;
|
|
42
42
|
exports.getChainInfo = getChainInfo.getChainInfo;
|
|
43
|
+
exports.getChainInfoWithOverrides = getChainInfo.getChainInfoWithOverrides;
|
|
44
|
+
exports.setChainInfoOverrides = getChainInfo.setChainInfoOverrides;
|
|
43
45
|
exports.isEmailOTPWalletConnector = isEmailOTPWalletConnector.isEmailOTPWalletConnector;
|
|
44
46
|
exports.isEmailWalletConnector = isEmailWalletConnector.isEmailWalletConnector;
|
|
45
47
|
exports.isSameAddress = isSameAddress.isSameAddress;
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { Chains, WalletConnectorBase, socialProviders } from './lib/WalletConnector.js';
|
|
3
3
|
export { logger } from './utils/logger.js';
|
|
4
4
|
export { ProviderLookup } from './utils/ProviderLookup/ProviderLookup.js';
|
|
5
|
-
export { getChainInfo } from './utils/getChainInfo/getChainInfo.js';
|
|
5
|
+
export { getChainInfo, getChainInfoWithOverrides, setChainInfoOverrides } from './utils/getChainInfo/getChainInfo.js';
|
|
6
6
|
export { isEmailOTPWalletConnector } from './utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.js';
|
|
7
7
|
export { isEmailWalletConnector } from './utils/isEmailWalletConnector/isEmailWalletConnector.js';
|
|
8
8
|
export { isSameAddress } from './utils/isSameAddress/isSameAddress.js';
|
|
@@ -58,6 +58,10 @@ const chainOverrides = {
|
|
|
58
58
|
eth: 'evm',
|
|
59
59
|
stark: 'starknet',
|
|
60
60
|
};
|
|
61
|
+
let chainInfoOverrides;
|
|
62
|
+
const setChainInfoOverrides = (overrides) => {
|
|
63
|
+
chainInfoOverrides = overrides;
|
|
64
|
+
};
|
|
61
65
|
const getChainInfo = (chain) => {
|
|
62
66
|
var _a;
|
|
63
67
|
const lowerCasedChain = chain.toLowerCase();
|
|
@@ -69,5 +73,22 @@ const getChainInfo = (chain) => {
|
|
|
69
73
|
}
|
|
70
74
|
return chainInfo;
|
|
71
75
|
};
|
|
76
|
+
const getChainInfoWithOverrides = (chain) => {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const chainInfo = getChainInfo(chain);
|
|
79
|
+
if (!chainInfo) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const overrides = chainInfoOverrides === null || chainInfoOverrides === void 0 ? void 0 : chainInfoOverrides[chainInfo.name];
|
|
83
|
+
const chainInfoClone = Object.assign({}, chainInfo);
|
|
84
|
+
if (overrides) {
|
|
85
|
+
chainInfoClone.blockchainName =
|
|
86
|
+
(_a = overrides.displayName) !== null && _a !== void 0 ? _a : chainInfo.blockchainName;
|
|
87
|
+
chainInfoClone.displayName = (_b = overrides.displayName) !== null && _b !== void 0 ? _b : chainInfo.displayName;
|
|
88
|
+
}
|
|
89
|
+
return chainInfoClone;
|
|
90
|
+
};
|
|
72
91
|
|
|
73
92
|
exports.getChainInfo = getChainInfo;
|
|
93
|
+
exports.getChainInfoWithOverrides = getChainInfoWithOverrides;
|
|
94
|
+
exports.setChainInfoOverrides = setChainInfoOverrides;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ChainInfo } from '../../lib';
|
|
2
|
+
export type ChainName = 'algorand' | 'bitcoin' | 'evm' | 'flow' | 'solana' | 'starknet' | 'cosmos';
|
|
3
|
+
export type ChainDisplayOverrides = Partial<Record<ChainName, {
|
|
4
|
+
displayName?: string;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const setChainInfoOverrides: (overrides?: ChainDisplayOverrides) => void;
|
|
2
7
|
export declare const getChainInfo: (chain: string) => ChainInfo | undefined;
|
|
8
|
+
export declare const getChainInfoWithOverrides: (chain: string) => ChainInfo | undefined;
|
|
@@ -54,6 +54,10 @@ const chainOverrides = {
|
|
|
54
54
|
eth: 'evm',
|
|
55
55
|
stark: 'starknet',
|
|
56
56
|
};
|
|
57
|
+
let chainInfoOverrides;
|
|
58
|
+
const setChainInfoOverrides = (overrides) => {
|
|
59
|
+
chainInfoOverrides = overrides;
|
|
60
|
+
};
|
|
57
61
|
const getChainInfo = (chain) => {
|
|
58
62
|
var _a;
|
|
59
63
|
const lowerCasedChain = chain.toLowerCase();
|
|
@@ -65,5 +69,20 @@ const getChainInfo = (chain) => {
|
|
|
65
69
|
}
|
|
66
70
|
return chainInfo;
|
|
67
71
|
};
|
|
72
|
+
const getChainInfoWithOverrides = (chain) => {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
const chainInfo = getChainInfo(chain);
|
|
75
|
+
if (!chainInfo) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const overrides = chainInfoOverrides === null || chainInfoOverrides === void 0 ? void 0 : chainInfoOverrides[chainInfo.name];
|
|
79
|
+
const chainInfoClone = Object.assign({}, chainInfo);
|
|
80
|
+
if (overrides) {
|
|
81
|
+
chainInfoClone.blockchainName =
|
|
82
|
+
(_a = overrides.displayName) !== null && _a !== void 0 ? _a : chainInfo.blockchainName;
|
|
83
|
+
chainInfoClone.displayName = (_b = overrides.displayName) !== null && _b !== void 0 ? _b : chainInfo.displayName;
|
|
84
|
+
}
|
|
85
|
+
return chainInfoClone;
|
|
86
|
+
};
|
|
68
87
|
|
|
69
|
-
export { getChainInfo };
|
|
88
|
+
export { getChainInfo, getChainInfoWithOverrides, setChainInfoOverrides };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getChainInfo } from './getChainInfo';
|
|
1
|
+
export { getChainInfo, setChainInfoOverrides, getChainInfoWithOverrides, type ChainDisplayOverrides, } from './getChainInfo';
|