avalanche

package
v0.0.0-...-e9c744c Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LocalNetPrivateKeysIDs = []string{
		"PrivateKey-ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN",
		"PrivateKey-wHR4zmr9am94KVYnV2aRR4QXt78cuGebt1GpYNwJYEbfAGonj",
		"PrivateKey-AR874kuHtHpDk7ntffuEQ9cwiQLL2dz1DmJankW1EyXnz5fc7",
		"PrivateKey-Ntk8vV7zaWzAot2wuDXK4e9ZGFUnU49AYTDew5XUyYaNz2u9d",
		"PrivateKey-oLM8XbXxXmBHVbdKm2tRYQ1WdMj3b2NggftQpvDUXWSMtdY4i",
		"PrivateKey-2kjfDc9RVUQJnu3HQDGiVdxvhM9BmR3UTx7Aq8AJ82G2MspATy",
		"PrivateKey-2Rh5Gtu28ca7PS6rLfN6uou9ext8Y5xhoAJDdWPU7GESBLHtv6",
		"PrivateKey-2ZcbEPKkXjswsNRBGViGzruReAtTAxW9hsGeMc2GgppnJnDgne",
		"PrivateKey-22SYvqaRgFtPJfiZmswrCyE57UcssLVnNPDJ48PYAiCjKVAGy7",
		"PrivateKey-tYRsRPijLo6KD2azMLzkcB2ZUndU3a2dJ8kEqBtqesa85pWhB",
	}
	PrimaryLocalNetPrivateKey = LocalNetPrivateKeysIDs[0]

	LocalNetPrivateKeys = make([]*privatekey.PkInfo, len(LocalNetPrivateKeysIDs))
)
View Source
var ErrIncorrectGenesisChainTxType = errors.New("incorrect genesis chain tx type")

Functions

func EvmUtxos

func EvmUtxos(ctx context.Context, client evm.Client, sourceChainID ids.ID, addrs []string, fetchLimit uint32) (utxos map[ids.ID]*UTXOContainer, err error)

EvmUtxos fetch all spendable utxos from atomic space (importable to c-chain)

func Utxos

func Utxos(ctx context.Context, client UTXOClient, sourceChainID string, addrs []ids.ShortID, fetchLimit uint32) (utxos map[ids.ID]*UTXOContainer, err error)

Utxos fetch all spendable utxos

Types

type Client

type Client struct {
	Info info.Client
	Avm  avm.Client
	Evm  evm.Client
}

func NewClient

func NewClient(addr string) *Client

type EvmClient

type EvmClient struct {
	RpcClient *rpc.Client
	EthClient ethclient.Client
}

func NewEvmClient

func NewEvmClient(addr string) (c *EvmClient, err error)

type Genesis

type Genesis struct {
	Bytes           []byte
	AvaxAssetID     ids.ID
	Platform        *platformgenesis.Genesis
	Chains          map[ids.ID]*platformtxs.CreateChainTx
	ChainsByStr     map[string]*platformtxs.CreateChainTx
	AvmCodec        codec.Manager
	PlatformvmCodec codec.Manager
	AvmParser       avmtxs.Parser
	AVMChain        *platformtxs.CreateChainTx
	EVMChain        *platformtxs.CreateChainTx
	AVMChainTx      *platformtxs.Tx
	EVMChainTX      *platformtxs.Tx
}

Genesis the genesis components

func NewGenesis

func NewGenesis(networkID uint32) (g *Genesis, err error)

NewGenesis fetch and parse the genesis into components.

type UTXOClient

type UTXOClient interface {
	GetAtomicUTXOs(
		ctx context.Context,
		addrs []ids.ShortID,
		sourceChain string,
		limit uint32,
		startAddress ids.ShortID,
		startUTXOID ids.ID,
		options ...rpc.Option,
	) ([][]byte, ids.ShortID, ids.ID, error)
}

type UTXOContainer

type UTXOContainer struct {
	Utxos []*avax.UTXO
	Amt   uint64
}

type UTXOMap

type UTXOMap struct {
	M map[ids.ID]*UTXOContainer
}

func NewUtxoMap

func NewUtxoMap() *UTXOMap

func (*UTXOMap) PraseUtxos

func (m *UTXOMap) PraseUtxos(codec codec.Manager, utxosBytes [][]byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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