@dynamic-labs/aleo 4.84.0 → 4.85.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,38 @@
1
1
 
2
+ ## [4.85.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.84.1...v4.85.0) (2026-05-29)
3
+
4
+
5
+ ### Features
6
+
7
+ * **moonpay:** add getMoonPayCurrencies API, MOONPAY_PROVIDER_ID, and chain enum fix ([#11362](https://github.com/dynamic-labs/dynamic-auth/issues/11362)) ([8f1c841](https://github.com/dynamic-labs/dynamic-auth/commit/8f1c841dcab3249e82a7152be373c0e0204a2f47))
8
+ * **sdk-react-core:** extend usePrivateTokenBalances with `accountAddress`, `tokenAddresses`, `includeNativeBalance`, `includeFiat` ([#11380](https://github.com/dynamic-labs/dynamic-auth/issues/11380)) ([ccb6d47](https://github.com/dynamic-labs/dynamic-auth/commit/ccb6d47b4683a12a13aaf8311ecffae3d46464a3))
9
+ * **sdk-react-core:** forward `chainName` + `networkId` through `usePrivateTokenBalances` ([#11383](https://github.com/dynamic-labs/dynamic-auth/issues/11383)) ([c2ad110](https://github.com/dynamic-labs/dynamic-auth/commit/c2ad1103d4d4fdba67fc9b50b60945a843adae99))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **aleo:** drop optimistically deducted unshielded rows when balance hits zero ([#11371](https://github.com/dynamic-labs/dynamic-auth/issues/11371)) ([a3bb8e8](https://github.com/dynamic-labs/dynamic-auth/commit/a3bb8e8fa7e877340c829c991ba31eeb8fa4fcf1)), closes [#11337](https://github.com/dynamic-labs/dynamic-auth/issues/11337)
15
+ * **aleo:** re-read gas sponsored flag after async fetchFee resolves ([#11375](https://github.com/dynamic-labs/dynamic-auth/issues/11375)) ([d27e74a](https://github.com/dynamic-labs/dynamic-auth/commit/d27e74a309aff18eb6b18046fe34e9e64363d331))
16
+ * remediate high-severity dependency vulnerabilities ([#11339](https://github.com/dynamic-labs/dynamic-auth/issues/11339)) ([f025b30](https://github.com/dynamic-labs/dynamic-auth/commit/f025b308e29153de49c88d91233139bb00caaf4e))
17
+ * **waas:** guard upgradeToDynamicWaas on the wallet arg, not primaryWallet ([#11324](https://github.com/dynamic-labs/dynamic-auth/issues/11324)) ([3e95eaf](https://github.com/dynamic-labs/dynamic-auth/commit/3e95eaf50afd2f49ff1cc416e5bf211ee04fbb23))
18
+
19
+ ### [4.84.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.84.0...v4.84.1) (2026-05-28)
20
+
21
+
22
+ ### Features
23
+
24
+ * **sdk-react-core:** add usePrivateTokenBalances public hook ([#11338](https://github.com/dynamic-labs/dynamic-auth/issues/11338)) ([91125e8](https://github.com/dynamic-labs/dynamic-auth/commit/91125e8e3ac010f760e1481fd4685dfde331b94a))
25
+ * **waas:** detect delegated wallets via otherShareSets ([#11312](https://github.com/dynamic-labs/dynamic-auth/issues/11312)) ([0c8277f](https://github.com/dynamic-labs/dynamic-auth/commit/0c8277f9e2f4e622fc7a75fdfcf4180d9b7db8ff))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **aleo:** misc Send-screen UI fixes — sponsorship, 0-amount, 0-balance, glyphs ([#11337](https://github.com/dynamic-labs/dynamic-auth/issues/11337)) ([f95bc34](https://github.com/dynamic-labs/dynamic-auth/commit/f95bc34c7f8e0a01df61a72f0cbcfa3508471cd7))
31
+ * **aleo:** optimistic shield balance updates + convergence polling ([#11336](https://github.com/dynamic-labs/dynamic-auth/issues/11336)) ([c86eeec](https://github.com/dynamic-labs/dynamic-auth/commit/c86eeecd1475838a61d58b7924ac7bec0db5b9f3))
32
+ * **locale:** capitalize "Key" in Export Private Key button ([#11319](https://github.com/dynamic-labs/dynamic-auth/issues/11319)) ([58eceff](https://github.com/dynamic-labs/dynamic-auth/commit/58eceff3fdaee5d70dac0a8fef89a86f31f814aa))
33
+
34
+
35
+
2
36
  ## [4.84.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.83.2-alpha.0...v4.84.0) (2026-05-22)
3
37
 
4
38
 
@@ -6522,4 +6556,4 @@ Enjoy!
6522
6556
  * setPrimaryWallet and useSyncPrimaryWallet updates ([#2128](https://github.com/dynamic-labs/DynamicAuth/issues/2128)) ([fb47b17](https://github.com/dynamic-labs/DynamicAuth/commit/fb47b17ddc7f41c29f140a1a85a1e47dbf017fff))
6523
6557
  * update text color and add close button on extension not installed prompt ([#2122](https://github.com/dynamic-labs/DynamicAuth/issues/2122)) ([b4848a0](https://github.com/dynamic-labs/DynamicAuth/commit/b4848a0a8094b4ceac67e2667d277a9aa5e2e137))
6524
6558
 
6525
- ## [0.17.0-RC.16](https://github.com/dynamic-labs/Dyna
6559
+ ## [0.17.0-RC.16](https://github.com/dynamic-labs/Dyna
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.84.0";
6
+ var version = "4.85.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.84.0";
2
+ var version = "4.85.0";
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.84.0",
3
+ "version": "4.85.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",
@@ -19,18 +19,18 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@dynamic-labs-sdk/client": "1.1.0",
22
- "@dynamic-labs/assert-package-version": "4.84.0",
22
+ "@dynamic-labs/assert-package-version": "4.85.0",
23
23
  "@dynamic-labs/sdk-api-core": "0.0.985",
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.84.0",
29
- "@dynamic-labs/types": "4.84.0",
30
- "@dynamic-labs/utils": "4.84.0",
31
- "@dynamic-labs/waas": "4.84.0",
32
- "@dynamic-labs/wallet-book": "4.84.0",
33
- "@dynamic-labs/wallet-connector-core": "4.84.0"
28
+ "@dynamic-labs/logger": "4.85.0",
29
+ "@dynamic-labs/types": "4.85.0",
30
+ "@dynamic-labs/utils": "4.85.0",
31
+ "@dynamic-labs/waas": "4.85.0",
32
+ "@dynamic-labs/wallet-book": "4.85.0",
33
+ "@dynamic-labs/wallet-connector-core": "4.85.0"
34
34
  },
35
35
  "peerDependencies": {}
36
36
  }
@@ -669,6 +669,11 @@ class DynamicWaasAleoConnector extends waas.withDynamicWaas(WaasAleoWalletConnec
669
669
  : Number(networkChainId !== null && networkChainId !== void 0 ? networkChainId : 1);
670
670
  return new AleoUiTransaction.AleoUiTransaction({
671
671
  from,
672
+ // Feemaster policy lookup, used by `fetchFee` to set
673
+ // `isGasSponsored` truthfully for the currently-selected token
674
+ // + transaction mode. Bound to the live connector so it picks up
675
+ // the active chainId (the policy keys off mainnet vs. testnet).
676
+ isFeemasterSponsored: (args) => _tslib.__awaiter(this, void 0, void 0, function* () { return this.isFeemasterSponsored(args); }),
672
677
  // Merge CTA: scope the join to the selected token. For credits +
673
678
  // stablecoins the program id alone is enough. For ARC-21 the
674
679
  // program (`token_registry.aleo`) hosts many tokens, so we
@@ -665,6 +665,11 @@ class DynamicWaasAleoConnector extends withDynamicWaas(WaasAleoWalletConnector)
665
665
  : Number(networkChainId !== null && networkChainId !== void 0 ? networkChainId : 1);
666
666
  return new AleoUiTransaction({
667
667
  from,
668
+ // Feemaster policy lookup, used by `fetchFee` to set
669
+ // `isGasSponsored` truthfully for the currently-selected token
670
+ // + transaction mode. Bound to the live connector so it picks up
671
+ // the active chainId (the policy keys off mainnet vs. testnet).
672
+ isFeemasterSponsored: (args) => __awaiter(this, void 0, void 0, function* () { return this.isFeemasterSponsored(args); }),
668
673
  // Merge CTA: scope the join to the selected token. For credits +
669
674
  // stablecoins the program id alone is enough. For ARC-21 the
670
675
  // program (`token_registry.aleo`) hosts many tokens, so we
@@ -57,7 +57,7 @@ const ALEO_ADDRESS_REGEX = /^aleo1[a-z0-9]{58}$/;
57
57
  * fits, the form surfaces a merge CTA backed by `joinAllRecordsForToken`.
58
58
  */
59
59
  class AleoUiTransaction {
60
- constructor({ from, networkId, listOwnedRecords, joinAllRecordsForToken, onSubmit, }) {
60
+ constructor({ from, networkId, listOwnedRecords, joinAllRecordsForToken, onSubmit, isFeemasterSponsored, }) {
61
61
  var _a;
62
62
  this.chain = 'ALEO';
63
63
  this.data = undefined;
@@ -81,11 +81,19 @@ class AleoUiTransaction {
81
81
  // presumptuous given Individual vs. Exchange has real semantic
82
82
  // differences (recipient gets a private record vs. public balance).
83
83
  this.selectedTransactionMode = undefined;
84
+ // Resolved at `fetchFee` time. The widget calls `isGasSponsored()`
85
+ // synchronously to decide whether to render the gas-estimate row, so
86
+ // we cache the async Feemaster lookup result on the instance. When
87
+ // the closure isn't supplied (legacy call sites + unit tests) we
88
+ // fall back to the pre-existing "credits is sponsored, everything
89
+ // else is user-paid" heuristic.
90
+ this.cachedIsGasSponsored = false;
84
91
  this.from = from;
85
92
  this.networkId = networkId;
86
93
  this.listOwnedRecords = listOwnedRecords;
87
94
  this.joinAllRecordsForToken = joinAllRecordsForToken;
88
95
  this.onSubmitFn = onSubmit;
96
+ this.isFeemasterSponsoredFn = isFeemasterSponsored;
89
97
  this.selectedToken = (_a = this.tokensForNetwork()[0]) !== null && _a !== void 0 ? _a : this.creditsFallback();
90
98
  }
91
99
  setTransactionMode(modeId) {
@@ -222,20 +230,62 @@ class AleoUiTransaction {
222
230
  });
223
231
  }
224
232
  /**
225
- * Feemaster sponsors `credits.aleo/transfer_public` and `transfer_private`
226
- * per ANF's policy, so the user pays zero on credits sends. Stablecoin
227
- * + ARC-21 sends today fall through to user-paid (Feemaster policy
228
- * doesn't yet cover them on testnet); the iframe still completes the
229
- * transfer, just deducts the credits-fee directly. The optimistic `0n`
230
- * here matches what we tell the user via `isGasSponsored()` below.
233
+ * Asks Feemaster (via the connector closure) whether the currently
234
+ * selected `(token, transactionMode)` is on its sponsorship policy and
235
+ * caches the answer on the instance so the synchronous
236
+ * `isGasSponsored()` getter can return the right boolean. We hold
237
+ * `fee.gas` at `0n` regardless: when Feemaster covers the call the
238
+ * user really does pay zero; when it doesn't, the iframe deducts a
239
+ * small credits-fee on the user's behalf and the prover-reported
240
+ * exact amount isn't known until after broadcast — the confirmation
241
+ * card then hides the row entirely (sponsored) or shows `--` until
242
+ * the receipt lands (user-paid). The async `fetchFee` is awaited by
243
+ * `TransactionConfirmationView` before the gas row renders so the
244
+ * cached flag is always populated by the time the row decides to
245
+ * mount.
231
246
  */
232
247
  fetchFee() {
233
248
  return _tslib.__awaiter(this, void 0, void 0, function* () {
234
249
  this.fee.gas = BigInt(0);
250
+ if (!this.isFeemasterSponsoredFn) {
251
+ // Pre-existing heuristic for tests / legacy call sites that
252
+ // construct `AleoUiTransaction` without the connector closure:
253
+ // treat credits as sponsored, every other token as user-paid.
254
+ this.cachedIsGasSponsored = this.selectedToken.programKind === 'credits';
255
+ return;
256
+ }
257
+ // Match the function name we'd actually submit:
258
+ // - Individual mode → `<program>/transfer_private`
259
+ // - Exchange mode → `<program>/transfer_private_to_public`
260
+ // (the heavier step-1 leg; step-2's
261
+ // `transfer_public` is cheap by comparison and
262
+ // currently shares the same policy bucket).
263
+ // - No mode picked yet → fall back to `transfer_private` so the
264
+ // confirmation card optimistically hides
265
+ // the row before the user picks; if the
266
+ // eventual selection isn't sponsored we'll
267
+ // re-render once the user advances.
268
+ const functionName = this.selectedTransactionMode === 'exchange'
269
+ ? 'transfer_private_to_public'
270
+ : 'transfer_private';
271
+ try {
272
+ this.cachedIsGasSponsored = yield this.isFeemasterSponsoredFn({
273
+ functionName,
274
+ programId: this.selectedToken.programId,
275
+ });
276
+ }
277
+ catch (_a) {
278
+ // Never throw from `fetchFee` — the widget would surface a
279
+ // confirmation-card error and the user couldn't proceed. A
280
+ // Feemaster outage just means we render the (zero) fee row
281
+ // conservatively, which the user will read as "no estimate
282
+ // yet". The submit path will still attempt the broadcast.
283
+ this.cachedIsGasSponsored = false;
284
+ }
235
285
  });
236
286
  }
237
287
  isGasSponsored() {
238
- return this.selectedToken.programKind === 'credits';
288
+ return this.cachedIsGasSponsored;
239
289
  }
240
290
  /**
241
291
  * Tells the SendBalanceView to populate the picker / "Available"
@@ -348,7 +398,7 @@ class AleoUiTransaction {
348
398
  return {
349
399
  contractAddress: aleoSendableTokens.ALEO_CREDITS_PROGRAM,
350
400
  decimals: aleoSendableTokens.ALEO_CREDITS_DECIMALS,
351
- logoURI: '',
401
+ logoURI: aleoSendableTokens.ALEO_NATIVE_LOGO_URI,
352
402
  name: 'Aleo Credits',
353
403
  programId: aleoSendableTokens.ALEO_CREDITS_PROGRAM,
354
404
  programKind: 'credits',
@@ -16,6 +16,10 @@ type AleoUiTransactionProps = {
16
16
  listOwnedRecords: () => Promise<AleoOwnedRecord[]>;
17
17
  joinAllRecordsForToken: (token: AleoSendableToken) => Promise<void>;
18
18
  onSubmit: (params: AleoSubmitParams) => Promise<string>;
19
+ isFeemasterSponsored?: (args: {
20
+ programId: string;
21
+ functionName: string;
22
+ }) => Promise<boolean>;
19
23
  };
20
24
  /**
21
25
  * Aleo `IUITransaction` for the widget's Send flow.
@@ -71,10 +75,12 @@ export declare class AleoUiTransaction implements IUITransaction {
71
75
  private readonly listOwnedRecords;
72
76
  private readonly joinAllRecordsForToken;
73
77
  private readonly onSubmitFn;
78
+ private readonly isFeemasterSponsoredFn;
79
+ private cachedIsGasSponsored;
74
80
  private pendingValue;
75
81
  private cachedRecords;
76
82
  private selectedToken;
77
- constructor({ from, networkId, listOwnedRecords, joinAllRecordsForToken, onSubmit, }: AleoUiTransactionProps);
83
+ constructor({ from, networkId, listOwnedRecords, joinAllRecordsForToken, onSubmit, isFeemasterSponsored, }: AleoUiTransactionProps);
78
84
  setTransactionMode(modeId: string): void;
79
85
  setSelectedToken(contractAddress: string): void;
80
86
  setPendingAmount(amountInput: string): void;
@@ -104,12 +110,19 @@ export declare class AleoUiTransaction implements IUITransaction {
104
110
  */
105
111
  getBalance(): Promise<bigint>;
106
112
  /**
107
- * Feemaster sponsors `credits.aleo/transfer_public` and `transfer_private`
108
- * per ANF's policy, so the user pays zero on credits sends. Stablecoin
109
- * + ARC-21 sends today fall through to user-paid (Feemaster policy
110
- * doesn't yet cover them on testnet); the iframe still completes the
111
- * transfer, just deducts the credits-fee directly. The optimistic `0n`
112
- * here matches what we tell the user via `isGasSponsored()` below.
113
+ * Asks Feemaster (via the connector closure) whether the currently
114
+ * selected `(token, transactionMode)` is on its sponsorship policy and
115
+ * caches the answer on the instance so the synchronous
116
+ * `isGasSponsored()` getter can return the right boolean. We hold
117
+ * `fee.gas` at `0n` regardless: when Feemaster covers the call the
118
+ * user really does pay zero; when it doesn't, the iframe deducts a
119
+ * small credits-fee on the user's behalf and the prover-reported
120
+ * exact amount isn't known until after broadcast — the confirmation
121
+ * card then hides the row entirely (sponsored) or shows `--` until
122
+ * the receipt lands (user-paid). The async `fetchFee` is awaited by
123
+ * `TransactionConfirmationView` before the gas row renders so the
124
+ * cached flag is always populated by the time the row decides to
125
+ * mount.
113
126
  */
114
127
  fetchFee(): Promise<void>;
115
128
  isGasSponsored(): boolean;
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { formatNumberText } from '@dynamic-labs/utils';
4
- import { recordMatchesSendableToken, extractRecordAtomicAmount, getAleoSendableTokensForNetwork, ALEO_CREDITS_PROGRAM, ALEO_CREDITS_DECIMALS } from '../aleoSendableTokens/aleoSendableTokens.js';
4
+ import { recordMatchesSendableToken, extractRecordAtomicAmount, getAleoSendableTokensForNetwork, ALEO_CREDITS_PROGRAM, ALEO_CREDITS_DECIMALS, ALEO_NATIVE_LOGO_URI } from '../aleoSendableTokens/aleoSendableTokens.js';
5
5
 
6
6
  // `10n ** decimals` via string construction. Equivalent to `BigInt(10) **
7
7
  // BigInt(decimals)` but avoids the TS2791 error in environments whose
@@ -53,7 +53,7 @@ const ALEO_ADDRESS_REGEX = /^aleo1[a-z0-9]{58}$/;
53
53
  * fits, the form surfaces a merge CTA backed by `joinAllRecordsForToken`.
54
54
  */
55
55
  class AleoUiTransaction {
56
- constructor({ from, networkId, listOwnedRecords, joinAllRecordsForToken, onSubmit, }) {
56
+ constructor({ from, networkId, listOwnedRecords, joinAllRecordsForToken, onSubmit, isFeemasterSponsored, }) {
57
57
  var _a;
58
58
  this.chain = 'ALEO';
59
59
  this.data = undefined;
@@ -77,11 +77,19 @@ class AleoUiTransaction {
77
77
  // presumptuous given Individual vs. Exchange has real semantic
78
78
  // differences (recipient gets a private record vs. public balance).
79
79
  this.selectedTransactionMode = undefined;
80
+ // Resolved at `fetchFee` time. The widget calls `isGasSponsored()`
81
+ // synchronously to decide whether to render the gas-estimate row, so
82
+ // we cache the async Feemaster lookup result on the instance. When
83
+ // the closure isn't supplied (legacy call sites + unit tests) we
84
+ // fall back to the pre-existing "credits is sponsored, everything
85
+ // else is user-paid" heuristic.
86
+ this.cachedIsGasSponsored = false;
80
87
  this.from = from;
81
88
  this.networkId = networkId;
82
89
  this.listOwnedRecords = listOwnedRecords;
83
90
  this.joinAllRecordsForToken = joinAllRecordsForToken;
84
91
  this.onSubmitFn = onSubmit;
92
+ this.isFeemasterSponsoredFn = isFeemasterSponsored;
85
93
  this.selectedToken = (_a = this.tokensForNetwork()[0]) !== null && _a !== void 0 ? _a : this.creditsFallback();
86
94
  }
87
95
  setTransactionMode(modeId) {
@@ -218,20 +226,62 @@ class AleoUiTransaction {
218
226
  });
219
227
  }
220
228
  /**
221
- * Feemaster sponsors `credits.aleo/transfer_public` and `transfer_private`
222
- * per ANF's policy, so the user pays zero on credits sends. Stablecoin
223
- * + ARC-21 sends today fall through to user-paid (Feemaster policy
224
- * doesn't yet cover them on testnet); the iframe still completes the
225
- * transfer, just deducts the credits-fee directly. The optimistic `0n`
226
- * here matches what we tell the user via `isGasSponsored()` below.
229
+ * Asks Feemaster (via the connector closure) whether the currently
230
+ * selected `(token, transactionMode)` is on its sponsorship policy and
231
+ * caches the answer on the instance so the synchronous
232
+ * `isGasSponsored()` getter can return the right boolean. We hold
233
+ * `fee.gas` at `0n` regardless: when Feemaster covers the call the
234
+ * user really does pay zero; when it doesn't, the iframe deducts a
235
+ * small credits-fee on the user's behalf and the prover-reported
236
+ * exact amount isn't known until after broadcast — the confirmation
237
+ * card then hides the row entirely (sponsored) or shows `--` until
238
+ * the receipt lands (user-paid). The async `fetchFee` is awaited by
239
+ * `TransactionConfirmationView` before the gas row renders so the
240
+ * cached flag is always populated by the time the row decides to
241
+ * mount.
227
242
  */
228
243
  fetchFee() {
229
244
  return __awaiter(this, void 0, void 0, function* () {
230
245
  this.fee.gas = BigInt(0);
246
+ if (!this.isFeemasterSponsoredFn) {
247
+ // Pre-existing heuristic for tests / legacy call sites that
248
+ // construct `AleoUiTransaction` without the connector closure:
249
+ // treat credits as sponsored, every other token as user-paid.
250
+ this.cachedIsGasSponsored = this.selectedToken.programKind === 'credits';
251
+ return;
252
+ }
253
+ // Match the function name we'd actually submit:
254
+ // - Individual mode → `<program>/transfer_private`
255
+ // - Exchange mode → `<program>/transfer_private_to_public`
256
+ // (the heavier step-1 leg; step-2's
257
+ // `transfer_public` is cheap by comparison and
258
+ // currently shares the same policy bucket).
259
+ // - No mode picked yet → fall back to `transfer_private` so the
260
+ // confirmation card optimistically hides
261
+ // the row before the user picks; if the
262
+ // eventual selection isn't sponsored we'll
263
+ // re-render once the user advances.
264
+ const functionName = this.selectedTransactionMode === 'exchange'
265
+ ? 'transfer_private_to_public'
266
+ : 'transfer_private';
267
+ try {
268
+ this.cachedIsGasSponsored = yield this.isFeemasterSponsoredFn({
269
+ functionName,
270
+ programId: this.selectedToken.programId,
271
+ });
272
+ }
273
+ catch (_a) {
274
+ // Never throw from `fetchFee` — the widget would surface a
275
+ // confirmation-card error and the user couldn't proceed. A
276
+ // Feemaster outage just means we render the (zero) fee row
277
+ // conservatively, which the user will read as "no estimate
278
+ // yet". The submit path will still attempt the broadcast.
279
+ this.cachedIsGasSponsored = false;
280
+ }
231
281
  });
232
282
  }
233
283
  isGasSponsored() {
234
- return this.selectedToken.programKind === 'credits';
284
+ return this.cachedIsGasSponsored;
235
285
  }
236
286
  /**
237
287
  * Tells the SendBalanceView to populate the picker / "Available"
@@ -344,7 +394,7 @@ class AleoUiTransaction {
344
394
  return {
345
395
  contractAddress: ALEO_CREDITS_PROGRAM,
346
396
  decimals: ALEO_CREDITS_DECIMALS,
347
- logoURI: '',
397
+ logoURI: ALEO_NATIVE_LOGO_URI,
348
398
  name: 'Aleo Credits',
349
399
  programId: ALEO_CREDITS_PROGRAM,
350
400
  programKind: 'credits',
@@ -38,10 +38,33 @@ const ALEO_TESTNET_NETWORK_ID = 1;
38
38
  const ALEO_CREDITS_DECIMALS = 6;
39
39
  const ALEO_CREDITS_PROGRAM = 'credits.aleo';
40
40
  const ALEO_TOKEN_REGISTRY_PROGRAM = 'token_registry.aleo';
41
+ // Brand-asset CDN URLs. Mirrors the URLs the multichain (unshielded) and
42
+ // curated-prices (shielded) feeds emit from redcoast — see
43
+ // `apps/dashboard-api/src/services/aleoPrices/aleoCuratedTokens.ts`.
44
+ // Hard-coded here (rather than threaded through a network call) so the
45
+ // Send picker has the right glyphs the moment the form renders;
46
+ // otherwise the row icons flash empty while redcoast's price lookup
47
+ // resolves.
48
+ const ALEO_NATIVE_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/aleo.svg';
49
+ const USAD_LOGO_URI = 'https://app.dynamic.xyz/assets/tokens/usad.svg';
50
+ const USDCX_LOGO_URI = 'https://app.dynamic.xyz/assets/tokens/usdcx.svg';
51
+ const WSOL_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/solana.svg';
52
+ const WETH_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/eth.svg';
53
+ const WBTC_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/bitcoin.svg';
54
+ // Tether's canonical brand glyph isn't currently mirrored under
55
+ // `app.dynamic.xyz/assets/...`; reuse the CoinGecko CDN URL that
56
+ // redcoast's `aleoCuratedTokens` registry uses for wUSDT, so the Send
57
+ // picker shows the same teal ₮ as the Shielded tab.
58
+ const USDT_LOGO_URI = 'https://coin-images.coingecko.com/coins/images/325/large/Tether.png';
59
+ // Matches the redcoast curated registry's mapping for `hyp_warp_token_usdc.aleo`,
60
+ // which currently re-uses the USDCx glyph (intentional grouping in that
61
+ // registry). Kept aligned so the Send picker and the Shielded tab show
62
+ // the same icon for the wrapped-USDC route.
63
+ const USDC_LOGO_URI = USDCX_LOGO_URI;
41
64
  const ALEO_CREDITS_TOKEN = {
42
65
  contractAddress: ALEO_CREDITS_PROGRAM,
43
66
  decimals: ALEO_CREDITS_DECIMALS,
44
- logoURI: '',
67
+ logoURI: ALEO_NATIVE_LOGO_URI,
45
68
  name: 'Aleo Credits',
46
69
  programId: ALEO_CREDITS_PROGRAM,
47
70
  programKind: 'credits',
@@ -50,9 +73,10 @@ const ALEO_CREDITS_TOKEN = {
50
73
  symbol: 'ALEO',
51
74
  };
52
75
  const ALEO_STABLECOIN_DECIMALS = 6;
53
- const buildStablecoin = (programId, symbol, name) => ({
76
+ const buildStablecoin = (programId, symbol, name, logoURI) => ({
54
77
  contractAddress: programId,
55
78
  decimals: ALEO_STABLECOIN_DECIMALS,
79
+ logoURI,
56
80
  name,
57
81
  programId,
58
82
  programKind: 'stablecoin',
@@ -64,6 +88,7 @@ const buildArc21 = (args) => ({
64
88
  contractAddress: args.warpProgram,
65
89
  decimals: args.decimals,
66
90
  externalAuthRequired: false,
91
+ logoURI: args.logoURI,
67
92
  name: args.name,
68
93
  programId: ALEO_TOKEN_REGISTRY_PROGRAM,
69
94
  programKind: 'arc21',
@@ -75,10 +100,11 @@ const buildArc21 = (args) => ({
75
100
  const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
76
101
  [ALEO_MAINNET_NETWORK_ID]: [
77
102
  ALEO_CREDITS_TOKEN,
78
- buildStablecoin('usad_stablecoin.aleo', 'USAD', 'USAD'),
79
- buildStablecoin('usdcx_stablecoin.aleo', 'USDCx', 'USDCx'),
103
+ buildStablecoin('usad_stablecoin.aleo', 'USAD', 'USAD', USAD_LOGO_URI),
104
+ buildStablecoin('usdcx_stablecoin.aleo', 'USDCx', 'USDCx', USDCX_LOGO_URI),
80
105
  buildArc21({
81
106
  decimals: 9,
107
+ logoURI: WSOL_LOGO_URI,
82
108
  name: 'Wrapped SOL',
83
109
  symbol: 'wSOL',
84
110
  tokenId: '2045969100091121326225168054634646230244820821909676777152465722877810201564field',
@@ -86,6 +112,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
86
112
  }),
87
113
  buildArc21({
88
114
  decimals: 18,
115
+ logoURI: WETH_LOGO_URI,
89
116
  name: 'Wrapped ETH',
90
117
  symbol: 'wETH',
91
118
  tokenId: '8189585964265444162798552221009403350643900573290534096996249214099143169251field',
@@ -93,6 +120,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
93
120
  }),
94
121
  buildArc21({
95
122
  decimals: 8,
123
+ logoURI: WBTC_LOGO_URI,
96
124
  name: 'Wrapped BTC',
97
125
  symbol: 'wBTC',
98
126
  tokenId: '3491859903473482085250871387962132231204352466326026409883548131580582527809field',
@@ -100,6 +128,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
100
128
  }),
101
129
  buildArc21({
102
130
  decimals: 6,
131
+ logoURI: USDT_LOGO_URI,
103
132
  name: 'Tether USD',
104
133
  symbol: 'USDT',
105
134
  tokenId: '7881654794448182580124231856035865816599796419758925654292946277940935117913field',
@@ -107,6 +136,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
107
136
  }),
108
137
  buildArc21({
109
138
  decimals: 6,
139
+ logoURI: USDC_LOGO_URI,
110
140
  name: 'USD Coin',
111
141
  symbol: 'USDC',
112
142
  tokenId: '4697275201844475848710842677807162058146139844643350200269139278887318953049field',
@@ -115,8 +145,8 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
115
145
  ],
116
146
  [ALEO_TESTNET_NETWORK_ID]: [
117
147
  ALEO_CREDITS_TOKEN,
118
- buildStablecoin('test_usad_stablecoin.aleo', 'USAD', 'USAD'),
119
- buildStablecoin('test_usdcx_stablecoin.aleo', 'USDCx', 'USDCx'),
148
+ buildStablecoin('test_usad_stablecoin.aleo', 'USAD', 'USAD', USAD_LOGO_URI),
149
+ buildStablecoin('test_usdcx_stablecoin.aleo', 'USDCx', 'USDCx', USDCX_LOGO_URI),
120
150
  ],
121
151
  };
122
152
  const getAleoSendableTokensForNetwork = (networkId) => { var _a; return (_a = ALEO_SENDABLE_TOKENS_BY_NETWORK[networkId]) !== null && _a !== void 0 ? _a : []; };
@@ -178,6 +208,7 @@ const extractRecordAtomicAmount = (record, token) => {
178
208
 
179
209
  exports.ALEO_CREDITS_DECIMALS = ALEO_CREDITS_DECIMALS;
180
210
  exports.ALEO_CREDITS_PROGRAM = ALEO_CREDITS_PROGRAM;
211
+ exports.ALEO_NATIVE_LOGO_URI = ALEO_NATIVE_LOGO_URI;
181
212
  exports.ALEO_SENDABLE_TOKENS_BY_NETWORK = ALEO_SENDABLE_TOKENS_BY_NETWORK;
182
213
  exports.ALEO_TOKEN_REGISTRY_PROGRAM = ALEO_TOKEN_REGISTRY_PROGRAM;
183
214
  exports.extractRecordAtomicAmount = extractRecordAtomicAmount;
@@ -31,6 +31,7 @@
31
31
  export declare const ALEO_CREDITS_DECIMALS = 6;
32
32
  export declare const ALEO_CREDITS_PROGRAM = "credits.aleo";
33
33
  export declare const ALEO_TOKEN_REGISTRY_PROGRAM = "token_registry.aleo";
34
+ export declare const ALEO_NATIVE_LOGO_URI = "https://app.dynamic.xyz/assets/networks/aleo.svg";
34
35
  export type AleoProgramKind = 'arc21' | 'credits' | 'stablecoin';
35
36
  export type AleoSendableToken = {
36
37
  contractAddress: string;
@@ -34,10 +34,33 @@ const ALEO_TESTNET_NETWORK_ID = 1;
34
34
  const ALEO_CREDITS_DECIMALS = 6;
35
35
  const ALEO_CREDITS_PROGRAM = 'credits.aleo';
36
36
  const ALEO_TOKEN_REGISTRY_PROGRAM = 'token_registry.aleo';
37
+ // Brand-asset CDN URLs. Mirrors the URLs the multichain (unshielded) and
38
+ // curated-prices (shielded) feeds emit from redcoast — see
39
+ // `apps/dashboard-api/src/services/aleoPrices/aleoCuratedTokens.ts`.
40
+ // Hard-coded here (rather than threaded through a network call) so the
41
+ // Send picker has the right glyphs the moment the form renders;
42
+ // otherwise the row icons flash empty while redcoast's price lookup
43
+ // resolves.
44
+ const ALEO_NATIVE_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/aleo.svg';
45
+ const USAD_LOGO_URI = 'https://app.dynamic.xyz/assets/tokens/usad.svg';
46
+ const USDCX_LOGO_URI = 'https://app.dynamic.xyz/assets/tokens/usdcx.svg';
47
+ const WSOL_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/solana.svg';
48
+ const WETH_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/eth.svg';
49
+ const WBTC_LOGO_URI = 'https://app.dynamic.xyz/assets/networks/bitcoin.svg';
50
+ // Tether's canonical brand glyph isn't currently mirrored under
51
+ // `app.dynamic.xyz/assets/...`; reuse the CoinGecko CDN URL that
52
+ // redcoast's `aleoCuratedTokens` registry uses for wUSDT, so the Send
53
+ // picker shows the same teal ₮ as the Shielded tab.
54
+ const USDT_LOGO_URI = 'https://coin-images.coingecko.com/coins/images/325/large/Tether.png';
55
+ // Matches the redcoast curated registry's mapping for `hyp_warp_token_usdc.aleo`,
56
+ // which currently re-uses the USDCx glyph (intentional grouping in that
57
+ // registry). Kept aligned so the Send picker and the Shielded tab show
58
+ // the same icon for the wrapped-USDC route.
59
+ const USDC_LOGO_URI = USDCX_LOGO_URI;
37
60
  const ALEO_CREDITS_TOKEN = {
38
61
  contractAddress: ALEO_CREDITS_PROGRAM,
39
62
  decimals: ALEO_CREDITS_DECIMALS,
40
- logoURI: '',
63
+ logoURI: ALEO_NATIVE_LOGO_URI,
41
64
  name: 'Aleo Credits',
42
65
  programId: ALEO_CREDITS_PROGRAM,
43
66
  programKind: 'credits',
@@ -46,9 +69,10 @@ const ALEO_CREDITS_TOKEN = {
46
69
  symbol: 'ALEO',
47
70
  };
48
71
  const ALEO_STABLECOIN_DECIMALS = 6;
49
- const buildStablecoin = (programId, symbol, name) => ({
72
+ const buildStablecoin = (programId, symbol, name, logoURI) => ({
50
73
  contractAddress: programId,
51
74
  decimals: ALEO_STABLECOIN_DECIMALS,
75
+ logoURI,
52
76
  name,
53
77
  programId,
54
78
  programKind: 'stablecoin',
@@ -60,6 +84,7 @@ const buildArc21 = (args) => ({
60
84
  contractAddress: args.warpProgram,
61
85
  decimals: args.decimals,
62
86
  externalAuthRequired: false,
87
+ logoURI: args.logoURI,
63
88
  name: args.name,
64
89
  programId: ALEO_TOKEN_REGISTRY_PROGRAM,
65
90
  programKind: 'arc21',
@@ -71,10 +96,11 @@ const buildArc21 = (args) => ({
71
96
  const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
72
97
  [ALEO_MAINNET_NETWORK_ID]: [
73
98
  ALEO_CREDITS_TOKEN,
74
- buildStablecoin('usad_stablecoin.aleo', 'USAD', 'USAD'),
75
- buildStablecoin('usdcx_stablecoin.aleo', 'USDCx', 'USDCx'),
99
+ buildStablecoin('usad_stablecoin.aleo', 'USAD', 'USAD', USAD_LOGO_URI),
100
+ buildStablecoin('usdcx_stablecoin.aleo', 'USDCx', 'USDCx', USDCX_LOGO_URI),
76
101
  buildArc21({
77
102
  decimals: 9,
103
+ logoURI: WSOL_LOGO_URI,
78
104
  name: 'Wrapped SOL',
79
105
  symbol: 'wSOL',
80
106
  tokenId: '2045969100091121326225168054634646230244820821909676777152465722877810201564field',
@@ -82,6 +108,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
82
108
  }),
83
109
  buildArc21({
84
110
  decimals: 18,
111
+ logoURI: WETH_LOGO_URI,
85
112
  name: 'Wrapped ETH',
86
113
  symbol: 'wETH',
87
114
  tokenId: '8189585964265444162798552221009403350643900573290534096996249214099143169251field',
@@ -89,6 +116,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
89
116
  }),
90
117
  buildArc21({
91
118
  decimals: 8,
119
+ logoURI: WBTC_LOGO_URI,
92
120
  name: 'Wrapped BTC',
93
121
  symbol: 'wBTC',
94
122
  tokenId: '3491859903473482085250871387962132231204352466326026409883548131580582527809field',
@@ -96,6 +124,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
96
124
  }),
97
125
  buildArc21({
98
126
  decimals: 6,
127
+ logoURI: USDT_LOGO_URI,
99
128
  name: 'Tether USD',
100
129
  symbol: 'USDT',
101
130
  tokenId: '7881654794448182580124231856035865816599796419758925654292946277940935117913field',
@@ -103,6 +132,7 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
103
132
  }),
104
133
  buildArc21({
105
134
  decimals: 6,
135
+ logoURI: USDC_LOGO_URI,
106
136
  name: 'USD Coin',
107
137
  symbol: 'USDC',
108
138
  tokenId: '4697275201844475848710842677807162058146139844643350200269139278887318953049field',
@@ -111,8 +141,8 @@ const ALEO_SENDABLE_TOKENS_BY_NETWORK = {
111
141
  ],
112
142
  [ALEO_TESTNET_NETWORK_ID]: [
113
143
  ALEO_CREDITS_TOKEN,
114
- buildStablecoin('test_usad_stablecoin.aleo', 'USAD', 'USAD'),
115
- buildStablecoin('test_usdcx_stablecoin.aleo', 'USDCx', 'USDCx'),
144
+ buildStablecoin('test_usad_stablecoin.aleo', 'USAD', 'USAD', USAD_LOGO_URI),
145
+ buildStablecoin('test_usdcx_stablecoin.aleo', 'USDCx', 'USDCx', USDCX_LOGO_URI),
116
146
  ],
117
147
  };
118
148
  const getAleoSendableTokensForNetwork = (networkId) => { var _a; return (_a = ALEO_SENDABLE_TOKENS_BY_NETWORK[networkId]) !== null && _a !== void 0 ? _a : []; };
@@ -172,4 +202,4 @@ const extractRecordAtomicAmount = (record, token) => {
172
202
  }
173
203
  };
174
204
 
175
- export { ALEO_CREDITS_DECIMALS, ALEO_CREDITS_PROGRAM, ALEO_SENDABLE_TOKENS_BY_NETWORK, ALEO_TOKEN_REGISTRY_PROGRAM, extractRecordAtomicAmount, getAleoSendableTokensForNetwork, recordMatchesSendableToken };
205
+ export { ALEO_CREDITS_DECIMALS, ALEO_CREDITS_PROGRAM, ALEO_NATIVE_LOGO_URI, ALEO_SENDABLE_TOKENS_BY_NETWORK, ALEO_TOKEN_REGISTRY_PROGRAM, extractRecordAtomicAmount, getAleoSendableTokensForNetwork, recordMatchesSendableToken };
@@ -1,2 +1,2 @@
1
- export { ALEO_CREDITS_DECIMALS, ALEO_CREDITS_PROGRAM, ALEO_SENDABLE_TOKENS_BY_NETWORK, ALEO_TOKEN_REGISTRY_PROGRAM, extractRecordAtomicAmount, getAleoSendableTokensForNetwork, recordMatchesSendableToken, } from './aleoSendableTokens';
1
+ export { ALEO_CREDITS_DECIMALS, ALEO_CREDITS_PROGRAM, ALEO_NATIVE_LOGO_URI, ALEO_SENDABLE_TOKENS_BY_NETWORK, ALEO_TOKEN_REGISTRY_PROGRAM, extractRecordAtomicAmount, getAleoSendableTokensForNetwork, recordMatchesSendableToken, } from './aleoSendableTokens';
2
2
  export type { AleoOwnedRecord, AleoProgramKind, AleoSendableToken, } from './aleoSendableTokens';