utxo

package
v8.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBitcoinCashChainConfig

func DefaultBitcoinCashChainConfig(
	name string,
	rpcUser string,
	rpcPassword string,
) ibc.ChainConfig

func DefaultBitcoinChainConfig

func DefaultBitcoinChainConfig(
	name string,
	rpcUser string,
	rpcPassword string,
) ibc.ChainConfig

func DefaultDogecoinChainConfig

func DefaultDogecoinChainConfig(
	name string,
	rpcUser string,
	rpcPassword string,
) ibc.ChainConfig

func DefaultLitecoinChainConfig

func DefaultLitecoinChainConfig(
	name string,
	rpcUser string,
	rpcPassword string,
) ibc.ChainConfig

func NewWallet

func NewWallet(keyname string, address string) ibc.Wallet

func PanicFunctionName

func PanicFunctionName()

Types

type ListReceivedByAddress

type ListReceivedByAddress []ReceivedByAddress

type ListUtxo

type ListUtxo []Utxo

type NodeWallet

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

type ReceivedByAddress

type ReceivedByAddress struct {
	Address string  `json:"address"`
	Amount  float64 `json:"amount"`
}

type SendInput

type SendInput struct {
	TxId string `json:"txid"` // hex
	Vout int    `json:"vout"`
}

type SendInputs

type SendInputs []SendInput

type SendOutput

type SendOutput struct {
	Amount float64 `json:"replaceWithAddress,omitempty"`
	Change float64 `json:"replaceWithChangeAddr,omitempty"`
	Data   string  `json:"data,omitempty"` // hex
}

type SendOutputs

type SendOutputs []SendOutput

type SignRawTxError

type SignRawTxError struct {
	Txid      string   `json:"txid"`
	Vout      int      `json:"vout"`
	Witness   []string `json:"witness"`
	ScriptSig string   `json:"scriptSig"`
	Sequence  int      `json:"sequence"`
	Error     string   `json:"error"`
}

type SignRawTxOutput

type SignRawTxOutput struct {
	Hex      string           `json:"hex"`
	Complete bool             `json:"complete"`
	Errors   []SignRawTxError `json:"errors"`
}

type TransactionReceipt

type TransactionReceipt struct {
	TxHash string `json:"transactionHash"`
}

type Utxo

type Utxo struct {
	TxId          string  `json:"txid,omitempty"`
	Vout          int     `json:"vout,omitempty"`
	Address       string  `json:"address,omitempty"`
	Label         string  `json:"label,omitempty"`
	ScriptPubKey  string  `json:"scriptPubKey,omitempty"`
	Amount        float64 `json:"amount,omitempty"`
	Confirmations int     `json:"confirmations,omitempty"`
	Spendable     bool    `json:"spendable,omitempty"`
	Solvable      bool    `json:"solvable,omitempty"`
	Desc          string  `json:"desc,omitempty"`
	Safe          bool    `json:"safe,omitempty"`
}

type UtxoChain

type UtxoChain struct {
	VolumeName   string
	NetworkID    string
	DockerClient *dockerclient.Client

	// cli arguments
	BinDaemon          string
	BinCli             string
	RpcUser            string
	RpcPassword        string
	BaseCli            []string
	AddrToKeyNameMap   map[string]string
	KeyNameToWalletMap map[string]*NodeWallet

	WalletVersion int
	// contains filtered or unexported fields
}

func NewUtxoChain

func NewUtxoChain(testName string, chainConfig ibc.ChainConfig, log *zap.Logger) *UtxoChain

func (*UtxoChain) Acknowledgements

func (c *UtxoChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)

func (*UtxoChain) Bind

func (c *UtxoChain) Bind() []string

func (*UtxoChain) BuildRelayerWallet

func (c *UtxoChain) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error)

func (*UtxoChain) BuildWallet

func (c *UtxoChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)

func (*UtxoChain) Config

func (c *UtxoChain) Config() ibc.ChainConfig

func (*UtxoChain) CreateKey

func (c *UtxoChain) CreateKey(ctx context.Context, keyName string) error

func (*UtxoChain) CreateRawTransaction

func (c *UtxoChain) CreateRawTransaction(ctx context.Context, keyName string, listUtxo ListUtxo, addr string, sendAmount float64, script []byte) (string, error)

func (*UtxoChain) CreateWallet

func (c *UtxoChain) CreateWallet(ctx context.Context, keyName string) error

func (*UtxoChain) Exec

func (c *UtxoChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)

func (*UtxoChain) ExportState

func (c *UtxoChain) ExportState(ctx context.Context, height int64) (string, error)

func (*UtxoChain) GetAddress

