Files
ark/noah/receive.go
Pietralberto Mazza 0210d39866 Monorepo scaffolding (#16)
* Change scaffolding

* Fix gh action
2023-11-27 14:23:22 +01:00

38 lines
658 B
Go

package main
import (
"fmt"
"github.com/ark-network/ark/common"
"github.com/urfave/cli/v2"
)
var receiveCommand = cli.Command{
Name: "receive",
Usage: "Print the Ark address associated with your wallet and the connected Ark",
Action: receiveAction,
}
func receiveAction(ctx *cli.Context) error {
privateKey, err := privateKeyFromPassword()
if err != nil {
return err
}
publicKey := privateKey.PubKey()
aspPublicKey, err := getServiceProviderPublicKey()
if err != nil {
return err
}
addr, err := common.EncodeAddress(common.MainNet.Addr, publicKey, aspPublicKey)
if err != nil {
return err
}
fmt.Println(addr)
return nil
}