Documentation
¶
Index ¶
- func AssetInfo(contractAddress string, massaClient network.NodeFetcherInterface) (*models.AssetInfo, error)
- func GetAssetsJSONPath() (string, error)
- func MASInfo() models.AssetInfo
- type Assets
- type AssetsStore
- func (s *AssetsStore) AddAsset(nickname, assetAddress string, assetInfo models.AssetInfo) error
- func (s *AssetsStore) AddAssetToMemory(nickname, assetAddress string, assetInfo models.AssetInfo)
- func (s *AssetsStore) AssetExists(nickname, contractAddress string) bool
- func (s *AssetsStore) DeleteAsset(nickname, assetAddress string) error
- func (s *AssetsStore) DeleteAssetFromMemory(nickname, assetAddress string)
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 ¶
GetAssetsJSONPath returns the path to the assets JSON file.
Types ¶
type AssetsStore ¶
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.