diff --git a/examples/graphql/graphql.go b/examples/graphql/graphql.go index 6cf75a8..ad3c8f8 100644 --- a/examples/graphql/graphql.go +++ b/examples/graphql/graphql.go @@ -17,7 +17,7 @@ func main() { // Create a client buxClient, err := buxclient.New( - buxclient.WithXPriv(keys.XPub().String()), + buxclient.WithXPriv(keys.XPriv()), buxclient.WithGraphQL("localhost:3001"), buxclient.WithDebugging(true), buxclient.WithSignRequest(true), diff --git a/examples/http/http.go b/examples/http/http.go index e5159d0..c4e988c 100644 --- a/examples/http/http.go +++ b/examples/http/http.go @@ -17,7 +17,7 @@ func main() { // Create a client buxClient, err := buxclient.New( - buxclient.WithXPriv(keys.String()), + buxclient.WithXPriv(keys.XPriv()), buxclient.WithHTTP("localhost:3001"), buxclient.WithDebugging(true), buxclient.WithSignRequest(true), diff --git a/examples/keys/keys.go b/examples/keys/keys.go index 132e4c7..23ac492 100644 --- a/examples/keys/keys.go +++ b/examples/keys/keys.go @@ -13,7 +13,7 @@ func main() { } fmt.Println("<-- Generate method") - fmt.Println("XPriv: ", keys.String()) + fmt.Println("XPriv: ", keys.XPriv()) fmt.Println("XPub: ", keys.XPub().String()) fmt.Println("Mnemonic: ", keys.Mnemonic()) @@ -24,18 +24,18 @@ func main() { } fmt.Println("<-- FromMnemonic method") - fmt.Println("XPriv: ", xpriv3.String()) + fmt.Println("XPriv: ", xpriv3.XPriv()) fmt.Println("XPub: ", xpriv3.XPub().String()) fmt.Println("Mnemonic: ", xpriv3.Mnemonic()) //Generate keys from string - xpriv2, err := xpriv.FromString(keys.String()) + xpriv2, err := xpriv.FromString(keys.XPriv()) if err != nil { panic(err) } fmt.Println("<-- FromString method") - fmt.Println("XPriv: ", xpriv2.String()) + fmt.Println("XPriv: ", xpriv2.XPriv()) fmt.Println("XPub: ", xpriv2.XPub().String()) fmt.Println("Can not get mnemonic from keys generated from string") } diff --git a/examples/new_paymail/new_paymail.go b/examples/new_paymail/new_paymail.go index 8102995..013a992 100644 --- a/examples/new_paymail/new_paymail.go +++ b/examples/new_paymail/new_paymail.go @@ -18,7 +18,7 @@ func main() { // Create a client buxClient, err := buxclient.New( - buxclient.WithXPriv(keys.String()), + buxclient.WithXPriv(keys.XPriv()), buxclient.WithHTTP("localhost:3001"), buxclient.WithDebugging(true), buxclient.WithSignRequest(true), diff --git a/examples/register_xpub/register_xpub.go b/examples/register_xpub/register_xpub.go index 58eb17d..fb667dc 100644 --- a/examples/register_xpub/register_xpub.go +++ b/examples/register_xpub/register_xpub.go @@ -18,7 +18,7 @@ func main() { // Create a client buxClient, err := buxclient.New( - buxclient.WithXPriv(keys.String()), + buxclient.WithXPriv(keys.XPriv()), buxclient.WithHTTP("localhost:3001"), buxclient.WithDebugging(true), buxclient.WithSignRequest(true), diff --git a/xpriv/xpriv.go b/xpriv/xpriv.go index 396bfbb..046a57b 100644 --- a/xpriv/xpriv.go +++ b/xpriv/xpriv.go @@ -22,7 +22,7 @@ type PublicKey struct { // Key represents basic key methods type Key interface { - String() string + XPriv() string XPub() PubKey } @@ -42,8 +42,8 @@ func (k *Keys) XPub() PubKey { return k.xpub } -// String return hierarchical deterministic private key -func (k *Keys) String() string { +// XPriv return hierarchical deterministic private key +func (k *Keys) XPriv() string { return k.xpriv }