Documentation ¶
Index ¶
- Constants
- func InitConfig()
- func RegisterSimulateRoute(cliCtx context.CLIContext, r *mux.Router)
- func SimulateRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc
- type Keybase
- func (kb *Keybase) CloseDB()
- func (kb *Keybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd, hdPath string, ...) (keys.Info, error)
- func (kb *Keybase) CreateLedger(name string, algo keys.SigningAlgo, hrp string, account, index uint32) (keys.Info, error)
- func (kb *Keybase) CreateMnemonic(name string, language keys.Language, passwd string, algo keys.SigningAlgo) (keys.Info, string, error)
- func (kb *Keybase) CreateMulti(name string, pubkey crypto.PubKey) (keys.Info, error)
- func (kb *Keybase) CreateOffline(name string, pubkey crypto.PubKey, algo keys.SigningAlgo) (keys.Info, error)
- func (kb *Keybase) Delete(name, passphrase string, skipPass bool) error
- func (kb *Keybase) Exist(name string) (bool, error)
- func (kb *Keybase) Export(name string) (armor string, err error)
- func (kb *Keybase) ExportPrivKey(name, decryptPassphrase, encryptPassphrase string) (armor string, err error)
- func (kb *Keybase) ExportPrivateKeyObject(name string, passphrase string) (crypto.PrivKey, error)
- func (kb *Keybase) ExportPubKey(name string) (armor string, err error)
- func (kb *Keybase) Get(name string) (keys.Info, error)
- func (kb *Keybase) GetByAddress(address types.AccAddress) (keys.Info, error)
- func (kb *Keybase) Import(name, armor string) error
- func (kb *Keybase) ImportPrivKey(name, armor, passphrase string) error
- func (kb *Keybase) ImportPubKey(name, armor string) (err error)
- func (kb *Keybase) List() ([]keys.Info, error)
- func (kb *Keybase) NewMnemonic() (string, error)
- func (kb *Keybase) Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error)
- func (kb *Keybase) SupportedAlgos() []keys.SigningAlgo
- func (kb *Keybase) SupportedAlgosLedger() []keys.SigningAlgo
- func (kb *Keybase) Update(name, oldpass string, getNewpass func() (string, error)) error
- type LCD
- func (lcd *LCD) BroadcastMsg(msg sdk.Msg) ([]byte, error)
- func (lcd *LCD) BroadcastMsgs(msgs []sdk.Msg) ([]byte, error)
- func (lcd *LCD) Get(path string, ptr interface{}) error
- func (lcd *LCD) Post(path string, req interface{}, ptr interface{}) error
- func (lcd *LCD) PostBare(path string, req interface{}, ptr interface{}) error
- type RPC
- func (c *RPC) BuildAndBroadcastMsg(msg sdktypes.Msg) (*abci.ResponseDeliverTx, error)
- func (c *RPC) Codec() *codec.Codec
- func (c *RPC) GetAccount() (authExported.Account, error)
- func (c *RPC) QueryJSON(path string, qdata, ptr interface{}) error
- func (c *RPC) QueryWithData(path string, data []byte) ([]byte, int64, error)
- type SimulateReq
Constants ¶
const ( // CosmosBech32MainPrefix defines the main Bech32 prefix. CosmosBech32MainPrefix = "mesg" // CosmosCoinType is the mesg registered coin type from https://github.com/satoshilabs/slips/blob/master/slip-0044.md. CosmosCoinType = uint32(470) // FullFundraiserPath is the parts of the BIP44 HD path that are fixed by what we used during the fundraiser. FullFundraiserPath = "44'/470'/0'/0/0" // GasAdjustment is a multiplier to make sure transactions have enough gas when gas are estimated. GasAdjustment = 1.5 // DefaultAlgo for create account. DefaultAlgo = keys.Secp256k1 )
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶ added in v0.21.0
func InitConfig()
InitConfig sets the bech32 prefix and HDPath to cosmos config.
func RegisterSimulateRoute ¶ added in v0.23.0
func RegisterSimulateRoute(cliCtx context.CLIContext, r *mux.Router)
RegisterSimulateRoute registers the route on the router.
func SimulateRequestHandlerFn ¶ added in v0.23.0
func SimulateRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc
SimulateRequestHandlerFn - http request handler to simulate msgs.
Types ¶
type Keybase ¶
type Keybase struct {
// contains filtered or unexported fields
}
Keybase is a standard cosmos keybase.
func NewInMemoryKeybase ¶ added in v0.24.0
func NewInMemoryKeybase() *Keybase
NewInMemoryKeybase initializes a in memory keybase.
func NewKeybase ¶
NewKeybase initializes a filesystem keybase at a particular dir.
func (*Keybase) CloseDB ¶ added in v0.18.0
func (kb *Keybase) CloseDB()
CloseDB is a lock protected version of keys.CloseDB
func (*Keybase) CreateAccount ¶ added in v0.18.0
func (kb *Keybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd, hdPath string, algo keys.SigningAlgo) (keys.Info, error)
CreateAccount is a lock protected version of keys.CreateAccount
func (*Keybase) CreateLedger ¶ added in v0.18.0
func (kb *Keybase) CreateLedger(name string, algo keys.SigningAlgo, hrp string, account, index uint32) (keys.Info, error)
CreateLedger is a lock protected version of keys.CreateLedger
func (*Keybase) CreateMnemonic ¶ added in v0.18.0
func (kb *Keybase) CreateMnemonic(name string, language keys.Language, passwd string, algo keys.SigningAlgo) (keys.Info, string, error)
CreateMnemonic is a lock protected version of keys.CreateMnemonic
func (*Keybase) CreateMulti ¶ added in v0.18.0
CreateMulti is a lock protected version of keys.CreateMulti
func (*Keybase) CreateOffline ¶ added in v0.18.0
func (kb *Keybase) CreateOffline(name string, pubkey crypto.PubKey, algo keys.SigningAlgo) (keys.Info, error)
CreateOffline is a lock protected version of keys.CreateOffline
func (*Keybase) ExportPrivKey ¶ added in v0.18.0
func (kb *Keybase) ExportPrivKey(name, decryptPassphrase, encryptPassphrase string) (armor string, err error)
ExportPrivKey is a lock protected version of keys.ExportPrivKey
func (*Keybase) ExportPrivateKeyObject ¶ added in v0.18.0
ExportPrivateKeyObject is a lock protected version of keys.ExportPrivateKeyObject
func (*Keybase) ExportPubKey ¶ added in v0.18.0
ExportPubKey is a lock protected version of keys.ExportPubKey
func (*Keybase) GetByAddress ¶ added in v0.18.0
GetByAddress is a lock protected version of keys.GetByAddress
func (*Keybase) ImportPrivKey ¶ added in v0.18.0
ImportPrivKey is a lock protected version of keys.ImportPrivKey
func (*Keybase) ImportPubKey ¶ added in v0.18.0
ImportPubKey is a lock protected version of keys.ImportPubKey
func (*Keybase) NewMnemonic ¶ added in v0.15.0
NewMnemonic returns a new mnemonic phrase.
func (*Keybase) Sign ¶ added in v0.18.0
Sign is a lock protected version of keys.Sign it also keeps the last private key used in memory for the time set in `keepPrivTime` for performance improvement.
func (*Keybase) SupportedAlgos ¶ added in v0.19.0
func (kb *Keybase) SupportedAlgos() []keys.SigningAlgo
SupportedAlgos returns a list of signing algorithms supported by the keybase
func (*Keybase) SupportedAlgosLedger ¶ added in v0.19.0
func (kb *Keybase) SupportedAlgosLedger() []keys.SigningAlgo
SupportedAlgosLedger returns a list of signing algorithms supported by the keybase's ledger integration
type LCD ¶ added in v0.21.0
type LCD struct {
// contains filtered or unexported fields
}
LCD is a simple cosmos LCD client.
func NewLCD ¶ added in v0.21.0
func NewLCD(endpoint string, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, gasPrices string) (*LCD, error)
NewLCD initializes a cosmos LCD client.
func (*LCD) BroadcastMsg ¶ added in v0.21.0
BroadcastMsg sign and broadcast a transaction from a message.
func (*LCD) BroadcastMsgs ¶ added in v0.21.0
BroadcastMsgs sign and broadcast a transaction from multiple messages.
type RPC ¶ added in v0.21.0
RPC is a tendermint rpc client with helper functions.
func NewRPC ¶ added in v0.21.0
func NewRPC(client rpcclient.Client, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, gasPrices string) (*RPC, error)
NewRPC returns a rpc tendermint client.
func (*RPC) BuildAndBroadcastMsg ¶ added in v0.21.0
BuildAndBroadcastMsg builds and signs message and broadcast it to node.
func (*RPC) GetAccount ¶ added in v0.21.0
func (c *RPC) GetAccount() (authExported.Account, error)
GetAccount returns the local account.
func (*RPC) QueryJSON ¶ added in v0.21.0
QueryJSON is abci.query wrapper with errors check and decode data.
func (*RPC) QueryWithData ¶ added in v0.21.0
QueryWithData performs a query to a Tendermint node with the provided path and a data payload. It returns the result and height of the query upon success or an error if the query fails.