MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetAccountMetadataMulti

Function GetAccountMetadataMulti

cmd/common/common.go:101–120  ·  view source on GitHub ↗
(wallet account.Client, accAddr string)

Source from the content-addressed store, hash-verified

99}
100
101func GetAccountMetadataMulti(wallet account.Client, accAddr string) *account.AccountMetadata {
102 //Address maybe address in base58, label or index
103 if accAddr == "" {
104 fmt.Printf("Using default account: %s\n", accAddr)
105 return wallet.GetDefaultAccountMetadata()
106 }
107 acc := wallet.GetAccountMetadataByAddress(accAddr)
108 if acc != nil {
109 return acc
110 }
111 acc = wallet.GetAccountMetadataByLabel(accAddr)
112 if acc != nil {
113 return acc
114 }
115 index, err := strconv.ParseInt(accAddr, 10, 32)
116 if err != nil {
117 return nil
118 }
119 return wallet.GetAccountMetadataByIndex(int(index))
120}
121
122func GetAccount(ctx *cli.Context, address ...string) (*account.Account, error) {
123 wallet, err := OpenWallet(ctx)

Callers 4

accountListFunction · 0.92
accountSetFunction · 0.92
accountDeleteFunction · 0.92
accountImportFunction · 0.92

Tested by

no test coverage detected