Documentation ¶
Overview ¶
Package internal provides private utilities for the client CLI application.
nolint
Index ¶
- Variables
- func CreateApp(algodClient *algod.Client, contract *abi.Contract, sender types.Address, ...) (uint64, error)
- func LoadContract() *abi.Contract
- func ResolveDID(appID uint64, pubKey []byte, algodClient *algod.Client, network string) ([]byte, error)
- type AlgoDIDClient
- func (c *AlgoDIDClient) DeleteDID(id *did.Identifier, sender *crypto.Account) error
- func (c *AlgoDIDClient) PublishDID(id *did.Identifier, sender *crypto.Account) error
- func (c *AlgoDIDClient) Read(id string) (*did.Document, *did.DocumentMetadata, error)
- func (c *AlgoDIDClient) Resolve(id string) (*did.Document, error)
- type ClientSettings
- type NetworkClient
- func (c *NetworkClient) AccountInformation(address string) (models.Account, error)
- func (c *NetworkClient) DeployContract(sender *crypto.Account) (uint64, error)
- func (c *NetworkClient) Ready() bool
- func (c *NetworkClient) StorageAppID() uint
- func (c *NetworkClient) SubmitTx(stx []byte) (string, error)
- func (c *NetworkClient) SuggestedParams() (types.SuggestedParams, error)
- type NetworkProfile
Constants ¶
This section is empty.
Variables ¶
var StorageContracts fs.FS
StorageContracts contains the pre-compiled smart contracts to support AlgoDID's on-chain storage.
Functions ¶
func CreateApp ¶ added in v1.0.0
func CreateApp( algodClient *algod.Client, contract *abi.Contract, sender types.Address, signer transaction.TransactionSigner, ) (uint64, error)
CreateApp is used to deploy the AlgoDID storage smart contract to the Algorand network.
func LoadContract ¶ added in v1.0.0
LoadContract loads the AlgoDID smart contract ABI from JSON file.
Types ¶
type AlgoDIDClient ¶ added in v1.0.0
type AlgoDIDClient struct { Networks map[string]*NetworkClient // contains filtered or unexported fields }
AlgoDIDClient provides a simplified interface to interact with the Algorand network.
func NewAlgoClient ¶ added in v1.0.0
func NewAlgoClient(profiles []*NetworkProfile, log xlog.Logger) (*AlgoDIDClient, error)
NewAlgoClient creates a new instance of the AlgoClient.
func (*AlgoDIDClient) DeleteDID ¶ added in v1.0.0
func (c *AlgoDIDClient) DeleteDID(id *did.Identifier, sender *crypto.Account) error
DeleteDID removes a DID document from the network.
func (*AlgoDIDClient) PublishDID ¶ added in v1.0.0
func (c *AlgoDIDClient) PublishDID(id *did.Identifier, sender *crypto.Account) error
PublishDID sends a new DID document to the network fot on-chain storage.
func (*AlgoDIDClient) Read ¶ added in v1.0.0
func (c *AlgoDIDClient) Read(id string) (*did.Document, *did.DocumentMetadata, error)
Read a DID document from the Algorand network. The method complies with the `resolver.Provider` interface.
type ClientSettings ¶
type ClientSettings struct {
Profiles []*NetworkProfile `json:"profiles" yaml:"profiles" mapstructure:"profiles"`
}
ClientSettings defines the configuration options available when interacting with an AlgoDID network agent.
type NetworkClient ¶ added in v1.0.0
type NetworkClient struct {
// contains filtered or unexported fields
}
NetworkClient is an interface for easily interacting with algod.
func (*NetworkClient) AccountInformation ¶ added in v1.0.0
func (c *NetworkClient) AccountInformation(address string) (models.Account, error)
AccountInformation returns the account information for the given address.
func (*NetworkClient) DeployContract ¶ added in v1.0.0
func (c *NetworkClient) DeployContract(sender *crypto.Account) (uint64, error)
DeployContract creates a new instance of the AlgoDID storage smart contract on the network.
func (*NetworkClient) Ready ¶ added in v1.0.0
func (c *NetworkClient) Ready() bool
Ready returns true if the network is available.
func (*NetworkClient) StorageAppID ¶ added in v1.0.0
func (c *NetworkClient) StorageAppID() uint
StorageAppID returns the application ID for the AlgoDID storage.
func (*NetworkClient) SubmitTx ¶ added in v1.0.0
func (c *NetworkClient) SubmitTx(stx []byte) (string, error)
SubmitTx sends a raw signed transaction to the network.
func (*NetworkClient) SuggestedParams ¶ added in v1.0.0
func (c *NetworkClient) SuggestedParams() (types.SuggestedParams, error)
SuggestedParams returns the suggested transaction parameters.
type NetworkProfile ¶ added in v1.0.0
type NetworkProfile struct { // Profile name. Name string `json:"name" yaml:"name" mapstructure:"name"` // Algod node address. Node string `json:"node" yaml:"node" mapstructure:"node"` // Algod node access token. NodeToken string `json:"node_token,omitempty" yaml:"node_token,omitempty" mapstructure:"node_token"` // Application ID for the AlgoDID storage smart contract. AppID uint `json:"app_id" yaml:"app_id" mapstructure:"app_id"` // Storage contract provider server, if any. StoreProvider string `json:"store_provider,omitempty" yaml:"store_provider,omitempty" mapstructure:"store_provider"` }
NetworkProfile defines the configuration options to connect to a specific AlgoDID network agent.