func (c *UtxoChain) GetAddress(ctx context.Context, keyName string) ([]byte, error)

Get address of account, cast to a string to use

func (*UtxoChain) GetBalance

func (c *UtxoChain) GetBalance(ctx context.Context, address string, denom string) (sdkmath.Int, error)

func (*UtxoChain) GetGRPCAddress

func (c *UtxoChain) GetGRPCAddress() string

func (*UtxoChain) GetGasFeesInNativeDenom

func (c *UtxoChain) GetGasFeesInNativeDenom(gasPaid int64) int64

func (*UtxoChain) GetHostGRPCAddress

func (c *UtxoChain) GetHostGRPCAddress() string

func (*UtxoChain) GetHostPeerAddress

func (*UtxoChain) GetHostPeerAddress() string

func (*UtxoChain) GetHostRPCAddress

func (c *UtxoChain) GetHostRPCAddress() string

func (*UtxoChain) GetHostWSAddress

func (c *UtxoChain) GetHostWSAddress() string

func (*UtxoChain) GetNewAddress

func (c *UtxoChain) GetNewAddress(ctx context.Context, keyName string, mweb bool) (string, error)

func (*UtxoChain) GetRPCAddress

func (c *UtxoChain) GetRPCAddress() string

func (*UtxoChain) GetWSAddress

func (c *UtxoChain) GetWSAddress() string

func (*UtxoChain) GetWalletVersion

func (c *UtxoChain) GetWalletVersion(ctx context.Context, keyName string) (int, error)

Depending on the wallet version, getwalletinfo may require a created wallet name

func (*UtxoChain) Height

func (c *UtxoChain) Height(ctx context.Context) (int64, error)

func (*UtxoChain) HomeDir

func (c *UtxoChain) HomeDir() string

func (*UtxoChain) HostName

func (c *UtxoChain) HostName() string

func (*UtxoChain) Initialize

func (c *UtxoChain) Initialize(ctx context.Context, testName string, cli *dockerclient.Client, networkID string) error

func (*UtxoChain) ListUnspent

func (c *UtxoChain) ListUnspent(ctx context.Context, keyName string) (ListUtxo, error)

func (*UtxoChain) LoadWallet

func (c *UtxoChain) LoadWallet(ctx context.Context, keyName string) error

func (*UtxoChain) Name

func (c *UtxoChain) Name() string

func (*UtxoChain) RecoverKey

func (c *UtxoChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error

func (*UtxoChain) SendFunds

func (c *UtxoChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error

func (*UtxoChain) SendFundsWithNote

func (c *UtxoChain) SendFundsWithNote(ctx context.Context, keyName string, amount ibc.WalletAmount, note string) (string, error)

func (*UtxoChain) SendIBCTransfer

func (c *UtxoChain) SendIBCTransfer(ctx context.Context, channelID, keyName string, amount ibc.WalletAmount, options ibc.TransferOptions) (ibc.Tx, error)

func (*UtxoChain) SendRawTransaction

func (c *UtxoChain) SendRawTransaction(ctx context.Context, signedRawTxHex string) (string, error)

func (*UtxoChain) SetAccount

func (c *UtxoChain) SetAccount(ctx context.Context, addr string, keyName string) error

func (*UtxoChain) SignRawTransaction

func (c *UtxoChain) SignRawTransaction(ctx context.Context, keyName string, rawTxHex string) (string, error)

func (*UtxoChain) Start

func (c *UtxoChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error

func (*UtxoChain) Timeouts

func (c *UtxoChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)

func (*UtxoChain) UnloadWallet

func (c *UtxoChain) UnloadWallet(ctx context.Context, keyName string) error

func (*UtxoChain) UnloadWalletAfterUse

func (c *UtxoChain) UnloadWalletAfterUse(on bool)

UnloadWalletAfterUse() sets whether non-default wallets stay loaded Default value is false, wallets will stay loaded Setting this to true will load/unload a wallet for each action on a specific wallet. Currently, the only know case where this is required true is when using bifrost.

type UtxoWallet

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

func (*UtxoWallet) Address

func (w *UtxoWallet) Address() []byte

Get Address with chain's prefix

func (*UtxoWallet) FormattedAddress

func (w *UtxoWallet) FormattedAddress() string

Get formatted address, passing in a prefix

func (*UtxoWallet) KeyName

func (w *UtxoWallet) KeyName() string

func (*UtxoWallet) Mnemonic

func (w *UtxoWallet) Mnemonic() string

Get mnemonic, only used for relayer wallets

type WalletInfo

type WalletInfo struct {
	WalletVersion int `json:"walletversion"`
}

Jump to

Keyboard shortcuts

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