nfd

package
v0.0.0-...-923a9ec Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const NFDMainNetRegistryAppID uint64 = 760937186
View Source
const NFDTestNetRegistryAppID uint64 = 84366825

Variables

This section is empty.

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 ints contained in the slice (up to 15 for a single local-state fetch for example)

func FetchUint64sFromState

func FetchUint64sFromState(appState []models.TealKeyValue, key string) ([]uint64, error)

FetchUint64sFromState fetches a specific key from application state - stored as set of 64-bit values (up to 15) // Returns array of values, and optional error

func FindNFDAppIDByName

func FindNFDAppIDByName(algoClient *algod.Client, ctx context.Context, registryAppID uint64, nfdName string) (uint64, error)

func FindNFDAppIDsByAddress

func FindNFDAppIDsByAddress(algoClient *algod.Client, ctx context.Context, registryAppID uint64, lookupAddress string) ([]uint64, error)

func GetApplicationBoxes

func GetApplicationBoxes(algoClient *algod.Client, ctx context.Context, appID uint64) (map[string][]byte, error)

func GetIPFSData

func GetIPFSData(url string) ([]byte, error)

func GetNFDSigNameLSIG

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

func GetNFDSigRevAddressLSIG

func GetNFDSigRevAddressLSIG(pointedToAddress types.Address, registryAppID uint64) (crypto.LogicSigAccount, error)

func GetRegistryBoxNameForAddress

func GetRegistryBoxNameForAddress(algoAddress types.Address) []byte

func GetRegistryBoxNameForNFD

func GetRegistryBoxNameForNFD(nfdName string) []byte

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 PrintNFD

func PrintNFD(properties *NFDProperties)

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 NFDProperties

type NFDProperties struct {
	AppID       uint64            `json:"appID"`
	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) NFDProperties

func GetNFDData

func GetNFDData(algoClient *algod.Client, ctx context.Context, appID uint64) (*NFDProperties, error)

type NFDProvider

type NFDProvider struct {
	DB      *sqlx.DB
	Algod   *algod.Client
	SyncMap *sync.Map
	// contains filtered or unexported fields
}

func (*NFDProvider) CatchUp

func (p *NFDProvider) CatchUp(dbConn *sqlx.DB, algodClient *algod.Client, startingRound uint64, indexerClient *indexer.Client) error

func (*NFDProvider) Init

func (p *NFDProvider) Init(network string, dbConn *sqlx.DB, algodClient *algod.Client) error

func (*NFDProvider) IsProviderApp

func (p *NFDProvider) IsProviderApp(appID uint64) bool

func (*NFDProvider) Process

func (p *NFDProvider) Process(appID uint64) error

func (*NFDProvider) ProcessBlock

func (p *NFDProvider) ProcessBlock(stxn types.SignedTxnInBlock, round uint64) error

func (*NFDProvider) SyncNFDByAppID

func (p *NFDProvider) SyncNFDByAppID(appID uint64, currentBlock uint64) error

helpers

func (*NFDProvider) Type

func (p *NFDProvider) Type() string

Jump to

Keyboard shortcuts

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