Documentation ¶
Index ¶
- Constants
- func DecodeEventAttributes(attrs []comettypes.EventAttribute)
- func ReplaceIncompatiableCosmosResponses(body []byte) []byte
- type Client
- func (client *Client) BuildReferenceTransfer(gasLimit uint64) (*tx.Tx, error)
- func (client *Client) EstimateGasPrice(ctx context.Context) (float64, error)
- func (client *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *Client) FetchBaseTxInput(ctx context.Context, from xc.Address) (*tx_input.TxInput, error)
- func (client *Client) FetchCw20Balance(ctx context.Context, address xc.Address, contract string) (xc.AmountBlockchain, error)
- func (client *Client) FetchDecimals(ctx context.Context, contract xc.ContractAddress) (int, error)
- func (client *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.LegacyTxInfo, error)
- func (client *Client) FetchLegacyTxInput(ctx context.Context, from xc.Address, to xc.Address) (xc.TxInput, error)
- func (client *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *Client) FetchStakeBalance(ctx context.Context, args xclient.StakedBalanceArgs) ([]*xclient.StakedBalance, error)
- func (client *Client) FetchStakingInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.StakeTxInput, error)
- func (client *Client) FetchTransferInput(ctx context.Context, args xcbuilder.TransferArgs) (xc.TxInput, error)
- func (client *Client) FetchTxInfo(ctx context.Context, txHashStr xc.TxHash) (xclient.TxInfo, error)
- func (client *Client) FetchUnstakingInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.UnstakeTxInput, error)
- func (client *Client) FetchWithdrawInput(ctx context.Context, args xcbuilder.StakeArgs) (xc.WithdrawTxInput, error)
- func (client *Client) GetAccount(ctx context.Context, address xc.Address) (client.Account, error)
- func (client *Client) SubmitTx(ctx context.Context, tx1 xc.Tx) error
- type DelegateEvent
- type ParsedEvents
- type TransferEvent
- type UnbondEvent
- type WithdrawRewardsEvent
Constants ¶
View Source
const TimeoutInBlocks = 10_000
At roughly 5s/block this is a ~12 hour timeout.
Variables ¶
This section is empty.
Functions ¶
func DecodeEventAttributes ¶
func DecodeEventAttributes(attrs []comettypes.EventAttribute)
Types ¶
type Client ¶
type Client struct { Asset xc.ITask Ctx client.Context Prefix string // contains filtered or unexported fields }
Client for Cosmos
func NewClientFrom ¶
func (*Client) BuildReferenceTransfer ¶
There is no way to estimate gas on cosmos chains. Every RPC node and validator has the ability to see their own min price. The only way currently to determine this price is to try to submit a tx for free and look at the error log.
func (*Client) EstimateGasPrice ¶
EstimateGas estimates gas price for a Cosmos chain
func (*Client) FetchBalance ¶
func (client *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
FetchBalance fetches balance for input asset for a Cosmos address
func (*Client) FetchBaseTxInput ¶
func (*Client) FetchCw20Balance ¶
func (*Client) FetchDecimals ¶
func (*Client) FetchLegacyTxInfo ¶
func (client *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.LegacyTxInfo, error)
FetchLegacyTxInfo returns tx info for a Cosmos tx
func (*Client) FetchLegacyTxInput ¶
func (*Client) FetchNativeBalance ¶
func (client *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
FetchNativeBalance fetches account balance for a Cosmos address
func (*Client) FetchStakeBalance ¶
func (client *Client) FetchStakeBalance(ctx context.Context, args xclient.StakedBalanceArgs) ([]*xclient.StakedBalance, error)
func (*Client) FetchStakingInput ¶
func (*Client) FetchTransferInput ¶
func (*Client) FetchTxInfo ¶
func (*Client) FetchUnstakingInput ¶
func (*Client) FetchWithdrawInput ¶
func (*Client) GetAccount ¶
GetAccount returns a Cosmos account Equivalent to client.Ctx.AccountRetriever.GetAccount(), but doesn't rely GetConfig()
type DelegateEvent ¶
type DelegateEvent struct { Validator string Delegator string Amount xc.AmountBlockchain Contract string }
type ParsedEvents ¶
type ParsedEvents struct { Transfers []TransferEvent // Every withdraw event also has a transfer event; so far we can ignore these Withdraws []WithdrawRewardsEvent Delegates []DelegateEvent Unbonds []UnbondEvent }
func ParseEvents ¶
func ParseEvents(events []comettypes.Event) ParsedEvents
type TransferEvent ¶
type TransferEvent struct { Recipient string Sender string Amount xc.AmountBlockchain Contract string }
type UnbondEvent ¶
type UnbondEvent struct { Validator string Delegator string Amount xc.AmountBlockchain Contract string }
type WithdrawRewardsEvent ¶
type WithdrawRewardsEvent struct { Validator string Delegator string Amount xc.AmountBlockchain Contract string }
Click to show internal directories.
Click to hide internal directories.