mapper

package
v0.1.47 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContractAddressMetadata  = "contractAddress"
	IndexTransferredMetadata = "indexTransferred"

	OpCall          = "CALL"
	OpFee           = "FEE"
	OpCreate        = "CREATE"
	OpCreate2       = "CREATE2"
	OpSelfDestruct  = "SELFDESTRUCT"
	OpCallCode      = "CALLCODE"
	OpDelegateCall  = "DELEGATECALL"
	OpStaticCall    = "STATICCALL"
	OpDestruct      = "DESTRUCT"
	OpImport        = "IMPORT"
	OpExport        = "EXPORT"
	OpErc20Transfer = "ERC20_TRANSFER"
	OpErc20Mint     = "ERC20_MINT"
	OpErc20Burn     = "ERC20_BURN"

	OpErc721TransferSender  = "ERC721_SENDER"
	OpErc721TransferReceive = "ERC721_RECEIVE"
	OpErc721Mint            = "ERC721_MINT"
	OpErc721Burn            = "ERC721_BURN"

	StatusSuccess = "SUCCESS"
	StatusFailure = "FAILURE"

	MetadataTxFee           = "tx_fee"
	MetadataImportedInputs  = "imported_inputs"
	MetadataExportedOutputs = "exported_outputs"
	MetadataAddressFormat   = "address_format"
	AddressFormatBech32     = "bech32"
)

Variables

View Source
var (
	StageBootstrap = &types.SyncStatus{
		Synced: types.Bool(false),
		Stage:  types.String("BOOTSTRAP"),
	}

	StageSynced = &types.SyncStatus{
		Synced: types.Bool(true),
		Stage:  types.String("SYNCED"),
	}

	AvaxCurrency = &types.Currency{
		Symbol:   "AVAX",
		Decimals: 18,
	}

	AtomicAvaxCurrency = &types.Currency{
		Symbol:   "AVAX",
		Decimals: 9,
	}

	OperationStatuses = []*types.OperationStatus{
		{
			Status:     StatusSuccess,
			Successful: true,
		},
		{
			Status:     StatusFailure,
			Successful: false,
		},
	}

	OperationTypes = []string{
		OpFee,
		OpCall,
		OpCreate,
		OpCreate2,
		OpSelfDestruct,
		OpCallCode,
		OpDelegateCall,
		OpStaticCall,
		OpDestruct,
		OpImport,
		OpExport,
		OpErc20Burn,
		OpErc20Mint,
		OpErc20Transfer,
		OpErc721TransferReceive,
		OpErc721TransferSender,
		OpErc721Mint,
		OpErc721Burn,
	}

	CallMethods = []string{
		"eth_getTransactionReceipt",
	}
)
View Source
var (
	X2crate = big.NewInt(1000000000)
)

Functions

func Account

func Account(address *common.Address) *types.AccountIdentifier

func Amount

func Amount(value *big.Int, currency *types.Currency) *types.Amount

func AtomicAvaxAmount added in v0.1.26

func AtomicAvaxAmount(value *big.Int) *types.Amount

AtomicAvaxAmount creates a Rosetta Amount representing AVAX amount in nAVAXs with given quantity

func AvaxAmount

func AvaxAmount(value *big.Int) *types.Amount

func BlockMetadata

func BlockMetadata(block *types.Block) map[string]interface{}

BlockMetadata returns meta data for a block

func CallType

func CallType(t string) bool

func CreateType

func CreateType(t string) bool

func CrossChainTransactions

func CrossChainTransactions(
	networkIdentifier *types.NetworkIdentifier,
	chainIDToAliasMapping map[ids.ID]constants.ChainIDAlias,
	avaxAssetID string,
	block *ethtypes.Block,
	ap5Activation uint64,
) ([]*types.Transaction, error)

func DecodeToBytes added in v0.1.26

func DecodeToBytes(binaryData string) ([]byte, error)

DecodeToBytes decodes given string into bytes using the same encoding as EncodeBytes

func DecodeUTXOID added in v0.1.26

func DecodeUTXOID(s string) (*avax.UTXOID, error)

DecodeUTXOID decodes given string into avax.UTXOID

func EncodeBytes added in v0.1.26

func EncodeBytes(bytes []byte) (string, error)

EncodeBytes encodes given bytes to string

func EqualFoldContains added in v0.0.26

func EqualFoldContains(arr []string, str string) bool

EqualFoldContains checks if the array contains the string regardless of casing

func Erc20Amount added in v0.0.26

func Erc20Amount(
	bytes []byte,
	currency *types.Currency,
	sender bool,
) *types.Amount

func GetHRP added in v0.1.26

func GetHRP(networkIdentifier *types.NetworkIdentifier) (string, error)

GetHRP fetches hrp for address formatting.

func MarshalJSONMap added in v0.1.26

func MarshalJSONMap(i interface{}) (map[string]interface{}, error)

MarshalJSONMap converts an interface into a map[string]interface{}.

func MempoolTransactionsIDs

func MempoolTransactionsIDs(accountMap client.TxAccountMap) []*types.TransactionIdentifier

MempoolTransactionsIDs returns a list of transction IDs in the mempool

func Peers

func Peers(peers []info.Peer) []*types.Peer

func ToCurrency added in v0.1.5

func ToCurrency(symbol string, decimals uint8, contractAddress common.Address) *types.Currency

func Transaction

func Transaction(
	header *ethtypes.Header,
	tx *ethtypes.Transaction,
	msg *core.Message,
	receipt *ethtypes.Receipt,
	trace *client.Call,
	flattenedTrace []*client.FlatCall,
	rpcClient client.Client,
	isAnalyticsMode bool,
	standardModeWhiteList []string,
	includeUnknownTokens bool,
) (*types.Transaction, error)

func UnmarshalJSONMap added in v0.1.26

func UnmarshalJSONMap(m map[string]interface{}, i interface{}) error

UnmarshalJSONMap converts map[string]interface{} into a interface{}.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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