Skip to content

Comments

fix(sdk): use string keys instead of object keys in JavaScript Maps#3145

Open
shumkov wants to merge 3 commits intov3.1-devfrom
fix/sdk/map-keys
Open

fix(sdk): use string keys instead of object keys in JavaScript Maps#3145
shumkov wants to merge 3 commits intov3.1-devfrom
fix/sdk/map-keys

Conversation

@shumkov
Copy link
Collaborator

@shumkov shumkov commented Feb 22, 2026

Issue being fixed or feature implemented

JavaScript Map uses reference equality for object keys. When Rust WASM bindings create Maps with IdentifierWasm or PlatformAddressWasm objects
as keys, the resulting JS Maps are unusable — map.get(new Identifier(sameBytes)) returns undefined because it's a different object instance.

What was done?

Converted all WASM Map keys from object instances to string primitives across wasm-sdk and wasm-dpp2:

  • Identifier keys.to_base58() string (35 locations across 10 Rust files)
  • PlatformAddress keys.to_hex() string (address.rs, addresses.rs)
  • ProTxHash keys in epoch.rs.to_hex() to match ProTxHashWasm hex convention
  • Updated all unchecked_return_type annotations from Map<Identifier, ...> / Map<PlatformAddress, ...> to Map<string, ...>
  • Updated test files to use string keys and removed redundant Identifier object creation

Rust files: token.rs (10 fixes), group.rs (7), identity.rs (4), epoch.rs (4), address.rs (2), document.rs (2), data_contract.rs
(2), votes.rs (1), addresses.rs (1), proof_result.rs (2)

How Has This Been Tested?

  • cargo check -p wasm-sdk and cargo check -p wasm-dpp2 — compile clean
  • Updated unit tests in wasm-dpp2: Group.spec.ts, ProofResult.spec.ts, TokenConfiguration.spec.ts, TokenDistributionRules.spec.ts,
    TokenPreProgrammedDistribution.spec.ts, js-value-to-json.spec.ts
  • Updated functional test in wasm-sdk: epochs-blocks.spec.ts, identities.spec.ts

Breaking Changes

Map keys returned by all wasm-sdk query methods and wasm-dpp2 proof result methods change from Identifier/PlatformAddress objects to
string. Consumers that previously called .toBase58() or .toHex() on map keys should use the key directly. Consumers that compared keys by
reference were already broken.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • API Changes

    • Many SDK query results now return JS Maps keyed by strings (base58 or hex) instead of identifier objects, across addresses, documents, data contracts, identities, tokens, epochs, groups, and voting.
    • Map values and behavior unchanged; key representations simplified for JS interoperability.
  • Tests

    • Unit and functional tests updated to use string-encoded keys (base58/hex) to match the new Map key types.

JavaScript Map uses reference equality for object keys, making lookups
fail when a new object is constructed from the same bytes. Convert all
IdentifierWasm keys to base58 strings and PlatformAddressWasm keys to
hex strings. ProTxHash-based keys use hex to match ProTxHash conventions.
Update unchecked_return_type annotations from Map<Identifier, ...> to
Map<string, ...> accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added this to the v3.1.0 milestone Feb 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

Map keys exposed at the WASM/JS boundary were converted from Identifier/PlatformAddress objects to string representations (base58 or hex) across wasm-dpp2, wasm-sdk queries, state transitions, and corresponding tests.

Changes

