sonr/app/cli/tui.go
Prad Nukala 60c48d2409
feature/did accounts (#23)
* feat: add support for DID number as primary key for Controllers

* refactor: rename pkg/proxy to app/proxy

* feat: add vault module keeper tests

* feat(vault): add DID keeper to vault module

* refactor: move vault client code to its own package

* refactor(vault): extract schema definition

* refactor: use vaulttypes for MsgAllocateVault

* refactor: update vault assembly logic to use new methods

* feat: add dwn-proxy command

* refactor: remove unused context.go file

* refactor: remove unused web-related code

* feat: add DWN proxy server

* feat: add BuildTx RPC to vault module

* fix: Implement BuildTx endpoint

* feat: add devbox integration to project
2024-09-25 19:45:28 -04:00

45 lines
1.1 KiB
Go

package cli
import (
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/onsonr/sonr/app/cli/dexmodel"
"github.com/onsonr/sonr/app/cli/txmodel"
"github.com/spf13/cobra"
)
func NewBuildTxnTUICmd() *cobra.Command {
return &cobra.Command{
Use: "dash",
Short: "TUI for managing the local Sonr validator node",
RunE: func(cmd *cobra.Command, args []string) error {
txBody, err := txmodel.RunBuildTxnTUI()
if err != nil {
return err
}
interfaceRegistry := codectypes.NewInterfaceRegistry()
marshaler := codec.NewProtoCodec(interfaceRegistry)
jsonBytes, err := marshaler.MarshalJSON(txBody)
if err != nil {
return fmt.Errorf("failed to marshal tx body: %w", err)
}
fmt.Println("Generated Protobuf Message (JSON format):")
fmt.Println(string(jsonBytes))
return nil
},
}
}
func NewExplorerTUICmd() *cobra.Command {
return &cobra.Command{
Use: "cosmos-explorer",
Short: "A terminal-based Cosmos blockchain explorer",
RunE: dexmodel.RunExplorerTUI,
}
}