nfd

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNfdNotFound     = errors.New("nfd not found")
	ErrNFdIncompatible = errors.New("nfd incompatible")
	ErrNfdExpired      = errors.New("nfd expired")
	ErrNfdNotOwned     = errors.New("nfd not owned")
)

Functions

func FetchAlgoAddressesFromPackedValue

func FetchAlgoAddressesFromPackedValue(data []byte) ([]string, error)

FetchAlgoAddressesFromPackedValue returns all non-zero Algorand 32-byte PKs encoded in a value (up to 3)

func FetchBToIFromState

func FetchBToIFromState(appState []models.TealKeyValue, key string) (uint64, bool)

FetchBToIFromState fetches a specific key from application state - stored as big-endian 64-bit value Returns value,and whether it w found or not.

func FetchUInt64sFromPackedValue

func FetchUInt64sFromPackedValue(data []byte) ([]uint64, error)

FetchUInt64sFromPackedValue returns all non-zero 64-bit big-endian integers contained in the data slice.

func GetNFDSigNameLSIG

func GetNFDSigNameLSIG(nfdName string, registryAppID uint64) (crypto.LogicSigAccount, error)

func GetRegistryBoxNameForAddress

func GetRegistryBoxNameForAddress(algoAddress types.Address) []byte

GetRegistryBoxNameForAddress returns the registry box key for an Algorand address reverse lookup. The box key is sha256("addr/algo/" + raw32BytePublicKey).

func GetRegistryBoxNameForNFD

func GetRegistryBoxNameForNFD(nfdName string) []byte

func IsContractVersionAtLeast

func IsContractVersionAtLeast(version string, major, minor int) bool

func IsNFdExpired

func IsNFdExpired(props Properties) bool

func IsNfdOwned

func IsNfdOwned(nfdAppId uint64, props Properties) bool

func MergeNFDProperties

func MergeNFDProperties(properties map[string]string) map[string]string

MergeNFDProperties - take a set of 'split' values spread across multiple keys like address_00, address_01 and merge into single address value, combining the values into single 'address'.

func RawPKAsAddress

func RawPKAsAddress(byteData []byte) types.Address

RawPKAsAddress is simplified version of types.EncodeAddress and that returns Address type, not string verison.

Types

type NfdFetcher

type NfdFetcher interface {
	FetchNfdDnsVals(ctx context.Context, names []string) (map[string]Properties, error)
	FetchNfdDidVals(ctx context.Context, name string) (Properties, uint64, error)
	FindNFDsByAddress(ctx context.Context, address string) ([]string, error)
}

func NewNfdFetcher

func NewNfdFetcher(client *algod.Client, registryID uint64) NfdFetcher

NewNfdFetcher creates a new NfdFetcher for use outside the DNS plugin (e.g., DID resolver).

type Properties

type Properties struct {
	Internal    map[string]string `json:"internal"`
	UserDefined map[string]string `json:"userDefined"`
	Verified    map[string]string `json:"verified"`
}

func FetchAllStateAsNFDProperties

func FetchAllStateAsNFDProperties(appState []models.TealKeyValue, boxData map[string][]byte) Properties

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL