@dynamic-labs/aleo 4.91.0 → 4.91.2

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,47 @@
1
1
 
2
+ ### [4.91.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.1...v4.91.2) (2026-06-26)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * **waas:** require expectedAddresses on migrateFromFireblocks (#11730)
8
+
9
+ ### Features
10
+
11
+ * **midnight:** support shielded/unshielded transfers and dust states in the embedded Send flow ([#11731](https://github.com/dynamic-labs/dynamic-auth/issues/11731)) ([663d171](https://github.com/dynamic-labs/dynamic-auth/commit/663d171a9628c634586831ee35c234e9331e3f80))
12
+ * **react-native-extension:** instrument all embedded webview failure paths ([#11737](https://github.com/dynamic-labs/dynamic-auth/issues/11737)) ([172998b](https://github.com/dynamic-labs/dynamic-auth/commit/172998b56e9bee04fbb8da71e83ce8885bc378ff))
13
+ * **waas:** migrateFromFireblocks connector method + demo panel (browser-wallet-client 1.0.46) ([#11702](https://github.com/dynamic-labs/dynamic-auth/issues/11702)) ([6bfc844](https://github.com/dynamic-labs/dynamic-auth/commit/6bfc8443fbaedabe1e7bee0ed78742cbbe5d0084))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * add coverage for scenario with passkey re-login and smart account ([#11726](https://github.com/dynamic-labs/dynamic-auth/issues/11726)) ([5364a72](https://github.com/dynamic-labs/dynamic-auth/commit/5364a72a750d835b9b2da602a91e8b5d7d305db7))
19
+ * remediate high-severity dependency vulnerabilities ([#11721](https://github.com/dynamic-labs/dynamic-auth/issues/11721)) ([cdb9306](https://github.com/dynamic-labs/dynamic-auth/commit/cdb93061365a20b8f73a1f8bea8352332e282c1e))
20
+ * replace node-fetch v2 with native fetch to fix Node 22 stream failure ([#11732](https://github.com/dynamic-labs/dynamic-auth/issues/11732)) ([b98f801](https://github.com/dynamic-labs/dynamic-auth/commit/b98f801e307b52dbd7e4b241a9a4a2d34d89118e))
21
+ * **zerodev-extension:** derive kernel 7702 vs 4337 per-wallet, not from global dashboard flag ([#11735](https://github.com/dynamic-labs/dynamic-auth/issues/11735)) ([72cf6a7](https://github.com/dynamic-labs/dynamic-auth/commit/72cf6a70a4857a4ea469faa555c485dbad8d0217))
22
+
23
+
24
+ * **waas:** require expectedAddresses on migrateFromFireblocks ([#11730](https://github.com/dynamic-labs/dynamic-auth/issues/11730)) ([c94824e](https://github.com/dynamic-labs/dynamic-auth/commit/c94824ebe11e0433a6ffbd2a5a9dd4283aeed31e))
25
+
26
+ ### [4.91.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.0...v4.91.1) (2026-06-24)
27
+
28
+
29
+ ### Features
30
+
31
+ * **aleo:** update sendBalance with individual and marketplace logic ([#11709](https://github.com/dynamic-labs/dynamic-auth/issues/11709)) ([f8dfc48](https://github.com/dynamic-labs/dynamic-auth/commit/f8dfc488ae607fbbbcc3432a3ef69f746f0b7df0))
32
+ * **sdk-react-core:** surface shielded address in Midnight deposit view ([#11698](https://github.com/dynamic-labs/dynamic-auth/issues/11698)) ([79c5402](https://github.com/dynamic-labs/dynamic-auth/commit/79c54029b1d8f722cf9f1d8b4c11977898442ac0))
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * display actual error message for WaaS export failures instead of generic fallback ([#11498](https://github.com/dynamic-labs/dynamic-auth/issues/11498)) ([373c931](https://github.com/dynamic-labs/dynamic-auth/commit/373c931eb96c88e484c557ee8f2934660d028f97))
38
+ * **wallet-book:** guard replaceKey and remove stale override ([#11682](https://github.com/dynamic-labs/dynamic-auth/issues/11682)) ([13947d9](https://github.com/dynamic-labs/dynamic-auth/commit/13947d972ed1f8227712bfc01af9cc2be616a78a))
39
+
40
+
41
+ ### Performance Improvements
42
+
43
+ * **e2e:** prebuild Expo web bundle for RN e2e tests ([#11674](https://github.com/dynamic-labs/dynamic-auth/issues/11674)) ([16e002d](https://github.com/dynamic-labs/dynamic-auth/commit/16e002d59b2035e3f2c116879a78418a959da8bc))
44
+
2
45
  ## [4.91.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.90.0...v4.91.0) (2026-06-23)
3
46
 
4
47
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.91.0";
6
+ var version = "4.91.2";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.91.0";
2
+ var version = "4.91.2";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/aleo",
3
- "version": "4.91.0",
3
+ "version": "4.91.2",
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,19 +18,19 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/assert-package-version": "4.91.0",
21
+ "@dynamic-labs/assert-package-version": "4.91.2",
22
22
  "@dynamic-labs-sdk/client": "1.12.1",
23
23
  "@dynamic-labs/sdk-api-core": "0.0.1046",
24
24
  "@provablehq/aleo-wallet-adaptor-core": "0.3.0-alpha.3",
25
25
  "@provablehq/aleo-wallet-adaptor-shield": "0.3.0-alpha.3",
26
26
  "@provablehq/aleo-wallet-standard": "0.3.0-alpha.3",
27
27
  "@provablehq/aleo-types": "0.3.0-alpha.3",
28
- "@dynamic-labs/logger": "4.91.0",
29
- "@dynamic-labs/types": "4.91.0",
30
- "@dynamic-labs/utils": "4.91.0",
31
- "@dynamic-labs/waas": "4.91.0",
32
- "@dynamic-labs/wallet-book": "4.91.0",
33
- "@dynamic-labs/wallet-connector-core": "4.91.0"
28
+ "@dynamic-labs/logger": "4.91.2",
29
+ "@dynamic-labs/types": "4.91.2",
30
+ "@dynamic-labs/utils": "4.91.2",
31
+ "@dynamic-labs/waas": "4.91.2",
32
+ "@dynamic-labs/wallet-book": "4.91.2",
33
+ "@dynamic-labs/wallet-connector-core": "4.91.2"
34
34
  },
35
35
  "peerDependencies": {}
36
36
  }
@@ -950,6 +950,79 @@ class DynamicWaasAleoConnector extends waas.withDynamicWaas(WaasAleoWalletConnec
950
950
  return result.txId;
951
951
  });
952
952
  }
953
+ /**
954
+ * Send from a private record. Automatically selects the smallest owned
955
+ * record of `tokenAddress` that covers `amount`, then routes by mode:
956
+ * - `individual` → `transfer_private` (record → private record)
957
+ * - `exchange` → `transfer_private_to_public` → `transfer_public`
958
+ *
959
+ * Called by `AleoWallet.sendBalance`. Requires `activeAccountAddress` to
960
+ * be set before calling (guaranteed by `getWaasConnectorOrThrow`).
961
+ */
962
+ sendBalance(args) {
963
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
964
+ var _a, _b;
965
+ const { mode, to, amount, tokenAddress } = args;
966
+ const networkId = Number((_b = (_a = this.getSelectedNetwork()) === null || _a === void 0 ? void 0 : _a.chainId) !== null && _b !== void 0 ? _b : 1);
967
+ const programId = tokenAddress !== null && tokenAddress !== void 0 ? tokenAddress : aleoSendableTokens.ALEO_CREDITS_PROGRAM;
968
+ const tokens = aleoSendableTokens.getAleoSendableTokensForNetwork(networkId);
969
+ const token = tokens.find((t) => t.programId === programId);
970
+ if (!token) {
971
+ throw new utils.DynamicError(`sendBalance: Aleo token '${programId}' is not supported on this network. Use proveTransaction for custom programs.`);
972
+ }
973
+ const value = BigInt(Math.round(parseFloat(amount) * Math.pow(10, token.decimals)));
974
+ const { records: rawRecords } = yield this.listOwnedRecords();
975
+ const fitting = rawRecords
976
+ .filter((r) => aleoSendableTokens.recordMatchesSendableToken(r, token) &&
977
+ typeof r.record_plaintext === 'string')
978
+ .map((r) => ({
979
+ atomic: aleoSendableTokens.extractRecordAtomicAmount(r, token),
980
+ plaintext: r.record_plaintext,
981
+ }))
982
+ .filter((r) => r.atomic >= value)
983
+ .sort((a, b) => {
984
+ if (a.atomic < b.atomic)
985
+ return -1;
986
+ if (a.atomic > b.atomic)
987
+ return 1;
988
+ return 0;
989
+ });
990
+ if (fitting.length === 0) {
991
+ throw new utils.DynamicError('No single private record covers this amount. Merge records first via wallet.joinRecords().');
992
+ }
993
+ const recordPlaintext = fitting[0].plaintext;
994
+ if (mode === 'exchange') {
995
+ if (!this.activeAccountAddress) {
996
+ throw new utils.DynamicError('Active account address is required');
997
+ }
998
+ return this.submitExchangeTransfer({
999
+ from: this.activeAccountAddress,
1000
+ recordPlaintext,
1001
+ to,
1002
+ token,
1003
+ value,
1004
+ });
1005
+ }
1006
+ const { functionName, inputs, inputTypes } = buildTransferInputs({
1007
+ mode: 'individual',
1008
+ recordPlaintext,
1009
+ to,
1010
+ token,
1011
+ value,
1012
+ });
1013
+ const result = yield this.proveTransaction({
1014
+ broadcast: true,
1015
+ functionName,
1016
+ inputTypes,
1017
+ inputs,
1018
+ programId: token.programId,
1019
+ });
1020
+ if (!result.txId) {
1021
+ throw new utils.DynamicError('Aleo transfer_private did not return a transaction id.');
1022
+ }
1023
+ return result.txId;
1024
+ });
1025
+ }
953
1026
  /**
954
1027
  * Two-step Exchange transfer.
955
1028
  *
@@ -5,6 +5,7 @@ import { IDynamicWaasConnector, InternalWalletConnector } from '@dynamic-labs/wa
5
5
  import { Logger } from '@dynamic-labs/logger';
6
6
  import { WaasAleoWalletConnector, type WaasAleoWalletConnectorProps } from '../WaasAleoWalletConnector';
7
7
  import { AleoWallet } from '../../wallet/AleoWallet';
8
+ import { AleoTransferMode } from '../../utils/AleoUiTransaction';
8
9
  import { AleoOwnedRecord } from '../../utils/aleoSendableTokens';
9
10
  import type { AleoTransaction } from '../../types';
10
11
  export type DynamicWaasAleoConnectorProps = WaasAleoWalletConnectorProps & {
@@ -91,6 +92,15 @@ declare const DynamicWaasAleoConnector_base: (abstract new (...args: any[]) => {
91
92
  legacyWalletId?: string | undefined;
92
93
  password?: string | undefined;
93
94
  }): Promise<void>;
95
+ migrateFromFireblocks({ deviceId, jwt, walletPassword, ncwStorage, expectedAddresses, coinTypes, password, }: {
96
+ deviceId: string;
97
+ jwt: string;
98
+ walletPassword: string;
99
+ ncwStorage: Record<string, string>;
100
+ expectedAddresses: Record<string, string>;
101
+ coinTypes?: Record<string, number> | undefined;
102
+ password?: string | undefined;
103
+ }): Promise<import("@dynamic-labs-wallet/browser-wallet-client").MigrateFromFireblocksResponse>;
94
104
  exportPrivateKey({ accountAddress, displayContainer, password, }?: {
95
105
  accountAddress?: string | undefined;
96
106
  displayContainer?: HTMLIFrameElement | undefined;
@@ -455,6 +465,21 @@ export declare class DynamicWaasAleoConnector extends DynamicWaasAleoConnector_b
455
465
  * allowed).
456
466
  */
457
467
  private dispatchShieldBroadcast;
468
+ /**
469
+ * Send from a private record. Automatically selects the smallest owned
470
+ * record of `tokenAddress` that covers `amount`, then routes by mode:
471
+ * - `individual` → `transfer_private` (record → private record)
472
+ * - `exchange` → `transfer_private_to_public` → `transfer_public`
473
+ *
474
+ * Called by `AleoWallet.sendBalance`. Requires `activeAccountAddress` to
475
+ * be set before calling (guaranteed by `getWaasConnectorOrThrow`).
476
+ */
477
+ sendBalance(args: {
478
+ mode: AleoTransferMode;
479
+ to: string;
480
+ amount: string;
481
+ tokenAddress?: string;
482
+ }): Promise<string>;
458
483
  /**
459
484
  * Two-step Exchange transfer.
460
485
  *
@@ -7,7 +7,7 @@ import { Logger } from '@dynamic-labs/logger';
7
7
  import { WaasAleoWalletConnector } from '../WaasAleoWalletConnector/WaasAleoWalletConnector.js';
8
8
  import { AleoWallet } from '../../wallet/AleoWallet/AleoWallet.js';
9
9
  import { AleoUiTransaction } from '../../utils/AleoUiTransaction/AleoUiTransaction.js';
10
- import { ALEO_TOKEN_REGISTRY_PROGRAM } from '../../utils/aleoSendableTokens/aleoSendableTokens.js';
10
+ import { getAleoSendableTokensForNetwork, recordMatchesSendableToken, extractRecordAtomicAmount, ALEO_CREDITS_PROGRAM, ALEO_TOKEN_REGISTRY_PROGRAM } from '../../utils/aleoSendableTokens/aleoSendableTokens.js';
11
11
  import { findAleoShieldableToken } from '../../utils/aleoShieldableTokens/aleoShieldableTokens.js';
12
12
 
13
13
  /**
@@ -946,6 +946,79 @@ class DynamicWaasAleoConnector extends withDynamicWaas(WaasAleoWalletConnector)
946
946
  return result.txId;
947
947
  });
948
948
  }
949
+ /**
950
+ * Send from a private record. Automatically selects the smallest owned
951
+ * record of `tokenAddress` that covers `amount`, then routes by mode:
952
+ * - `individual` → `transfer_private` (record → private record)
953
+ * - `exchange` → `transfer_private_to_public` → `transfer_public`
954
+ *
955
+ * Called by `AleoWallet.sendBalance`. Requires `activeAccountAddress` to
956
+ * be set before calling (guaranteed by `getWaasConnectorOrThrow`).
957
+ */
958
+ sendBalance(args) {
959
+ return __awaiter(this, void 0, void 0, function* () {
960
+ var _a, _b;
961
+ const { mode, to, amount, tokenAddress } = args;
962
+ const networkId = Number((_b = (_a = this.getSelectedNetwork()) === null || _a === void 0 ? void 0 : _a.chainId) !== null && _b !== void 0 ? _b : 1);
963
+ const programId = tokenAddress !== null && tokenAddress !== void 0 ? tokenAddress : ALEO_CREDITS_PROGRAM;
964
+ const tokens = getAleoSendableTokensForNetwork(networkId);
965
+ const token = tokens.find((t) => t.programId === programId);
966
+ if (!token) {
967
+ throw new DynamicError(`sendBalance: Aleo token '${programId}' is not supported on this network. Use proveTransaction for custom programs.`);
968
+ }
969
+ const value = BigInt(Math.round(parseFloat(amount) * Math.pow(10, token.decimals)));
970
+ const { records: rawRecords } = yield this.listOwnedRecords();
971
+ const fitting = rawRecords
972
+ .filter((r) => recordMatchesSendableToken(r, token) &&
973
+ typeof r.record_plaintext === 'string')
974
+ .map((r) => ({
975
+ atomic: extractRecordAtomicAmount(r, token),
976
+ plaintext: r.record_plaintext,
977
+ }))
978
+ .filter((r) => r.atomic >= value)
979
+ .sort((a, b) => {
980
+ if (a.atomic < b.atomic)
981
+ return -1;
982
+ if (a.atomic > b.atomic)
983
+ return 1;
984
+ return 0;
985
+ });
986
+ if (fitting.length === 0) {
987
+ throw new DynamicError('No single private record covers this amount. Merge records first via wallet.joinRecords().');
988
+ }
989
+ const recordPlaintext = fitting[0].plaintext;
990
+ if (mode === 'exchange') {
991
+ if (!this.activeAccountAddress) {
992
+ throw new DynamicError('Active account address is required');
993
+ }
994
+ return this.submitExchangeTransfer({
995
+ from: this.activeAccountAddress,
996
+ recordPlaintext,
997
+ to,
998
+ token,
999
+ value,
1000
+ });
1001
+ }
1002
+ const { functionName, inputs, inputTypes } = buildTransferInputs({
1003
+ mode: 'individual',
1004
+ recordPlaintext,
1005
+ to,
1006
+ token,
1007
+ value,
1008
+ });
1009
+ const result = yield this.proveTransaction({
1010
+ broadcast: true,
1011
+ functionName,
1012
+ inputTypes,
1013
+ inputs,
1014
+ programId: token.programId,
1015
+ });
1016
+ if (!result.txId) {
1017
+ throw new DynamicError('Aleo transfer_private did not return a transaction id.');
1018
+ }
1019
+ return result.txId;
1020
+ });
1021
+ }
949
1022
  /**
950
1023
  * Two-step Exchange transfer.
951
1024
  *
@@ -10,31 +10,13 @@ var getAleoExplorerTxUrl = require('../../utils/getAleoExplorerTxUrl/getAleoExpl
10
10
 
11
11
  class AleoWallet extends walletConnectorCore.Wallet {
12
12
  sendBalance(_a) {
13
- return _tslib.__awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, }) {
14
- var _b, _c, _d;
15
- const chainId = (_b = (yield this._connector.getNetwork())) !== null && _b !== void 0 ? _b : '0';
16
- const decimals = (_c = token === null || token === void 0 ? void 0 : token.decimals) !== null && _c !== void 0 ? _c : 6;
17
- const microcredits = BigInt(Math.round(parseFloat(amount) * Math.pow(10, decimals)));
18
- const program = (_d = token === null || token === void 0 ? void 0 : token.address) !== null && _d !== void 0 ? _d : 'credits.aleo';
19
- // credits.aleo's transfer_public takes u64; token programs (e.g. stablecoins)
20
- // take u128. Key off the program, NOT merely whether a token was passed —
21
- // passing token { address: 'credits.aleo' } must still produce u64.
22
- const isCredits = program === 'credits.aleo';
23
- const amountSuffix = isCredits ? 'u64' : 'u128';
24
- const transaction = {
25
- address: this.address,
26
- chainId,
27
- fee: 50000,
28
- feePrivate: false,
29
- transitions: [
30
- {
31
- functionName: 'transfer_public',
32
- inputs: [toAddress, `${microcredits}${amountSuffix}`],
33
- program,
34
- },
35
- ],
36
- };
37
- return this._connector.requestTransaction(transaction);
13
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, mode = 'individual', }) {
14
+ return this.getWaasConnectorOrThrow('sendBalance').sendBalance({
15
+ amount,
16
+ mode,
17
+ to: toAddress,
18
+ tokenAddress: token === null || token === void 0 ? void 0 : token.address,
19
+ });
38
20
  });
39
21
  }
40
22
  getBalance() {
@@ -2,14 +2,16 @@ import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
2
  import type { AleoWalletConnector } from '../../connectors/AleoWalletConnector';
3
3
  import type { DynamicWaasAleoConnector } from '../../connectors/DynamicWaasAleoConnector';
4
4
  import type { AleoTransaction } from '../../types';
5
+ import type { AleoTransferMode } from '../../utils/AleoUiTransaction';
5
6
  export declare class AleoWallet extends Wallet<AleoWalletConnector> {
6
- sendBalance({ amount, toAddress, token, }: {
7
+ sendBalance({ amount, toAddress, token, mode, }: {
7
8
  amount: string;
8
9
  toAddress: string;
9
10
  token?: {
10
11
  address: string;
11
12
  decimals?: number;
12
13
  };
14
+ mode?: AleoTransferMode;
13
15
  }): Promise<string | undefined>;
14
16
  getBalance(): Promise<string>;
15
17
  /**
@@ -6,31 +6,13 @@ import { getAleoExplorerTxUrl } from '../../utils/getAleoExplorerTxUrl/getAleoEx
6
6
 
7
7
  class AleoWallet extends Wallet {
8
8
  sendBalance(_a) {
9
- return __awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, }) {
10
- var _b, _c, _d;
11
- const chainId = (_b = (yield this._connector.getNetwork())) !== null && _b !== void 0 ? _b : '0';
12
- const decimals = (_c = token === null || token === void 0 ? void 0 : token.decimals) !== null && _c !== void 0 ? _c : 6;
13
- const microcredits = BigInt(Math.round(parseFloat(amount) * Math.pow(10, decimals)));
14
- const program = (_d = token === null || token === void 0 ? void 0 : token.address) !== null && _d !== void 0 ? _d : 'credits.aleo';
15
- // credits.aleo's transfer_public takes u64; token programs (e.g. stablecoins)
16
- // take u128. Key off the program, NOT merely whether a token was passed —
17
- // passing token { address: 'credits.aleo' } must still produce u64.
18
- const isCredits = program === 'credits.aleo';
19
- const amountSuffix = isCredits ? 'u64' : 'u128';
20
- const transaction = {
21
- address: this.address,
22
- chainId,
23
- fee: 50000,
24
- feePrivate: false,
25
- transitions: [
26
- {
27
- functionName: 'transfer_public',
28
- inputs: [toAddress, `${microcredits}${amountSuffix}`],
29
- program,
30
- },
31
- ],
32
- };
33
- return this._connector.requestTransaction(transaction);
9
+ return __awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, mode = 'individual', }) {
10
+ return this.getWaasConnectorOrThrow('sendBalance').sendBalance({
11
+ amount,
12
+ mode,
13
+ to: toAddress,
14
+ tokenAddress: token === null || token === void 0 ? void 0 : token.address,
15
+ });
34
16
  });
35
17
  }
36
18
  getBalance() {