kava

package
v0.0.0-...-11a4fed Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	Config *util.KavaConfig

	NetworkType client.ChainNetwork

	Client *client.KavaClient
	Cdc    *amino.Codec
	// contains filtered or unexported fields
}

Executor implements the common executor interface

func NewExecutor

func NewExecutor(networkType client.ChainNetwork, cfg *util.KavaConfig) *Executor

NewExecutor creates a new Executor

func (*Executor) CalcSwapId

func (executor *Executor) CalcSwapId(randomNumberHash ec.Hash, sender string, senderOtherChain string) ([]byte, error)

CalcSwapId calculates the swap ID for a given random number hash, sender, and sender other chain

func (*Executor) Claim

func (executor *Executor) Claim(swapId ec.Hash, randomNumber ec.Hash) (string, *common.Error)

Claim sends a MsgClaimAtomicSwap to kava

func (*Executor) Claimable

func (executor *Executor) Claimable(swapId ec.Hash) (bool, error)

Claimable returns true is an AtomicSwap is currently claimable

func (*Executor) GetBalance

func (executor *Executor) GetBalance(addressString string) (*big.Int, error)

GetBalance gets an account's current kava-bnb balance

func (*Executor) GetBalanceAlertMsg

func (executor *Executor) GetBalanceAlertMsg() (string, error)

GetBalanceAlertMsg constructs an alert message if the deputy's balance is low

func (*Executor) GetBlockAndTxs

func (executor *Executor) GetBlockAndTxs(height int64) (*common.BlockAndTxLogs, error)

GetBlockAndTxs parses all transactions from a specific block height

func (*Executor) GetChain

func (executor *Executor) GetChain() string

GetChain gets the chain ID

func (*Executor) GetColdWalletAddress

func (executor *Executor) GetColdWalletAddress() string

GetColdWalletAddress gets the deputy's address from the config

func (*Executor) GetDeputyAddress

func (executor *Executor) GetDeputyAddress() string

GetDeputyAddress gets the deputy's address from the config

func (*Executor) GetFetchInterval

func (executor *Executor) GetFetchInterval() time.Duration

GetFetchInterval gets the duration between fetches

func (*Executor) GetHeight

func (executor *Executor) GetHeight() (int64, error)

GetHeight gets the current block height of the kava blockchain

func (*Executor) GetSentTxStatus

func (executor *Executor) GetSentTxStatus(hash string) store.TxStatus

GetSentTxStatus gets a sent transaction's status

func (*Executor) GetStatus

func (executor *Executor) GetStatus() (interface{}, error)

GetStatus gets the total coin balances of the deputy

func (*Executor) GetSwap

func (executor *Executor) GetSwap(swapId ec.Hash) (*common.SwapRequest, error)

GetSwap gets an AtomicSwap by its ID

func (*Executor) HTLT

func (executor *Executor) HTLT(randomNumberHash ec.Hash, timestamp int64, heightSpan int64, recipientAddr string,
	otherChainSenderAddr string, otherChainRecipientAddr string, outAmount *big.Int) (string, *common.Error)

HTLT sends a transaction containing a MsgCreateAtomicSwap to kava

func (*Executor) HasSwap

func (executor *Executor) HasSwap(swapId ec.Hash) (bool, error)

HasSwap returns true if an AtomicSwap with this ID exists on kava

func (*Executor) IsSameAddress

func (executor *Executor) IsSameAddress(addrA string, addrB string) bool

IsSameAddress checks for equality between two addresses

func (*Executor) QuerySwap

func (executor *Executor) QuerySwap(swapId []byte) (swap bep3.AtomicSwap, isExist bool, err error)

QuerySwap queries kava for an AtomicSwap

func (*Executor) Refund

func (executor *Executor) Refund(swapId ec.Hash) (string, *common.Error)

Refund sends a MsgRefundAtomicSwap to kava

func (*Executor) Refundable

func (executor *Executor) Refundable(swapId ec.Hash) (bool, error)

Refundable returns true is an AtomicSwap is currently refundable

func (*Executor) SendAmount

func (executor *Executor) SendAmount(address string, amount *big.Int) (string, error)

Jump to

Keyboard shortcuts

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