accountwallet

package
v0.0.0-...-1f0f14a Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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 AvailableCommands(cmd string) bool

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) RequestFaucetFunds

func (a *AccountWallet) RequestFaucetFunds(clt models.Client, receiveAddr iotago.Address, amount iotago.BaseToken) (*models.Output, error)

type AllotAccountParams

type AllotAccountParams struct {
	Amount uint64
	To     string
	From   string // if not set we use faucet
}

func (*AllotAccountParams) Type

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

type CreateAccountParams

type CreateAccountParams struct {
	Alias    string
	Amount   uint64
	NoBIF    bool
	Implicit bool
}

func (*CreateAccountParams) Type

type DelegateAccountParams

type DelegateAccountParams struct {
	Amount uint64
	To     string
	From   string // if not set we use faucet
}

func (*DelegateAccountParams) Type

type DestroyAccountParams

type DestroyAccountParams struct {
	AccountAlias string
	ExpirySlot   uint64
}

func (*DestroyAccountParams) Type

type NoAccountParams

type NoAccountParams struct {
	Operation AccountOperation
}

func (*NoAccountParams) Type

type StakeAccountParams

type StakeAccountParams struct {
	Alias      string
	Amount     uint64
	FixedCost  uint64
	StartEpoch uint64
	EndEpoch   uint64
}

func (*StakeAccountParams) Type

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

Jump to

Keyboard shortcuts

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