SDK Reference
Complete reference for all methods available in the Self SDK.
Name Resolution
resolveName
-
Resolve a Self name to its default address i.e owner of name (NFT).
async function resolveName(name: string): Promise<string> // Example const address = await sdk.resolveName('ricomaverick') // Returns: "0x383D8ee00c3Ea31dd4eb6e5eCf649Bc9C08D8e31"
Metadata
resolveCrossChain
-
Resolves a Self name to its owner's address (BSC by default).
async function resolveCrossChain( name: string, chain: ChainIntegrationKey ): Promise<string> // Example const ethAddress = await sdk.resolveCrossChain('ricomaverick', 'eth') const btcAddress = await sdk.resolveCrossChain('ricomaverick', 'btc')
resolveMetadata
-
Retrieves complete metadata for a Self name.
async function resolveMetadata(name: string): Promise<Metadata> // Example const metadata = await sdk.resolveMetadata('ricomaverick')
Utility Methods
hashName
-
Generates the hash of a Self name.
function hashName(name: string): string // Example const hash = sdk.hashName('ricomaverick')
isValidName
-
Checks if a name follows the valid format rules.
function isValidName(name: string): boolean // Example const isValid = sdk.isValidName('ricomaverick')
Types
ResolverOptions
-
Configuration options for the SDK.
interface ResolverOptions { /** * Custom RPC URL for the blockchain provider * @default "https://bsc-dataseed1.binance.org/" */ rpcUrl?: string /** * Custom IPFS gateway URL * @default "https://ipfs.io/ipfs/" */ ipfsGateway?: string }
Metadata
-
Structure of name metadata.
interface Metadata { name: string description: string image: string email?: string foreignAddresses: { [key in ChainIntegrationKey]?: { address: string } } }
ChainIntegrationKey
-
Integration keys for supported blockchain.
type ChainIntegrationKey = | 'eth' | 'bsc' | 'btc' | 'ltc' | 'xmr' | 'trx' | 'nim' | 'ada' | 'sol' | 'xlm' | 'xrp' | 'eos' | 'klv' | 'dot' | 'polygon' | 'avax' | 'arb' | 'bnb' | 'strk' | 'email'