assets

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetInfo

func AssetInfo(contractAddress string, massaClient network.NodeFetcherInterface) (*models.AssetInfo, error)

AssetInfo retrieves the asset information for a given contract address by making a smart contract call.

func GetAssetsJSONPath

func GetAssetsJSONPath() (string, error)

GetAssetsJSONPath returns the path to the assets JSON file.

func MASInfo

func MASInfo() models.AssetInfo

Types

type Assets

type Assets struct {
	ContractAssets map[string]models.AssetInfo
}

Assets encapsulates the contract assets associated with a specific account.

type AssetsStore

type AssetsStore struct {
	Assets     map[string]Assets
	StoreMutex sync.Mutex
}

AssetsStore encapsulates all the nicknames with their related contract assets.

func NewAssetsStore

func NewAssetsStore(assetsJSONPath string) (*AssetsStore, error)

NewAssetsStore creates and initializes a new instance of AssetsStore.

func (*AssetsStore) AddAsset

func (s *AssetsStore) AddAsset(nickname, assetAddress string, assetInfo models.AssetInfo) error

AddAsset adds the asset information for a given account nickname in the JSON.

func (*AssetsStore) AddAssetToMemory

func (s *AssetsStore) AddAssetToMemory(nickname, assetAddress string, assetInfo models.AssetInfo)

AddAssetToMemory adds the asset information for a given account nickname to the AssetsStore.

func (*AssetsStore) AssetExists

func (s *AssetsStore) AssetExists(nickname, contractAddress string) bool

AssetExists checks if the asset information exists for a given contract address in the JSON.

func (*AssetsStore) DeleteAsset

func (s *AssetsStore) DeleteAsset(nickname, assetAddress string) error

DeleteAsset deletes the asset information for a given account nickname in the JSON.

func (*AssetsStore) DeleteAssetFromMemory

func (s *AssetsStore) DeleteAssetFromMemory(nickname, assetAddress string)

DeleteAssetFromMemory removes the asset information for a given account nickname and asset address from the AssetsStore.

Jump to

Keyboard shortcuts

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