utils

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Example (RespChainInfo_json)
display.Print(&respChainInfo{
	&types.ChainInfo{
		ChainID:     "kwil-chain",
		BlockHeight: 100,
		BlockHash:   "00000beefbeefbeef",
	},
}, nil, "json")
Output:

{
  "result": {
    "chain_id": "kwil-chain",
    "block_height": 100,
    "block_hash": "00000beefbeefbeef"
  },
  "error": ""
}
Example (RespChainInfo_text)
display.Print(&respChainInfo{
	&types.ChainInfo{
		ChainID:     "kwil-chain",
		BlockHeight: 100,
		BlockHash:   "00000beefbeefbeef",
	},
}, nil, "text")
Output:

Chain ID: kwil-chain
Height: 100
Hash: 00000beefbeefbeef
Example (RespKwilCliConfig_json)
pk, err := crypto.GenerateSecp256k1Key()
if err != nil {
	panic(err)
}

display.Print(&respKwilCliConfig{
	cfg: &config.KwilCliConfig{
		PrivateKey: pk,
		ChainID:    "chainid123",
		GrpcURL:    "localhost:9090",
	},
}, nil, "json")
Output:

{
  "result": {
    "private_key": "***",
    "grpc_url": "localhost:9090",
    "chain_id": "chainid123"
  },
  "error": ""
}
Example (RespKwilCliConfig_text)
pk, err := crypto.GenerateSecp256k1Key()
if err != nil {
	panic(err)
}

display.Print(&respKwilCliConfig{
	cfg: &config.KwilCliConfig{
		PrivateKey: pk,
		ChainID:    "chainid123",
		GrpcURL:    "localhost:9090",
	},
}, nil, "text")
Output:

PrivateKey: ***
GrpcURL: localhost:9090
ChainID: chainid123

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdUtils

func NewCmdUtils() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL