Documentation
¶
Overview ¶
Dedicated to my love, Lexi.
Index ¶
- Constants
- Variables
- func BroadcastHandler(cfg *BroadcastCfg) (*ctypes.ResultBroadcastTxCommit, error)
- func ExecSignAndBroadcast(cfg *MakeTxCfg, args []string, tx std.Tx, io commands.IO) error
- func GenerateMnemonic(entropySize int) (string, error)
- func GenerateMnemonicWithCustomEntropy(io commands.IO, masked bool) (string, error)
- func NewAddBech32Cmd(rootCfg *AddCfg, io commands.IO) *commands.Command
- func NewAddCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewAddLedgerCmd(cfg *AddCfg, io commands.IO) *commands.Command
- func NewAddMultisigCmd(rootCfg *AddCfg, io commands.IO) *commands.Command
- func NewBroadcastCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewDeleteCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewExportCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewGenerateCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewImportCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewListCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewMakeSendCmd(rootCfg *MakeTxCfg, io commands.IO) *commands.Command
- func NewMakeTxCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewMultisignCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewQueryCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewRootCmdWithBaseConfig(io commands.IO, base BaseOptions) *commands.Command
- func NewRotateCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewSessionCmd(rootCfg *MakeTxCfg, io commands.IO) *commands.Command
- func NewSessionCreateCmd(rootCfg *SessionCfg, io commands.IO) *commands.Command
- func NewSessionRevokeAllCmd(rootCfg *SessionCfg, io commands.IO) *commands.Command
- func NewSessionRevokeCmd(rootCfg *SessionCfg, io commands.IO) *commands.Command
- func NewSignCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewVerifyCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func NewVersionCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command
- func QueryHandler(cfg *QueryCfg) (*ctypes.ResultABCIQuery, error)
- func SignAndBroadcastHandler(cfg *MakeTxCfg, nameOrBech32 string, tx std.Tx, pass string) (*types.ResultBroadcastTxCommit, error)
- func SimulateTx(cli client.ABCIClient, tx []byte) (*ctypes.ResultBroadcastTxCommit, error)
- type AddBech32Cfg
- type AddCfg
- type AddMultisigCfg
- type BaseCfg
- type BaseOptions
- type BroadcastCfg
- type DeleteCfg
- type ExportCfg
- type GenerateCfg
- type ImportCfg
- type MakeSendCfg
- type MakeTxCfg
- type MultisignCfg
- type QueryCfg
- type RotateCfg
- type SessionCfg
- type SessionCreateCfg
- type SessionRevokeAllCfg
- type SessionRevokeCfg
- type SignCfg
- type VerifyCfg
Constants ¶
const ( SimulateTest = "test" SimulateSkip = "skip" SimulateOnly = "only" )
These are the valid options for MakeTxConfig.Simulate.
const ( // MinEntropyChars is the minimum number of characters required for custom entropy // Calculated as: ceil(180 / log2(10+24)) = 36 // This ensures at least 180 bits of entropy when using alphanumeric characters MinEntropyChars = 36 )
Variables ¶
var DefaultBaseOptions = BaseOptions{ Home: "", Remote: "127.0.0.1:26657", Quiet: false, InsecurePasswordStdin: false, Config: "", }
Functions ¶
func BroadcastHandler ¶
func BroadcastHandler(cfg *BroadcastCfg) (*ctypes.ResultBroadcastTxCommit, error)
func ExecSignAndBroadcast ¶
func GenerateMnemonic ¶
GenerateMnemonic generates a new BIP39 mnemonic using the provided entropy size
func GenerateMnemonicWithCustomEntropy ¶
GenerateMnemonicWithCustomEntropy generates a BIP39 mnemonic using user-provided entropy instead of computer PRNG
func NewAddBech32Cmd ¶
NewAddBech32Cmd creates a gnokey add bech32 command
func NewAddLedgerCmd ¶
NewAddLedgerCmd creates a gnokey add ledger command
func NewAddMultisigCmd ¶
NewAddMultisigCmd creates a gnokey add multisig command
func NewRootCmdWithBaseConfig ¶
func NewRootCmdWithBaseConfig(io commands.IO, base BaseOptions) *commands.Command
func NewSessionCreateCmd ¶
func NewSessionCreateCmd(rootCfg *SessionCfg, io commands.IO) *commands.Command
NewSessionCreateCmd creates a gnokey session create command
func NewSessionRevokeAllCmd ¶
func NewSessionRevokeAllCmd(rootCfg *SessionCfg, io commands.IO) *commands.Command
NewSessionRevokeAllCmd creates a gnokey session revokeall command
func NewSessionRevokeCmd ¶
func NewSessionRevokeCmd(rootCfg *SessionCfg, io commands.IO) *commands.Command
NewSessionRevokeCmd creates a gnokey session revoke command
func QueryHandler ¶
func QueryHandler(cfg *QueryCfg) (*ctypes.ResultABCIQuery, error)
func SignAndBroadcastHandler ¶
func SimulateTx ¶
func SimulateTx(cli client.ABCIClient, tx []byte) (*ctypes.ResultBroadcastTxCommit, error)
Types ¶
type AddBech32Cfg ¶
func (*AddBech32Cfg) RegisterFlags ¶
func (c *AddBech32Cfg) RegisterFlags(fs *flag.FlagSet)
type AddCfg ¶
type AddCfg struct {
RootCfg *BaseCfg
Recover bool
NoBackup bool
Account uint64
Index uint64
Entropy bool
Masked bool
Force bool
DerivationPath commands.StringArr
}
func (*AddCfg) RegisterFlags ¶
type AddMultisigCfg ¶
type AddMultisigCfg struct {
RootCfg *AddCfg
NoSort bool
Multisig commands.StringArr
MultisigThreshold int
}
func (*AddMultisigCfg) RegisterFlags ¶
func (c *AddMultisigCfg) RegisterFlags(fs *flag.FlagSet)
type BaseOptions ¶
type BaseOptions struct {
Home string
Remote string
Quiet bool
InsecurePasswordStdin bool
Config string
// OnTxSuccess is called when the transaction tx succeeds. It can, for example,
// print info in the result. If OnTxSuccess is nil, print basic info.
OnTxSuccess func(tx std.Tx, res *ctypes.ResultBroadcastTxCommit)
}
type BroadcastCfg ¶
func (*BroadcastCfg) RegisterFlags ¶
func (c *BroadcastCfg) RegisterFlags(fs *flag.FlagSet)
type DeleteCfg ¶
func (*DeleteCfg) RegisterFlags ¶
type ExportCfg ¶
func (*ExportCfg) RegisterFlags ¶
type GenerateCfg ¶
func (*GenerateCfg) RegisterFlags ¶
func (c *GenerateCfg) RegisterFlags(fs *flag.FlagSet)
type ImportCfg ¶
func (*ImportCfg) RegisterFlags ¶
type MakeSendCfg ¶
func (*MakeSendCfg) RegisterFlags ¶
func (c *MakeSendCfg) RegisterFlags(fs *flag.FlagSet)
type MakeTxCfg ¶
type MakeTxCfg struct {
RootCfg *BaseCfg
GasWanted int64
GasFee string
Memo string
Broadcast bool
// Valid options are SimulateTest, SimulateSkip or SimulateOnly.
Simulate string
ChainID string
// Master, when set, signs the tx as a session account on behalf of this master key
// (name or bech32). The chain enforces which msg types a session may sign.
Master string
}
func (*MakeTxCfg) GetCaller ¶
GetCaller returns the address that should appear as msg.Caller. When c.Master is set (session-signed tx), the caller is master; otherwise it's the signer resolved from nameOrBech32.
func (*MakeTxCfg) GetMaster ¶
GetMaster resolves c.Master (bech32 or keybase name) to an Address. Returns an error if c.Master is empty.
func (*MakeTxCfg) RegisterFlags ¶
type MultisignCfg ¶
func (*MultisignCfg) RegisterFlags ¶
func (c *MultisignCfg) RegisterFlags(fs *flag.FlagSet)
type QueryCfg ¶
func (*QueryCfg) RegisterFlags ¶
type RotateCfg ¶
func (*RotateCfg) RegisterFlags ¶
type SessionCfg ¶
type SessionCfg struct {
RootCfg *MakeTxCfg
}
func (*SessionCfg) RegisterFlags ¶
func (c *SessionCfg) RegisterFlags(fs *flag.FlagSet)
type SessionCreateCfg ¶
type SessionCreateCfg struct {
RootCfg *SessionCfg
PublicKey string
ExpiresAt string
AllowPaths commands.StringArr
SpendLimit string
SpendPeriod int64
}
func (*SessionCreateCfg) RegisterFlags ¶
func (c *SessionCreateCfg) RegisterFlags(fs *flag.FlagSet)
type SessionRevokeAllCfg ¶
type SessionRevokeAllCfg struct {
RootCfg *SessionCfg
}
func (*SessionRevokeAllCfg) RegisterFlags ¶
func (c *SessionRevokeAllCfg) RegisterFlags(fs *flag.FlagSet)
type SessionRevokeCfg ¶
type SessionRevokeCfg struct {
RootCfg *SessionCfg
PublicKey string
}
func (*SessionRevokeCfg) RegisterFlags ¶
func (c *SessionRevokeCfg) RegisterFlags(fs *flag.FlagSet)
type SignCfg ¶
type SignCfg struct {
RootCfg *BaseCfg
TxPath string
ChainID string
AccountNumber uint64
Sequence uint64
NameOrBech32 string
Session bool
OutputDocument string
}
func (*SignCfg) RegisterFlags ¶
type VerifyCfg ¶
type VerifyCfg struct {
RootCfg *BaseCfg
SigPath string
TxPath string
ChainID string
AccountNumber commands.Uint64Flag
AccountSequence commands.Uint64Flag
}