cchainatomictx

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataAtomicTxGas = "atomic_tx_gas"
	MetadataNonce       = "nonce"
	MetadataSourceChain = "source_chain"
)

Variables

This section is empty.

Functions

func BuildTx

func BuildTx(opType string, matches []*parser.Match, metadata Metadata, codec codec.Manager, avaxAssetID ids.ID) (*evm.Tx, []*types.AccountIdentifier, error)

BuildTx constructs an evm tx based on the provided operation type, Rosetta matches and metadata This method is only used during construction.

func IsAtomicOpType

func IsAtomicOpType(t string) bool

IsAtomicOpType determines whether a given C-chain operation is an atomic one

func IsCChainBech32Address

func IsCChainBech32Address(accountIdentifier *types.AccountIdentifier) bool

IsCChainBech32Address checks whether a given account identifier contains a C-chain Bech32 type address

Types

type Metadata

type Metadata struct {
	NetworkID          uint32  `json:"network_id,omitempty"`
	CChainID           ids.ID  `json:"c_chain_id,omitempty"`
	SourceChainID      *ids.ID `json:"source_chain_id,omitempty"`
	DestinationChain   string  `json:"destination_chain,omitempty"`
	DestinationChainID *ids.ID `json:"destination_chain_id,omitempty"`
	Nonce              uint64  `json:"nonce"`
}

Metadata contains metadata values returned by /construction/metadata for C-chain atomic transactions

type Options

type Options struct {
	AtomicTxGas      *big.Int `json:"atomic_tx_gas"`
	From             string   `json:"from,omitempty"`
	SourceChain      string   `json:"source_chain,omitempty"`
	DestinationChain string   `json:"destination_chain,omitempty"`
	Nonce            *big.Int `json:"nonce,omitempty"`
}

Options contains response values returned by /construction/preprocess for C-chain atomic transactions

type TxParser

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

TxParser parses C-chain atomic transactions and generate corresponding Rosetta operations

func NewTxParser

func NewTxParser(hrp string, chainIDs map[ids.ID]string, inputTxAccounts map[string]*types.AccountIdentifier) *TxParser

NewTxParser returns a new transaction parser

func (*TxParser) Parse

func (t *TxParser) Parse(tx evm.Tx) ([]*types.Operation, error)

Parse converts the given atomic evm tx to corresponding Rosetta operations This method is only used during construction.

Jump to

Keyboard shortcuts

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