cmd

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 80 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlocksWait      time.Duration
	BlocksNoWait    bool
	BlocksWaitSynth time.Duration
)
View Source
var (
	Client         *client.Client
	ClientV3       clientV3
	Q              v3.Querier2
	ClientTimeout  time.Duration
	ClientDebug    bool
	WantJsonOutput = false
	TxPretend      = false
	Prove          = false
	Memo           string
	Metadata       flags.Bytes
	SigType        string
	Authorities    []string
	SignWith       []*url.URL
	SignFor        *url.URL
	SignerVersion  uint
	DaemonConnStr  string
	VaultName      string
	Entropy        uint
	WalletDir      string
	NonInteractive bool
	Server         string
)
View Source
var (
	TxWait          time.Duration
	TxNoWait        bool
	TxWaitSynth     time.Duration
	TxIgnorePending bool
	TxLocal         bool
	TxGetFor        *url.URL
)
View Source
var DataSigningKeys []string
View Source
var ErrNonInteractive = fmt.Errorf("non-interactive")
View Source
var GetDirect bool
View Source
var Scratch bool
View Source
var WriteState bool

Functions

func Execute

func Execute()

func GetCreditValue

func GetCreditValue() (string, error)

func GetKey

func GetKey(url, key string) (string, error)

func GetTokenUrlFromAccount

func GetTokenUrlFromAccount(u *url.URL) (*url.URL, error)

func GetVersion

func GetVersion() (string, error)

func IsLiteIdentity

func IsLiteIdentity(urlstr string) (bool, error)

func IsLiteTokenAccount

func IsLiteTokenAccount(urlstr string) (bool, error)

func PrintBlocks

func PrintBlocks()

func PrintEncrypt

func PrintEncrypt()

func PrintGetMajorBlocks

func PrintGetMajorBlocks()

func PrintGetMinorBlocks

func PrintGetMinorBlocks()

func PrintJson

func PrintJson(v interface{}) (string, error)

func PrintJsonRpcError

func PrintJsonRpcError(err error) (string, error)

func PrintKey

func PrintKey()

func PrintKeyExport

func PrintKeyExport()

func PrintKeyGenerate

func PrintKeyGenerate()

func PrintKeyImport

func PrintKeyImport()

func PrintKeyPublic

func PrintKeyPublic()

func PrintMajorBlockQueryResponseV2

func PrintMajorBlockQueryResponseV2(res *client.MajorQueryResponse) (string, error)

func PrintTokenCreate

func PrintTokenCreate()

func PrintTokenGet

func PrintTokenGet()

func QrAccount

func QrAccount(s string) (string, error)

func QueryAcmeOracle

func QueryAcmeOracle() (*protocol.AcmeOracle, error)

func Remarshal

func Remarshal(src interface{}, dst interface{}) error

Remarshal uses mapstructure to convert a generic JSON-decoded map into a struct.

func RemarshalAs added in v0.4.0

func RemarshalAs[T any](src any) (*T, error)

func ValidateSigType

func ValidateSigType(input string) (protocol.SignatureType, error)

Types

type ActionDataResponse

type ActionDataResponse struct {
	EntryHash types.Bytes32 `json:"entryHash"`
	ActionResponse
}

func ActionResponseFromData

func ActionResponseFromData(r *client.TxResponse, entryHash []byte) *ActionDataResponse

func (*ActionDataResponse) Print

func (a *ActionDataResponse) Print(x *Context) (string, error)

type ActionLiteDataResponse

type ActionLiteDataResponse struct {
	AccountUrl types.String  `json:"accountUrl"`
	AccountId  types.Bytes32 `json:"accountId"`
	ActionDataResponse
}

func ActionResponseFromLiteData

func ActionResponseFromLiteData(r *client.TxResponse, accountUrl string, accountId []byte, entryHash []byte) *ActionLiteDataResponse

func (*ActionLiteDataResponse) Print

func (a *ActionLiteDataResponse) Print(x *Context) (string, error)

type ActionResponse

