Repository navigation
feat(stellar): replace public Stellar name-resolution stubs with core resolver - #261
carelessdept wants to merge 1 commit into
Conversation
|
@carelessdept Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
truthixify
left a comment
There was a problem hiding this comment.
Core Stellar name resolution and React integration pass the focused resolver and hook tests after a clean SDK build. Approved.
bb43a6b to
ee98a71
Compare
|
Rebased/resolved the conflict in |
truthixify
left a comment
There was a problem hiding this comment.
The resolver works for the common path, but normalizeStellarName rejects names the configured on-chain contract can register. In src/chains/stellar/names.ts:79-85 every label is required to be at least 3 characters; the contract only applies the 3-character minimum to the full name and permits a single-level subdomain such as a.alice. That record can exist on chain but this public resolver fails before RPC, so its owner cannot resolve it. Please align client validation with the contract's actual accepted name set (and add a short-subdomain regression), or tighten the contract first. The focused core/React tests and build passed locally.
Summary
Replaces the 500 ms timer stubs in
@wraith-protocol/sdk-reactand@wraith-protocol/sdk-sveltewith a typed core Sorobanwraith-namescontract resolver in@wraith-protocol/sdk/chains/stellar.Changes
src/chains/stellar/names.ts, exported from@wraith-protocol/sdk/chains/stellar):normalizeStellarName(name)strips trailing.wraithand validates3..=32characters, lowercase ASCII alphanumeric labels, and single-level subdomains (sub.parent), rejecting malformed inputs before any RPC request withInvalidNameError.resolveStellarName(name, chain, options)simulatesresolve(name)against the configuredwraith-namesSoroban contract (DEPLOYMENTS.stellar.contracts.names), decodes and validates 64-byte(spendingPubKey || viewingPubKey)payloads intost:xlm:...stealth meta-addresses viaencodeStealthMetaAddress/decodeStealthMetaAddress, and rejects malformed contract payloads withInvalidMetaAddressError.NameNotFound/ contract error#6/scvVoid) returnnullby default (or throwNameNotFoundErrorwhenthrowOnNotFound: true) and are never cached.DEFAULT_STELLAR_NAME_TTL_MS(5 minutes) withbypassCache,ttlMs,clearStellarNameCache(),getStellarNameDefaultTtl(), andsetStellarNameDefaultTtl()controls.WalletWrongNetworkError.AbortSignalinstances reject immediately withRPCAbortedError.packages/sdk-react/src/hooks.ts,packages/sdk-svelte/src/primitives/useStellarName.ts):useStellarNamewrappers now callresolveStellarNamewithAbortControllercancellation on unmount/abort()/superseding lookups,loadingstate transitions, and typedWraithErrorpropagation.test/chains/stellar/names.test.ts,packages/sdk-react/test/hooks.test.tsx, andpackages/sdk-svelte/test/stellarParity.test.tscoveringfound,missing,malformed,wrong-network, andabortedrequests plus cache TTL/bypass semantics.README.mdandpackages/sdk-svelte/README.md, and updatedetc/sdk-stellar.api.md.Closes #242