import { Rpc, GetProgramAccountsApi, GetMultipleAccountsApi, Address, GetAccountInfoApi, GetTokenLargestAccountsApi, Instruction, GetMinimumBalanceForRentExemptionApi, GetSlotApi, ReadonlyUint8Array } from '@solana/kit'; import * as _solana_program_token from '@solana-program/token'; import * as _solana_codecs_core from '@solana/codecs-core'; import * as _solana_addresses from '@solana/addresses'; import { Schema } from 'borsh'; /** * Parameters for retrieving SNS domains owned by an address. * * @example * ```ts * const params: GetSnsDomainsForAddressParams = { rpc, address }; * ``` */ interface GetSnsDomainsForAddressParams { /** RPC client. */ rpc: Rpc; /** Owner address. */ address: Address; } /** * An SNS domain owned directly by a registry address. * * @example * ```ts * const domain: GetSnsDomainsForAddressResult = { * domain: "example", * domainAddress, * }; * ``` */ interface GetSnsDomainsForAddressResult { /** TLD-less domain name. */ domain: string; /** Domain account address. */ domainAddress: Address; } /** * Retrieves directly registry-owned top-level SNS domains for an address. * * Tokenized domains and subdomains are not included. Entries without reverse * lookup results are omitted. * * @param params Domain retrieval parameters * @param params.rpc RPC client implementing program account and multiple-account APIs * @param params.address Address whose directly registry-owned SNS domains are retrieved * @returns Domain records with names without a TLD suffix and domain addresses. * * @example * ```ts * const domains = await getSnsDomainsForAddress({ rpc, address }); * ``` */ declare const getSnsDomainsForAddress: ({ rpc, address, }: GetSnsDomainsForAddressParams) => Promise; /** * Parameters for retrieving SNS domain NFTs owned by an address. * * @example * ```ts * const params: GetSnsNftsForAddressParams = { rpc, address }; * ``` */ interface GetSnsNftsForAddressParams { /** RPC client. */ rpc: Rpc; /** Owner address. */ address: Address; } /** * An SNS domain NFT owned by an address. * * @example * ```ts * const domain: GetSnsNftsForAddressResult = { * domain: "example", * domainAddress, * mint, * }; * ``` */ interface GetSnsNftsForAddressResult { /** TLD-less domain name. */ domain: string; /** Domain account address. */ domainAddress: Address; /** NFT mint address. */ mint: Address; } /** * Retrieves the SNS domain NFTs owned by a given address. * * Returned `domain` values do not include a `.sns` or `.sol` suffix. * If NFT records cannot be retrieved or decoded, this function returns an empty * array instead of throwing. * * Entries without reverse lookup results are omitted. * * @param params Tokenized domain retrieval parameters * @param params.rpc RPC client implementing multiple-account and program account APIs * @param params.address Address whose SNS domain NFTs are retrieved * @returns Tokenized domain records with names without a TLD suffix, domain addresses, and mints. * * @example * ```ts * const domains = await getSnsNftsForAddress({ rpc, address }); * ``` */ declare const getSnsNftsForAddress: ({ rpc, address, }: GetSnsNftsForAddressParams) => Promise; /** * Parameters for retrieving a wallet's primary domain. * * @example * ```ts * const params: GetPrimaryDomainParams = { rpc, walletAddress }; * ``` */ interface GetPrimaryDomainParams { /** RPC client. */ rpc: Rpc; /** Wallet address. */ walletAddress: Address; } /** * A wallet's primary domain. * * @example * ```ts * const primary: GetPrimaryDomainResult = { * domainAddress, * domainName: "example", * stale: false, * }; * ``` */ interface GetPrimaryDomainResult { /** Primary domain account address. */ domainAddress: Address; /** TLD-less primary domain name. */ domainName: string; /** Whether the wallet is no longer the domain's effective owner. */ stale: boolean; } /** * Retrieves the primary SNS domain associated with a wallet address. * * Returned domain names omit the TLD suffix; subdomain primary names can * include parent labels such as `sub.parent`. * * @param params Primary domain retrieval parameters * @param params.rpc RPC client implementing account and token-largest-account APIs * @param params.walletAddress Wallet address whose primary domain is retrieved * @returns Primary domain address, domain name, and stale status. * * @example * ```ts * const primary = await getPrimaryDomain({ rpc, walletAddress }); * ``` */ declare const getPrimaryDomain: ({ rpc, walletAddress, }: GetPrimaryDomainParams) => Promise; /** * Parameters for retrieving primary domains for multiple wallets. * * @example * ```ts * const params: GetPrimaryDomainsBatchParams = { rpc, walletAddresses }; * ``` */ interface GetPrimaryDomainsBatchParams { /** RPC client. */ rpc: Rpc; /** Wallet addresses. */ walletAddresses: Address[]; } /** * Retrieves primary SNS domain names for multiple wallet addresses. * * Returned values are index-aligned with `walletAddresses`. Domain names omit * the TLD suffix; subdomain primary names can include parent labels such as * `sub.parent`. * * @param params Primary domain retrieval parameters * @param params.rpc RPC client implementing multiple-account and token-largest-account APIs * @param params.walletAddresses Wallet addresses whose primary domains are retrieved * @returns Primary domain names, or `undefined` when no valid non-stale primary domain is found. * * @example * ```ts * const domains = await getPrimaryDomainsBatch({ rpc, walletAddresses }); * ``` */ declare const getPrimaryDomainsBatch: ({ rpc, walletAddresses, }: GetPrimaryDomainsBatchParams) => Promise<(string | undefined)[]>; /** * Parameters for burning an SNS domain. * * @example * ```ts * const params: BurnDomainParams = { * domain: "example.sns", * owner, * refundAddress, * }; * ``` */ interface BurnDomainParams { /** Full `.sns` domain name. */ domain: string; /** Current domain owner. */ owner: Address; /** Account receiving reclaimed rent. */ refundAddress: Address; } /** * Builds an instruction to burn a top-level `.sns` domain. * * @param params Burn parameters * @param params.domain Full `.sns` domain name * @param params.owner Current owner of the domain * @param params.refundAddress Account receiving reclaimed rent * @returns Transaction instruction. * * @example * ```ts * const instruction = await burnDomain({ domain: "example.sns", owner, refundAddress }); * ``` */ declare const burnDomain: ({ domain, owner, refundAddress, }: BurnDomainParams) => Promise; /** * Parameters for creating a name registry. * * @example * ```ts * const params: CreateNameRegistryParams = { rpc, name: "example", space: 32, payer, owner }; * ``` */ interface CreateNameRegistryParams { /** RPC client. */ rpc: Rpc; /** Raw registry name. */ name: string; /** Account data size in bytes. */ space: number; /** Account paying for creation. */ payer: Address; /** Owner of the new registry. */ owner: Address; /** Account funding amount. Defaults to the rent-exempt minimum. */ lamports?: bigint; /** Registry class address. */ classAddress?: Address; /** Parent registry address. */ parentAddress?: Address; } /** * Creates a raw SPL Name Registry account with the given rent budget, * allocated space, owner, and class. * * This low-level helper accepts a raw registry seed/name and does not parse * `.sns` or `.sol` suffixes. * * @param params Creation parameters * @param params.rpc RPC client implementing account and rent-exemption APIs * @param params.name Raw registry seed/name for the new account * @param params.space Space in bytes allocated to the account * @param params.payer Account paying for allocation * @param params.owner Owner of the new name account * @param params.lamports Optional lamports to fund the account. Defaults to the rent-exempt minimum * @param params.classAddress Optional class address for the registry * @param params.parentAddress Optional parent registry address * @returns Transaction instruction. * * @example * ```ts * const instruction = await createNameRegistry({ rpc, name: "example", space: 32, payer, owner }); * ``` */ declare const createNameRegistry: ({ rpc, name, space, payer, owner, lamports, classAddress, parentAddress, }: CreateNameRegistryParams) => Promise; /** * Supported SNS record identifiers. */ declare enum Record { IPFS = "IPFS", ARWV = "ARWV", SOL = "SOL", ETH = "ETH", BTC = "BTC", LTC = "LTC", DOGE = "DOGE", Email = "email", Url = "url", Discord = "discord", Github = "github", Reddit = "reddit", Twitter = "twitter", Telegram = "telegram", Pic = "pic", SHDW = "SHDW", POINT = "POINT", BSC = "BSC", Injective = "INJ", Backpack = "backpack", A = "A", AAAA = "AAAA", CNAME = "CNAME", TXT = "TXT", Background = "background", BASE = "BASE", IPNS = "IPNS", Bio = "bio" } /** Fixed content sizes, in bytes, for V1 record types. */ declare const RECORD_V1_SIZE: Map; /** Versions of the SNS record account layout. */ declare enum RecordVersion { V1 = 1, V2 = 2 } /** * Parameters for creating a domain record. * * @example * ```ts * const params: CreateRecordParams = { * domain: "example.sns", * record: Record.Url, * content: "https://example.com", * owner, * payer, * }; * ``` */ interface CreateRecordParams { /** Full `.sns` domain name. */ domain: string; /** Record type. */ record: Record; /** Record content. */ content: string; /** Current domain owner. */ owner: Address; /** Instruction fee payer. */ payer: Address; } /** * Builds an instruction to create a V2 record for a `.sns` domain or subdomain. * * Record content is serialized according to SNS-IP 1. * * @param params Record creation parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record Record type * @param params.content Record content * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @returns Transaction instruction. * * @example * ```ts * const instruction = await createRecord({ * domain: "example.sns", * record: Record.Url, * content: "https://example.com", * owner, * payer, * }); * ``` */ declare const createRecord: ({ domain, record, content, owner, payer, }: CreateRecordParams) => Promise; /** * Parameters for creating a reverse lookup record. * * @example * ```ts * const params: CreateReverseParams = { domainAddress, domain: "example", payer }; * ``` */ interface CreateReverseParams { /** Domain account address. */ domainAddress: Address; /** Raw reverse lookup payload. */ domain: string; /** Account funding creation. */ payer: Address; /** Parent domain address for a subdomain. */ parentAddress?: Address; /** Parent domain owner for a subdomain. */ parentOwner?: Address; } /** * Creates a raw reverse lookup record for the specified domain account. * * This low-level helper accepts the stored reverse payload as `domain` and * does not parse `.sns` or `.sol` suffixes. * * @param params Reverse lookup creation parameters * @param params.domainAddress Domain account the reverse lookup points to * @param params.domain Raw reverse payload to store * @param params.payer Account funding reverse lookup creation * @param params.parentAddress Optional parent domain address for subdomain reverse lookups * @param params.parentOwner Optional parent domain owner for subdomain reverse lookups * @returns Transaction instruction. * * @example * ```ts * const instruction = await createReverse({ domainAddress, domain: "example", payer }); * ``` */ declare const createReverse: ({ domainAddress, domain, payer, parentAddress, parentOwner, }: CreateReverseParams) => Promise; /** * Parameters for creating an SNS subdomain. * * @example * ```ts * const params: CreateSubdomainParams = { * rpc, * subdomain: "sub.example.sns", * owner, * }; * ``` */ interface CreateSubdomainParams { /** RPC client. */ rpc: Rpc; /** Full `.sns` subdomain name. */ subdomain: string; /** New subdomain owner. */ owner: Address; /** Account data size in bytes. Defaults to 2,000. */ space?: number; /** Account funding creation. Defaults to `owner`. */ feePayer?: Address; } /** * Builds the instructions to create a `.sns` subdomain. * * The subdomain registry instruction is always included. The reverse lookup * instruction is included only when the reverse lookup account does not exist. * * @param params Subdomain creation parameters * @param params.rpc RPC client implementing account and rent-exemption APIs * @param params.subdomain Full `.sns` subdomain name * @param params.owner New subdomain owner and parent owner for reverse lookup creation * @param params.space Optional space in bytes allocated to the subdomain account. Defaults to 2,000 * @param params.feePayer Optional account funding subdomain creation. Defaults to `owner` * @returns Transaction instructions. * * @example * ```ts * const instructions = await createSubdomain({ rpc, subdomain: "sub.example.sns", owner }); * ``` */ declare const createSubdomain: ({ rpc, subdomain, owner, space, feePayer, }: CreateSubdomainParams) => Promise; /** * Parameters for deleting a name registry. * * @example * ```ts * const params: DeleteNameRegistryParams = { rpc, name: "example", refundAddress }; * ``` */ interface DeleteNameRegistryParams { /** RPC client. */ rpc: Rpc; /** Raw registry name. */ name: string; /** Account receiving refunded rent. */ refundAddress: Address; /** Registry class address. */ classAddress?: Address; /** Parent registry address. */ parentAddress?: Address; } /** * Deletes a raw SPL Name Registry account and refunds the associated rent * balance to the specified target. * * This low-level helper accepts a raw registry seed/name and does not parse * `.sns` or `.sol` suffixes. * * @param params Deletion parameters * @param params.rpc RPC client implementing account lookup * @param params.name Raw registry seed/name whose account will be deleted * @param params.refundAddress Address receiving the refunded rent balance * @param params.classAddress Optional class address for the registry * @param params.parentAddress Optional parent registry address * @returns Transaction instruction. * * @example * ```ts * const instruction = await deleteNameRegistry({ rpc, name: "example", refundAddress }); * ``` */ declare const deleteNameRegistry: ({ rpc, name, refundAddress, classAddress, parentAddress, }: DeleteNameRegistryParams) => Promise; /** * Parameters for deleting a domain record. * * @example * ```ts * const params: DeleteRecordParams = { * domain: "example.sns", * record: Record.Url, * owner, * payer, * }; * ``` */ interface DeleteRecordParams { /** Full `.sns` domain name. */ domain: string; /** Record type. */ record: Record; /** Current domain owner. */ owner: Address; /** Instruction fee payer. */ payer: Address; } /** * Builds an instruction to delete a V2 record for a `.sns` domain or subdomain. * * @param params Record deletion parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record Record type * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @returns Transaction instruction. * * @example * ```ts * const instruction = await deleteRecord({ * domain: "example.sns", * record: Record.Url, * owner, * payer, * }); * ``` */ declare const deleteRecord: ({ domain, record, owner, payer, }: DeleteRecordParams) => Promise; /** * Parameters for registering an SNS domain. * * @example * ```ts * const params: RegisterDomainParams = { * domain: "example.sns", * space: 1_000, * buyer, * buyerTokenAccount, * }; * ``` */ interface RegisterDomainParams { /** Full `.sns` domain name. */ domain: string; /** Domain registry size in bytes. */ space: number; /** Account paying for registration. */ buyer: Address; /** Buyer's payment token account. */ buyerTokenAccount: Address; /** Payment token mint. Defaults to USDC. */ mint?: Address; /** Supported referrer address. */ referrer?: Address; } /** * Builds the instructions to register a top-level `.sns` domain. * * If a supported referrer is provided, the returned instructions include an * idempotent associated token account creation instruction before the * registration instruction. * * @param params Registration parameters * @param params.domain Full `.sns` domain name * @param params.space Number of bytes to allocate for the domain registry * @param params.buyer Buyer paying for the registration * @param params.buyerTokenAccount Buyer's token account used to pay for registration * @param params.mint Token mint used for payment. Defaults to USDC * @param params.referrer Optional referrer address * @returns Transaction instructions. * * @example * ```ts * const instructions = await registerDomain({ * domain: "example.sns", * space: 1_000, * buyer, * buyerTokenAccount, * }); * ``` */ declare const registerDomain: ({ domain, space, buyer, buyerTokenAccount, mint, referrer, }: RegisterDomainParams) => Promise; /** * Parameters for registering an SNS domain with an NFT. * * @example * ```ts * const params: RegisterDomainWithNftParams = { * domain: "example.sns", * space: 1_000, * buyer, * nftSource, * nftMint, * }; * ``` */ interface RegisterDomainWithNftParams { /** Full `.sns` domain name. */ domain: string; /** Domain registry size in bytes. */ space: number; /** Account registering the domain. */ buyer: Address; /** Source token account for the NFT. */ nftSource: Address; /** Bonfida Wolves NFT mint. */ nftMint: Address; } /** * Builds an instruction to register a top-level `.sns` domain using a Bonfida Wolves NFT. * * @param params Registration parameters * @param params.domain Full `.sns` domain name * @param params.space Number of bytes to allocate for the domain registry * @param params.buyer Buyer paying for the registration * @param params.nftSource NFT source account * @param params.nftMint NFT mint used for registration * @returns Transaction instruction. * * @example * ```ts * const instruction = await registerDomainWithNft({ * domain: "example.sns", * space: 1_000, * buyer, * nftSource, * nftMint, * }); * ``` */ declare const registerDomainWithNft: ({ domain, space, buyer, nftSource, nftMint, }: RegisterDomainWithNftParams) => Promise; /** * Input for setting an owner's already-derived SNS primary domain. * * @example * ```ts * const params: SetPrimaryDomainParams = { rpc, domainAddress, owner }; * ``` */ interface SetPrimaryDomainParams { /** RPC client used to retrieve the domain registry. */ rpc: Rpc; /** Already-derived SNS domain account address. */ domainAddress: Address; /** Owner of the domain account. */ owner: Address; } /** * Sets the primary domain for the specified owner. * * This is an address-only API: `domainAddress` must be an already-derived SNS * domain account. * * @param params Primary-domain registration parameters * @param params.rpc RPC client implementing account lookup * @param params.domainAddress SNS domain account address to set as primary * @param params.owner Owner of the domain account * @returns Transaction instruction. * * @example * ```ts * const instruction = await setPrimaryDomain({ rpc, domainAddress, owner }); * ``` */ declare const setPrimaryDomain: ({ rpc, domainAddress, owner, }: SetPrimaryDomainParams) => Promise; /** * Accounts and record identity required to build a record-validation instruction. * * @example * ```ts * const params: RecordVerificationParams = { * domain: "example.sns", * record: Record.Url, * owner, * payer, * verifier, * }; * ``` */ interface RecordVerificationParams { /** Full `.sns` domain or subdomain name. */ domain: string; /** V2 record type to validate. */ record: Record; /** Current owner of the domain. */ owner: Address; /** Fee payer for the validation instruction. */ payer: Address; /** Account whose signature or identity verifies the record. */ verifier: Address; } /** * Builds an instruction to store the expected Right of Association verifier for a V2 record. * * @param params V2 record validation parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record V2 record type * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @param params.verifier Verifier account used by the record validation instruction * @returns Transaction instruction. * * @example * ```ts * const instruction = await setRecordRoaVerifier({ * domain: "example.sns", * record: Record.Url, * owner, * payer, * verifier, * }); * ``` */ declare const setRecordRoaVerifier: ({ domain, record, owner, payer, verifier, }: RecordVerificationParams) => Promise; /** * Builds an instruction to write or refresh staleness verifier metadata for a V2 record. * * @param params V2 record validation parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record V2 record type * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @param params.verifier Verifier account used by the record validation instruction * @returns Transaction instruction. * * @example * ```ts * const instruction = await setRecordStalenessVerifier({ * domain: "example.sns", * record: Record.Url, * owner, * payer, * verifier, * }); * ``` */ declare const setRecordStalenessVerifier: (params: RecordVerificationParams) => Promise; /** * Parameters for transferring an SNS domain. * * @example * ```ts * const params: TransferDomainParams = { rpc, domain: "example.sns", newOwner }; * ``` */ interface TransferDomainParams { /** RPC client. */ rpc: Rpc; /** Full `.sns` domain name. */ domain: string; /** New domain owner. */ newOwner: Address; } /** * Builds an instruction to transfer a top-level `.sns` domain. * * @param params Transfer parameters * @param params.rpc RPC client implementing account lookup * @param params.domain Full `.sns` domain name * @param params.newOwner New owner of the domain * @returns Transaction instruction. * * @example * ```ts * const instruction = await transferDomain({ rpc, domain: "example.sns", newOwner }); * ``` */ declare const transferDomain: ({ rpc, domain, newOwner, }: TransferDomainParams) => Promise; /** * Parameters for transferring an SNS subdomain. * * @example * ```ts * const params: TransferSubdomainParams = { * rpc, * subdomain: "sub.example.sns", * newOwner, * }; * ``` */ interface TransferSubdomainParams { /** RPC client. */ rpc: Rpc; /** Full `.sns` subdomain name. */ subdomain: string; /** New subdomain owner. */ newOwner: Address; /** Whether the parent domain owner signs. */ isParentOwnerSigner?: boolean; /** Current subdomain owner. Resolved when omitted. */ currentOwner?: Address; } /** * Builds an instruction to transfer a `.sns` subdomain. * * @param params Transfer parameters * @param params.rpc RPC client implementing account lookup * @param params.subdomain Full `.sns` subdomain name * @param params.newOwner New owner of the subdomain * @param params.isParentOwnerSigner Whether the parent domain owner signs the transfer * @param params.currentOwner Optional current owner of the subdomain. Resolved automatically when omitted * @returns Transaction instruction. * * @example * ```ts * const instruction = await transferSubdomain({ rpc, subdomain: "sub.example.sns", newOwner }); * ``` */ declare const transferSubdomain: ({ rpc, subdomain, newOwner, isParentOwnerSigner, currentOwner, }: TransferSubdomainParams) => Promise; /** * Input for updating bytes in a raw SNS name-registry account. * * @example * ```ts * const params: UpdateNameRegistryParams = { * rpc, * domain: "example", * offset: 0, * data: new TextEncoder().encode("data"), * }; * ``` */ interface UpdateNameRegistryParams { /** RPC client used to retrieve the registry owner. */ rpc: Rpc; /** Raw registry seed/name to update. */ domain: string; /** Byte offset where the update begins. */ offset: number; /** Bytes to write to the registry. */ data: Uint8Array; /** Optional class address for the registry. */ classAddress?: Address; /** * Optional parent name-account address. */ parentAddress?: Address; } /** * Updates the data of a raw SPL Name Registry account. * * This low-level helper accepts a raw registry seed/name as `domain` and does * not parse `.sns` or `.sol` suffixes. * * @param params Update parameters * @param params.rpc RPC client implementing account lookup * @param params.domain Raw registry seed/name whose account will be updated * @param params.offset Offset in bytes where the update should begin * @param params.data Data to write to the registry * @param params.classAddress Optional class address for the registry * @param params.parentAddress Optional parent registry address * @returns Transaction instruction. * * @example * ```ts * const instruction = await updateNameRegistry({ * rpc, * domain: "example", * offset: 0, * data: new TextEncoder().encode("data"), * }); * ``` */ declare function updateNameRegistry({ rpc, domain, offset, data, classAddress, parentAddress, }: UpdateNameRegistryParams): Promise; /** * Parameters for updating a domain record. * * @example * ```ts * const params: UpdateRecordParams = { * domain: "example.sns", * record: Record.Url, * content: "https://example.com", * owner, * payer, * }; * ``` */ interface UpdateRecordParams { /** Full `.sns` domain name. */ domain: string; /** Record type. */ record: Record; /** Record content. */ content: string; /** Current domain owner. */ owner: Address; /** Instruction fee payer. */ payer: Address; } /** * Builds an instruction to update a V2 record for a `.sns` domain or subdomain. * * Record content is serialized according to SNS-IP 1. * * @param params Record update parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record Record type * @param params.content Record content * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @returns Transaction instruction. * * @example * ```ts * const instruction = await updateRecord({ * domain: "example.sns", * record: Record.Url, * content: "https://example.com", * owner, * payer, * }); * ``` */ declare const updateRecord: ({ domain, record, content, owner, payer, }: UpdateRecordParams) => Promise; /** * Builds an instruction to validate a V2 record's Right of Association with a Solana verifier. * * @param params Record validation parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record Record type * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @param params.verifier Verifier account used by the record validation instruction * @returns Transaction instruction. * * @example * ```ts * const instruction = await validateRecordRoa({ * domain: "example.sns", * record: Record.Url, * owner, * payer, * verifier, * }); * ``` */ declare const validateRecordRoa: (params: RecordVerificationParams) => Promise; /** * Parameters for validating a record with an Ethereum signature. * * @example * ```ts * const params: ValidateRecordRoaEthereumParams = { * domain: "example.sns", record: Record.ETH, owner, payer, signature, expectedPubkey, * }; * ``` */ interface ValidateRecordRoaEthereumParams { /** Full `.sns` domain name. */ domain: string; /** Record type. */ record: Record; /** Current domain owner. */ owner: Address; /** Instruction fee payer. */ payer: Address; /** Ethereum signature. */ signature: Uint8Array; /** Expected Ethereum public key. */ expectedPubkey: Uint8Array; } /** * Builds an instruction to validate a V2 record's Right of Association with an Ethereum signature. * * @param params Record validation parameters * @param params.domain Full `.sns` domain or subdomain name * @param params.record Record type * @param params.owner Current owner of the domain * @param params.payer Fee payer for the instruction * @param params.signature Ethereum signature used for validation * @param params.expectedPubkey Expected Ethereum public key for validation * @returns Transaction instruction. * * @example * ```ts * const instruction = await validateRecordRoaEthereum({ * domain: "example.sns", * record: Record.ETH, * owner, * payer, * signature, * expectedPubkey, * }); * ``` */ declare const validateRecordRoaEthereum: ({ domain, record, owner, payer, signature, expectedPubkey, }: ValidateRecordRoaEthereumParams) => Promise; /** Codec for serializing and deserializing Solana addresses. */ declare const addressCodec: _solana_codecs_core.FixedSizeCodec<_solana_addresses.Address, _solana_addresses.Address, 32>; /** Codec for Base58-encoded binary data. */ declare const base58Codec: _solana_codecs_core.VariableSizeCodec; /** Codec for Base64-encoded binary data. */ declare const base64Codec: _solana_codecs_core.VariableSizeCodec; /** Codec for SPL Token account data. */ declare const tokenCodec: _solana_codecs_core.FixedSizeCodec<_solana_program_token.TokenArgs, _solana_program_token.Token>; /** Codec for UTF-8 text data. */ declare const utf8Codec: _solana_codecs_core.VariableSizeCodec; /** Address of the Solana System Program. */ declare const SYSTEM_PROGRAM_ADDRESS: Address; /** Address of the rent sysvar account. */ declare const SYSVAR_RENT_ADDRESS: Address; /** All-zero Solana address used as the SDK default sentinel. */ declare const DEFAULT_ADDRESS: Address; /** Address of the SPL Token program. */ declare const TOKEN_PROGRAM_ADDRESS: Address; /** * The Solana Name Service program address. */ declare const NAME_PROGRAM_ADDRESS: Address; /** * The SNS root domain account address. */ declare const SNS_ROOT_DOMAIN_ACCOUNT: Address; /** * The SNS Registry program address. */ declare const REGISTRY_PROGRAM_ADDRESS: Address; /** * The SNS Name Tokenizer program address. */ declare const NAME_TOKENIZER_ADDRESS: Address; /** * The SNS Offers program address. */ declare const NAME_OFFERS_ADDRESS: Address; /** * The SNS Records program address. */ declare const RECORDS_PROGRAM_ADDRESS: Address; /** * The Solana Registration Service registrar central state PDA. * * This address is derived from the `central_state` seed and must be recomputed * if `SOL_REGISTRAR_PROGRAM_ADDRESS` is updated. */ declare const SRS_CENTRAL_STATE: Address; /** * The Solana Registration Service class PDA for `.sol` records. * * This address is derived from `SRS_CENTRAL_STATE`, `.sol`, and * `SRS_PROGRAM_ADDRESS`. It must be recomputed if either * `SOL_REGISTRAR_PROGRAM_ADDRESS` or `SRS_PROGRAM_ADDRESS` is updated. */ declare const SOL_SRS_CLASS: Address; /** * The reverse lookup class address. */ declare const REVERSE_LOOKUP_CLASS: Address; /** Legacy alias for the reverse-lookup class address. */ declare const CENTRAL_STATE: Address; /** * The central state address for domain records. */ declare const CENTRAL_STATE_DOMAIN_RECORDS: Address; /** * Address of the `.twitter` TLD authority. */ declare const TWITTER_VERIFICATION_AUTHORITY: Address; /** * The `.twitter` root parent registry address. */ declare const TWITTER_ROOT_PARENT_REGISTRY_ADDRESS: Address; /** Owner address of the SNS registration vault. */ declare const VAULT_OWNER: Address; /** Mainnet USDC mint address. */ declare const USDC_MINT: Address; /** Mainnet FIDA mint address. */ declare const FIDA_MINT: Address; /** Address of the Metaplex Token Metadata program. */ declare const METAPLEX_PROGRAM_ADDRESS: Address; /** Metadata account for the SNS Wolves collection. */ declare const WOLVES_COLLECTION_METADATA: Address; /** Approved referrer addresses for SNS registration flows. */ declare const REFERRERS: Address[]; /** Program address of the legacy Pyth oracle program. */ declare const PYTH_PROGRAM_ID: Address; /** Maps supported payment mint addresses to their Pyth price-feed identifiers. */ declare const PYTH_FEEDS: Map; /** * Maps record types to guardian addresses used for Right of Association verification. */ declare const GUARDIANS: Map; /** * Record types that use Ethereum/secp256k1 Right of Association validation. */ declare const ETH_ROA_RECORDS: Set; /** * Record types whose content is a `0x`-prefixed EVM address. */ declare const EVM_RECORDS: Set; /** * Record types whose content is UTF-8 encoded. */ declare const UTF8_ENCODED_RECORDS: Set; /** * Record types whose Right of Association verifier is derived from the record content itself. */ declare const SELF_SIGNED_RECORDS: Set; /** * Parameters for retrieving all SNS domains. * * @example * ```ts * const params: GetAllSnsDomainsParams = { rpc }; * ``` */ interface GetAllSnsDomainsParams { /** RPC client. */ rpc: Rpc; } /** * A top-level SNS domain account. * * @example * ```ts * const domain: GetAllSnsDomainsResult = { domainAddress, owner }; * ``` */ interface GetAllSnsDomainsResult { /** Domain account address. */ domainAddress: Address; /** Registry owner address. */ owner: Address; } /** * Retrieves all top-level SNS domain accounts. * * @param params Domain retrieval parameters * @param params.rpc RPC client implementing program account lookup * @returns Domain account addresses and owners. * * @example * ```ts * const domains = await getAllSnsDomains({ rpc }); * ``` */ declare const getAllSnsDomains: ({ rpc, }: GetAllSnsDomainsParams) => Promise; /** * Parameters for deriving an SNS domain address. * * @example * ```ts * const params: GetSnsDomainAddressParams = { domain: "example" }; * ``` */ interface GetSnsDomainAddressParams { /** TLD-less domain name. */ domain: string; /** Record version. */ record?: RecordVersion; } /** * A derived SNS domain address. * * @example * ```ts * const derived: GetSnsDomainAddressResult = { * domainAddress, * isSub: false, * }; * ``` */ interface GetSnsDomainAddressResult { /** Derived account address. */ domainAddress: Address; /** Parent domain address for subdomains. */ parentAddress?: Address; /** Whether the input is a subdomain. */ isSub: boolean; /** Whether the input is a subdomain record. */ isSubRecord?: boolean; } /** * Derives the address of a domain, subdomain, or record account. * * @param params Derivation parameters * @param params.domain TLD-trimmed SNS domain name * @param params.record Optional record account version for record derivation * @returns Derived account address and metadata describing top-level, subdomain, or sub-record derivation. * * @example * ```ts * const derived = await getSnsDomainAddress({ domain: "example" }); * ``` */ declare const getSnsDomainAddress: ({ domain, record, }: GetSnsDomainAddressParams) => Promise; /** * Parameters for deriving an SRS domain address. * * @example * ```ts * const params: GetSrsDomainAddressParams = { domain: "example" }; * ``` */ interface GetSrsDomainAddressParams { /** TLD-less `.sol` domain name. */ domain: string; } /** * A derived SRS domain address. * * @example * ```ts * const derived: GetSrsDomainAddressResult = { domainAddress, hashed }; * ``` */ interface GetSrsDomainAddressResult { /** Derived SRS record address. */ domainAddress: Address; /** SHA-256 hash of the canonical name. */ hashed: Uint8Array; } /** * Derives the canonical SRS record address for a TLD-trimmed `.sol` name. * * @param params Derivation parameters * @param params.domain TLD-trimmed `.sol` name * @returns The SRS record address and canonical name hash. * * @example * ```ts * const derived = await getSrsDomainAddress({ domain: "example" }); * ``` */ declare const getSrsDomainAddress: ({ domain, }: GetSrsDomainAddressParams) => Promise; /** * Parameters for retrieving a domain owner. * * @example * ```ts * const params: GetDomainOwnerParams = { rpc, domain: "example.sns" }; * ``` */ interface GetDomainOwnerParams { /** RPC client. */ rpc: Rpc; /** Full domain name. */ domain: string; } /** * Retrieves the owner of the specified domain. If the domain is tokenized, * the NFT's owner is returned; otherwise, the registry owner is returned. * * @param params Domain owner retrieval parameters * @param params.rpc RPC client implementing account and token-largest-account APIs * @param params.domain Full domain name including a `.sns` or `.sol` suffix * @returns The domain owner address. * * @example * ```ts * const owner = await getDomainOwner({ rpc, domain: "example.sns" }); * ``` */ declare const getDomainOwner: ({ rpc, domain }: GetDomainOwnerParams) => Promise<_solana_addresses.Address>; /** Validation modes encoded in an SNS record header. */ declare enum Validation { None = 0, Solana = 1, Ethereum = 2, UnverifiedSolana = 3 } /** Byte length of the common SNS name-registry account header. */ declare const NAME_REGISTRY_LEN = 96; /** * Returns the byte length of an identifier encoded for a validation mode. * * @example * ```ts * const length = getValidationLength(Validation.Solana); * ``` */ declare const getValidationLength: (validation: Validation) => 32 | 0 | 20; /** * Input for decoding an SNS V2 record header. * * @example * ```ts * const params: RecordHeaderStateParams = { stalenessValidation: 0, rightOfAssociationValidation: 0, contentLength: 0 }; * ``` */ interface RecordHeaderStateParams { /** Staleness validation mode. */ stalenessValidation: number; /** Right of Association validation mode. */ rightOfAssociationValidation: number; /** Record content length in bytes. */ contentLength: number; } /** Decoded header of an SNS V2 record account. */ declare class RecordHeaderState { /** Staleness validation mode. */ stalenessValidation: number; /** Right of Association validation mode. */ rightOfAssociationValidation: number; /** Record content length in bytes. */ contentLength: number; static schema: Schema; static LEN: number; constructor(obj: RecordHeaderStateParams); static deserialize(data: Uint8Array): RecordHeaderState; static retrieve(rpc: Rpc, address: Address): Promise; } /** Decoded SNS V2 record account, including its validation data and content. */ declare class RecordState { /** Decoded record header. */ header: RecordHeaderState; /** Validation identifiers and record content. */ data: Uint8Array; constructor(header: RecordHeaderState, data: Uint8Array); static deserialize(data: Uint8Array): RecordState; static retrieve(rpc: Rpc, address: Address): Promise; static retrieveBatch(rpc: Rpc, addresses: Address[]): Promise<(RecordState | undefined)[]>; getContent(): Uint8Array; getStalenessId(): Uint8Array; getRoAId(): Uint8Array; } /** * Options for retrieving a domain record. * * @example * ```ts * const options: GetDomainRecordOptions = { deserialize: true }; * ``` */ interface GetDomainRecordOptions { /** Whether to decode record content. */ deserialize?: boolean; /** Custom Right of Association verifier. */ verifier?: ReadonlyUint8Array; } /** * Parameters for retrieving a domain record. * * @example * ```ts * const params: GetDomainRecordParams = { * rpc, * domain: "example.sns", * record: Record.Url, * }; * ``` */ interface GetDomainRecordParams { /** RPC client. */ rpc: Rpc; /** Full domain name. */ domain: string; /** Record type to retrieve. */ record: Record; /** Record retrieval options. */ options?: GetDomainRecordOptions; } /** * Verification status for a domain record. * * @example * ```ts * const verified: GetDomainRecordVerification = { staleness: true }; * ``` */ interface GetDomainRecordVerification { /** Whether the record is current. */ staleness: boolean; /** Right of Association verification result. */ roa?: boolean; } /** * A retrieved domain record. * * @example * ```ts * const result: GetDomainRecordResult = { * record: Record.Url, * retrievedRecord, * verified: { staleness: true }, * }; * ``` */ interface GetDomainRecordResult { /** Record type. */ record: Record; /** Retrieved record state. */ retrievedRecord: RecordState; /** Verification status. */ verified: GetDomainRecordVerification; /** Decoded record content. */ deserializedContent?: string; } /** * Retrieves a V2 record under a domain, verifies it, and optionally decodes its content. * * @param params Record retrieval parameters * @param params.rpc RPC client implementing account, multiple-account, and token-largest-account APIs * @param params.domain Full domain name including a `.sns` or `.sol` suffix * @param params.record Record type to retrieve * @param params.options Optional record processing options * @returns The V2 record state, its verification result, and optional decoded content * * @example * ```ts * const result = await getDomainRecord({ rpc, domain: "example.sns", record: Record.Url }); * ``` */ declare function getDomainRecord({ rpc, domain, record, options, }: GetDomainRecordParams): Promise; /** * Options for retrieving domain records. * * @example * ```ts * const options: GetDomainRecordsOptions<[Record.Url], [undefined]> = { * deserialize: true, * verifiers: [undefined], * }; * ``` */ interface GetDomainRecordsOptions { /** Whether to decode record content. */ deserialize?: boolean; /** Right of Association verifiers by record position. */ verifiers?: [...U]; } /** * Parameters for retrieving domain records. * * @example * ```ts * const params: GetDomainRecordsParams<[Record.Url], [undefined]> = { * rpc, * domain: "example.sns", * records: [Record.Url], * }; * ``` */ interface GetDomainRecordsParams { /** RPC client. */ rpc: Rpc; /** Full domain name. */ domain: string; /** Record types to retrieve. */ records: [...T]; /** Record retrieval options. */ options?: GetDomainRecordsOptions; } /** * Verification status for a domain record. * * @example * ```ts * const verified: GetDomainRecordsVerification = { staleness: true }; * ``` */ interface GetDomainRecordsVerification { /** Whether the record is current. */ staleness: boolean; /** Right of Association verification result. */ roa?: boolean; } /** * A retrieved domain record. * * @example * ```ts * const result: GetDomainRecordsResult = { * record: Record.Url, * retrievedRecord, * verified: { staleness: true }, * }; * ``` */ interface GetDomainRecordsResult { /** Record type. */ record: Record; /** Retrieved record state. */ retrievedRecord: RecordState; /** Verification status. */ verified: GetDomainRecordsVerification; /** Decoded record content. */ deserializedContent?: string; } /** * Retrieves V2 records under a domain, verifies them, and optionally decodes their content. * * @param params Record retrieval parameters * @param params.rpc RPC client implementing account, multiple-account, and token-largest-account APIs * @param params.domain Full domain name including a `.sns` or `.sol` suffix * @param params.records Record types to retrieve * @param params.options Optional record processing options * @returns Results aligned with `records`; missing V2 record accounts produce `undefined` * * @example * ```ts * const results = await getDomainRecords({ rpc, domain: "example.sns", records: [Record.Url] }); * ``` */ declare function getDomainRecords({ rpc, domain, records, options, }: GetDomainRecordsParams): Promise<(GetDomainRecordsResult | undefined)[]>; /** * Parameters for retrieving subdomains under a parent domain. * * @example * ```ts * const params: GetSubdomainsParams = { * rpc, * domain: "example.sns", * }; * ``` */ interface GetSubdomainsParams { /** RPC client. */ rpc: Rpc; /** Full parent domain name, including its `.sns` or `.sol` suffix. */ domain: string; } /** * A subdomain and the owner recorded in its name registry. * * @example * ```ts * const subdomain: GetSubdomainsResult = { * subdomain: "blog", * owner: "Fxuoy3gFjfJALhwkRcuKjRdechcgffUApeYAfMWck6w8" as Address, * }; * ``` */ interface GetSubdomainsResult { /** TLD-less label recorded by the subdomain's reverse lookup account. */ subdomain: string; /** Owner address stored in the subdomain's name registry account. */ owner: Address; } /** * Retrieves subdomains under a parent domain, including their owners. * * Entries without reverse lookup data are omitted. Passing a subdomain returns * an empty array. * * @param params Subdomain retrieval parameters * @param params.rpc RPC client implementing program account lookup * @param params.domain Full parent domain name including a `.sns` or `.sol` suffix * @returns Subdomain names and owner addresses. * * @example * ```ts * const subdomains = await getSubdomains({ rpc, domain: "example.sns" }); * ``` */ declare const getSubdomains: ({ rpc, domain, }: GetSubdomainsParams) => Promise; /** Controls whether resolution may return program-derived addresses. */ type ResolveOptions = { allowPda: false; programIds?: never; } | { allowPda: "any"; programIds?: never; } | { allowPda: true; programIds: Address[]; }; /** RPC client type for domain resolution. */ type ResolveRpc = Rpc; /** * Parameters for resolving a domain. * * @example * ```ts * const params: ResolveParams = { rpc, domain: "example.sns" }; * ``` */ interface ResolveParams { /** RPC client. */ rpc: ResolveRpc; /** Full domain name. */ domain: string; /** Resolution options. */ options?: ResolveOptions; } /** * Resolves a `.sns` or `.sol` domain to its target address. * * @param params Resolution parameters * @param params.rpc RPC client implementing account, multiple-account, token-largest-account, and slot APIs * @param params.domain Full domain name including a `.sns` or `.sol` suffix * @param params.options Optional PDA owner resolution options. Defaults to `{ allowPda: false }` * @returns The resolved target address. * * @see {@link safeResolve} for `.sol` resolution that verifies the SRS and * corresponding SNS targets match when SRS-backed resolution is enabled. * * @example * ```ts * const address = await resolve({ rpc, domain: "example.sns" }); * ``` */ declare const resolve: ({ rpc, domain, options, }: ResolveParams) => Promise
; /** * Resolves a `.sns` or `.sol` domain using the same routing as {@link resolve}. * * When SRS-backed `.sol` resolution is enabled, both the `.sol` domain and its * corresponding `.sns` domain must resolve to the same target; otherwise, * {@link Errors.SnsSolResolutionMismatchError} is thrown. * * @param params Resolution parameters * @param params.rpc RPC client implementing account, multiple-account, token-largest-account, and slot APIs * @param params.domain Full domain name including a `.sns` or `.sol` suffix * @param params.options Optional PDA owner resolution options. Defaults to `{ allowPda: false }` * @returns The matching SRS and SNS target when compared; otherwise the target returned by {@link resolve} * @throws * - {@link Errors.SnsSolResolutionMismatchError} when SRS and SNS resolve a `.sol` domain to different addresses. * - Any resolution error propagated by {@link resolve}, `resolveSol`, or `resolveSns`. * @example * ```ts * const address = await safeResolve({ rpc, domain: "example.sol" }); * ``` */ declare const safeResolve: ({ rpc, domain, options, }: ResolveParams) => Promise
; /** * Error classes and stable error categories emitted by SDK operations. * @module Errors */ /** Stable error codes emitted by SNS SDK operations. */ declare enum ErrorType { InvalidSubdomain = "InvalidSubdomain", PrimaryDomainNotFound = "PrimaryDomainNotFound", NoRecordData = "NoRecordData", InvalidRecordData = "InvalidRecordData", InvalidEvmAddress = "InvalidEvmAddress", InvalidInjectiveAddress = "InvalidInjectiveAddress", InvalidARecord = "InvalidARecord", InvalidAAAARecord = "InvalidAAAARecord", InvalidRecordInput = "InvalidRecordInput", AccountDoesNotExist = "AccountDoesNotExist", NoAccountData = "NoAccountData", InvalidInput = "InvalidInput", InvalidDomain = "InvalidDomain", MissingVerifier = "MissingVerifier", PythFeedNotFound = "PythFeedNotFound", InvalidRoa = "InvalidRoa", InvalidParent = "InvalidParent", NftAccountNotFound = "NftRecordNotFound", PdaOwnerNotAllowed = "PdaOwnerNotAllowed", DomainDoesNotExist = "DomainDoesNotExist", RecordMalformed = "RecordMalformed", CouldNotFindNftOwner = "CouldNotFindNftOwner", InvalidValidation = "InvalidValidation", InvalidSerializedData = "InvalidSerializedData", UnsupportedTld = "UnsupportedTld", DomainExpired = "DomainExpired", CouldNotFindSrsOwner = "CouldNotFindSrsOwner", SnsSolResolutionMismatch = "SnsSolResolutionMismatch" } /** Base error thrown by SNS SDK operations. Inspect `type` for a stable error code. */ declare class SNSError extends Error { type: ErrorType; constructor(type: ErrorType, message?: string); } /** Thrown when a subdomain name is malformed or unsupported. */ declare class InvalidSubdomainError extends SNSError { constructor(message?: string); } /** Thrown when an address has no configured primary domain. */ declare class PrimaryDomainNotFoundError extends SNSError { constructor(message?: string); } /** Thrown when a requested record account has no readable data. */ declare class NoRecordDataError extends SNSError { constructor(message?: string); } /** Thrown when record content fails format validation. */ declare class InvalidRecordDataError extends SNSError { constructor(message?: string); } /** Thrown when an EVM address is invalid for a record operation. */ declare class InvalidEvmAddressError extends SNSError { constructor(message?: string); } /** Thrown when an Injective address is invalid for a record operation. */ declare class InvalidInjectiveAddressError extends SNSError { constructor(message?: string); } /** Thrown when an IPv4 record value is invalid. */ declare class InvalidARecordError extends SNSError { constructor(message?: string); } /** Thrown when an IPv6 record value is invalid. */ declare class InvalidAAAARecordError extends SNSError { constructor(message?: string); } /** Thrown when record creation or update input is incomplete or invalid. */ declare class InvalidRecordInputError extends SNSError { constructor(message?: string); } /** Thrown when a required on-chain account does not exist. */ declare class AccountDoesNotExistError extends SNSError { constructor(message?: string); } /** Thrown when an existing account has no readable data. */ declare class NoAccountDataError extends SNSError { constructor(message?: string); } /** Thrown when a general SDK input contract is not met. */ declare class InvalidInputError extends SNSError { constructor(message?: string); } /** Thrown when a domain name is malformed or invalid. */ declare class InvalidDomainError extends SNSError { constructor(message?: string); } /** Thrown when required record verification data is missing. */ declare class MissingVerifierError extends SNSError { constructor(message?: string); } /** Thrown when no Pyth price feed is configured for a mint. */ declare class PythFeedNotFoundError extends SNSError { constructor(message?: string); } /** Thrown when a Right of Association proof is invalid. */ declare class InvalidRoaError extends SNSError { constructor(message?: string); } /** Thrown when a required parent domain account cannot be resolved. */ declare class InvalidParentError extends SNSError { constructor(message?: string); } /** Thrown when an expected SNS NFT account cannot be found. */ declare class NftAccountNotFoundError extends SNSError { constructor(message?: string); } /** Thrown when a program-derived address is not an allowed owner. */ declare class PdaOwnerNotAllowedError extends SNSError { constructor(message?: string); } /** Thrown when a requested SNS domain account does not exist. */ declare class DomainDoesNotExistError extends SNSError { constructor(message?: string); } /** Thrown when serialized record data cannot be decoded safely. */ declare class RecordMalformedError extends SNSError { constructor(message?: string); } /** Thrown when the owner of an SNS NFT cannot be determined. */ declare class CouldNotFindNftOwnerError extends SNSError { constructor(message?: string); } /** Thrown when an unsupported record validation mode is encountered. */ declare class InvalidValidationError extends SNSError { constructor(message?: string); } /** Thrown when serialized account or record data is inconsistent. */ declare class InvalidSerializedDataError extends SNSError { constructor(message?: string); } /** Thrown when a domain does not use a supported top-level domain. */ declare class UnsupportedTldError extends SNSError { constructor(message?: string); } /** Thrown when a Solana Registration Service domain has expired. */ declare class DomainExpiredError extends SNSError { constructor(message?: string); } /** Thrown when a Solana Registration Service domain owner cannot be resolved. */ declare class CouldNotFindSrsOwnerError extends SNSError { constructor(message?: string); } /** Thrown when .sns and .sol resolve the same domain to different addresses. */ declare class SnsSolResolutionMismatchError extends SNSError { constructor(message?: string); } /** * Input for allocating and writing an SNS V2 record. * * @example * ```ts * const params: AllocateAndPostRecordInstructionParams = { record, content }; * ``` */ interface AllocateAndPostRecordInstructionParams { /** Encoded V2 record label. */ record: string; /** Serialized record content. */ content: ReadonlyUint8Array; } /** Builder for allocating and writing an SNS V2 record account. */ declare class AllocateAndPostRecordInstruction { /** Instruction discriminator. */ tag: number; /** Encoded V2 record label. */ record: string; /** Serialized record content. */ content: ReadonlyUint8Array; static schema: { struct: { tag: string; record: string; content: { array: { type: string; }; }; }; }; constructor(obj: AllocateAndPostRecordInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, payer: Address, record: Address, domainAddress: Address, domainOwner: Address, centralState: Address): Instruction; } /** Builder for burning an SNS domain NFT and registry account. */ declare class BurnDomainInstruction { /** Instruction discriminator. */ tag: number; static schema: { struct: { tag: string; }; }; constructor(); serialize(): Uint8Array; getInstruction(programAddress: Address, nameServiceId: Address, systemProgram: Address, domainAddress: Address, reverse: Address, resellingState: Address, state: Address, centralState: Address, owner: Address, target: Address): Instruction; } /** * Creates an idempotent associated-token-account instruction. * * The instruction succeeds when the associated token account already exists, * allowing callers to include it safely before token transfers. * * @param programAddress Associated Token Program address * @param payer Account funding associated token account creation * @param ata Derived associated token account address * @param owner Owner of the associated token account * @param mint Token mint for the associated token account * @param systemProgram Solana System Program address * @param splTokenProgram SPL Token Program address * @returns Idempotent associated-token-account creation instruction * * @example * ```ts * const instruction = _createAtaIdempotentInstruction( * ASSOCIATED_TOKEN_PROGRAM_ADDRESS, * payer, * ata, * owner, * mint, * SYSTEM_PROGRAM_ADDRESS, * TOKEN_PROGRAM_ADDRESS, * ); * ``` */ declare const _createAtaIdempotentInstruction: (programAddress: Address, payer: Address, ata: Address, owner: Address, mint: Address, systemProgram: Address, splTokenProgram: Address) => Instruction; /** * Input for creating an SNS name-registry account. * * @example * ```ts * const params: CreateNameRegistryInstructionParams = { nameHash, lamports, space: 32 }; * ``` */ interface CreateNameRegistryInstructionParams { /** Hash of the registry name. */ nameHash: Uint8Array; /** Account funding amount. */ lamports: bigint; /** Account data size in bytes. */ space: number; } /** Builder for creating an SNS name-registry account. */ declare class CreateNameRegistryInstruction { /** Instruction discriminator. */ tag: number; /** Hash of the registry name. */ nameHash: Uint8Array; /** Account funding amount. */ lamports: bigint; /** Account data size in bytes. */ space: number; static schema: { struct: { tag: string; nameHash: { array: { type: string; }; }; lamports: string; space: string; }; }; constructor(obj: CreateNameRegistryInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, domainAddress: Address, owner: Address, payer: Address, classAddress?: Address, parentAddress?: Address, parentOwner?: Address): Instruction; } /** * Input for creating an SNS reverse-lookup account. * * @example * ```ts * const params: CreateReverseInstructionParams = { domain: "example" }; * ``` */ interface CreateReverseInstructionParams { /** Raw reverse lookup payload. */ domain: string; } /** Builder for creating an SNS reverse-lookup account. */ declare class CreateReverseInstruction { /** Instruction discriminator. */ tag: number; /** Raw reverse lookup payload. */ domain: string; static schema: { struct: { tag: string; domain: string; }; }; constructor(obj: CreateReverseInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, namingServiceProgram: Address, rootDomain: Address, reverseLookup: Address, systemProgram: Address, centralState: Address, payer: Address, rentSysvar: Address, parentAddress?: Address, parentOwner?: Address): Instruction; } /** * Input for creating a split SNS V2 domain account. * * @example * ```ts * const params: CreateSplitV2InstructionParams = { name: "example", space: 1_000, referrerIdxOpt: null }; * ``` */ interface CreateSplitV2InstructionParams { /** TLD-less domain name. */ name: string; /** Account data size in bytes. */ space: number; /** Approved referrer index, if any. */ referrerIdxOpt: number | null; } /** Builder for creating a split SNS V2 domain account. */ declare class CreateSplitV2Instruction { /** Instruction discriminator. */ tag: number; /** TLD-less domain name. */ name: string; /** Account data size in bytes. */ space: number; /** Approved referrer index, if any. */ referrerIdxOpt: number | null; static schema: { struct: { tag: string; name: string; space: string; referrerIdxOpt: { option: string; }; }; }; constructor(obj: CreateSplitV2InstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, namingServiceProgram: Address, rootDomain: Address, name: Address, reverseLookup: Address, systemProgram: Address, centralState: Address, buyer: Address, domainOwner: Address, feePayer: Address, buyerTokenSource: Address, pythFeedAccount: Address, vault: Address, splTokenProgram: Address, rentSysvar: Address, state: Address, referrerAccountOpt?: Address): Instruction; } /** * Input for registering an SNS domain backed by an NFT. * * @example * ```ts * const params: CreateWithNftInstructionParams = { name: "example", space: 1_000 }; * ``` */ interface CreateWithNftInstructionParams { /** TLD-less domain name. */ name: string; /** Account data size in bytes. */ space: number; } /** Builder for registering an SNS domain backed by an NFT. */ declare class CreateWithNftInstruction { /** Instruction discriminator. */ tag: number; /** TLD-less domain name. */ name: string; /** Account data size in bytes. */ space: number; static schema: { struct: { tag: string; name: string; space: string; }; }; constructor(obj: CreateWithNftInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, namingServiceProgram: Address, rootDomain: Address, name: Address, reverseLookup: Address, systemProgram: Address, centralState: Address, buyer: Address, nftSource: Address, nftMetadata: Address, nftMint: Address, masterEdition: Address, collection: Address, splTokenProgram: Address, rentSysvar: Address, state: Address, mplTokenMetadata: Address): Instruction; } /** Builder for deleting an SNS name-registry account. */ declare class DeleteNameRegistryInstruction { /** Instruction discriminator. */ tag: number; static schema: { struct: { tag: string; }; }; constructor(); serialize(): Uint8Array; getInstruction(programAddress: Address, domainAddress: Address, refundTarget: Address, owner: Address): Instruction; } /** Builder for deleting an SNS V2 record account. */ declare class DeleteRecordInstruction { /** Instruction discriminator. */ tag: number; static schema: { struct: { tag: string; }; }; constructor(); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, payer: Address, record: Address, domainAddress: Address, domainOwner: Address, centralState: Address): Instruction; } /** * Input for reallocating an SNS name-registry account. * * @example * ```ts * const params: ReallocInstructionParams = { space: 1_000 }; * ``` */ interface ReallocInstructionParams { /** New account data size in bytes. */ space: number; } /** Builder for reallocating an SNS name-registry account. */ declare class ReallocInstruction { /** Instruction discriminator. */ tag: number; /** New account data size in bytes. */ space: number; static schema: { struct: { tag: string; space: string; }; }; constructor(obj: ReallocInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgramId: Address, payerKey: Address, nameAccountKey: Address, nameOwnerKey: Address): Instruction; } /** Builder for registering an address's SNS primary domain. */ declare class RegisterPrimaryInstruction { /** Instruction discriminator. */ tag: number; static schema: { struct: { tag: string; }; }; constructor(); serialize(): Uint8Array; getInstruction(programAddress: Address, nameAccount: Address, primaryAccount: Address, owner: Address, systemProgram: Address, optParent?: Address): Instruction; } /** * Input for transferring an SNS name-registry account. * * @example * ```ts * const params: TransferInstructionParams = { newOwner }; * ``` */ interface TransferInstructionParams { /** New registry owner. */ newOwner: Address; } /** Builder for the SNS name-registry transfer instruction. */ declare class TransferInstruction { /** Instruction discriminator. */ tag: number; /** Encoded new owner address. */ encodedNewOwnerAddress: ReadonlyUint8Array; static schema: { struct: { tag: string; encodedNewOwnerAddress: { array: { type: string; len: number; }; }; }; }; constructor(obj: TransferInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, domainAddress: Address, currentOwner: Address, classAddress?: Address, parentAddress?: Address, parentOwner?: Address): Instruction; } /** * Input for updating an SNS name-registry account. * * @example * ```ts * const params: UpdateNameRegistryInstructionParams = { offset: 0, inputData }; * ``` */ interface UpdateNameRegistryInstructionParams { /** Byte offset where the update begins. */ offset: number; /** Bytes to write. */ inputData: Uint8Array; } /** Builder for updating the data of an SNS name-registry account. */ declare class UpdateNameRegistryInstruction { /** Instruction discriminator. */ tag: number; /** Byte offset where the update begins. */ offset: number; /** Bytes to write. */ inputData: Uint8Array; static schema: { struct: { tag: string; offset: string; inputData: { array: { type: string; }; }; }; }; constructor(obj: UpdateNameRegistryInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, domainAddress: Address, signer: Address): Instruction; } /** * Input for updating an SNS V2 record account. * * @example * ```ts * const params: UpdateRecordInstructionParams = { record, content }; * ``` */ interface UpdateRecordInstructionParams { /** Encoded V2 record label. */ record: string; /** Serialized record content. */ content: ReadonlyUint8Array; } /** Builder for updating content in an SNS V2 record account. */ declare class UpdateRecordInstruction { /** Instruction discriminator. */ tag: number; /** Encoded V2 record label. */ record: string; /** Serialized record content. */ content: ReadonlyUint8Array; static schema: { struct: { tag: string; record: string; content: { array: { type: string; }; }; }; }; constructor(obj: UpdateRecordInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address): Instruction; } /** * Input for validating an Ethereum signature for an SNS record. * * @example * ```ts * const params: ValidateEthereumSignatureInstructionParams = { validation, signature, expectedPubkey }; * ``` */ interface ValidateEthereumSignatureInstructionParams { /** Validation mode discriminator. */ validation: number; /** Ethereum signature. */ signature: ReadonlyUint8Array; /** Expected Ethereum public key. */ expectedPubkey: ReadonlyUint8Array; } /** Builder for validating an Ethereum signature for an SNS record. */ declare class ValidateEthereumSignatureInstruction { /** Instruction discriminator. */ tag: number; /** Validation mode discriminator. */ validation: number; /** Ethereum signature. */ signature: ReadonlyUint8Array; /** Expected Ethereum public key. */ expectedPubkey: ReadonlyUint8Array; static schema: { struct: { tag: string; validation: string; signature: { array: { type: string; }; }; expectedPubkey: { array: { type: string; }; }; }; }; constructor(obj: ValidateEthereumSignatureInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address): Instruction; } /** * Input for validating a Solana signature for an SNS record. * * @example * ```ts * const params: ValidateSolanaSignatureInstructionParams = { staleness: false }; * ``` */ interface ValidateSolanaSignatureInstructionParams { /** Whether to validate staleness. */ staleness: boolean; } /** Builder for validating a Solana signature for an SNS record. */ declare class ValidateSolanaSignatureInstruction { /** Instruction discriminator. */ tag: number; /** Whether to validate staleness. */ staleness: boolean; static schema: { struct: { tag: string; staleness: string; }; }; constructor(obj: ValidateSolanaSignatureInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address, verifier: Address): Instruction; } /** * Input for setting an SNS record's Right of Association verifier. * * @example * ```ts * const params: SetRecordRoaVerifierInstructionParams = { verifier }; * ``` */ interface SetRecordRoaVerifierInstructionParams { /** Verifier account address. */ verifier: Address; } /** Builder for setting an SNS record's Right of Association verifier. */ declare class SetRecordRoaVerifierInstruction { /** Instruction discriminator. */ tag: number; /** Encoded verifier address. */ roaId: ReadonlyUint8Array; static schema: { struct: { tag: string; roaId: { array: { type: string; }; }; }; }; constructor(obj: SetRecordRoaVerifierInstructionParams); serialize(): Uint8Array; getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address): Instruction; } /** * Parameters for deriving an SNS NFT mint. * * @example * ```ts * const params: GetSnsNftMintParams = { domainAddress }; * ``` */ interface GetSnsNftMintParams { /** Tokenized domain account address. */ domainAddress: Address; } /** * Derives the mint address of a tokenized SNS domain. * * @param params NFT mint derivation parameters * @param params.domainAddress Domain account address used to derive the NFT mint * @returns The derived SNS domain NFT mint address. * * @example * ```ts * const mint = await getSnsNftMint({ domainAddress }); * ``` */ declare const getSnsNftMint: ({ domainAddress }: GetSnsNftMintParams) => Promise>; /** * Parameters for retrieving an SNS NFT owner. * * @example * ```ts * const params: GetSnsNftOwnerParams = { rpc, domainAddress }; * ``` */ interface GetSnsNftOwnerParams { /** RPC client. */ rpc: Rpc; /** Tokenized domain account address. */ domainAddress: Address; } /** * Retrieves the owner of a tokenized SNS domain. * * @param params NFT owner retrieval parameters * @param params.rpc RPC client implementing account and token-largest-account APIs * @param params.domainAddress Domain account address whose tokenized owner is retrieved * @returns The SNS domain NFT owner address, or `null` when no valid tokenized owner is found. * * @example * ```ts * const owner = await getSnsNftOwner({ rpc, domainAddress }); * ``` */ declare const getSnsNftOwner: ({ rpc, domainAddress, }: GetSnsNftOwnerParams) => Promise
; /** * Parameters for deriving a V1 record address. * * @example * ```ts * const params: GetRecordV1AddressParams = { domain: "example", record: Record.Url }; * ``` */ interface GetRecordV1AddressParams { /** TLD-less domain name. */ domain: string; /** Record type. */ record: Record; } /** * Derives the address of a V1 record account. * * The V1 account is derived by prefixing the record label to the domain name. * * @param params Record address derivation parameters * @param params.domain TLD-trimmed SNS domain name * @param params.record Record type * @returns The derived V1 record account address. * * @example * ```ts * const address = await getRecordV1Address({ domain: "example", record: Record.Url }); * ``` */ declare const getRecordV1Address: ({ domain, record, }: GetRecordV1AddressParams) => Promise<_solana_addresses.Address>; /** * Parameters for deriving a V2 record address. * * @example * ```ts * const params: GetRecordV2AddressParams = { domain: "example", record: Record.Url }; * ``` */ interface GetRecordV2AddressParams { /** TLD-less domain name. */ domain: string; /** Record type. */ record: Record; } /** * Derives the address of a V2 record account. * * @param params Record address derivation parameters * @param params.domain TLD-trimmed SNS domain name * @param params.record Record type * @returns The derived V2 record account address. * * @example * ```ts * const address = await getRecordV2Address({ domain: "example", record: Record.Url }); * ``` */ declare const getRecordV2Address: ({ domain, record, }: GetRecordV2AddressParams) => Promise
; /** * Internal helper that derives the default verifier for a record state. * * @param params Default verifier parameters * @param params.record Record type * @param params.state Record state * @returns The default verifier, or `undefined` when no verifier is found. * * @example * ```ts * const verifier = _getDefaultVerifier({ record: Record.Url, state }); * ``` */ declare const _getDefaultVerifier: ({ record, state, }: { record: Record; state: RecordState; }) => Uint8Array | ReadonlyUint8Array | undefined; /** * Internal helper that verifies a record's Right of Association validation. * * Ethereum/secp256k1 validation is used for EVM RoA records; Solana validation * is used otherwise. * * @param params Right of Association verification parameters * @param params.record Record type to verify * @param params.state Record state * @param params.verifier Verifier for the record * @returns True if the association is valid, false otherwise. * * @example * ```ts * const valid = _verifyRoaSync({ record: Record.Url, state, verifier }); * ``` */ declare const _verifyRoaSync: ({ record, state, verifier, }: { record: Record; state: RecordState; verifier: ReadonlyUint8Array; }) => boolean; /** * Verifies a record's Right of Association validation. * * @param rpc RPC client implementing account and token-largest-account APIs * @param domain Full domain name including a `.sns` or `.sol` suffix * @param record Record type to verify * @param verifier Optional verifier for the record. If omitted, a default verifier is derived * @returns True if the association is valid, false otherwise. * @throws MissingVerifierError If no verifier is specified and no default verifier is found. * * @example * ```ts * const valid = await verifyRecordRightOfAssociation(rpc, "example.sns", Record.Url); * ``` */ declare const verifyRecordRightOfAssociation: (rpc: Rpc, domain: string, record: Record, verifier?: ReadonlyUint8Array) => Promise; /** * Internal helper that verifies a record's staleness validation. * * @param params Staleness verification parameters * @param params.domainOwner Current owner of the domain * @param params.state Record state to verify * @returns True if the record's staleness validation passes, false otherwise. * * @example * ```ts * const valid = _verifyStalenessSync({ domainOwner, state }); * ``` */ declare const _verifyStalenessSync: ({ domainOwner, state, }: { domainOwner: Address; state: RecordState; }) => boolean; /** * Parameters for verifying record staleness. * * @example * ```ts * const params: VerifyRecordStalenessParams = { * rpc, * domain: "example.sns", * record: Record.Url, * }; * ``` */ interface VerifyRecordStalenessParams { /** RPC client. */ rpc: Rpc; /** Full domain name. */ domain: string; /** Record type. */ record: Record; } /** * Verifies a record's staleness validation. * * @param params Staleness verification parameters * @param params.rpc RPC client implementing account and token-largest-account APIs * @param params.domain Full domain name including a `.sns` or `.sol` suffix * @param params.record Record type to verify * @returns True if the record's staleness validation passes, false otherwise. * * @example * ```ts * const valid = await verifyRecordStaleness({ rpc, domain: "example.sns", record: Record.Url }); * ``` */ declare const verifyRecordStaleness: ({ rpc, domain, record, }: VerifyRecordStalenessParams) => Promise; /** Tags identifying the SNS NFT state variant. */ declare enum NftTag { Uninitialized = 0, CentralState = 1, ActiveRecord = 2, InactiveRecord = 3 } /** * Input for decoding an SNS NFT account. * * @example * ```ts * const params: NftStateParams = { tag: 2, nonce: 0, nameAccount, owner, nftMint }; * ``` */ interface NftStateParams { /** NFT state tag. */ tag: number; /** NFT record nonce. */ nonce: number; /** Encoded SNS domain account address. */ nameAccount: Uint8Array; /** Encoded NFT owner address. */ owner: Uint8Array; /** Encoded NFT mint address. */ nftMint: Uint8Array; } /** Decoded state of an SNS NFT account. */ declare class NftState { /** NFT state tag. */ tag: NftTag; /** NFT record nonce. */ nonce: number; /** SNS domain account address. */ nameAccount: Address; /** NFT owner address. */ owner: Address; /** NFT mint address. */ nftMint: Address; static schema: { struct: { tag: string; nonce: string; nameAccount: { array: { type: string; len: number; }; }; owner: { array: { type: string; len: number; }; }; nftMint: { array: { type: string; len: number; }; }; }; }; static LEN: number; constructor(obj: NftStateParams); static deserialize(data: Uint8Array): NftState; static retrieve(rpc: Rpc, address: Address): Promise; static retrieveFromMint(rpc: Rpc, mint: Address): Promise; static getAddress(domainAddress: Address): Promise
; } /** * Input for decoding an SNS primary-domain account. * * @example * ```ts * const params: PrimaryDomainStateParams = { tag: 0, nameAccount }; * ``` */ interface PrimaryDomainStateParams { /** Account state tag. */ tag: number; /** Encoded primary domain account address. */ nameAccount: Uint8Array; } /** Decoded state of an SNS primary-domain account. */ declare class PrimaryDomainState { /** Account state tag. */ tag: number; /** Primary domain account address. */ nameAccount: Address; static schema: { struct: { tag: string; nameAccount: { array: { type: string; len: number; }; }; }; }; constructor(obj: PrimaryDomainStateParams); static deserialize(data: Uint8Array): PrimaryDomainState; static retrieve(rpc: Rpc, address: Address): Promise; static _retrieveBatch(rpc: Rpc, primaryAddresses: Address[]): Promise<(PrimaryDomainState | undefined)[]>; static retrieveBatch(rpc: Rpc, primaryAddresses: Address[]): Promise<(PrimaryDomainState | undefined)[]>; static getAddress(programAddress: Address, walletAddress: Address): Promise>; } /** * Input for decoding an SNS name-registry account. * * @example * ```ts * const params: RegistryStateParams = { parentName, owner, class: classAddress }; * ``` */ interface RegistryStateParams { /** Encoded parent registry address. */ parentName: Uint8Array; /** Encoded registry owner address. */ owner: Uint8Array; /** Encoded registry class address. */ class: Uint8Array; } /** Decoded state of an SNS name-registry account. */ declare class RegistryState { /** Parent registry address. */ parentName: Address; /** Registry owner address. */ owner: Address; /** Registry class address. */ class: Address; /** Registry data after the fixed header. */ data: Uint8Array | undefined; static schema: { struct: { parentName: { array: { type: string; len: number; }; }; owner: { array: { type: string; len: number; }; }; class: { array: { type: string; len: number; }; }; }; }; static HEADER_LEN: number; constructor(obj: RegistryStateParams); static deserialize(data: Uint8Array): RegistryState; static retrieve(rpc: Rpc, address: Address): Promise; static _retrieveBatch(rpc: Rpc, domainAddresses: Address[]): Promise<(RegistryState | undefined)[]>; static retrieveBatch(rpc: Rpc, domainAddresses: Address[]): Promise<(RegistryState | undefined)[]>; } /** * Returns whether a Solana address represents a valid Ed25519 curve point. * * @param address Solana address to validate * @returns Whether the address is an Ed25519 curve point * * @example * ```ts * const onCurve = checkAddressOnCurve(address); * ``` */ declare function checkAddressOnCurve(address: Address): boolean; /** * Parameters for deserializing record content. * * @example * ```ts * const params: DeserializeRecordContentParams = { content, record: Record.Url }; * ``` */ interface DeserializeRecordContentParams { /** Serialized record content. */ content: ReadonlyUint8Array; /** Record type. */ record: Record; } /** * Deserializes record content according to SNS-IP 1. * * `CNAME` and `TXT` content is punycode-decoded after UTF-8 deserialization. * * @param params Record deserialization parameters * @param params.content Serialized record content * @param params.record Record type * @returns Deserialized record content. * @throws InvalidRecordDataError If the record type or content is unsupported. * * @example * ```ts * const result = await getDomainRecord({ * rpc, * domain: "example.sns", * record: Record.Url, * }); * const content = deserializeRecordContent({ * content: result.retrievedRecord.getContent(), * record: Record.Url, * }); * ``` */ declare const deserializeRecordContent: ({ content, record, }: DeserializeRecordContentParams) => string; /** * Parameters for deserializing reverse account data. * * @example * ```ts * const params: DeserializeReverseParams = { data: reverseAccountData }; * ``` */ interface DeserializeReverseParams { /** Reverse account data. */ data: ReadonlyUint8Array | undefined; /** Whether to remove a subdomain's leading null byte. Defaults to false. */ trimFirstNullByte?: boolean; } /** * Deserializes reverse account data. * * The first four bytes encode the reverse name length. * * @param params Reverse deserialization parameters * @param params.data Reverse account data. If undefined, returns undefined * @param params.trimFirstNullByte Whether to trim the first null byte for subdomain reverse names. Defaults to false * @returns The deserialized string, or `undefined` if data is undefined. * * @example * ```ts * const name = deserializeReverse({ data: reverseAccountData }); * ``` */ declare function deserializeReverse({ data, trimFirstNullByte, }: DeserializeReverseParams): string; declare function deserializeReverse({ data, trimFirstNullByte, }: DeserializeReverseParams): undefined; /** * Parameters for deriving a Pyth feed address. * * @example * ```ts * const params: GetPythFeedAddressParams = { shard: 0, priceFeed }; * ``` */ interface GetPythFeedAddressParams { /** Pyth feed shard number. */ shard: number; /** Pyth price feed ID bytes. */ priceFeed: number[]; } /** * Derives the Pyth feed PDA for a shard and price feed. * * @param params Pyth feed derivation parameters * @param params.shard Shard number associated with the Pyth feed * @param params.priceFeed Feed ID bytes * @returns The Pyth feed address. * * @example * ```ts * const address = await getPythFeedAddress({ shard: 0, priceFeed }); * ``` */ declare const getPythFeedAddress: ({ shard, priceFeed, }: GetPythFeedAddressParams) => Promise<_solana_addresses.Address>; /** * Derives the reverse lookup account address for a TLD-trimmed SNS domain. * * @param domain TLD-trimmed SNS domain name * @returns The reverse lookup account address. * * @example * ```ts * const address = await getReverseAddress("example"); * ``` */ declare const getReverseAddress: (domain: string) => Promise<_solana_addresses.Address>; /** * Parameters for deriving a reverse lookup address. * * @example * ```ts * const params: GetReverseAddressFromDomainAddressParams = { domainAddress }; * ``` */ interface GetReverseAddressFromDomainAddressParams { /** Domain account address. */ domainAddress: Address; /** Parent domain address for a subdomain. */ parentAddress?: Address; } /** * Derives the reverse lookup account address from a domain address. * * @param params Reverse lookup derivation parameters * @param params.domainAddress Domain account address to reverse look up * @param params.parentAddress Optional parent address for subdomain reverse lookups * @returns The reverse lookup account address. * * @example * ```ts * const address = await getReverseAddressFromDomainAddress({ domainAddress }); * ``` */ declare const getReverseAddressFromDomainAddress: ({ domainAddress, parentAddress, }: GetReverseAddressFromDomainAddressParams) => Promise
; /** * Parameters for reverse lookup. * * @example * ```ts * const params: ReverseLookupParams = { rpc, domainAddress }; * ``` */ interface ReverseLookupParams { /** RPC client. */ rpc: Rpc; /** Domain account address. */ domainAddress: Address; /** Parent domain address for a subdomain. */ parentAddress?: Address; } /** * Performs a reverse lookup for a domain address. * * @param params Reverse lookup parameters * @param params.rpc RPC client implementing account lookup * @param params.domainAddress Domain address to reverse look up * @param params.parentAddress Optional parent domain address for subdomain reverse lookups * @returns Human-readable domain name. * @throws NoAccountDataError If the registry data is empty. * * @example * ```ts * const name = await reverseLookup({ rpc, domainAddress }); * ``` */ declare function reverseLookup({ rpc, domainAddress, parentAddress, }: ReverseLookupParams): Promise; /** * Parameters for batch reverse lookup. * * @example * ```ts * const params: ReverseLookupBatchParams = { rpc, domainAddresses }; * ``` */ interface ReverseLookupBatchParams { /** RPC client. */ rpc: Rpc; /** Domain account addresses. */ domainAddresses: Address[]; } /** * Performs reverse lookups for domain addresses. * * @param params Reverse lookup parameters * @param params.rpc RPC client implementing multiple-account lookup * @param params.domainAddresses Domain addresses to reverse look up * @returns Human-readable domain names, or `undefined` when reverse account data is unavailable. * * @example * ```ts * const domains = await reverseLookupBatch({ rpc, domainAddresses }); * ``` */ declare function reverseLookupBatch({ rpc, domainAddresses, }: ReverseLookupBatchParams): Promise<(string | undefined)[]>; /** * Parameters for serializing record content. * * @example * ```ts * const params: SerializeRecordContentParams = { * content: "https://example.com", * record: Record.Url, * }; * ``` */ interface SerializeRecordContentParams { /** Record content. */ content: string; /** Record type. */ record: Record; } /** * Serializes record content according to SNS-IP 1. * * `CNAME` and `TXT` content is punycode-encoded before UTF-8 serialization. * * @param params Record serialization parameters * @param params.content Record content to serialize * @param params.record Record type * @returns Serialized record content. * @throws InvalidEvmAddressError, InvalidInjectiveAddressError, InvalidARecordError, * InvalidAAAARecordError, or InvalidRecordInputError when the record content is invalid or unsupported. * * @example * ```ts * const content = serializeRecordContent({ * content: "https://example.com", * record: Record.Url, * }); * ``` */ declare const serializeRecordContent: ({ content, record, }: SerializeRecordContentParams) => ReadonlyUint8Array; /** The Solana Name Service top-level domain. */ declare const SOL_TLD = ".sol"; /** The Bonfida SNS top-level domain. */ declare const SNS_TLD = ".sns"; /** A top-level domain supported by this SDK. */ type SupportedTld = typeof SNS_TLD | typeof SOL_TLD; /** TLD suffixes accepted by the domain parsing and resolution helpers. */ declare const SUPPORTED_TLDS: readonly SupportedTld[]; /** * Returns the matching TLD from `supportedTlds` if `domain` ends with one, * or `undefined` otherwise. * * @param domain Domain name to inspect * @param supportedTlds Supported suffixes to match against * @returns The matching suffix, or `undefined` when none match. * * @example * ```ts * const tld = getTld("example.sns"); * ``` */ declare const getTld: (domain: string, supportedTlds?: readonly string[]) => string | undefined; /** * Ensures `domain` ends with one of the `supportedTlds` and strips that suffix. * * @param domain Domain name to parse * @param supportedTlds Supported suffixes to match against * @returns Domain name without suffix and the matching suffix. * @throws UnsupportedTldError If no supported suffix matches. * * @example * ```ts * const [domain, tld] = parseSupportedTld("example.sns"); * ``` */ declare const parseSupportedTld: (domain: string, supportedTlds?: readonly string[]) => [string, string]; /** * Ensures `domain` ends with `.sns` and strips that suffix. * * @param domain Domain name to parse * @returns Domain name without suffix and the `.sns` suffix. * @throws UnsupportedTldError If the domain does not end with `.sns`. * * @example * ```ts * const [domain] = parseSnsTld("example.sns"); * ``` */ declare const parseSnsTld: (domain: string) => [string, string]; export { AccountDoesNotExistError, AllocateAndPostRecordInstruction, BurnDomainInstruction, CENTRAL_STATE, CENTRAL_STATE_DOMAIN_RECORDS, CouldNotFindNftOwnerError, CouldNotFindSrsOwnerError, CreateNameRegistryInstruction, CreateReverseInstruction, CreateSplitV2Instruction, CreateWithNftInstruction, DEFAULT_ADDRESS, DeleteNameRegistryInstruction, DeleteRecordInstruction, DomainDoesNotExistError, DomainExpiredError, ETH_ROA_RECORDS, EVM_RECORDS, ErrorType, FIDA_MINT, GUARDIANS, InvalidAAAARecordError, InvalidARecordError, InvalidDomainError, InvalidEvmAddressError, InvalidInjectiveAddressError, InvalidInputError, InvalidParentError, InvalidRecordDataError, InvalidRecordInputError, InvalidRoaError, InvalidSerializedDataError, InvalidSubdomainError, InvalidValidationError, METAPLEX_PROGRAM_ADDRESS, MissingVerifierError, NAME_OFFERS_ADDRESS, NAME_PROGRAM_ADDRESS, NAME_REGISTRY_LEN, NAME_TOKENIZER_ADDRESS, NftAccountNotFoundError, NftState, NftTag, NoAccountDataError, NoRecordDataError, PYTH_FEEDS, PYTH_PROGRAM_ID, PdaOwnerNotAllowedError, PrimaryDomainNotFoundError, PrimaryDomainState, PythFeedNotFoundError, RECORDS_PROGRAM_ADDRESS, RECORD_V1_SIZE, REFERRERS, REGISTRY_PROGRAM_ADDRESS, REVERSE_LOOKUP_CLASS, ReallocInstruction, Record, RecordHeaderState, RecordMalformedError, RecordState, RecordVersion, RegisterPrimaryInstruction, RegistryState, SELF_SIGNED_RECORDS, SNSError, SNS_ROOT_DOMAIN_ACCOUNT, SNS_TLD, SOL_SRS_CLASS, SOL_TLD, SRS_CENTRAL_STATE, SUPPORTED_TLDS, SYSTEM_PROGRAM_ADDRESS, SYSVAR_RENT_ADDRESS, SetRecordRoaVerifierInstruction, SnsSolResolutionMismatchError, TOKEN_PROGRAM_ADDRESS, TWITTER_ROOT_PARENT_REGISTRY_ADDRESS, TWITTER_VERIFICATION_AUTHORITY, TransferInstruction, USDC_MINT, UTF8_ENCODED_RECORDS, UnsupportedTldError, UpdateNameRegistryInstruction, UpdateRecordInstruction, VAULT_OWNER, ValidateEthereumSignatureInstruction, ValidateSolanaSignatureInstruction, Validation, WOLVES_COLLECTION_METADATA, _createAtaIdempotentInstruction, _getDefaultVerifier, _verifyRoaSync, _verifyStalenessSync, addressCodec, base58Codec, base64Codec, burnDomain, checkAddressOnCurve, createNameRegistry, createRecord, createReverse, createSubdomain, deleteNameRegistry, deleteRecord, deserializeRecordContent, deserializeReverse, getAllSnsDomains, getDomainOwner, getDomainRecord, getDomainRecords, getPrimaryDomain, getPrimaryDomainsBatch, getPythFeedAddress, getRecordV1Address, getRecordV2Address, getReverseAddress, getReverseAddressFromDomainAddress, getSnsDomainAddress, getSnsDomainsForAddress, getSnsNftMint, getSnsNftOwner, getSnsNftsForAddress, getSrsDomainAddress, getSubdomains, getTld, getValidationLength, parseSnsTld, parseSupportedTld, registerDomain, registerDomainWithNft, resolve, reverseLookup, reverseLookupBatch, safeResolve, serializeRecordContent, setPrimaryDomain, setRecordRoaVerifier, setRecordStalenessVerifier, tokenCodec, transferDomain, transferSubdomain, updateNameRegistry, updateRecord, utf8Codec, validateRecordRoa, validateRecordRoaEthereum, verifyRecordRightOfAssociation, verifyRecordStaleness }; export type { AllocateAndPostRecordInstructionParams, BurnDomainParams, CreateNameRegistryInstructionParams, CreateNameRegistryParams, CreateRecordParams, CreateReverseInstructionParams, CreateReverseParams, CreateSplitV2InstructionParams, CreateSubdomainParams, CreateWithNftInstructionParams, DeleteNameRegistryParams, DeleteRecordParams, DeserializeRecordContentParams, DeserializeReverseParams, GetAllSnsDomainsParams, GetAllSnsDomainsResult, GetDomainOwnerParams, GetDomainRecordOptions, GetDomainRecordParams, GetDomainRecordResult, GetDomainRecordVerification, GetDomainRecordsOptions, GetDomainRecordsParams, GetDomainRecordsResult, GetDomainRecordsVerification, GetPrimaryDomainParams, GetPrimaryDomainResult, GetPrimaryDomainsBatchParams, GetPythFeedAddressParams, GetRecordV1AddressParams, GetRecordV2AddressParams, GetReverseAddressFromDomainAddressParams, GetSnsDomainAddressParams, GetSnsDomainAddressResult, GetSnsDomainsForAddressParams, GetSnsDomainsForAddressResult, GetSnsNftMintParams, GetSnsNftOwnerParams, GetSnsNftsForAddressParams, GetSnsNftsForAddressResult, GetSrsDomainAddressParams, GetSrsDomainAddressResult, GetSubdomainsParams, GetSubdomainsResult, NftStateParams, PrimaryDomainStateParams, ReallocInstructionParams, RecordHeaderStateParams, RecordVerificationParams, RegisterDomainParams, RegisterDomainWithNftParams, RegistryStateParams, ResolveOptions, ResolveParams, ReverseLookupBatchParams, ReverseLookupParams, SerializeRecordContentParams, SetPrimaryDomainParams, SetRecordRoaVerifierInstructionParams, SupportedTld, TransferDomainParams, TransferInstructionParams, TransferSubdomainParams, UpdateNameRegistryInstructionParams, UpdateNameRegistryParams, UpdateRecordInstructionParams, UpdateRecordParams, ValidateEthereumSignatureInstructionParams, ValidateRecordRoaEthereumParams, ValidateSolanaSignatureInstructionParams, VerifyRecordStalenessParams };