type ActionResponse struct {
	TransactionHash types.Bytes                        `json:"transactionHash"`
	SignatureHashes []types.Bytes                      `json:"signatureHashes"`
	SimpleHash      types.Bytes                        `json:"simpleHash"`
	Log             types.String                       `json:"log"`
	Code            types.String                       `json:"code"`
	Codespace       types.String                       `json:"codespace"`
	Error           types.String                       `json:"error"`
	Mempool         types.String                       `json:"mempool"`
	Result          *protocol.TransactionStatus        `json:"result"`
	Flow            []*client.TransactionQueryResponse `json:"flow"`
}

func ActionResponseFrom

func ActionResponseFrom(r *client.TxResponse) *ActionResponse

func (*ActionResponse) Print

func (a *ActionResponse) Print(x *Context) (string, error)

type ActionResponseError

type ActionResponseError struct {
	ActionResponse
}

func (*ActionResponseError) Error

func (a *ActionResponseError) Error() string

type Context added in v0.6.0

type Context struct {
	viper.Viper

	// State
	DidError error
	// contains filtered or unexported fields
}

func (*Context) AddAuth added in v0.6.0

func (x *Context) AddAuth(cmd *cobra.Command, account *url2.URL, signers []*api.SignRequest, args []string) (string, error)

func (*Context) AddCredits added in v0.6.0

func (x *Context) AddCredits(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) BurnTokens added in v0.6.0

func (x *Context) BurnTokens(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) CreateDataAccount added in v0.6.0

func (x *Context) CreateDataAccount(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) CreateKeyBook added in v0.6.0

func (x *Context) CreateKeyBook(cmd *cobra.Command, args []string) (string, error)

CreateKeyBook create a new key book

func (*Context) CreateKeyPage added in v0.6.0

func (x *Context) CreateKeyPage(cmd *cobra.Command, args []string) (string, error)

CreateKeyPage create a new key page

func (*Context) CreateLiteDataAccount added in v0.6.0

func (x *Context) CreateLiteDataAccount(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) CreateLiteTokenAccount added in v0.6.0

func (x *Context) CreateLiteTokenAccount(cmd *cobra.Command, principal *url2.URL, signers []*api.SignRequest, args []string) (string, error)

CreateLiteTokenAccount usage is: accumulate account create token --lite ${LTA} --sign-with ${KEY}@${SIGNER}

func (*Context) CreateTX added in v0.6.0

func (x *Context) CreateTX(cmd *cobra.Command, sender string, args []string) (string, error)

func (*Context) CreateToken added in v0.6.0

func (x *Context) CreateToken(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) CreateTokenAccount added in v0.6.0

func (x *Context) CreateTokenAccount(cmd *cobra.Command, principal *url2.URL, signers []*api.SignRequest, args []string) (string, error)

CreateTokenAccount account create url labelOrPubKeyHex height index tokenUrl keyBookUrl

func (*Context) DaemonSocket added in v0.6.0

func (x *Context) DaemonSocket() string

func (*Context) DisableAuth added in v0.6.0

func (x *Context) DisableAuth(cmd *cobra.Command, account *url2.URL, signers []*api.SignRequest, args []string) (string, error)

func (*Context) EnableAuth added in v0.6.0

func (x *Context) EnableAuth(cmd *cobra.Command, account *url2.URL, signers []*api.SignRequest, args []string) (string, error)

func (*Context) ExecuteTX added in v0.6.0

func (x *Context) ExecuteTX(cmd *cobra.Command, sender string, args []string) (string, error)

func (*Context) ExportAccounts added in v0.6.0

func (x *Context) ExportAccounts(cmd *cobra.Command, filePath string) error

func (*Context) ExportKey added in v0.6.0

func (x *Context) ExportKey(cmd *cobra.Command, label string) (string, error)

func (*Context) ExportKeys added in v0.6.0

func (x *Context) ExportKeys(cmd *cobra.Command) (out string, err error)

func (*Context) ExportMnemonic added in v0.6.0

func (x *Context) ExportMnemonic(cmd *cobra.Command) (string, error)

