Skip to main content

Transfer, release, and lookup

After registration, owners can transfer a name to another address or release it back to the pool. Apps can also reverse-lookup which name belongs to an address.

Transfer ownership

Only the current owner may transfer.

await safHandle.transferName('john.saf', 'addr_safro1newowner...', {
signer: offlineSigner,
gas: 'auto',
});

CosmJS execute payload:

{
"transfer_name": {
"name": "john.saf",
"new_owner": "addr_safro1..."
}
}

No registration fee attached. Gas only.

Release a name

Frees the name for someone else to register. Irreversible from the user's perspective (they lose the handle).

await safHandle.releaseName('john.saf', {
signer: offlineSigner,
gas: 'auto',
});

Contract message:

{ "release_name": { "name": "john.saf" } }

Reverse lookup: handles by address

Find which name (and later phone) an address owns:

import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate';

const client = await CosmWasmClient.connect(RPC);
const handles = await client.queryContractSmart(CONTRACT, {
handles: { address: 'addr_safro1...' },
});
// v1: { name: "john.saf" } or { name: null }

Use in profile screens: "Your handle: john.saf".

Read contract config

Before registration UI, fetch live fees:

const config = await safHandle.getConfig();
// {
// nameRegistrationFeeUsaf: '50000000',
// phoneLinkFeeUsaf: '100000000',
// devModuleWallet: 'addr_safro1...',
// nativeDenom: 'usaf'
// }

Or REST / CosmWasm query:

{ "config": {} }

Name record detail

Full on-chain record for debugging or explorer views:

{ "name_record": { "name": "john.saf" } }

Returns owner, registration height, and metadata per STATE_SCHEMA.

Events to index

ActionAttributes
register_namename, owner, fee_usaf
transfer_namename, from, to
release_namename, owner

Subscribe via events and WebSockets:

tm.event='Tx' AND wasm.action='register_name'

Security notes

  • Re-resolve names before every send (owner may have transferred)
  • Pin contract address per network in app config
  • Validate fees from getConfig() before signing registration txs

Next steps