mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 20:24:21 +01:00
* Rename arkd folder & drop cli * Rename ark cli folder & update docs * Update readme * Fix * scripts: add build-all * Add target to build cli for all platforms * Update build scripts --------- Co-authored-by: tiero <3596602+tiero@users.noreply.github.com>
30 lines
592 B
Go
30 lines
592 B
Go
package main
|
|
|
|
import (
|
|
"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 {
|
|
offchainAddr, onchainAddr, err := getAddress()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
state, err := getState()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
relays := []string{state["ark_url"]}
|
|
|
|
return printJSON(map[string]interface{}{
|
|
"offchain_address": offchainAddr,
|
|
"onchain_address": onchainAddr,
|
|
"relays": relays,
|
|
})
|
|
}
|