func (*Context) ExportSeed added in v0.6.0

func (x *Context) ExportSeed(cmd *cobra.Command) (string, error)

func (*Context) Faucet added in v0.6.0

func (x *Context) Faucet(cmd *cobra.Command, url string) (string, error)

func (*Context) GenerateKey added in v0.6.0

func (x *Context) GenerateKey(cmd *cobra.Command, labels ...string) (string, error)

func (*Context) Get added in v0.6.0

func (x *Context) Get(cmd *cobra.Command, urlStr string) (string, error)

func (*Context) GetADI added in v0.6.0

func (x *Context) GetADI(cmd *cobra.Command, url string) (string, error)

func (*Context) GetAdiDirectory added in v0.6.0

func (x *Context) GetAdiDirectory(cmd *cobra.Command, origin string, start string, count string) (string, error)

func (*Context) GetAndPrintKeyBook added in v0.6.0

func (x *Context) GetAndPrintKeyBook(cmd *cobra.Command, args []string) (string, error)

func (*Context) GetAndPrintKeyPage added in v0.6.0

func (x *Context) GetAndPrintKeyPage(cmd *cobra.Command, url string) (string, error)

func (*Context) GetDataEntry added in v0.6.0

func (x *Context) GetDataEntry(cmd *cobra.Command, accountUrl string, args []string) (string, error)

func (*Context) GetDataEntrySet added in v0.6.0

func (x *Context) GetDataEntrySet(cmd *cobra.Command, accountUrl string, args []string) (string, error)

func (*Context) GetMajorBlocks added in v0.6.0

func (x *Context) GetMajorBlocks(cmd *cobra.Command, args []string) (string, error)

func (*Context) GetMinorBlocks added in v0.6.0

func (x *Context) GetMinorBlocks(cmd *cobra.Command, args []string) (string, error)

func (*Context) GetPendingTx added in v0.6.0

func (x *Context) GetPendingTx(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) GetTX added in v0.6.0

func (x *Context) GetTX(cmd *cobra.Command, hashOrUrl string) (string, error)

func (*Context) GetTXHistory added in v0.6.0

func (x *Context) GetTXHistory(cmd *cobra.Command, accountUrl string, startArg string, endArg string) (string, error)

func (*Context) GetToken added in v0.6.0

func (x *Context) GetToken(cmd *cobra.Command, url string) (string, error)

func (*Context) GetTokenAccount added in v0.6.0

func (x *Context) GetTokenAccount(cmd *cobra.Command, url string) (string, error)

func (*Context) ImportAccounts added in v0.6.0

func (x *Context) ImportAccounts(cmd *cobra.Command, filePath string) error

func (*Context) ImportFactoidKey added in v0.6.0

func (x *Context) ImportFactoidKey(cmd *cobra.Command) (out string, err error)

func (*Context) ImportKey added in v0.6.0

func (x *Context) ImportKey(cmd *cobra.Command, token []byte, label string, signatureType protocol.SignatureType) (out string, err error)

ImportKey will import the private key and assign it to the label

func (*Context) ImportKeyPrompt added in v0.6.0

func (x *Context) ImportKeyPrompt(cmd *cobra.Command, label string, signatureType protocol.SignatureType) (out string, err error)

func (*Context) InitDBCreate added in v0.6.0

func (x *Context) InitDBCreate(cmd *cobra.Command) error

func (*Context) InitDBImport added in v0.6.0

func (x *Context) InitDBImport(cmd *cobra.Command, memDb bool) error

func (*Context) IssueTokenToRecipient added in v0.6.0

func (x *Context) IssueTokenToRecipient(cmd *cobra.Command, origin string, args []string) (string, error)

func (*Context) KeyPageUpdate added in v0.6.0

func (x *Context) KeyPageUpdate(cmd *cobra.Command, origin string, op protocol.KeyPageOperationType, args []string) (string, error)

func (*Context) ListAccounts added in v0.6.0

func (x *Context) ListAccounts(cmd *cobra.Command) (string, error)

