Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## 4.48.1 (2026-04-28)

- added: Resolve and display ZcashNames (.zcash) in the Zcash send flow and transaction history.
- added: Resolve and display ZNS names (.zcash/.zec) in the Zcash send flow and transaction history.
- changed: Remove free FIO handle creation flows.
- changed: Migrate Thorchain Savers and Thorchain Yield endpoints off NineRealms to gateway.liquify.com.

Expand Down
21 changes: 21 additions & 0 deletions src/components/scenes/SendScene2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,27 @@ const SendComponent = (props: Props): React.ReactElement => {

await coreWallet.saveTx(broadcastedTx)

// edge-core-js's saveTx silently drops tx.metadata when the engine
// has already registered the txid in walletState before we get here
// (race against the engine's onTransactionsChanged callback, which
// calls setupNewTxMetadata with no metadata for the engine's view of
// the tx). Re-apply via saveTxMetadata so payeeName and fio notes
// survive a reload from disk.
if (payeeName != null) {
await coreWallet
.saveTxMetadata({
txid: broadcastedTx.txid,
tokenId: broadcastedTx.tokenId,
metadata: {
name: broadcastedTx.metadata.name,
notes: broadcastedTx.metadata.notes
}
})
.catch((error: unknown) => {
showError(error)
})
}

for (const target of spendInfo.spendTargets) {
// Write FIO OBT per spendTarget
await recordFioObtData(
Expand Down
20 changes: 15 additions & 5 deletions src/util/zns.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { ZNS } from 'zcashname-sdk'

// Canonical suffix used when rendering a name resolved from an address.
export const ZNS_SUFFIX = '.zcash'

// All suffixes accepted as ZNS input. Order matters for `stripZnsSuffix`:
// longer suffixes must be checked first so that e.g. ".zcash" is preferred
// over a hypothetical ".z" prefix-match.
const ZNS_INPUT_SUFFIXES = ['.zcash', '.zec'] as const

// The SDK's `network` option only selects the registry address; its `url`
// always falls back to the testnet indexer unless overridden explicitly.
const ZNS_MAINNET_URL = 'https://main.zcashnames.com'
Expand All @@ -17,14 +23,18 @@ export const resetZnsClient = (): void => {
znsClient = null
}

export const isZnsName = (input: string): boolean =>
input.toLowerCase().endsWith(ZNS_SUFFIX)
export const isZnsName = (input: string): boolean => {
const lower = input.toLowerCase()
return ZNS_INPUT_SUFFIXES.some(suffix => lower.endsWith(suffix))
}

export const stripZnsSuffix = (input: string): string => {
const lower = input.toLowerCase()
return lower.endsWith(ZNS_SUFFIX)
? lower.slice(0, lower.length - ZNS_SUFFIX.length)
: lower
for (const suffix of ZNS_INPUT_SUFFIXES) {
if (lower.endsWith(suffix))
return lower.slice(0, lower.length - suffix.length)
}
return lower
}

export const resolveZnsName = async (input: string): Promise<string | null> => {
Expand Down
Loading