Cohort / File(s) Summary
WASM-DPP2 Implementation
packages/wasm-dpp2/src/state_transitions/proof_result.rs
Switched map key construction for VerifiedTokenIdentitiesBalances and VerifiedDocuments to use base58 string keys (to_base58()) instead of Identifier JsValues.
WASM-DPP2 Core
packages/wasm-dpp2/src/core/pro_tx_hash.rs
Added From<dpp::platform_value::Identifier> for ProTxHashWasm conversion to support hex string key construction.
WASM-DPP2 Tests
packages/wasm-dpp2/tests/unit/Group.spec.ts, ProofResult.spec.ts, TokenConfiguration.spec.ts, TokenDistributionRules.spec.ts, TokenPreProgrammedDistribution.spec.ts, js-value-to-json.spec.ts
Test map constructions updated to use identifier base58 strings as keys and adjust types from Map<Identifier, ...> to Map<string, ...> where applicable.
WASM-SDK Queries — Addresses & State Transitions
packages/wasm-sdk/src/queries/address.rs, packages/wasm-sdk/src/state_transitions/addresses.rs
Changed unchecked_return_type annotations to Map<string, ...> and built keys using PlatformAddressWasm::to_hex() (hex strings) instead of PlatformAddress JsValues.
WASM-SDK Queries — Documents & Data Contracts
packages/wasm-sdk/src/queries/document.rs, packages/wasm-sdk/src/queries/data_contract.rs
Updated wasm_bindgen unchecked_return_type to Map<string, ...> and switched key construction to IdentifierWasm::to_base58() string keys.
WASM-SDK Queries — Epochs & ProTxHash keys
packages/wasm-sdk/src/queries/epoch.rs
Return types for epoch-related maps changed to Map<string, bigint>; keys now created via ProTxHashWasm::to_hex() (hex strings) instead of Identifier JsValues.
WASM-SDK Queries — Group & Identity
packages/wasm-sdk/src/queries/group.rs, packages/wasm-sdk/src/queries/identity.rs
Multiple group and identity query return types switched to Map<string, ...>; internal key construction now uses IdentifierWasm::to_base58() for JS Map keys.
WASM-SDK Queries — Token & Voting
packages/wasm-sdk/src/queries/token.rs, packages/wasm-sdk/src/queries/voting/votes.rs
Token and voting query return types updated to Map<string, ...>; keys use base58 strings. Added internal helper prefetch_token_configuration(token_id) (pub(crate) async).
WASM-SDK Tests — Functional
packages/wasm-sdk/tests/functional/epochs-blocks.spec.ts, packages/wasm-sdk/tests/functional/identities.spec.ts
Test expectations/comments updated to reflect string (hex/base58) map keys; removed prior object-to-hex conversion where redundant.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through Maps and changed each key,

From objects to strings — base58 and hex for tea.
No more heavy wrappers, just light little threads,
Maps now hum softly as my rabbit feet tread. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title concisely and accurately summarizes the primary change: converting JavaScript Map keys from object instances to string primitives in WASM bindings across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sdk/map-keys

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/wasm-sdk/src/state_transitions/addresses.rs (1)

33-56: ⚠️ Potential issue | 🟡 Minor

Stale doc comment: still references Map<PlatformAddress, PlatformAddressInfo>.

Line 35 says "to Map<PlatformAddress, PlatformAddressInfo>" but the function now produces Map<string, PlatformAddressInfo> with hex string keys.

Proposed fix
-/// This helper handles the common pattern of converting IndexMap<PlatformAddress, Option<AddressInfo>>
-/// to Map<PlatformAddress, PlatformAddressInfo> for WASM bindings.
+/// This helper handles the common pattern of converting IndexMap<PlatformAddress, Option<AddressInfo>>
+/// to Map<string, PlatformAddressInfo> for WASM bindings, using hex string keys.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-sdk/src/state_transitions/addresses.rs` around lines 33 - 56,
Update the stale doc comment on function address_infos_to_js_map to state that
it converts IndexMap<PlatformAddress, Option<AddressInfo>> into a JavaScript
Map<string, PlatformAddressInfo> where keys are hex strings (produced by
PlatformAddressWasm::from(...).to_hex()) and values are PlatformAddressInfo
(PlatformAddressInfoWasm), instead of claiming Map<PlatformAddress,
PlatformAddressInfo>; be concise and mention that keys are hex string
representations of PlatformAddress.
packages/wasm-dpp2/src/state_transitions/proof_result.rs (1)

249-249: ⚠️ Potential issue | 🟡 Minor

Stale type comments not updated to reflect string keys

Both field comments still reference IdentifierWasm keys, but after lines 789 and 811 the runtime keys are string (base58). The comment at line 509 (Map<string(hex), ...>) shows the correct pattern.

📝 Proposed fix
 pub struct VerifiedTokenIdentitiesBalancesWasm {
-    balances: Map, // Map<IdentifierWasm, BigInt>
+    balances: Map, // Map<string, BigInt>
 }
 pub struct VerifiedDocumentsWasm {
-    documents: Map, // Map<IdentifierWasm, DocumentWasm | undefined>
+    documents: Map, // Map<string, DocumentWasm | undefined>
 }

