cosmos_gravity

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMON_GAS = 100000
)

Variables

This section is empty.

Functions

func GetAllValsetConfirms

func GetAllValsetConfirms(contact Contact, latestNonce uint64) ([]types.ValsetConfirmResponse, error)

func GetLastEventNonce

func GetLastEventNonce(contact Contact, ourCosmosAddress common.Address) (uint64, error)

func GetLatestLogicCalls

func GetLatestLogicCalls(contact Contact) ([]types.LogicCall, error)

func GetLatestTransactionBatches

func GetLatestTransactionBatches(contact Contact) ([]types.TransactionBatch, error)

func GetLatestValSets

func GetLatestValSets(contact Contact) ([]*types.ValSet, error)

func GetLogicCallSignatures

func GetLogicCallSignatures(contact Contact, invalidId []byte, invalidNonce uint64) ([]types.LogicCallConfirmResponse, error)

func GetOldestUnsignedBatch

func GetOldestUnsignedBatch(contact Contact, address common.Address) (*types.TransactionBatch, error)

func GetOldestUnsignedValsets

func GetOldestUnsignedValsets(contact Contact, address common.Address) ([]types.ValSet, error)

func GetRequest

func GetRequest(url string) ([]byte, error)

GetRequest defines a wrapper around an HTTP GET request with a provided URL. An error is returned if the request or reading the body fails.

func GetTransactionBatchSignatures

func GetTransactionBatchSignatures(contact Contact, nonce uint64, tokenContract common.Address) ([]types.BatchConfirmResponse, error)

func GetValSet

func GetValSet(contact Contact, valSetNonce uint64) (*types.ValSet, error)

func PostRequest

func PostRequest(url string, data url.Values) ([]byte, error)

PostRequest defines a wrapper around an HTTP POST request with a provided URL and data. An error is returned if the request or reading the body fails.

func SendBatchConfirm

func SendBatchConfirm(contact Contact,
	ethPrivKey *ecdsa.PrivateKey,
	fee sdk.Coin,
	transactionBatches []*types.TransactionBatch,
	cosmosPrivKey *ecdsa.PrivateKey,
	gravityId string) (sdk.TxResponse, error)

func SendEthereumClaims

func SendEthereumClaims(contact Contact,
	cosmosPrivKey *ecdsa.PrivateKey,
	deposits []types.SendToCosmosEvent,
	withdraws []types.TransactionBatchExecutedEvent,
	erc20Deploys []types.Erc20DeployedEvent,
	logicCalls []types.LogicCallExecutedEvent,
	fee sdk.Coin) (sdk.TxResponse, error)

func SendRequestBatch

func SendRequestBatch(
	privKey *ecdsa.PrivateKey,
	denom string,
	contact Contact,
) (sdk.TxResponse, error)

func SendToEth

func SendToEth(privKey *ecdsa.PrivateKey, destination *common.Address, amount sdk.Coin, fee sdk.Coin, contact Contact) (sdk.TxResponse, error)

func SendValsetConfirms

func SendValsetConfirms(contact Contact,
	ethPrivKey *ecdsa.PrivateKey,
	fee sdk.Coin,
	valsets []types.ValSet,
	cosmosPrivKey *ecdsa.PrivateKey,
	gravityId string) (sdk.TxResponse, error)

Types

type ChainStatus

type ChainStatus struct {
	BlockHeight uint64          `json:"block_height,omitempty"`
	Status      ChainStatusEnum `json:"status"`
}

type ChainStatusEnum

type ChainStatusEnum string
const (
	MOVING           ChainStatusEnum = "moving"
	SYNCING          ChainStatusEnum = "syncing"
	WAITING_TO_START ChainStatusEnum = "waiting_to_start"
)

type Contact

type Contact struct {
	// contains filtered or unexported fields
}

func NewContact

func NewContact(rpc string) Contact

func (Contact) BroadcastTx

func (c Contact) BroadcastTx(txBz []byte) []byte

func (Contact) Get

func (c Contact) Get(url string) ([]byte, error)

func (Contact) GetBalance

func (c Contact) GetBalance(address string) sdk.Coins

func (Contact) GetChainStatus

func (c Contact) GetChainStatus() (ChainStatus, error)

func (Contact) GetNonce

func (c Contact) GetNonce(address string) uint64

func (Contact) Post

func (c Contact) Post(url string, data url.Values) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL