@dynamic-labs/stellar 4.64.0 → 4.66.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 +29 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/connectors/DynamicWaasStellarConnector/DynamicWaasStellarConnector.cjs +23 -6
- package/src/connectors/DynamicWaasStellarConnector/DynamicWaasStellarConnector.d.ts +13 -4
- package/src/connectors/DynamicWaasStellarConnector/DynamicWaasStellarConnector.js +23 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.66.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.65.0...v4.66.0) (2026-03-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **stellar:** send serialized XDR for transaction signing ([#10548](https://github.com/dynamic-labs/dynamic-auth/issues/10548)) ([3ff6438](https://github.com/dynamic-labs/dynamic-auth/commit/3ff64384e16d5fdb32cd6a3fd144757bf05f4456))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* prevent MFA backup codes screen from being dismissed before acknowledgement ([#10530](https://github.com/dynamic-labs/dynamic-auth/issues/10530)) ([67086f0](https://github.com/dynamic-labs/dynamic-auth/commit/67086f0b4a1302d39853eb2eedcb6f5b8bfca889))
|
|
13
|
+
* **react-native:** add retry when setting items to secure store ([#10576](https://github.com/dynamic-labs/dynamic-auth/issues/10576)) ([22ea162](https://github.com/dynamic-labs/dynamic-auth/commit/22ea162420806a4a67394c99f3691754982a7f1f))
|
|
14
|
+
|
|
15
|
+
## [4.65.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.64.0...v4.65.0) (2026-02-27)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add CSP nonce support for style and link tags ([#10514](https://github.com/dynamic-labs/dynamic-auth/issues/10514)) ([62128f5](https://github.com/dynamic-labs/dynamic-auth/commit/62128f5eddfd2a037c2ed6e9320b5009d350c0b5))
|
|
21
|
+
* add setPassword method for initial wallet password setup ([#10534](https://github.com/dynamic-labs/dynamic-auth/issues/10534)) ([87d1e5f](https://github.com/dynamic-labs/dynamic-auth/commit/87d1e5f3c41fe4417320f6971566526e8bf07e99))
|
|
22
|
+
* add step-up authentication and walletsVerify API ([#10482](https://github.com/dynamic-labs/dynamic-auth/issues/10482)) ([e762a63](https://github.com/dynamic-labs/dynamic-auth/commit/e762a634e9782c34926f5947db5446ad95617064))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **react-native:** ensure items are saved to storage successfully ([#10538](https://github.com/dynamic-labs/dynamic-auth/issues/10538)) ([60bfd5e](https://github.com/dynamic-labs/dynamic-auth/commit/60bfd5e4bf1e7265e754c222839662ff615495b2))
|
|
28
|
+
* **sdk-react-core:** add stellar to compareChains to prevent duplicate wallet creation ([#10526](https://github.com/dynamic-labs/dynamic-auth/issues/10526)) ([89f4498](https://github.com/dynamic-labs/dynamic-auth/commit/89f449892a5153dc8032e0e8ea61cf453e0a2b23))
|
|
29
|
+
* show password setup button for all WaaS wallets regardless of passcodeRequired ([#10532](https://github.com/dynamic-labs/dynamic-auth/issues/10532)) ([615cbf2](https://github.com/dynamic-labs/dynamic-auth/commit/615cbf25fcf95cb5b82a118a2d5d37285e8b5b83))
|
|
30
|
+
|
|
2
31
|
## [4.64.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.63.1...v4.64.0) (2026-02-25)
|
|
3
32
|
|
|
4
33
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/stellar",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.66.0",
|
|
4
4
|
"description": "A React SDK for implementing Stellar wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.875",
|
|
22
22
|
"@stellar/stellar-sdk": "14.4.3",
|
|
23
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
24
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
23
|
+
"@dynamic-labs/wallet-connector-core": "4.66.0",
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.66.0",
|
|
25
25
|
"@lobstrco/signer-extension-api": "2.0.0",
|
|
26
26
|
"@stellar/freighter-api": "6.0.1",
|
|
27
|
-
"@dynamic-labs/logger": "4.
|
|
28
|
-
"@dynamic-labs/types": "4.
|
|
29
|
-
"@dynamic-labs/utils": "4.
|
|
30
|
-
"@dynamic-labs/waas": "4.
|
|
31
|
-
"@dynamic-labs/wallet-book": "4.
|
|
27
|
+
"@dynamic-labs/logger": "4.66.0",
|
|
28
|
+
"@dynamic-labs/types": "4.66.0",
|
|
29
|
+
"@dynamic-labs/utils": "4.66.0",
|
|
30
|
+
"@dynamic-labs/waas": "4.66.0",
|
|
31
|
+
"@dynamic-labs/wallet-book": "4.66.0",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {}
|
|
@@ -221,10 +221,24 @@ class DynamicWaasStellarConnector extends waas.withDynamicWaas(StellarWalletConn
|
|
|
221
221
|
this.activeAccountAddress = undefined;
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Converts network passphrase to numeric chainId for policy validation
|
|
226
|
+
* ChainIds: '1' = pubnet (mainnet), '2' = testnet, '3' = futurenet
|
|
227
|
+
*/
|
|
228
|
+
getChainIdFromNetworkPassphrase(networkPassphrase) {
|
|
229
|
+
// Check futurenet first since its passphrase also contains 'Test'
|
|
230
|
+
if (networkPassphrase.includes('Future')) {
|
|
231
|
+
return '3';
|
|
232
|
+
}
|
|
233
|
+
if (networkPassphrase.includes('Test')) {
|
|
234
|
+
return '2';
|
|
235
|
+
}
|
|
236
|
+
return '1';
|
|
237
|
+
}
|
|
224
238
|
/**
|
|
225
239
|
* Signs a Stellar transaction XDR.
|
|
226
240
|
* @param transactionXdr - The XDR-encoded transaction envelope to sign
|
|
227
|
-
* @returns The
|
|
241
|
+
* @returns The signed transaction XDR
|
|
228
242
|
*/
|
|
229
243
|
signTransaction(transactionXdr) {
|
|
230
244
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -240,19 +254,22 @@ class DynamicWaasStellarConnector extends waas.withDynamicWaas(StellarWalletConn
|
|
|
240
254
|
const password = yield this.getPasswordIfNeeded({
|
|
241
255
|
accountAddress: this.activeAccountAddress,
|
|
242
256
|
});
|
|
243
|
-
// Get
|
|
257
|
+
// Get chainId from network passphrase for policy validation
|
|
244
258
|
const networkPassphrase = yield this.getNetworkPassphrase();
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
//
|
|
259
|
+
const chainId = this.getChainIdFromNetworkPassphrase(networkPassphrase);
|
|
260
|
+
// Sign the transaction XDR using MPC
|
|
261
|
+
// The SDK will compute the hash internally and build the context for policy validation
|
|
248
262
|
const signature = yield walletClient.signTransaction({
|
|
249
263
|
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
264
|
+
chainId,
|
|
250
265
|
mfaToken,
|
|
251
266
|
password,
|
|
252
267
|
senderAddress: this.activeAccountAddress,
|
|
253
268
|
signedSessionId,
|
|
254
|
-
transaction:
|
|
269
|
+
transaction: transactionXdr,
|
|
255
270
|
});
|
|
271
|
+
// Parse the XDR to add the signature
|
|
272
|
+
const transaction = stellarSdk.TransactionBuilder.fromXDR(transactionXdr, networkPassphrase);
|
|
256
273
|
// The signature from WaaS is base64 encoded
|
|
257
274
|
// addSignature expects both public key and signature as strings
|
|
258
275
|
transaction.addSignature(this.activeAccountAddress, signature);
|
|
@@ -58,7 +58,7 @@ declare const DynamicWaasStellarConnector_base: (abstract new (...args: any[]) =
|
|
|
58
58
|
createWalletAccount({ thresholdSignatureScheme, password, bitcoinConfig, }?: {
|
|
59
59
|
thresholdSignatureScheme?: string | undefined;
|
|
60
60
|
password?: string | undefined;
|
|
61
|
-
bitcoinConfig?: import("@dynamic-labs-wallet/
|
|
61
|
+
bitcoinConfig?: import("@dynamic-labs-wallet/browser-wallet-client").BitcoinConfig | undefined;
|
|
62
62
|
} | undefined): Promise<{
|
|
63
63
|
chainName: string;
|
|
64
64
|
accountAddress: string;
|
|
@@ -120,6 +120,10 @@ declare const DynamicWaasStellarConnector_base: (abstract new (...args: any[]) =
|
|
|
120
120
|
existingPassword?: string | undefined;
|
|
121
121
|
newPassword: string;
|
|
122
122
|
}): Promise<void>;
|
|
123
|
+
setPassword({ accountAddress, newPassword, }: {
|
|
124
|
+
accountAddress: string;
|
|
125
|
+
newPassword: string;
|
|
126
|
+
}): Promise<void>;
|
|
123
127
|
signRawMessage({ accountAddress, message, password, }: {
|
|
124
128
|
accountAddress: string;
|
|
125
129
|
message: string;
|
|
@@ -128,10 +132,10 @@ declare const DynamicWaasStellarConnector_base: (abstract new (...args: any[]) =
|
|
|
128
132
|
unlockWallet({ accountAddress, password, }: {
|
|
129
133
|
accountAddress: string;
|
|
130
134
|
password?: string | undefined;
|
|
131
|
-
}): Promise<import("@dynamic-labs-wallet/
|
|
135
|
+
}): Promise<import("@dynamic-labs-wallet/browser-wallet-client").GetWalletResponse>;
|
|
132
136
|
getWalletRecoveryState({ accountAddress, }: {
|
|
133
137
|
accountAddress: string;
|
|
134
|
-
}): Promise<import("@dynamic-labs-wallet/
|
|
138
|
+
}): Promise<import("@dynamic-labs-wallet/browser-wallet-client").WalletRecoveryState>;
|
|
135
139
|
endSession(): Promise<void>;
|
|
136
140
|
getActiveAccountAddress(): Promise<string | undefined>;
|
|
137
141
|
getConnectedAccounts(): Promise<string[]>;
|
|
@@ -252,10 +256,15 @@ export declare class DynamicWaasStellarConnector extends DynamicWaasStellarConne
|
|
|
252
256
|
* Ends the current session and clears the active account address
|
|
253
257
|
*/
|
|
254
258
|
endSession(): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Converts network passphrase to numeric chainId for policy validation
|
|
261
|
+
* ChainIds: '1' = pubnet (mainnet), '2' = testnet, '3' = futurenet
|
|
262
|
+
*/
|
|
263
|
+
private getChainIdFromNetworkPassphrase;
|
|
255
264
|
/**
|
|
256
265
|
* Signs a Stellar transaction XDR.
|
|
257
266
|
* @param transactionXdr - The XDR-encoded transaction envelope to sign
|
|
258
|
-
* @returns The
|
|
267
|
+
* @returns The signed transaction XDR
|
|
259
268
|
*/
|
|
260
269
|
signTransaction(transactionXdr: string): Promise<string>;
|
|
261
270
|
/**
|
|
@@ -217,10 +217,24 @@ class DynamicWaasStellarConnector extends withDynamicWaas(StellarWalletConnector
|
|
|
217
217
|
this.activeAccountAddress = undefined;
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Converts network passphrase to numeric chainId for policy validation
|
|
222
|
+
* ChainIds: '1' = pubnet (mainnet), '2' = testnet, '3' = futurenet
|
|
223
|
+
*/
|
|
224
|
+
getChainIdFromNetworkPassphrase(networkPassphrase) {
|
|
225
|
+
// Check futurenet first since its passphrase also contains 'Test'
|
|
226
|
+
if (networkPassphrase.includes('Future')) {
|
|
227
|
+
return '3';
|
|
228
|
+
}
|
|
229
|
+
if (networkPassphrase.includes('Test')) {
|
|
230
|
+
return '2';
|
|
231
|
+
}
|
|
232
|
+
return '1';
|
|
233
|
+
}
|
|
220
234
|
/**
|
|
221
235
|
* Signs a Stellar transaction XDR.
|
|
222
236
|
* @param transactionXdr - The XDR-encoded transaction envelope to sign
|
|
223
|
-
* @returns The
|
|
237
|
+
* @returns The signed transaction XDR
|
|
224
238
|
*/
|
|
225
239
|
signTransaction(transactionXdr) {
|
|
226
240
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -236,19 +250,22 @@ class DynamicWaasStellarConnector extends withDynamicWaas(StellarWalletConnector
|
|
|
236
250
|
const password = yield this.getPasswordIfNeeded({
|
|
237
251
|
accountAddress: this.activeAccountAddress,
|
|
238
252
|
});
|
|
239
|
-
// Get
|
|
253
|
+
// Get chainId from network passphrase for policy validation
|
|
240
254
|
const networkPassphrase = yield this.getNetworkPassphrase();
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
//
|
|
255
|
+
const chainId = this.getChainIdFromNetworkPassphrase(networkPassphrase);
|
|
256
|
+
// Sign the transaction XDR using MPC
|
|
257
|
+
// The SDK will compute the hash internally and build the context for policy validation
|
|
244
258
|
const signature = yield walletClient.signTransaction({
|
|
245
259
|
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
260
|
+
chainId,
|
|
246
261
|
mfaToken,
|
|
247
262
|
password,
|
|
248
263
|
senderAddress: this.activeAccountAddress,
|
|
249
264
|
signedSessionId,
|
|
250
|
-
transaction:
|
|
265
|
+
transaction: transactionXdr,
|
|
251
266
|
});
|
|
267
|
+
// Parse the XDR to add the signature
|
|
268
|
+
const transaction = TransactionBuilder.fromXDR(transactionXdr, networkPassphrase);
|
|
252
269
|
// The signature from WaaS is base64 encoded
|
|
253
270
|
// addSignature expects both public key and signature as strings
|
|
254
271
|
transaction.addSignature(this.activeAccountAddress, signature);
|