Also applies to: 322-322

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-dpp2/src/state_transitions/proof_result.rs` at line 249, Update
the stale field comments in proof_result.rs to reflect that runtime map keys are
strings (base58) rather than IdentifierWasm: change the comment for the balances
field (Map, previously annotated as Map<IdentifierWasm, BigInt>) to indicate
Map<string(base58), BigInt> and make the same update for the other affected
field referenced around the 322 comment; locate the fields by name (e.g.,
balances) in the ProofResult struct and replace IdentifierWasm in comments with
the correct string(base58) key notation to match the runtime behavior shown
elsewhere (e.g., the Map<string(hex), ...> comment).
🧹 Nitpick comments (3)
packages/wasm-sdk/tests/functional/identities.spec.ts (1)

172-179: Add an assertion on the Map key to actually exercise the PR's fix.

The updated comment correctly documents that keys are now string (base58), but the test body never touches the keys — it only reads balances.values(). A regression where keys revert to Identifier objects would silently pass this test.

Since TEST_IDENTITY is already a base58 string, the cleanest fix is to look up via balances.get(TEST_IDENTITY) directly:

✅ Proposed assertion improvement
-      // getIdentitiesBalances returns Map<string, bigint | null> where keys are base58-encoded identifiers
       const balances = await client.getIdentitiesBalances([TEST_IDENTITY]);
       expect(balances).to.be.instanceOf(Map);
       expect(balances.size).to.equal(1);
+      // Keys must be base58 strings — string lookup must succeed (core fix in this PR)
+      expect(Array.from(balances.keys())[0]).to.be.a('string');
+      expect(Array.from(balances.keys())[0]).to.equal(TEST_IDENTITY);
+      // Retrieve by string key directly
+      const balance = balances.get(TEST_IDENTITY);
-      // For existing identity, balance should be present
-      const balance = Array.from(balances.values())[0];
       expect(typeof balance).to.equal('bigint');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-sdk/tests/functional/identities.spec.ts` around lines 172 -
179, The test currently only inspects values and misses verifying that Map keys
are base58 strings; update the assertions around balances (returned by
client.getIdentitiesBalances) to directly assert the Map contains the key
TEST_IDENTITY (e.g., use balances.get(TEST_IDENTITY) or
balances.has(TEST_IDENTITY)) and then assert the retrieved value is a bigint;
ensure you still check balances is a Map and its size is 1 but replace the
Array.from(balances.values())[0] lookup with a direct lookup using TEST_IDENTITY
so the test fails if keys are not the expected base58 string.
packages/wasm-sdk/src/queries/token.rs (1)

408-408: Minor: duplicated price schedule → (base_price, current_price) extraction logic.

The match schedule { SinglePrice(..) => ..., SetPrices(..) => ... } block appears identically in get_token_price_by_contract (Lines 204–222), get_token_direct_purchase_prices (Lines 429–446), and get_token_direct_purchase_prices_with_proof_info (Lines 767–784). Consider extracting a small helper to avoid this triplication.

