From e077e50d6d39f843d3c587840506e2594111477b Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 22 Jun 2019 19:24:14 -0400 Subject: [PATCH] Add StellarAddress() --- wallet.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wallet.go b/wallet.go index f88b5dc..da3eb60 100644 --- a/wallet.go +++ b/wallet.go @@ -11,6 +11,7 @@ type walletOut struct { Params walletOutParams `json:"params"` } type walletOutOptions struct { + Name string `json:"name"` Txid string `json:"txid"` } type walletOutParams struct { @@ -104,3 +105,13 @@ func (k Keybase) TxDetail(txid string) (WalletResult, error) { r, err := walletAPIOut(k.Path, m) return r.Result, err } + +// StellarAddress() returns the primary stellar address of a given user +func (k Keybase) StellarAddress(user string) (string, error) { + m := walletOut{} + m.Method = "lookup" + m.Params.Options.Name = user + + r, err := walletAPIOut(k.Path, m) + return r.Result.AccountID, err +}