cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client         = client.NewAPIClient()
	Db             db.DB
	WantJsonOutput = false
	TxPretend      = false
)
View Source
var (
	BucketAnon     = []byte("anon")
	BucketAdi      = []byte("adi")
	BucketKeys     = []byte("keys")
	BucketLabel    = []byte("label")
	BucketMnemonic = []byte("mnemonic")
)
View Source
var (
	TxWait      time.Duration
	TxWaitSynth time.Duration
)
View Source
var (
	ApiToString = map[string]string{
		"liteTokenAccount": "lite account",
		"tokenAccount":     "ADI token account",
		"adi":              "ADI",
		"keyBook":          "Key Book",
		"keyPage":          "Key Page",
	}
)
View Source
var DidError bool

Functions

func AddCredits

func AddCredits(actor string, args []string) (string, error)

func CreateAccount

func CreateAccount(url string, args []string) (string, error)

account create adiActor labelOrPubKeyHex height index tokenUrl keyBookUrl

func CreateDataAccount

func CreateDataAccount(actorUrl string, args []string) (string, error)

func CreateKeyBook

func CreateKeyBook(book string, args []string) (string, error)

CreateKeyBook create a new key page

func CreateKeyPage

func CreateKeyPage(page string, args []string) (string, error)

CreateKeyPage create a new key page

func CreateTX

func CreateTX(sender string, args []string) (string, error)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ExportKey

func ExportKey(label string) (string, error)

func ExportKeys

func ExportKeys() (out string, err error)

func ExportMnemonic

func ExportMnemonic() (string, error)

func ExportSeed

func ExportSeed() (string, error)

func Faucet

func Faucet(url string) (string, error)

func FindLabelFromPubKey

func FindLabelFromPubKey(pubKey []byte) (lab string, err error)

func GenerateAccount

func GenerateAccount() (string, error)

func GenerateKey

func GenerateKey(label string) (string, error)

func GeneratePrivateKey

func GeneratePrivateKey() (privKey []byte, err error)

func Get

func Get(url string) (string, error)

func GetADI

func GetADI(url string) (string, error)

func GetAccount

func GetAccount(url string) (string, error)

func GetAdiDirectory

func GetAdiDirectory(actor string) (string, error)

func GetAndPrintKeyBook

func GetAndPrintKeyBook(url string) (string, error)

func GetAndPrintKeyPage

func GetAndPrintKeyPage(url string) (string, error)

func GetByChainId

func GetByChainId(chainId []byte) (*acmeapi.APIDataResponse, error)

func GetDataEntry

func GetDataEntry(accountUrl string, args []string) (string, error)

func GetDataEntrySet

func GetDataEntrySet(accountUrl string, args []string) (string, error)

func GetKey

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

func GetKeyBook

func GetKeyBook(url string) ([]byte, *protocol.KeyBook, error)

func GetKeyPage

func GetKeyPage(url string) ([]byte, *protocol.KeyPage, error)

func GetKeyPageInBook

func GetKeyPageInBook(book string, keyLabel string) (*protocol.KeyPage, int, error)

func GetTX

func GetTX(hash string) (string, error)

func GetTXHistory

func GetTXHistory(accountUrl string, s string, e string) (string, error)

func GetUrl

func GetUrl(url string, method string) ([]byte, error)

func GetVersion

func GetVersion() (string, error)

func ImportKey

func ImportKey(pkhex string, label string) (out string, err error)

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

func ImportMnemonic

func ImportMnemonic(mnemonic []string) (string, error)

func InitRootCmd

func InitRootCmd(database db.DB) *cobra.Command

func IsLiteAccount

func IsLiteAccount(url string) bool

func KeyPageUpdate

func KeyPageUpdate(actorUrl string, op protocol.KeyPageOperation, args []string) (string, error)

func ListADIs

func ListADIs() (string, error)

func ListAccounts

func ListAccounts() (string, error)

func ListKeyPublic

func ListKeyPublic() (out string, err error)

func LookupByLabel

