Documentation ¶
Index ¶
- Constants
- func SetSDKConfigContext(prefix string) func()
- type Client
- func (c *Client) BroadcastTx(txBytes []byte) (*sdkTypes.TxResponse, error)
- func (c *Client) BuildTxFactory() (tx.Factory, error)
- func (c *Client) CreateAccount(uid, passphrase string) (string, string, error)
- func (c *Client) EstimateGas(txf tx.Factory, msgs ...sdkTypes.Msg) (*txTypes.SimulateResponse, uint64, error)
- func (c *Client) GetAccountInfo(ctx context.Context, addr string) (sdkTypes.AccountI, error)
- func (c *Client) GetArmor(uid, passphrase string) (string, error)
- func (c *Client) GetBalance(ctx context.Context, addr string, denomination string) (*sdkTypes.Coin, error)
- func (c *Client) GetFee(ctx context.Context, addr string, queryData []byte) (uint64, error)
- func (c *Client) GetKey(uid string) (*keyring.Record, error)
- func (c *Client) GetKeyByAddr(addr sdkTypes.Address) (*keyring.Record, error)
- func (c *Client) GetLatestBlockHeight(ctx context.Context) (uint64, error)
- func (c *Client) GetNetworkInfo(ctx context.Context) (*coretypes.ResultStatus, error)
- func (c *Client) GetTransactionReceipt(ctx context.Context, txHash string) (*txTypes.GetTxResponse, error)
- func (c *Client) HTTP(rpcUrl string) (*http.HTTP, error)
- func (c *Client) ImportArmor(uid string, armor []byte, passphrase string) error
- func (c *Client) IsConnected() bool
- func (c *Client) PrepareTx(ctx context.Context, txf tx.Factory, msgs ...sdkTypes.Msg) ([]byte, error)
- func (c *Client) QuerySmartContract(ctx context.Context, address string, queryData []byte) (*wasmTypes.QuerySmartContractStateResponse, error)
- func (c *Client) Reconnect() error
- func (c *Client) SetAddress(addr sdkTypes.AccAddress) sdkTypes.AccAddress
- func (c *Client) Subscribe(ctx context.Context, _, query string) (<-chan coretypes.ResultEvent, error)
- func (c *Client) TxSearch(ctx context.Context, param types.TxSearchParam) (*coretypes.ResultTxSearch, error)
- func (c *Client) Unsubscribe(ctx context.Context, _, query string) error
- type Codec
- type Config
- func (p *Config) GetMonitorEventFilters(eventMap map[string]relayerTypes.EventMap) []sdkTypes.Event
- func (pc *Config) GetWallet() string
- func (c *Config) MakeCodec(moduleBasics []module.AppModuleBasic, extraCodecs ...string) *Codec
- func (pc *Config) NewProvider(ctx context.Context, log *zap.Logger, homePath string, _ bool, ...) (provider.ChainProvider, error)
- func (pc *Config) SetWallet(addr string)
- func (pc *Config) Validate() error
- type IClient
- type Provider
- func (p *Provider) ClaimFee(ctx context.Context) error
- func (p *Provider) Config() provider.Config
- func (p *Provider) ExecuteRollback(ctx context.Context, sn *big.Int) error
- func (p *Provider) FinalityBlock(ctx context.Context) uint64
- func (p *Provider) GenerateMessages(ctx context.Context, messageKey *relayTypes.MessageKeyWithMessageHeight) ([]*relayTypes.Message, error)
- func (p *Provider) GetAddressByEventType(eventType string) string
- func (p *Provider) GetEventName(addr string) string
- func (p *Provider) GetFee(ctx context.Context, networkID string, responseFee bool) (uint64, error)
- func (p *Provider) GetLastSavedHeight() uint64
- func (p *Provider) ImportKeystore(ctx context.Context, keyPath, passphrase string) (string, error)
- func (p *Provider) Init(ctx context.Context, homePath string, kms kms.KMS) error
- func (p *Provider) Listener(ctx context.Context, lastProcessedTx relayTypes.LastProcessedTx, ...) error
- func (p *Provider) MessageReceived(ctx context.Context, key *relayTypes.MessageKey) (bool, error)
- func (p *Provider) NID() string
- func (p *Provider) Name() string
- func (p *Provider) NewKeystore(passphrase string) (string, error)
- func (p *Provider) ParseMessageFromEvents(eventsList []abiTypes.Event) ([]*relayerTypes.Message, error)
- func (p *Provider) QueryBalance(ctx context.Context, addr string) (*relayTypes.Coin, error)
- func (p *Provider) QueryLatestHeight(ctx context.Context) (uint64, error)
- func (p *Provider) QueryTransactionReceipt(ctx context.Context, txHash string) (*relayTypes.Receipt, error)
- func (p *Provider) RestoreKeystore(ctx context.Context) error
- func (p *Provider) RevertMessage(ctx context.Context, sn *big.Int) error
- func (p *Provider) Route(ctx context.Context, message *relayTypes.Message, ...) error
- func (p *Provider) SetAdmin(ctx context.Context, address string) error
- func (p *Provider) SetFee(ctx context.Context, networkdID string, msgFee, resFee *big.Int) error
- func (p *Provider) SetLastSavedHeightFunc(f func() uint64)
- func (c *Provider) SetSDKContext() func()
- func (p *Provider) ShouldReceiveMessage(ctx context.Context, message *relayTypes.Message) (bool, error)
- func (p *Provider) ShouldSendMessage(ctx context.Context, message *relayTypes.Message) (bool, error)
- func (p *Provider) SubscribeMessageEvents(ctx context.Context, blockInfoChan chan *relayTypes.BlockInfo, ...) error
- func (p *Provider) Type() string
- func (p *Provider) Wallet() sdkTypes.AccAddress
Constants ¶
const ( EventTypeWasmMessage = "wasm-Message" EventTypeWasmCallMessage = "wasm-CallMessage" EventTypeWasmRollbackMessage = "wasm-RollbackMessage" // Attr keys for connection contract events EventAttrKeyMsg = "msg" EventAttrKeyTargetNetwork string = "targetNetwork" EventAttrKeyConnSn string = "connSn" // Attr keys for xcall contract events EventAttrKeyReqID string = "reqId" EventAttrKeyData string = "data" EventAttrKeyTo string = "to" EventAttrKeyFrom string = "from" EventAttrKeySn string = "sn" EventAttrKeyContractAddress string = "_contract_address" )
Variables ¶
This section is empty.
Functions ¶
func SetSDKConfigContext ¶ added in v1.2.4
func SetSDKConfigContext(prefix string) func()
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BroadcastTx ¶
func (c *Client) BroadcastTx(txBytes []byte) (*sdkTypes.TxResponse, error)
func (*Client) CreateAccount ¶
Create new AccountI
func (*Client) EstimateGas ¶
func (*Client) GetAccountInfo ¶
func (*Client) GetBalance ¶
func (*Client) GetKeyByAddr ¶
GetAccount returns account from keyring
func (*Client) GetLatestBlockHeight ¶
func (*Client) GetNetworkInfo ¶ added in v1.2.9
GetNetworkInfo returns the network information
func (*Client) GetTransactionReceipt ¶
func (*Client) ImportArmor ¶
Load private key from keyring
func (*Client) IsConnected ¶ added in v1.2.0
IsConnected returns if the client is connected to the network
func (*Client) QuerySmartContract ¶
func (*Client) SetAddress ¶
func (c *Client) SetAddress(addr sdkTypes.AccAddress) sdkTypes.AccAddress
Set the address to be used for the transactions
func (*Client) Subscribe ¶
func (c *Client) Subscribe(ctx context.Context, _, query string) (<-chan coretypes.ResultEvent, error)
Subscribe
func (*Client) TxSearch ¶
func (c *Client) TxSearch(ctx context.Context, param types.TxSearchParam) (*coretypes.ResultTxSearch, error)
type Config ¶ added in v1.2.4
type Config struct { provider.CommonConfig `json:",inline" yaml:",inline"` GrpcUrl string `json:"grpc-url" yaml:"grpc-url"` KeyringBackend string `json:"keyring-backend" yaml:"keyring-backend"` KeyringDir string `json:"keyring-dir" yaml:"keyring-dir"` AccountPrefix string `json:"account-prefix" yaml:"account-prefix"` Denomination string `json:"denomination" yaml:"denomination"` GasPrices string `json:"gas-prices" yaml:"gas-prices"` GasAdjustment float64 `json:"gas-adjustment" yaml:"gas-adjustment"` MinGasAmount uint64 `json:"min-gas-amount" yaml:"min-gas-amount"` MaxGasAmount uint64 `json:"max-gas-amount" yaml:"max-gas-amount"` TxConfirmationInterval time.Duration `json:"tx-confirmation-interval" yaml:"tx-confirmation-interval"` BroadcastMode string `json:"broadcast-mode" yaml:"broadcast-mode"` // sync, async and block. Recommended: sync SignModeStr string `json:"sign-mode" yaml:"sign-mode"` Simulate bool `json:"simulate" yaml:"simulate"` ExtraCodec string `json:"extra-codecs" yaml:"extra-codecs"` BlockBatchSize uint64 `json:"block-batch-size" yaml:"block-batch-size"` }
func (*Config) GetMonitorEventFilters ¶ added in v1.2.4
func (*Config) MakeCodec ¶ added in v1.2.4
func (c *Config) MakeCodec(moduleBasics []module.AppModuleBasic, extraCodecs ...string) *Codec
func (*Config) NewProvider ¶ added in v1.2.4
type IClient ¶
type IClient interface { HTTP(rpcUrl string) (*http.HTTP, error) IsConnected() bool Reconnect() error GetLatestBlockHeight(ctx context.Context) (uint64, error) GetTransactionReceipt(ctx context.Context, txHash string) (*txTypes.GetTxResponse, error) GetBalance(ctx context.Context, addr string, denomination string) (*sdkTypes.Coin, error) BuildTxFactory() (tx.Factory, error) EstimateGas(txf tx.Factory, msgs ...sdkTypes.Msg) (*txTypes.SimulateResponse, uint64, error) PrepareTx(ctx context.Context, txf tx.Factory, msgs ...sdkTypes.Msg) ([]byte, error) BroadcastTx(txBytes []byte) (*sdkTypes.TxResponse, error) TxSearch(ctx context.Context, param types.TxSearchParam) (*coretypes.ResultTxSearch, error) GetAccountInfo(ctx context.Context, addr string) (sdkTypes.AccountI, error) QuerySmartContract(ctx context.Context, address string, queryData []byte) (*wasmTypes.QuerySmartContractStateResponse, error) CreateAccount(name, pass string) (string, string, error) ImportArmor(uid string, armor []byte, passphrase string) error GetArmor(uid, passphrase string) (string, error) GetKey(uid string) (*keyring.Record, error) GetKeyByAddr(addr sdkTypes.Address) (*keyring.Record, error) SetAddress(account sdkTypes.AccAddress) sdkTypes.AccAddress Subscribe(ctx context.Context, _, query string) (<-chan coretypes.ResultEvent, error) Unsubscribe(ctx context.Context, _, query string) error GetFee(ctx context.Context, addr string, queryData []byte) (uint64, error) GetNetworkInfo(ctx context.Context) (*coretypes.ResultStatus, error) }
type Provider ¶
type Provider struct { LastSavedHeightFunc func() uint64 // contains filtered or unexported fields }
func (*Provider) ExecuteRollback ¶
ExecuteRollback
func (*Provider) GenerateMessages ¶
func (p *Provider) GenerateMessages(ctx context.Context, messageKey *relayTypes.MessageKeyWithMessageHeight) ([]*relayTypes.Message, error)
func (*Provider) GetAddressByEventType ¶
GetAddressNyEventType returns the address of the contract by event type
func (*Provider) GetEventName ¶
func (*Provider) GetFee ¶
GetFee returns the fee for the given networkID responseFee is used to determine if the fee should be returned
func (*Provider) GetLastSavedHeight ¶ added in v1.2.6
GetLastSavedHeight returns the last saved height
func (*Provider) ImportKeystore ¶
ImportKeystore imports a keystore from a file
func (*Provider) Listener ¶
func (p *Provider) Listener(ctx context.Context, lastProcessedTx relayTypes.LastProcessedTx, blockInfoChan chan *relayTypes.BlockInfo) error
func (*Provider) MessageReceived ¶
func (p *Provider) MessageReceived(ctx context.Context, key *relayTypes.MessageKey) (bool, error)
func (*Provider) ParseMessageFromEvents ¶
func (*Provider) QueryBalance ¶
func (*Provider) QueryLatestHeight ¶
func (*Provider) QueryTransactionReceipt ¶
func (*Provider) RevertMessage ¶
func (*Provider) Route ¶
func (p *Provider) Route(ctx context.Context, message *relayTypes.Message, callback relayTypes.TxResponseFunc) error
func (*Provider) SetLastSavedHeightFunc ¶ added in v1.2.6
SetLastSavedHeightFunc sets the function to save the last saved height
func (*Provider) SetSDKContext ¶ added in v1.2.4
func (c *Provider) SetSDKContext() func()
func (*Provider) ShouldReceiveMessage ¶
func (*Provider) ShouldSendMessage ¶
func (*Provider) SubscribeMessageEvents ¶
func (p *Provider) SubscribeMessageEvents(ctx context.Context, blockInfoChan chan *relayTypes.BlockInfo, opts *types.SubscribeOpts, resetFunc func()) error
SubscribeMessageEvents subscribes to the message events Expermental: Allows to subscribe to the message events realtime without fully syncing the chain
func (*Provider) Wallet ¶
func (p *Provider) Wallet() sdkTypes.AccAddress
Wallet returns the wallet of the provider