@dynamic-labs/waas-svm 4.18.7 → 4.19.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
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.19.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.8...v4.19.0) (2025-05-23)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* expose 7702 kernel and add viem controller ([#8786](https://github.com/dynamic-labs/dynamic-auth/issues/8786)) ([eea710e](https://github.com/dynamic-labs/dynamic-auth/commit/eea710e238ccbc36e6be37d8f7493954b99858ef))
|
|
8
|
+
* use browser wallet client & iframe for waas operations ([#8697](https://github.com/dynamic-labs/dynamic-auth/issues/8697)) ([13a47b1](https://github.com/dynamic-labs/dynamic-auth/commit/13a47b1c9a2984f08682e833ca8c87605a3a872f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **global-wallet:** close popup when page unloads to prevent orphaned popup windows ([#8787](https://github.com/dynamic-labs/dynamic-auth/issues/8787)) ([441b04c](https://github.com/dynamic-labs/dynamic-auth/commit/441b04ca04a02feb37473e43bca0e66c5d772ce2))
|
|
14
|
+
* override network when requesting BTC networks in useTokenBalances ([#8773](https://github.com/dynamic-labs/dynamic-auth/issues/8773)) ([fd07d09](https://github.com/dynamic-labs/dynamic-auth/commit/fd07d09de970c7e6f85b251a88854e8eca57e249))
|
|
15
|
+
* remove libmpc executor dependency global wallet ([#8792](https://github.com/dynamic-labs/dynamic-auth/issues/8792)) ([7502585](https://github.com/dynamic-labs/dynamic-auth/commit/75025859d2f952915322cf65504117ec2506152b))
|
|
16
|
+
* standardize font on headers ([#8734](https://github.com/dynamic-labs/dynamic-auth/issues/8734)) ([9f0900c](https://github.com/dynamic-labs/dynamic-auth/commit/9f0900cb7c4294201cc952ae7538648bdea83ff5))
|
|
17
|
+
|
|
18
|
+
### [4.18.8](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.7...v4.18.8) (2025-05-22)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* allow closing widget right after login ([#8760](https://github.com/dynamic-labs/dynamic-auth/issues/8760)) ([a9afff0](https://github.com/dynamic-labs/dynamic-auth/commit/a9afff0ab2a685853b39aed88e10bf1e700e4c8c))
|
|
23
|
+
* user wallets turning empty when linking new wallets ([#8775](https://github.com/dynamic-labs/dynamic-auth/issues/8775)) ([04215f5](https://github.com/dynamic-labs/dynamic-auth/commit/04215f5307e16ec4e1a7ff235a0d7df2340c3447))
|
|
24
|
+
|
|
2
25
|
### [4.18.7](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.6...v4.18.7) (2025-05-21)
|
|
3
26
|
|
|
4
27
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas-svm",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.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,17 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs-wallet/
|
|
21
|
+
"@dynamic-labs-wallet/browser-wallet-client": "0.0.76",
|
|
22
22
|
"@solana/web3.js": "1.98.1",
|
|
23
23
|
"eventemitter3": "5.0.1",
|
|
24
24
|
"bs58": "5.0.0",
|
|
25
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
26
|
-
"@dynamic-labs/logger": "4.
|
|
27
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
28
|
-
"@dynamic-labs/solana-core": "4.
|
|
29
|
-
"@dynamic-labs/types": "4.
|
|
30
|
-
"@dynamic-labs/utils": "4.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
25
|
+
"@dynamic-labs/assert-package-version": "4.19.0",
|
|
26
|
+
"@dynamic-labs/logger": "4.19.0",
|
|
27
|
+
"@dynamic-labs/rpc-providers": "4.19.0",
|
|
28
|
+
"@dynamic-labs/solana-core": "4.19.0",
|
|
29
|
+
"@dynamic-labs/types": "4.19.0",
|
|
30
|
+
"@dynamic-labs/utils": "4.19.0",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "4.19.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {}
|
|
34
34
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
|
-
var
|
|
7
|
+
var browserWalletClient = require('@dynamic-labs-wallet/browser-wallet-client');
|
|
8
|
+
var web3_js = require('@solana/web3.js');
|
|
8
9
|
var solanaCore = require('@dynamic-labs/solana-core');
|
|
9
10
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
11
|
var utils = require('@dynamic-labs/utils');
|
|
@@ -46,10 +47,11 @@ class DynamicWaasSVMConnector extends solanaCore.SolanaWalletConnector {
|
|
|
46
47
|
if (!this.environmentId) {
|
|
47
48
|
throw new Error('Environment ID is required');
|
|
48
49
|
}
|
|
49
|
-
return new
|
|
50
|
+
return new browserWalletClient.DynamicWalletClient({
|
|
50
51
|
authToken,
|
|
51
|
-
baseApiUrl: this.baseApiUrl,
|
|
52
|
+
baseApiUrl: this.baseApiUrl || 'api.dynamicauth.xyz',
|
|
52
53
|
baseMPCRelayApiUrl: this.relayUrl || 'relay.dynamic-preprod.xyz',
|
|
54
|
+
chainName: 'SVM',
|
|
53
55
|
environmentId: this.environmentId,
|
|
54
56
|
});
|
|
55
57
|
}
|
|
@@ -114,12 +116,17 @@ class DynamicWaasSVMConnector extends solanaCore.SolanaWalletConnector {
|
|
|
114
116
|
if (!this.activeAccountAddress) {
|
|
115
117
|
throw new Error('Active account address is required');
|
|
116
118
|
}
|
|
117
|
-
const
|
|
119
|
+
const messageBytes = transaction instanceof web3_js.Transaction
|
|
120
|
+
? transaction.serializeMessage()
|
|
121
|
+
: transaction.message.serialize();
|
|
122
|
+
const messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
123
|
+
const signature = yield walletClient.signTransaction({
|
|
118
124
|
senderAddress: this.activeAccountAddress,
|
|
119
|
-
transaction,
|
|
125
|
+
transaction: messageToSign,
|
|
120
126
|
});
|
|
127
|
+
transaction.addSignature(new web3_js.PublicKey(this.activeAccountAddress), Buffer.from(signature, 'hex'));
|
|
121
128
|
try {
|
|
122
|
-
|
|
129
|
+
transaction.serialize({
|
|
123
130
|
requireAllSignatures: false,
|
|
124
131
|
verifySignatures: true,
|
|
125
132
|
});
|
|
@@ -127,7 +134,7 @@ class DynamicWaasSVMConnector extends solanaCore.SolanaWalletConnector {
|
|
|
127
134
|
catch (err) {
|
|
128
135
|
logger.logger.warn('[signTransaction] Error signing transaction', err);
|
|
129
136
|
}
|
|
130
|
-
return
|
|
137
|
+
return transaction;
|
|
131
138
|
});
|
|
132
139
|
}
|
|
133
140
|
signTransaction(transaction) {
|
|
@@ -241,10 +248,9 @@ class DynamicWaasSVMConnector extends solanaCore.SolanaWalletConnector {
|
|
|
241
248
|
});
|
|
242
249
|
}
|
|
243
250
|
importPrivateKey(_a) {
|
|
244
|
-
return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey,
|
|
251
|
+
return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
|
|
245
252
|
const walletClient = this.getWaasWalletClient();
|
|
246
253
|
yield walletClient.importPrivateKey({
|
|
247
|
-
chainName,
|
|
248
254
|
privateKey,
|
|
249
255
|
thresholdSignatureScheme: thresholdSignatureScheme,
|
|
250
256
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';
|
|
2
2
|
import { Connection, Transaction, VersionedTransaction, SendOptions } from '@solana/web3.js';
|
|
3
3
|
import { IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
|
|
4
4
|
import { ISolanaSigner, SolanaWalletConnector, SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
|
|
@@ -24,15 +24,16 @@ export declare class DynamicWaasSVMConnector extends SolanaWalletConnector imple
|
|
|
24
24
|
setBaseApiUrl(baseApiUrl: string): void;
|
|
25
25
|
setRelayUrl(relayUrl: string): void;
|
|
26
26
|
private setActiveAccountAddress;
|
|
27
|
-
createDynamicWaasClient():
|
|
28
|
-
getWaasWalletClient():
|
|
27
|
+
createDynamicWaasClient(): DynamicWalletClient;
|
|
28
|
+
getWaasWalletClient(): DynamicWalletClient;
|
|
29
29
|
validateActiveWallet(expectedAddress: string): Promise<void>;
|
|
30
30
|
createWalletAccount({ thresholdSignatureScheme, }?: {
|
|
31
31
|
thresholdSignatureScheme?: string;
|
|
32
32
|
}): Promise<{
|
|
33
|
+
chainName: string;
|
|
33
34
|
accountAddress: string;
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
publicKeyHex: string;
|
|
36
|
+
rawPublicKey: string | Uint8Array | undefined;
|
|
36
37
|
}>;
|
|
37
38
|
internalSignMessage(message: string): Promise<string>;
|
|
38
39
|
signMessage(message: string): Promise<string>;
|
|
@@ -50,9 +51,8 @@ export declare class DynamicWaasSVMConnector extends SolanaWalletConnector imple
|
|
|
50
51
|
accountAddress?: string;
|
|
51
52
|
displayContainer?: HTMLIFrameElement;
|
|
52
53
|
}): Promise<void>;
|
|
53
|
-
importPrivateKey({ privateKey,
|
|
54
|
+
importPrivateKey({ privateKey, thresholdSignatureScheme, }: {
|
|
54
55
|
privateKey: string;
|
|
55
|
-
chainName: string;
|
|
56
56
|
thresholdSignatureScheme?: string;
|
|
57
57
|
}): Promise<void>;
|
|
58
58
|
exportClientKeyshares({ accountAddress, }: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
|
-
import {
|
|
3
|
+
import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';
|
|
4
|
+
import { Transaction, PublicKey } from '@solana/web3.js';
|
|
4
5
|
import { SolanaWalletConnector, SolanaUiTransaction } from '@dynamic-labs/solana-core';
|
|
5
6
|
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
6
7
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
@@ -42,10 +43,11 @@ class DynamicWaasSVMConnector extends SolanaWalletConnector {
|
|
|
42
43
|
if (!this.environmentId) {
|
|
43
44
|
throw new Error('Environment ID is required');
|
|
44
45
|
}
|
|
45
|
-
return new
|
|
46
|
+
return new DynamicWalletClient({
|
|
46
47
|
authToken,
|
|
47
|
-
baseApiUrl: this.baseApiUrl,
|
|
48
|
+
baseApiUrl: this.baseApiUrl || 'api.dynamicauth.xyz',
|
|
48
49
|
baseMPCRelayApiUrl: this.relayUrl || 'relay.dynamic-preprod.xyz',
|
|
50
|
+
chainName: 'SVM',
|
|
49
51
|
environmentId: this.environmentId,
|
|
50
52
|
});
|
|
51
53
|
}
|
|
@@ -110,12 +112,17 @@ class DynamicWaasSVMConnector extends SolanaWalletConnector {
|
|
|
110
112
|
if (!this.activeAccountAddress) {
|
|
111
113
|
throw new Error('Active account address is required');
|
|
112
114
|
}
|
|
113
|
-
const
|
|
115
|
+
const messageBytes = transaction instanceof Transaction
|
|
116
|
+
? transaction.serializeMessage()
|
|
117
|
+
: transaction.message.serialize();
|
|
118
|
+
const messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
119
|
+
const signature = yield walletClient.signTransaction({
|
|
114
120
|
senderAddress: this.activeAccountAddress,
|
|
115
|
-
transaction,
|
|
121
|
+
transaction: messageToSign,
|
|
116
122
|
});
|
|
123
|
+
transaction.addSignature(new PublicKey(this.activeAccountAddress), Buffer.from(signature, 'hex'));
|
|
117
124
|
try {
|
|
118
|
-
|
|
125
|
+
transaction.serialize({
|
|
119
126
|
requireAllSignatures: false,
|
|
120
127
|
verifySignatures: true,
|
|
121
128
|
});
|
|
@@ -123,7 +130,7 @@ class DynamicWaasSVMConnector extends SolanaWalletConnector {
|
|
|
123
130
|
catch (err) {
|
|
124
131
|
logger.warn('[signTransaction] Error signing transaction', err);
|
|
125
132
|
}
|
|
126
|
-
return
|
|
133
|
+
return transaction;
|
|
127
134
|
});
|
|
128
135
|
}
|
|
129
136
|
signTransaction(transaction) {
|
|
@@ -237,10 +244,9 @@ class DynamicWaasSVMConnector extends SolanaWalletConnector {
|
|
|
237
244
|
});
|
|
238
245
|
}
|
|
239
246
|
importPrivateKey(_a) {
|
|
240
|
-
return __awaiter(this, arguments, void 0, function* ({ privateKey,
|
|
247
|
+
return __awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
|
|
241
248
|
const walletClient = this.getWaasWalletClient();
|
|
242
249
|
yield walletClient.importPrivateKey({
|
|
243
|
-
chainName,
|
|
244
250
|
privateKey,
|
|
245
251
|
thresholdSignatureScheme: thresholdSignatureScheme,
|
|
246
252
|
});
|