heimdallutil

package
v0.1.114 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package heimdallutil implements the `polycli heimdall util` umbrella command and its local utility subcommands (addr, b64, version, completions). These helpers are deliberately offline — only `version --node` reaches the network.

Package directory is named `util` under cmd/heimdall/ and the Go package is `heimdallutil` to avoid colliding with the repo's top-level util/ package.

Index

Constants

View Source
const DefaultHRP = "cosmos"

DefaultHRP is the bech32 human-readable part used by Heimdall v2. Confirmed from heimdall-v2/API_REFERENCE.md ("Cosmos bech32 cosmos1…") and the absence of any sdk.Config.SetBech32PrefixForAccount override in heimdall-v2/cmd/heimdalld/cmd/commands.go — Heimdall v2 uses the default cosmos-sdk account prefix.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "util",
	Short: "Local helpers: addr, b64, version, completions.",
	Long:  usage,
	Args:  cobra.NoArgs,
}

Cmd is the `util` umbrella command. Subcommands are attached by Register so tests can wire their own parent for isolation.

Functions

func ConvertAddress

func ConvertAddress(value, hrp string) (hexAddr, bechAddr string, err error)

ConvertAddress returns both the canonical 0x-hex and bech32 encodings of value, given the target bech32 prefix hrp. Direction is inferred from the input: 0x-prefixed hex inputs are encoded; anything else is decoded as bech32.

func ConvertBase64

func ConvertBase64(value, direction string) (string, error)

ConvertBase64 returns the converted representation of value according to direction. When direction is "auto" a 0x-prefixed input is converted to base64; anything else is converted from base64 to 0x-hex. When direction is explicit, the input must be in the opposite format.

func Register

func Register(parent *cobra.Command, f *config.Flags)

Register attaches the util umbrella command and its subcommands to parent, wiring in the shared flag struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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