@dynamic-labs/embedded-wallet-solana 4.6.3 → 4.7.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 +14 -0
- package/package.cjs +4 -4
- package/package.js +4 -4
- package/package.json +11 -11
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaWalletConnector.cjs +11 -9
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaWalletConnector.d.ts +5 -1
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaWalletConnector.js +12 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.7.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.3...v4.7.0) (2025-02-20)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* 7702 support ([14ee3cd](https://github.com/dynamic-labs/dynamic-auth/commit/14ee3cd3513ac8b3e8e866cc2026b042c706b7e6))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fallback to empty array when token balances is called with an invalid chain ID ([#8108](https://github.com/dynamic-labs/dynamic-auth/issues/8108)) ([7d14ded](https://github.com/dynamic-labs/dynamic-auth/commit/7d14ded6afa0de604901bbc8bc13620d03dc2e8c))
|
|
13
|
+
* improve global connectivity sign typed data reliability ([#8103](https://github.com/dynamic-labs/dynamic-auth/issues/8103)) ([8b0d2dd](https://github.com/dynamic-labs/dynamic-auth/commit/8b0d2ddbeb62a11732a9d59bc6cd4b72d82b9855))
|
|
14
|
+
* **QNTM-2902:** ensure react updates icons ([#8105](https://github.com/dynamic-labs/dynamic-auth/issues/8105)) ([1182c4c](https://github.com/dynamic-labs/dynamic-auth/commit/1182c4cc103c599e6bbff89af9b1312fb96b6d05))
|
|
15
|
+
|
|
2
16
|
### [4.6.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.2...v4.6.3) (2025-02-14)
|
|
3
17
|
|
|
4
18
|
|
package/package.cjs
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.7.0";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/utils": "4.
|
|
9
|
-
"@dynamic-labs/logger": "4.
|
|
10
|
-
"@dynamic-labs/types": "4.
|
|
8
|
+
"@dynamic-labs/utils": "4.7.0",
|
|
9
|
+
"@dynamic-labs/logger": "4.7.0",
|
|
10
|
+
"@dynamic-labs/types": "4.7.0",
|
|
11
11
|
"@dynamic-labs/sdk-api-core": "0.0.628",
|
|
12
12
|
eventemitter3: "5.0.1",
|
|
13
13
|
"@solana/web3.js": "1.92.1",
|
package/package.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.
|
|
2
|
+
var version = "4.7.0";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/utils": "4.
|
|
5
|
-
"@dynamic-labs/logger": "4.
|
|
6
|
-
"@dynamic-labs/types": "4.
|
|
4
|
+
"@dynamic-labs/utils": "4.7.0",
|
|
5
|
+
"@dynamic-labs/logger": "4.7.0",
|
|
6
|
+
"@dynamic-labs/types": "4.7.0",
|
|
7
7
|
"@dynamic-labs/sdk-api-core": "0.0.628",
|
|
8
8
|
eventemitter3: "5.0.1",
|
|
9
9
|
"@solana/web3.js": "1.92.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/embedded-wallet-solana",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/utils": "4.
|
|
22
|
-
"@dynamic-labs/logger": "4.
|
|
23
|
-
"@dynamic-labs/types": "4.
|
|
21
|
+
"@dynamic-labs/utils": "4.7.0",
|
|
22
|
+
"@dynamic-labs/logger": "4.7.0",
|
|
23
|
+
"@dynamic-labs/types": "4.7.0",
|
|
24
24
|
"@dynamic-labs/sdk-api-core": "0.0.628",
|
|
25
25
|
"eventemitter3": "5.0.1",
|
|
26
26
|
"@solana/web3.js": "1.92.1",
|
|
27
27
|
"@turnkey/iframe-stamper": "2.0.0",
|
|
28
28
|
"@turnkey/solana": "1.0.1",
|
|
29
29
|
"@turnkey/webauthn-stamper": "0.5.0",
|
|
30
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
31
|
-
"@dynamic-labs/embedded-wallet": "4.
|
|
32
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
33
|
-
"@dynamic-labs/solana-core": "4.
|
|
34
|
-
"@dynamic-labs/wallet-book": "4.
|
|
35
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
36
|
-
"@dynamic-labs/webauthn": "4.
|
|
30
|
+
"@dynamic-labs/assert-package-version": "4.7.0",
|
|
31
|
+
"@dynamic-labs/embedded-wallet": "4.7.0",
|
|
32
|
+
"@dynamic-labs/rpc-providers": "4.7.0",
|
|
33
|
+
"@dynamic-labs/solana-core": "4.7.0",
|
|
34
|
+
"@dynamic-labs/wallet-book": "4.7.0",
|
|
35
|
+
"@dynamic-labs/wallet-connector-core": "4.7.0",
|
|
36
|
+
"@dynamic-labs/webauthn": "4.7.0",
|
|
37
37
|
"react-dom": "18.2.0",
|
|
38
38
|
"viem": "2.21.57"
|
|
39
39
|
},
|
|
@@ -42,7 +42,7 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
|
|
|
42
42
|
}
|
|
43
43
|
throw new Error('Failed to get environment id');
|
|
44
44
|
};
|
|
45
|
-
this.solNetworks = props.solNetworks;
|
|
45
|
+
this.solNetworks = solanaCore.getBackwardsCompatibleSolNetworks(props.solNetworks, props.connectionConfig);
|
|
46
46
|
this.walletUiUtils = props.walletUiUtils;
|
|
47
47
|
this._turnkeyAccount = undefined;
|
|
48
48
|
this._connectionClient = undefined;
|
|
@@ -72,8 +72,12 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
|
|
|
72
72
|
getWalletClient() {
|
|
73
73
|
return this.getConnection();
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* @param returnDynamicNetworkId - If true, the dynamic network ID will be returned instead of the network cluster
|
|
77
|
+
* @returns The network cluster (e.g. 'mainnet', 'testnet', 'devnet') or dynamic network (used for switching networks)
|
|
78
|
+
*/
|
|
75
79
|
getNetwork() {
|
|
76
|
-
return _tslib.__awaiter(this,
|
|
80
|
+
return _tslib.__awaiter(this, arguments, void 0, function* (returnDynamicNetworkId = false) {
|
|
77
81
|
const connection = this.getConnection();
|
|
78
82
|
let genesisHash = localStorage.getItem(solanaCore.getGenesisHashLSKey(connection.rpcEndpoint));
|
|
79
83
|
if (!genesisHash) {
|
|
@@ -83,14 +87,12 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
|
|
|
83
87
|
genesisHash = genesisHash.substring(0, 32);
|
|
84
88
|
// see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
|
|
85
89
|
if (genesisHash === '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp') {
|
|
86
|
-
return 'mainnet';
|
|
87
|
-
}
|
|
88
|
-
else if (genesisHash === 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1') {
|
|
89
|
-
return 'devnet';
|
|
90
|
+
return returnDynamicNetworkId ? '101' : 'mainnet';
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
-
return '
|
|
92
|
+
if (genesisHash === 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1') {
|
|
93
|
+
return returnDynamicNetworkId ? '103' : 'devnet';
|
|
93
94
|
}
|
|
95
|
+
return returnDynamicNetworkId ? '102' : 'testnet';
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
98
|
getPublicClient() {
|
|
@@ -439,7 +441,7 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
|
|
|
439
441
|
let optimizedTransaction = transaction;
|
|
440
442
|
try {
|
|
441
443
|
// we cannot optimize partially signed transactions as once a tx is modified the signatures are no longer valid
|
|
442
|
-
if ((yield this.getNetwork()) === '
|
|
444
|
+
if ((yield this.getNetwork(true)) === '101' &&
|
|
443
445
|
!solanaCore.isTxAlreadySigned(transaction)) {
|
|
444
446
|
optimizedTransaction = (yield api.optimizeSolanaTransaction(this.getEnvId(), transaction, (_a = this.turnkeyAddress) !== null && _a !== void 0 ? _a : ''));
|
|
445
447
|
}
|
|
@@ -31,7 +31,11 @@ export declare class TurnkeySolanaWalletConnector extends TurnkeyWalletConnector
|
|
|
31
31
|
getRpcUrl(): string;
|
|
32
32
|
getConnection(commitmentOrConfig?: Commitment | ConnectionConfig): Connection;
|
|
33
33
|
getWalletClient(): Connection;
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @param returnDynamicNetworkId - If true, the dynamic network ID will be returned instead of the network cluster
|
|
36
|
+
* @returns The network cluster (e.g. 'mainnet', 'testnet', 'devnet') or dynamic network (used for switching networks)
|
|
37
|
+
*/
|
|
38
|
+
getNetwork(returnDynamicNetworkId?: boolean): Promise<string>;
|
|
35
39
|
getPublicClient(): Promise<Connection | undefined>;
|
|
36
40
|
supportsNetworkSwitching(): boolean;
|
|
37
41
|
setVerifiedCredentials(verifiedCredentials: JwtVerifiedCredential[]): void;
|
|
@@ -6,7 +6,7 @@ import { TurnkeySigner } from '@turnkey/solana';
|
|
|
6
6
|
import { IframeStamper } from '@turnkey/iframe-stamper';
|
|
7
7
|
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import { DynamicError, bufferToBase64 } from '@dynamic-labs/utils';
|
|
9
|
-
import { SolanaWallet, getOverrideRpcUrlForNetwork, ProviderChain, getGenesisHashLSKey, SolanaUiTransaction, isTxAlreadySigned } from '@dynamic-labs/solana-core';
|
|
9
|
+
import { SolanaWallet, getBackwardsCompatibleSolNetworks, getOverrideRpcUrlForNetwork, ProviderChain, getGenesisHashLSKey, SolanaUiTransaction, isTxAlreadySigned } from '@dynamic-labs/solana-core';
|
|
10
10
|
import { TurnkeyWalletConnectorBase, findTurnkeyVerifiedCredentials, TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS, logger } from '@dynamic-labs/embedded-wallet';
|
|
11
11
|
import { createSolanaConnection } from '../utils/createSolanaConnection/createSolanaConnection.js';
|
|
12
12
|
import { optimizeSolanaTransaction } from '../utils/api/api.js';
|
|
@@ -38,7 +38,7 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
38
38
|
}
|
|
39
39
|
throw new Error('Failed to get environment id');
|
|
40
40
|
};
|
|
41
|
-
this.solNetworks = props.solNetworks;
|
|
41
|
+
this.solNetworks = getBackwardsCompatibleSolNetworks(props.solNetworks, props.connectionConfig);
|
|
42
42
|
this.walletUiUtils = props.walletUiUtils;
|
|
43
43
|
this._turnkeyAccount = undefined;
|
|
44
44
|
this._connectionClient = undefined;
|
|
@@ -68,8 +68,12 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
68
68
|
getWalletClient() {
|
|
69
69
|
return this.getConnection();
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* @param returnDynamicNetworkId - If true, the dynamic network ID will be returned instead of the network cluster
|
|
73
|
+
* @returns The network cluster (e.g. 'mainnet', 'testnet', 'devnet') or dynamic network (used for switching networks)
|
|
74
|
+
*/
|
|
71
75
|
getNetwork() {
|
|
72
|
-
return __awaiter(this,
|
|
76
|
+
return __awaiter(this, arguments, void 0, function* (returnDynamicNetworkId = false) {
|
|
73
77
|
const connection = this.getConnection();
|
|
74
78
|
let genesisHash = localStorage.getItem(getGenesisHashLSKey(connection.rpcEndpoint));
|
|
75
79
|
if (!genesisHash) {
|
|
@@ -79,14 +83,12 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
79
83
|
genesisHash = genesisHash.substring(0, 32);
|
|
80
84
|
// see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
|
|
81
85
|
if (genesisHash === '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp') {
|
|
82
|
-
return 'mainnet';
|
|
83
|
-
}
|
|
84
|
-
else if (genesisHash === 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1') {
|
|
85
|
-
return 'devnet';
|
|
86
|
+
return returnDynamicNetworkId ? '101' : 'mainnet';
|
|
86
87
|
}
|
|
87
|
-
|
|
88
|
-
return '
|
|
88
|
+
if (genesisHash === 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1') {
|
|
89
|
+
return returnDynamicNetworkId ? '103' : 'devnet';
|
|
89
90
|
}
|
|
91
|
+
return returnDynamicNetworkId ? '102' : 'testnet';
|
|
90
92
|
});
|
|
91
93
|
}
|
|
92
94
|
getPublicClient() {
|
|
@@ -435,7 +437,7 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
435
437
|
let optimizedTransaction = transaction;
|
|
436
438
|
try {
|
|
437
439
|
// we cannot optimize partially signed transactions as once a tx is modified the signatures are no longer valid
|
|
438
|
-
if ((yield this.getNetwork()) === '
|
|
440
|
+
if ((yield this.getNetwork(true)) === '101' &&
|
|
439
441
|
!isTxAlreadySigned(transaction)) {
|
|
440
442
|
optimizedTransaction = (yield optimizeSolanaTransaction(this.getEnvId(), transaction, (_a = this.turnkeyAddress) !== null && _a !== void 0 ? _a : ''));
|
|
441
443
|
}
|