func (*Context) PrintChainQueryResponseV2 added in v0.6.0

func (x *Context) PrintChainQueryResponseV2(cmd *cobra.Command, res *QueryResponse) (string, error)

func (*Context) PrintMinorBlockQueryResponseV2 added in v0.6.0

func (x *Context) PrintMinorBlockQueryResponseV2(cmd *cobra.Command, res *client.MinorQueryResponse) (string, error)

func (*Context) PrintMultiResponse added in v0.6.0

func (x *Context) PrintMultiResponse(cmd *cobra.Command, res *client.MultiResponse) (string, error)

func (*Context) PrintTransactionQueryResponseV2 added in v0.6.0

func (x *Context) PrintTransactionQueryResponseV2(res *client.TransactionQueryResponse) (string, error)

func (*Context) RemoveAuth added in v0.6.0

func (x *Context) RemoveAuth(cmd *cobra.Command, account *url2.URL, signers []*api.SignRequest, args []string) (string, error)

func (*Context) ReplaceKey added in v0.6.0

func (x *Context) ReplaceKey(cmd *cobra.Command, args []string) (string, error)

func (*Context) SignTX added in v0.6.0

func (x *Context) SignTX(cmd *cobra.Command, hashStr string, vote protocol.VoteType) (string, error)

func (*Context) SpawnDaemon added in v0.6.0

func (x *Context) SpawnDaemon() bool

func (*Context) WriteData added in v0.6.0

func (x *Context) WriteData(cmd *cobra.Command, accountUrl string, args []string) (string, error)

func (*Context) WriteDataTo added in v0.6.0

func (x *Context) WriteDataTo(cmd *cobra.Command, accountUrl string, args []string) (string, error)

type KeyResponse

type KeyResponse struct {
	Lite          types.String   `json:"name,omitempty"`
	Addresses     []types.String `json:"addresses,omitempty"`
	Names         []types.String `json:"names,omitempty"`
	PrivateKey    types.Bytes    `json:"privateKey,omitempty"`
	PublicKey     types.Bytes    `json:"publicKey,omitempty"`
	KeyInfo       api.KeyInfo    `json:"keyInfo,omitempty"`
	KeyHash       types.Bytes    `json:"keyHash,omitempty"`
	NativeAddress types.String   `json:"nativeAddress,omitempty"`
	LastUsedOn    uint64         `json:"lastUsedOn,omitempty"`
	LiteAccount   *url.URL       `json:"liteAccount,omitempty"`
	Seed          types.Bytes    `json:"seed,omitempty"`
	Mnemonic      types.String   `json:"mnemonic,omitempty"`
}

func (*KeyResponse) Print added in v0.4.0

func (r *KeyResponse) Print() string

type QueryResponse

type QueryResponse struct {
	Type           string                      `json:"type,omitempty"`
	MainChain      *client.MerkleState         `json:"mainChain,omitempty"`
	Data           interface{}                 `json:"data,omitempty"`
	ChainId        []byte                      `json:"chainId,omitempty"`
	Origin         string                      `json:"origin,omitempty"`
	KeyPage        *client.KeyPage             `json:"keyPage,omitempty"`
	Txid           []byte                      `json:"txid,omitempty"`
	Signatures     []protocol.Signature        `json:"signatures,omitempty"`
	Status         *protocol.TransactionStatus `json:"status,omitempty"`
	SyntheticTxids [][32]byte                  `json:"syntheticTxids,omitempty"`
}

This is a hack to reduce how much we have to change

func GetKeyBook

func GetKeyBook(url string) (*QueryResponse, *protocol.KeyBook, error)

func GetKeyPage

func GetKeyPage(url string) (*QueryResponse, *protocol.KeyPage, error)

func GetUrl

func GetUrl(urlstr string) (*QueryResponse, error)

type RpcError added in v0.6.0

type RpcError struct {
	Msg string
	Err error
}

func (*RpcError) Error added in v0.6.0

func (e *RpcError) Error() string

func (*RpcError) Unwrap added in v0.6.0

func (e *RpcError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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