Documentation ¶
Index ¶
- Variables
- func InitCosmosKeyring(cosmosKeyringDir string, cosmosKeyringAppName string, ...) (cosmtypes.AccAddress, keyring.Keyring, error)
- func KeyringForPrivKey(cdc codec.Codec, name string, privKey cryptotypes.PrivKey) (keyring.Keyring, error)
- func NewClientContext(chainId, fromSpec string, kb keyring.Keyring) (client.Context, error)
- func NewCodec() (*codec.ProtoCodec, types.InterfaceRegistry)
- func NewTxConfig(signModes []signingtypes.SignMode) client.TxConfig
- func NewTxFactory(clientCtx client.Context) tx.Factory
- type ChainClient
- type EncodingConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InitCosmosKeyring ¶
func KeyringForPrivKey ¶
func KeyringForPrivKey(cdc codec.Codec, name string, privKey cryptotypes.PrivKey) (keyring.Keyring, error)
KeyringForPrivKey creates a temporary in-mem keyring for a PrivKey. Allows to init Context when the key has been provided in plaintext and parsed.
func NewClientContext ¶
NewClientContext creates a new Cosmos Client context, where chainID corresponds to Cosmos chain ID, fromSpec is either name of the key, or bech32-address of the Cosmos account. Keyring is required to contain the specified key.
func NewCodec ¶
func NewCodec() (*codec.ProtoCodec, types.InterfaceRegistry)
func NewTxConfig ¶
func NewTxConfig(signModes []signingtypes.SignMode) client.TxConfig
NewTxConfig initializes new Cosmos TxConfig with certain signModes enabled.
Types ¶
type ChainClient ¶
type ChainClient interface { CanSignTransactions() bool FromAddress() sdk.AccAddress QueryClient() *grpc.ClientConn ClientContext() client.Context SimulateMsg(clientCtx client.Context, msgs ...sdk.Msg) (*txtypes.SimulateResponse, error) AsyncBroadcastMsg(msgs ...sdk.Msg) (*txtypes.BroadcastTxResponse, error) SyncBroadcastMsg(msgs ...sdk.Msg) (*txtypes.BroadcastTxResponse, error) QueueBroadcastMsg(msgs ...sdk.Msg) error GetBankBalances(ctx context.Context, address string) (*banktypes.QueryAllBalancesResponse, error) GetBankBalance(ctx context.Context, address string, denom string) (*banktypes.QueryBalanceResponse, error) GetAccount(ctx context.Context, address string) (*authtypes.QueryAccountResponse, error) // MultiChain GetAllChainConfig(ctx context.Context) (*multichainTypes.QueryAllChainConfigResponse, error) GetChainConfig(ctx context.Context, chainId string) (*multichainTypes.QueryGetChainConfigResponse, error) // Attestation GetLatestValsetNonce(ctx context.Context) (*attestationTypes.QueryLatestValsetNonceResponse, error) GetAllValsets(ctx context.Context, pagination *query.PageRequest) (*attestationTypes.QueryAllValsetResponse, error) GetValsetByNonce(c context.Context, valsetNonce uint64) (*attestationTypes.QueryGetValsetResponse, error) GetLatestValset(ctx context.Context) (*attestationTypes.QueryLatestValsetResponse, error) GetLastEventByValidator(ctx context.Context, chainId string, validator sdk.ValAddress) (*attestationTypes.QueryLastEventNonceResponse, error) GetAllOrchestrators(ctx context.Context) (*attestationTypes.QueryListOrchestratorsResponse, error) GetOrchestratorValidator(ctx context.Context, orchestratorAddr sdk.AccAddress) (*attestationTypes.QueryFetchOrchestratorValidatorResponse, error) GetValsetConfirm(ctx context.Context, valsetNonce uint64, orchestrator string) (*attestationTypes.QueryGetValsetConfirmationResponse, error) GetAllValsetConfirms(ctx context.Context, valsetNonce uint64) (*attestationTypes.QueryAllValsetConfirmationResponse, error) // Crosschain GetAllCrosschainRequests(ctx context.Context, pagination *query.PageRequest) (*crosschainTypes.QueryAllCrosschainRequestResponse, error) GetAllCrosschainRequestConfirmations(ctx context.Context, pagination *query.PageRequest, sourceChainId string, requestIdentifier uint64, claimHash []byte) (*crosschainTypes.QueryAllCrosschainRequestConfirmResponse, error) GetAllCrosschainAckRequests(ctx context.Context, pagination *query.PageRequest) (*crosschainTypes.QueryAllCrosschainAckRequestResponse, error) GetAllCrosschainRequestAckConfirmations(ctx context.Context, pagination *query.PageRequest, ackSrcChainId string, ackRequestIdentifier uint64, claimHash []byte) (*crosschainTypes.QueryAllCrosschainAckRequestConfirmResponse, error) GetCrosschainRequestConfirmation(ctx context.Context, pagination *query.PageRequest, sourceChainId string, requestIdentifier uint64, claimHash []byte, orchestrator string) (*crosschainTypes.QueryGetCrosschainRequestConfirmResponse, error) GetCrosschainAckRequestConfirmation(ctx context.Context, pagination *query.PageRequest, ackSrcChainId string, ackRequestIdentifier uint64, claimHash []byte, orchestrator string) (*crosschainTypes.QueryGetCrosschainAckRequestConfirmResponse, error) GetCrosschainAckRequest(ctx context.Context, ackSrcChainId string, ackRequestIdentifier uint64) (*crosschainTypes.QueryGetCrosschainAckRequestResponse, error) GetCrosschainRequest(ctx context.Context, srcChainId string, requestIdentifier uint64) (*crosschainTypes.QueryGetCrosschainRequestResponse, error) GetCrosschainAckReceipt(ctx context.Context, ackReceiptSrcChainId string, ackReceiptIdentifier uint64) (*crosschainTypes.QueryGetCrosschainAckReceiptResponse, error) // MetaStore GetAllMetaInfo(ctx context.Context) (*metastoreTypes.QueryAllMetaInfoResponse, error) GetMetaInfo(ctx context.Context, chainId string, dappAddress []byte) (*metastoreTypes.QueryAllMetaInfoResponseByChainAndAddress, error) // Wasm StoreCode(file string, sender sdk.AccAddress) (int64, error) InstantiateContract(codeID uint64, label string, amountStr string, initMsg string, adminStr string, noAdmin bool, sender sdk.AccAddress) (string, error) ExecuteContract(amountStr string, sender sdk.AccAddress, contractAddr string, execMsg string) error SmartContractState(ctx context.Context, contractAddress string, queryData []byte) (*wasmTypes.QuerySmartContractStateResponse, error) RawContractState(ctx context.Context, contractAddress string, queryData []byte) (*wasmTypes.QueryRawContractStateResponse, error) GetGasFee() (string, error) Close() }
func InitialiseChainClient ¶
func InitialiseChainClient(networkName string, keyringFrom string, passphrase string, privateKey string) ChainClient
func NewChainClient ¶
func NewChainClient( ctx client.Context, protoAddr string, options ...common.ClientOption, ) (ChainClient, error)
NewCosmosClient creates a new gRPC client that communicates with gRPC server at protoAddr. protoAddr must be in form "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock", protocol is required.
type EncodingConfig ¶
Click to show internal directories.
Click to hide internal directories.