func LookupByLabel(label string) ([]byte, error)

func LookupByPubKey

func LookupByPubKey(pubKey []byte) ([]byte, error)

func NewADI

func NewADI(actor string, params []string) (string, error)

NewADI create a new ADI from a sponsored account.

func NewADIFromADISigner

func NewADIFromADISigner(actor *url2.URL, args []string) (string, error)

func PrintADI

func PrintADI()

func PrintADICreate

func PrintADICreate()

func PrintADIGet

func PrintADIGet()

func PrintADIImport

func PrintADIImport()

func PrintAccount

func PrintAccount()

func PrintAccountCreate

func PrintAccountCreate()

func PrintAccountExport

func PrintAccountExport()

func PrintAccountGenerate

func PrintAccountGenerate()

func PrintAccountGet

func PrintAccountGet()

func PrintAccountImport

func PrintAccountImport()

func PrintAccountList

func PrintAccountList()

func PrintAccountQr

func PrintAccountQr()

func PrintAccountRestore

func PrintAccountRestore()

func PrintAdiDirectory

func PrintAdiDirectory()

func PrintCredits

func PrintCredits()

func PrintData

func PrintData()

func PrintDataAccountCreate

func PrintDataAccountCreate()

func PrintDataGet

func PrintDataGet()

func PrintDataWrite

func PrintDataWrite()

func PrintFaucet

func PrintFaucet()

func PrintGet

func PrintGet()

func PrintJsonRpcError

func PrintJsonRpcError(err error) (string, error)

func PrintKey

func PrintKey()

func PrintKeyBook

func PrintKeyBook()

func PrintKeyBookCreate

func PrintKeyBookCreate()

func PrintKeyBookGet

func PrintKeyBookGet()

func PrintKeyExport

func PrintKeyExport()

func PrintKeyGenerate

func PrintKeyGenerate()

func PrintKeyImport

func PrintKeyImport()

func PrintKeyPageCreate

func PrintKeyPageCreate()

func PrintKeyPageGet

func PrintKeyPageGet()

func PrintKeyPublic

func PrintKeyPublic()

func PrintKeyUpdate

func PrintKeyUpdate()

func PrintPage

func PrintPage()

func PrintQueryResponse

func PrintQueryResponse(res *acmeapi.APIDataResponse) (string, error)

func PrintQueryResponseV2

func PrintQueryResponseV2(v2 *api2.QueryResponse) (string, error)

func PrintTX

func PrintTX()

func PrintTXCreate

func PrintTXCreate()

func PrintTXGet

func PrintTXGet()

func PrintTXHistoryGet

func PrintTXHistoryGet()

func QrAccount

func QrAccount(s string) (string, error)

func RestoreAccounts

func RestoreAccounts() (out string, err error)

func WriteData

func WriteData(accountUrl string, args []string) (string, error)

Types

type AccountKeyBookStore

type AccountKeyBookStore struct {
	KeyBook KeyBookStore `json:"keyBook"`
}

type ActionDataResponse

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

func ActionResponseFromData

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

func (*ActionDataResponse) Print

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

type ActionResponse

type ActionResponse struct {
	Txid      types.Bytes32 `json:"txid"`
	Hash      types.Bytes32 `json:"hash"`
	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"`
}

func ActionResponseFrom

func ActionResponseFrom(r *api2.TxResponse) *ActionResponse

func (*ActionResponse) Print

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

type KeyBookStore

type KeyBookStore struct {
	KeyPageList []string `json:"keyPages"`
}

type KeyPageStore

type KeyPageStore struct {
	PrivKeys []types.Bytes `json:"privKeys"`
}

type KeyResponse

type KeyResponse struct {
	Label      types.String `json:"name"`
	PrivateKey types.Bytes  `json:"privateKey"`
	PublicKey  types.Bytes  `json:"publicKey"`
	Seed       types.Bytes  `json:"seed"`
	Mnemonic   types.Bytes  `json:"mnemonic"`
}

Jump to

Keyboard shortcuts

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