Documentation ¶
Index ¶
- Constants
- func AvailableCommands(cmd string) bool
- func SaveConfiguration(config *Configuration)
- func SaveState(w *AccountWallet) error
- func WithAccountStatesFile(fileName string) options.Option[AccountWallet]
- func WithClientURL(url string) options.Option[AccountWallet]
- func WithFaucetAccountParams(params *faucetParams) options.Option[AccountWallet]
- type AccountOperation
- type AccountSubcommands
- type AccountWallet
- func (a *AccountWallet) AllotToAccount(params *AllotAccountParams) error
- func (a *AccountWallet) CreateAccount(params *CreateAccountParams) (iotago.AccountID, error)
- func (a *AccountWallet) CreateBlock(payload iotago.Payload, issuer blockhandler.Account, ...) (*iotago.ProtocolBlock, error)
- func (a *AccountWallet) DestroyAccount(params *DestroyAccountParams) error
- func (a *AccountWallet) GetAccount(alias string) (*models.AccountData, error)
- func (a *AccountWallet) GetReadyAccount(alias string) (*models.AccountData, error)
- func (a *AccountWallet) ListAccount() error
- func (a *AccountWallet) PostWithBlock(clt models.Client, payload iotago.Payload, issuer blockhandler.Account, ...) (iotago.BlockID, error)
- func (a *AccountWallet) RequestBlockBuiltData(clt *nodeclient.Client, issuerID iotago.AccountID) (*apimodels.CongestionResponse, *apimodels.IssuanceBlockHeaderResponse, ...)
- func (a *AccountWallet) RequestFaucetFunds(clt models.Client, receiveAddr iotago.Address, amount iotago.BaseToken) (*models.Output, error)
- type AllotAccountParams
- type Configuration
- type ConvertAccountParams
- type CreateAccountParams
- type DelegateAccountParams
- type DestroyAccountParams
- type NoAccountParams
- type StakeAccountParams
- type StateData
- type UpdateAccountParams
Constants ¶
View Source
const ( OperationCreateAccount AccountOperation = iota OperationConvertAccount OperationDestroyAccound OperationAllotAccount OperationDelegateAccount OperationStakeAccount OperationListAccounts OperationUpdateAccount CmdNameCreateAccount = "create" CmdNameConvertAccount = "convert" CmdNameDestroyAccount = "destroy" CmdNameAllotAccount = "allot" CmdNameDelegateAccount = "delegate" CmdNameStakeAccount = "stake" CmdNameListAccounts = "list" CmdNameUpdateAccount = "update" )
View Source
const (
FaucetAccountAlias = "faucet"
)
Variables ¶
This section is empty.
Functions ¶
func AvailableCommands ¶
func SaveConfiguration ¶
func SaveConfiguration(config *Configuration)
func SaveState ¶
func SaveState(w *AccountWallet) error
func WithAccountStatesFile ¶
func WithAccountStatesFile(fileName string) options.Option[AccountWallet]
func WithClientURL ¶
func WithClientURL(url string) options.Option[AccountWallet]
WithClientURL sets the client bind address.
func WithFaucetAccountParams ¶
func WithFaucetAccountParams(params *faucetParams) options.Option[AccountWallet]
Types ¶
type AccountOperation ¶
type AccountOperation int
func (AccountOperation) String ¶
func (a AccountOperation) String() string
type AccountSubcommands ¶
type AccountSubcommands interface {
Type() AccountOperation
}
type AccountWallet ¶
type AccountWallet struct {
// contains filtered or unexported fields
}
func NewAccountWallet ¶
func NewAccountWallet(opts ...options.Option[AccountWallet]) (*AccountWallet, error)
func Run ¶
func Run(config *Configuration) (*AccountWallet, error)
func (*AccountWallet) AllotToAccount ¶
func (a *AccountWallet) AllotToAccount(params *AllotAccountParams) error
func (*AccountWallet) CreateAccount ¶
func (a *AccountWallet) CreateAccount(params *CreateAccountParams) (iotago.AccountID, error)
func (*AccountWallet) CreateBlock ¶
func (a *AccountWallet) CreateBlock(payload iotago.Payload, issuer blockhandler.Account, congestionResp *apimodels.CongestionResponse, issuerResp *apimodels.IssuanceBlockHeaderResponse, version iotago.Version) (*iotago.ProtocolBlock, error)
func (*AccountWallet) DestroyAccount ¶
func (a *AccountWallet) DestroyAccount(params *DestroyAccountParams) error
func (*AccountWallet) GetAccount ¶
func (a *AccountWallet) GetAccount(alias string) (*models.AccountData, error)
func (*AccountWallet) GetReadyAccount ¶
func (a *AccountWallet) GetReadyAccount(alias string) (*models.AccountData, error)
func (*AccountWallet) ListAccount ¶
func (a *AccountWallet) ListAccount() error
func (*AccountWallet) PostWithBlock ¶
func (a *AccountWallet) PostWithBlock(clt models.Client, payload iotago.Payload, issuer blockhandler.Account, congestionResp *apimodels.CongestionResponse, issuerResp *apimodels.IssuanceBlockHeaderResponse, version iotago.Version) (iotago.BlockID, error)
func (*AccountWallet) RequestBlockBuiltData ¶
func (a *AccountWallet) RequestBlockBuiltData(clt *nodeclient.Client, issuerID iotago.AccountID) (*apimodels.CongestionResponse, *apimodels.IssuanceBlockHeaderResponse, iotago.Version, error)
type AllotAccountParams ¶
func (*AllotAccountParams) Type ¶
func (a *AllotAccountParams) Type() AccountOperation
type Configuration ¶
type Configuration struct { BindAddress string `json:"bindAddress,omitempty"` AccountStatesFile string `json:"accountStatesFile,omitempty"` GenesisSeed string `json:"genesisSeed,omitempty"` BlockIssuerPrivateKey string `json:"blockIssuerPrivateKey,omitempty"` AccountID string `json:"accountID,omitempty"` }
func LoadConfiguration ¶
func LoadConfiguration() *Configuration
LoadConfiguration loads the config file.
type ConvertAccountParams ¶
type ConvertAccountParams struct {
AccountAlias string
}
func (*ConvertAccountParams) Type ¶
func (d *ConvertAccountParams) Type() AccountOperation
type CreateAccountParams ¶
func (*CreateAccountParams) Type ¶
func (c *CreateAccountParams) Type() AccountOperation
type DelegateAccountParams ¶
type DelegateAccountParams struct { Amount uint64 To string From string // if not set we use faucet }
func (*DelegateAccountParams) Type ¶
func (a *DelegateAccountParams) Type() AccountOperation
type DestroyAccountParams ¶
func (*DestroyAccountParams) Type ¶
func (d *DestroyAccountParams) Type() AccountOperation
type NoAccountParams ¶
type NoAccountParams struct {
Operation AccountOperation
}
func (*NoAccountParams) Type ¶
func (a *NoAccountParams) Type() AccountOperation
type StakeAccountParams ¶
type StakeAccountParams struct { Alias string Amount uint64 FixedCost uint64 StartEpoch uint64 EndEpoch uint64 }
func (*StakeAccountParams) Type ¶
func (a *StakeAccountParams) Type() AccountOperation
type StateData ¶
type StateData struct { Seed string `serix:"0,mapKey=seed,lengthPrefixType=uint8"` LastUsedIndex uint64 `serix:"1,mapKey=lastUsedIndex"` AccountsData []*models.AccountState `serix:"2,mapKey=accounts,lengthPrefixType=uint8"` }
type UpdateAccountParams ¶
type UpdateAccountParams struct { Alias string BlockIssuerKey string Mana uint64 Amount uint64 ExpirySlot uint64 }
func (*UpdateAccountParams) Type ¶
func (a *UpdateAccountParams) Type() AccountOperation
Click to show internal directories.
Click to hide internal directories.