Also applies to: 448-452

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-sdk/src/queries/token.rs` at line 408, Duplicate logic
extracting (base_price, current_price) from a PriceSchedule enum is repeated in
get_token_price_by_contract, get_token_direct_purchase_prices, and
get_token_direct_purchase_prices_with_proof_info; factor it into a small helper
like fn extract_prices(schedule: &PriceSchedule) -> (PriceType, PriceType) (use
the actual price numeric type in the crate) that matches on SinglePrice and
SetPrices and returns (base_price, current_price), then replace the repeated
match blocks in those functions with calls to extract_prices and update any
imports/visibility accordingly.
packages/wasm-dpp2/tests/unit/ProofResult.spec.ts (1)

370-395: Consider asserting value retrieval by string key

The test currently only checks size === 1 after the round-trip. Adding a get assertion would directly validate the core fix — that lookups by base58 string actually return the expected value from the map produced by the WASM binding.

✅ Suggested addition
       const result = wasm.VerifiedTokenIdentitiesBalances.fromObject(data);

       expect(result.balances).to.be.instanceOf(Map);
       expect(result.balances.size).to.equal(1);
+      expect(result.balances.get(id1.toBase58())).to.equal(999000n);
       const result = wasm.VerifiedDocuments.fromObject(data);

       expect(result.documents).to.be.instanceOf(Map);
       expect(result.documents.size).to.equal(1);
+      expect(result.documents.has(id1.toBase58())).to.equal(true);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-dpp2/tests/unit/ProofResult.spec.ts` around lines 370 - 395,
The test should assert that map lookups by the base58 key return the expected
value: after creating id1 (Identifier) and setting balancesMap with
id1.toBase58() -> 999000n, add assertions that
result.balances.get(id1.toBase58()) === 999000n and that after serializing with
result.toObject() and rehydrating via
wasm.VerifiedTokenIdentitiesBalances.fromObject(obj) the
roundtrip.balances.get(id1.toBase58()) === 999000n so you verify
fromObject/toObject preserves key lookup behavior for
VerifiedTokenIdentitiesBalances.balances.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/wasm-sdk/src/queries/epoch.rs`:
- Around line 521-525: The map that builds ProTxHash keys in the proof-info
variants uses IdentifierWasm::from(identifier).to_base58(), causing inconsistent
key formats versus the non-proof variants; update those occurrences (the closure
building the Map from counts.0.into_iter() in the proof-info methods such as
getEvonodesProposedEpochBlocksByIdsWithProofInfo and the other proof-info
helper) to use .to_hex() instead of .to_base58() so ProTxHash keys match the
ProTxHashWasm hex convention used elsewhere.

In `@packages/wasm-sdk/tests/functional/epochs-blocks.spec.ts`:
- Around line 103-107: The comment is incorrect: byRange keys are hex strings
(created via IdentifierWasm::from(identifier).to_hex()), not base58. Update the
comment near byRange.keys() to state the keys are hex, and when you pass that
key (testProTxHash) into getEvonodesProposedEpochBlocksByIdsWithProofInfo (which
expects base58 keys) convert the hex key to base58 first (e.g., decode the hex
Identifier and call its to_base58 / toBase58 equivalent) so the key formats
match between getEvonodesProposedEpochBlocksByRange and
getEvonodesProposedEpochBlocksByIdsWithProofInfo.

---

Outside diff comments:
In `@packages/wasm-dpp2/src/state_transitions/proof_result.rs`:
- Line 249: Update the stale field comments in proof_result.rs to reflect that
runtime map keys are strings (base58) rather than IdentifierWasm: change the
comment for the balances field (Map, previously annotated as Map<IdentifierWasm,
BigInt>) to indicate Map<string(base58), BigInt> and make the same update for
the other affected field referenced around the 322 comment; locate the fields by
name (e.g., balances) in the ProofResult struct and replace IdentifierWasm in
comments with the correct string(base58) key notation to match the runtime
behavior shown elsewhere (e.g., the Map<string(hex), ...> comment).

In `@packages/wasm-sdk/src/state_transitions/addresses.rs`:
- Around line 33-56: Update the stale doc comment on function
address_infos_to_js_map to state that it converts IndexMap<PlatformAddress,
Option<AddressInfo>> into a JavaScript Map<string, PlatformAddressInfo> where
keys are hex strings (produced by PlatformAddressWasm::from(...).to_hex()) and
values are PlatformAddressInfo (PlatformAddressInfoWasm), instead of claiming
Map<PlatformAddress, PlatformAddressInfo>; be concise and mention that keys are
hex string representations of PlatformAddress.

---

Nitpick comments:
In `@packages/wasm-dpp2/tests/unit/ProofResult.spec.ts`:
- Around line 370-395: The test should assert that map lookups by the base58 key
return the expected value: after creating id1 (Identifier) and setting
balancesMap with id1.toBase58() -> 999000n, add assertions that
result.balances.get(id1.toBase58()) === 999000n and that after serializing with
result.toObject() and rehydrating via
wasm.VerifiedTokenIdentitiesBalances.fromObject(obj) the
roundtrip.balances.get(id1.toBase58()) === 999000n so you verify
fromObject/toObject preserves key lookup behavior for
VerifiedTokenIdentitiesBalances.balances.

In `@packages/wasm-sdk/src/queries/token.rs`:
- Line 408: Duplicate logic extracting (base_price, current_price) from a
PriceSchedule enum is repeated in get_token_price_by_contract,
get_token_direct_purchase_prices, and
get_token_direct_purchase_prices_with_proof_info; factor it into a small helper
like fn extract_prices(schedule: &PriceSchedule) -> (PriceType, PriceType) (use
the actual price numeric type in the crate) that matches on SinglePrice and
SetPrices and returns (base_price, current_price), then replace the repeated
match blocks in those functions with calls to extract_prices and update any
imports/visibility accordingly.

In `@packages/wasm-sdk/tests/functional/identities.spec.ts`:
- Around line 172-179: The test currently only inspects values and misses
verifying that Map keys are base58 strings; update the assertions around
balances (returned by client.getIdentitiesBalances) to directly assert the Map
contains the key TEST_IDENTITY (e.g., use balances.get(TEST_IDENTITY) or
balances.has(TEST_IDENTITY)) and then assert the retrieved value is a bigint;
ensure you still check balances is a Map and its size is 1 but replace the
Array.from(balances.values())[0] lookup with a direct lookup using TEST_IDENTITY
so the test fails if keys are not the expected base58 string.

- Use ProTxHashWasm for ProTxHash map keys in epoch.rs instead of
  IdentifierWasm, with hex encoding matching ProTxHash conventions
- Add From<Identifier> for ProTxHashWasm conversion
- Fix stale doc comments in addresses.rs, proof_result.rs, and
  epochs-blocks.spec.ts to reflect string key types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/wasm-sdk/src/state_transitions/addresses.rs (1)

219-222: addressInfos getters on result structs are missing unchecked_return_type after the key-type change.

The PR updates unchecked_return_type for the three methods that return a Map directly (addressFundsTransfer, addressFundsWithdraw, addressFundingFromAssetLock), but the addressInfos getters on IdentityTopUpFromAddressesResultWasm (line 219), IdentityTransferToAddressesResultWasm (line 564), and IdentityCreateFromAddressesResultWasm (line 808) all call the same address_infos_to_js_map helper and now serve Map<string, PlatformAddressInfo> without advertising that to TypeScript consumers.

♻️ Proposed additions for all three getters
-    #[wasm_bindgen(getter = "addressInfos")]
+    #[wasm_bindgen(getter = "addressInfos", unchecked_return_type = "Map<string, PlatformAddressInfo>")]
     pub fn address_infos(&self) -> Map {

Apply identically at lines 219, 564, and 808.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-sdk/src/state_transitions/addresses.rs` around lines 219 - 222,
The addressInfos getters on IdentityTopUpFromAddressesResultWasm,
IdentityTransferToAddressesResultWasm, and IdentityCreateFromAddressesResultWasm
call address_infos_to_js_map and now return a Map<string, PlatformAddressInfo>
but lack the unchecked_return_type annotation; update each getter's attribute to
#[wasm_bindgen(getter = "addressInfos", unchecked_return_type)] so the
TypeScript signature reflects the actual keyed value type (apply the change to
the address_infos method on each of those three structs).
packages/wasm-dpp2/src/core/pro_tx_hash.rs (1)

