Documentation
¶
Index ¶
- Constants
- func GetMnemonic(chName string) string
- func LoadSingleChainInfo(env string, chainName string) (cns.Chain, error)
- type ChainClient
- func (c *ChainClient) AccountCreate(accountName, mnemonic, hdPath string) (spn.Account, error)
- func (c ChainClient) AccountGet(accountName string) (spn.Account, error)
- func (c *ChainClient) AccountList() (accounts []spn.Account, err error)
- func (c *ChainClient) Broadcast(fromName string, fromAddr types.AccAddress, clientCtx client.Context, ...) (*types.TxResponse, error)
- func (c *ChainClient) BuildClientCtx(accountName string, accountAddress types.AccAddress) (client.Context, error)
- func (c *ChainClient) GetAccAddress(accountName string) (sdktypes.AccAddress, error)
- func (c ChainClient) GetAccountBalances(address, denom string) (*sdktypes.Coin, error)
- func (c *ChainClient) GetAccountInfo(address string) (authtypes.AccountI, error)
- func (c *ChainClient) GetBondedValidators() (stakingtypes.Validators, error)
- func (c *ChainClient) GetContext() client.Context
- func (c *ChainClient) GetDelegations(address string) (stakingtypes.DelegationResponses, error)
- func (c *ChainClient) GetKeyring() keyring.Keyring
- func (c *ChainClient) GetUnbondedValidators() (stakingtypes.Validators, error)
- func (c *ChainClient) GetUnbondingDelegations(address string) (stakingtypes.UnbondingDelegations, error)
- func (c ChainClient) ImportMnemonic(keyName, mnemonic, hdPath string) (acc spn.Account, err error)
- func (c *ChainClient) PrepareBroadcast(msgs ...types.Msg) error
- func (c *ChainClient) SignTx(fromName string, fromAddr types.AccAddress, clientCtx client.Context, ...) ([]byte, error)
- func (c ChainClient) ToAccount(info keyring.Info) spn.Account
Constants ¶
const ( StagingEnvKey = "staging" AkashMnemonicKey = "AKASH_MNEMONIC" CosmosMnemonicKey = "COSMOS_MNEMONIC" TerraMnemonicKey = "TERRA_MNEMONIC" OsmosisMnemonicKey = "OSMOSIS_MNEMONIC" )
const (
KeyringBackendTest = "test"
)
Variables ¶
This section is empty.
Functions ¶
func GetMnemonic ¶
GetMnemonic returns the mnemonic of particular chain for staging accounts
Types ¶
type ChainClient ¶
type ChainClient struct { Address string `json:"address"` AddressPrefix string `json:"account_address_prefix"` RPC string `json:"rpc"` Key string `json:"key"` Mnemonic string `json:"mnemonic"` KeyringServiceName string `json:"keyring_service_name"` HDPath string `json:"hd_path"` Enabled bool `json:"enabled"` ChainName string `json:"chain_name"` Denom string `json:"denom"` // contains filtered or unexported fields }
ChainClient is client to interact with SPN.
func CreateChainClient ¶
func CreateChainClient(nodeAddress, keyringServiceName, chainID, homePath string) (*ChainClient, error)
func GetClient ¶
func GetClient(env string, chainName string, cc ChainClient, dir string) (c *ChainClient, err error)
GetClient is to create client and imports mnemonic and returns created chain client
func (*ChainClient) AccountCreate ¶
func (c *ChainClient) AccountCreate(accountName, mnemonic, hdPath string) (spn.Account, error)
AccountCreate creates an account by name and mnemonic (optional) in the keyring.
func (ChainClient) AccountGet ¶
func (c ChainClient) AccountGet(accountName string) (spn.Account, error)
AccountGet retrieves an account by name from the keyring.
func (*ChainClient) AccountList ¶
func (c *ChainClient) AccountList() (accounts []spn.Account, err error)
AccountList returns a list of accounts.
func (*ChainClient) Broadcast ¶
func (c *ChainClient) Broadcast(fromName string, fromAddr types.AccAddress, clientCtx client.Context, msgs ...types.Msg) (*types.TxResponse, error)
Broadcast directly broadcasts the messages
func (*ChainClient) BuildClientCtx ¶
func (c *ChainClient) BuildClientCtx(accountName string, accountAddress types.AccAddress) (client.Context, error)
BuildClientCtx builds the context for the client
func (*ChainClient) GetAccAddress ¶
func (c *ChainClient) GetAccAddress(accountName string) (sdktypes.AccAddress, error)
GetAccAddress return hex address from given account name
func (ChainClient) GetAccountBalances ¶
func (c ChainClient) GetAccountBalances(address, denom string) (*sdktypes.Coin, error)
GetAccountBalances returns the balance of the account
func (*ChainClient) GetAccountInfo ¶
func (c *ChainClient) GetAccountInfo(address string) (authtypes.AccountI, error)
func (*ChainClient) GetBondedValidators ¶
func (c *ChainClient) GetBondedValidators() (stakingtypes.Validators, error)
GetBondedValidators returns bonded validators list
func (*ChainClient) GetContext ¶
func (c *ChainClient) GetContext() client.Context
GetContext return context of client
func (*ChainClient) GetDelegations ¶
func (c *ChainClient) GetDelegations(address string) (stakingtypes.DelegationResponses, error)
GetDelegations returns delegation balance of delegator address
func (*ChainClient) GetKeyring ¶
func (c *ChainClient) GetKeyring() keyring.Keyring
GetKeyring return keyring of client
func (*ChainClient) GetUnbondedValidators ¶
func (c *ChainClient) GetUnbondedValidators() (stakingtypes.Validators, error)
GetUnbondedValidators returns bonded validators list
func (*ChainClient) GetUnbondingDelegations ¶
func (c *ChainClient) GetUnbondingDelegations(address string) (stakingtypes.UnbondingDelegations, error)
GetUnbondingDelegations returns unbonding delegations of delegator address
func (ChainClient) ImportMnemonic ¶
func (c ChainClient) ImportMnemonic(keyName, mnemonic, hdPath string) (acc spn.Account, err error)
ImportMnemonic is to import existing account mnemonic in keyring
func (*ChainClient) PrepareBroadcast ¶
func (c *ChainClient) PrepareBroadcast(msgs ...types.Msg) error
PrepareBroadcast performs checks and operations before broadcasting messages