@dynamic-labs/stellar 4.65.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 CHANGED
@@ -1,4 +1,17 @@
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
+
2
15
  ## [4.65.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.64.0...v4.65.0) (2026-02-27)
3
16
 
4
17
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.65.0";
6
+ var version = "4.66.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.65.0";
2
+ var version = "4.66.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/stellar",
3
- "version": "4.65.0",
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.65.0",
24
- "@dynamic-labs/assert-package-version": "4.65.0",
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.65.0",
28
- "@dynamic-labs/types": "4.65.0",
29
- "@dynamic-labs/utils": "4.65.0",
30
- "@dynamic-labs/waas": "4.65.0",
31
- "@dynamic-labs/wallet-book": "4.65.0",
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 signature as a base64 string
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 the transaction hash that needs to be signed
257
+ // Get chainId from network passphrase for policy validation
244
258
  const networkPassphrase = yield this.getNetworkPassphrase();
245
- const transaction = stellarSdk.TransactionBuilder.fromXDR(transactionXdr, networkPassphrase);
246
- const transactionHash = transaction.hash().toString('hex');
247
- // Sign the transaction hash using MPC
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: transactionHash,
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/core").BitcoinConfig | undefined;
61
+ bitcoinConfig?: import("@dynamic-labs-wallet/browser-wallet-client").BitcoinConfig | undefined;
62
62
  } | undefined): Promise<{
63
63
  chainName: string;
64
64
  accountAddress: string;
@@ -132,10 +132,10 @@ declare const DynamicWaasStellarConnector_base: (abstract new (...args: any[]) =
132
132
  unlockWallet({ accountAddress, password, }: {
133
133
  accountAddress: string;
134
134
  password?: string | undefined;
135
- }): Promise<import("@dynamic-labs-wallet/core").GetWalletResponse>;
135
+ }): Promise<import("@dynamic-labs-wallet/browser-wallet-client").GetWalletResponse>;
136
136
  getWalletRecoveryState({ accountAddress, }: {
137
137
  accountAddress: string;
138
- }): Promise<import("@dynamic-labs-wallet/core").WalletRecoveryState>;
138
+ }): Promise<import("@dynamic-labs-wallet/browser-wallet-client").WalletRecoveryState>;
139
139
  endSession(): Promise<void>;
140
140
  getActiveAccountAddress(): Promise<string | undefined>;
141
141
  getConnectedAccounts(): Promise<string[]>;
@@ -256,10 +256,15 @@ export declare class DynamicWaasStellarConnector extends DynamicWaasStellarConne
256
256
  * Ends the current session and clears the active account address
257
257
  */
258
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;
259
264
  /**
260
265
  * Signs a Stellar transaction XDR.
261
266
  * @param transactionXdr - The XDR-encoded transaction envelope to sign
262
- * @returns The signature as a base64 string
267
+ * @returns The signed transaction XDR
263
268
  */
264
269
  signTransaction(transactionXdr: string): Promise<string>;
265
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 signature as a base64 string
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 the transaction hash that needs to be signed
253
+ // Get chainId from network passphrase for policy validation
240
254
  const networkPassphrase = yield this.getNetworkPassphrase();
241
- const transaction = TransactionBuilder.fromXDR(transactionXdr, networkPassphrase);
242
- const transactionHash = transaction.hash().toString('hex');
243
- // Sign the transaction hash using MPC
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: transactionHash,
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);