160-164: Consider adding a doc comment clarifying the semantic constraint.

This From<Identifier> impl silently reinterprets any 32-byte Identifier as a ProTxHash. It is semantically valid only when the Identifier wraps actual ProTxHash bytes (e.g., evonode IDs from ProposerBlockCountById). Without a comment, future callers may invoke this conversion for non-ProTxHash identifiers and get a well-typed but semantically wrong value.

🔧 Suggested clarifying doc comment
+/// Reinterprets the raw 32-byte buffer of an `Identifier` as a `ProTxHash`.
+///
+/// # Safety / Correctness
+/// This conversion is only semantically meaningful when the `Identifier` actually
+/// represents an evonode ProTxHash (e.g., keys from `ProposerBlockCountById`).
+/// Using it for arbitrary identifiers (document IDs, contract IDs, etc.) will
+/// produce a structurally valid but meaningless `ProTxHashWasm`.
 impl From<dpp::platform_value::Identifier> for ProTxHashWasm {
     fn from(id: dpp::platform_value::Identifier) -> Self {
         ProTxHashWasm(ProTxHash::from_byte_array(id.to_buffer()))
     }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wasm-dpp2/src/core/pro_tx_hash.rs` around lines 160 - 164, Add a doc
comment on the impl From<dpp::platform_value::Identifier> for ProTxHashWasm
explaining that the conversion simply reinterprets the 32-byte Identifier bytes
via ProTxHash::from_byte_array and is only semantically valid when the
Identifier actually contains ProTxHash bytes (e.g., evonode IDs from
ProposerBlockCountById); indicate that using this conversion on other Identifier
values produces a well-typed but semantically incorrect ProTxHash and callers
should validate the identifier source before converting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/wasm-dpp2/src/core/pro_tx_hash.rs`:
- Around line 160-164: Add a doc comment on the impl
From<dpp::platform_value::Identifier> for ProTxHashWasm explaining that the
conversion simply reinterprets the 32-byte Identifier bytes via
ProTxHash::from_byte_array and is only semantically valid when the Identifier
actually contains ProTxHash bytes (e.g., evonode IDs from
ProposerBlockCountById); indicate that using this conversion on other Identifier
values produces a well-typed but semantically incorrect ProTxHash and callers
should validate the identifier source before converting.

In `@packages/wasm-sdk/src/state_transitions/addresses.rs`:
- Around line 219-222: The addressInfos getters on
IdentityTopUpFromAddressesResultWasm, IdentityTransferToAddressesResultWasm, and
IdentityCreateFromAddressesResultWasm call address_infos_to_js_map and now
return a Map<string, PlatformAddressInfo> but lack the unchecked_return_type
annotation; update each getter's attribute to #[wasm_bindgen(getter =
"addressInfos", unchecked_return_type)] so the TypeScript signature reflects the
actual keyed value type (apply the change to the address_infos method on each of
those three structs).

@shumkov shumkov changed the title fix(wasm): use string keys instead of object keys in JavaScript Maps fix(sdk): use string keys instead of object keys in JavaScript Maps Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant