ethereum

package
v0.0.0-...-916ecc0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TransactionMode_name = map[int32]string{
		0: "Legacy",
		1: "Enveloped",
	}
	TransactionMode_value = map[string]int32{
		"Legacy":    0,
		"Enveloped": 1,
	}
)

Enum value maps for TransactionMode.

View Source
var File_Ethereum_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type SigningInput

type SigningInput struct {

	// Chain identifier (uint256, serialized little endian)
	ChainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	// Nonce (uint256, serialized little endian)
	Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// Transaction version selector: Legacy or enveloped, has impact on fee structure.
	// Default is Legacy (value 0)
	TxMode TransactionMode `protobuf:"varint,3,opt,name=tx_mode,json=txMode,proto3,enum=TW.Ethereum.Proto.TransactionMode" json:"tx_mode,omitempty"`
	// Gas price (uint256, serialized little endian)
	// Relevant for legacy transactions only (disregarded for enveloped/EIP1559)
	GasPrice []byte `protobuf:"bytes,4,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"`
	// Gas limit (uint256, serialized little endian)
	GasLimit []byte `protobuf:"bytes,5,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"`
	// Maximum optional inclusion fee (aka tip) (uint256, serialized little endian)
	// Relevant for enveloped/EIP1559 transactions only, tx_mode=Enveloped, (disregarded for legacy)
	MaxInclusionFeePerGas []byte `` /* 130-byte string literal not displayed */
	// Maximum fee (uint256, serialized little endian)
	// Relevant for enveloped/EIP1559 transactions only, tx_mode=Enveloped, (disregarded for legacy)
	MaxFeePerGas []byte `protobuf:"bytes,7,opt,name=max_fee_per_gas,json=maxFeePerGas,proto3" json:"max_fee_per_gas,omitempty"`
	// Recipient's address.
	ToAddress string `protobuf:"bytes,8,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"`
	// The secret private key used for signing (32 bytes).
	PrivateKey []byte `protobuf:"bytes,9,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
	// The payload transaction
	Transaction *Transaction `protobuf:"bytes,10,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

Input data necessary to create a signed transaction. Legacy and EIP2718/EIP1559 transactions supported, see TransactionMode.

func (*SigningInput) Descriptor deprecated

func (*SigningInput) Descriptor() ([]byte, []int)

Deprecated: Use SigningInput.ProtoReflect.Descriptor instead.

func (*SigningInput) GetChainId

func (x *SigningInput) GetChainId() []byte

func (*SigningInput) GetGasLimit

func (x *SigningInput) GetGasLimit() []byte

func (*SigningInput) GetGasPrice

func (x *SigningInput) GetGasPrice() []byte

func (*SigningInput) GetMaxFeePerGas

func (x *SigningInput) GetMaxFeePerGas() []byte

func (*SigningInput) GetMaxInclusionFeePerGas

func (x *SigningInput) GetMaxInclusionFeePerGas() []byte

func (*SigningInput) GetNonce

func (x *SigningInput) GetNonce() []byte

func (*SigningInput) GetPrivateKey

func (x *SigningInput) GetPrivateKey() []byte

func (*SigningInput) GetToAddress

func (x *SigningInput) GetToAddress() string

func (*SigningInput) GetTransaction

func (x *SigningInput) GetTransaction() *Transaction

func (*SigningInput) GetTxMode

func (x *SigningInput) GetTxMode() TransactionMode

func (*SigningInput) ProtoMessage

func (*SigningInput) ProtoMessage()

func (*SigningInput) ProtoReflect

func (x *SigningInput) ProtoReflect() protoreflect.Message

func (*SigningInput) Reset

func (x *SigningInput) Reset()

func (*SigningInput) String

func (x *SigningInput) String() string

type SigningOutput

type SigningOutput struct {

	// Signed and encoded transaction bytes.
	Encoded []byte `protobuf:"bytes,1,opt,name=encoded,proto3" json:"encoded,omitempty"`
	// The V, R, S components of the resulting signature, (each uint256, serialized little endian)
	V []byte `protobuf:"bytes,2,opt,name=v,proto3" json:"v,omitempty"`
	R []byte `protobuf:"bytes,3,opt,name=r,proto3" json:"r,omitempty"`
	S []byte `protobuf:"bytes,4,opt,name=s,proto3" json:"s,omitempty"`
	// The payload part, supplied in the input or assembled from input parameters
	Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	// error code, 0 is ok, other codes will be treated as errors
	Error common.SigningError `protobuf:"varint,6,opt,name=error,proto3,enum=TW.Common.Proto.SigningError" json:"error,omitempty"`
	// error code description
	ErrorMessage string `protobuf:"bytes,7,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
	// contains filtered or unexported fields
}

Result containing the signed and encoded transaction.

func (*SigningOutput) Descriptor deprecated

func (*SigningOutput) Descriptor() ([]byte, []int)

Deprecated: Use SigningOutput.ProtoReflect.Descriptor instead.

func (*SigningOutput) GetData

func (x *SigningOutput) GetData() []byte

func (*SigningOutput) GetEncoded

func (x *SigningOutput) GetEncoded() []byte

func (*SigningOutput) GetError

func (x *SigningOutput) GetError() common.SigningError

func (*SigningOutput) GetErrorMessage

func (x *SigningOutput) GetErrorMessage() string

func (*SigningOutput) GetR

func (x *SigningOutput) GetR() []byte

func (*SigningOutput) GetS

func (x *SigningOutput) GetS() []byte

func (*SigningOutput) GetV

func (x *SigningOutput) GetV() []byte

func (*SigningOutput) ProtoMessage

func (*SigningOutput) ProtoMessage()

func (*SigningOutput) ProtoReflect

func (x *SigningOutput) ProtoReflect() protoreflect.Message

func (*SigningOutput) Reset

func (x *SigningOutput) Reset()

func (*SigningOutput) String

func (x *SigningOutput) String() string

type Transaction

type Transaction struct {

	// Payload transfer
	//
	// Types that are assignable to TransactionOneof:
	//	*Transaction_Transfer_
	//	*Transaction_Erc20Transfer
	//	*Transaction_Erc20Approve
	//	*Transaction_Erc721Transfer
	//	*Transaction_Erc1155Transfer
	//	*Transaction_ContractGeneric_
	TransactionOneof isTransaction_TransactionOneof `protobuf_oneof:"transaction_oneof"`
	// contains filtered or unexported fields
}

Transaction (transfer, smart contract call, ...)

func (*Transaction) Descriptor deprecated

func (*Transaction) Descriptor() ([]byte, []int)

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetContractGeneric

func (x *Transaction) GetContractGeneric() *Transaction_ContractGeneric

func (*Transaction) GetErc1155Transfer

func (x *Transaction) GetErc1155Transfer() *Transaction_ERC1155Transfer

func (*Transaction) GetErc20Approve

func (x *Transaction) GetErc20Approve() *Transaction_ERC20Approve

func (*Transaction) GetErc20Transfer

func (x *Transaction) GetErc20Transfer() *Transaction_ERC20Transfer

func (*Transaction) GetErc721Transfer

func (x *Transaction) GetErc721Transfer() *Transaction_ERC721Transfer

func (*Transaction) GetTransactionOneof

func (m *Transaction) GetTransactionOneof() isTransaction_TransactionOneof

func (*Transaction) GetTransfer

func (x *Transaction) GetTransfer() *Transaction_Transfer

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

func (x *Transaction) ProtoReflect() protoreflect.Message

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type TransactionMode

type TransactionMode int32

Transaction type

const (
	// Legacy transaction, pre-EIP2718/EIP1559; for fee gasPrice/gasLimit is used
	TransactionMode_Legacy TransactionMode = 0
	// Enveloped transaction EIP2718 (with type 0x2), fee is according to EIP1559 (base fee, inclusion fee, ...)
	TransactionMode_Enveloped TransactionMode = 1
)

func (TransactionMode) Descriptor

func (TransactionMode) Enum

func (x TransactionMode) Enum() *TransactionMode

func (TransactionMode) EnumDescriptor deprecated

func (TransactionMode) EnumDescriptor() ([]byte, []int)

Deprecated: Use TransactionMode.Descriptor instead.

func (TransactionMode) Number

func (TransactionMode) String

func (x TransactionMode) String() string

func (TransactionMode) Type

type Transaction_ContractGeneric

type Transaction_ContractGeneric struct {

	// Amount to send in wei (uint256, serialized little endian)
	Amount []byte `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"`
	// Contract call payload data
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

Generic smart contract transaction

func (*Transaction_ContractGeneric) Descriptor deprecated

func (*Transaction_ContractGeneric) Descriptor() ([]byte, []int)

Deprecated: Use Transaction_ContractGeneric.ProtoReflect.Descriptor instead.

func (*Transaction_ContractGeneric) GetAmount

func (x *Transaction_ContractGeneric) GetAmount() []byte

func (*Transaction_ContractGeneric) GetData

func (x *Transaction_ContractGeneric) GetData() []byte

func (*Transaction_ContractGeneric) ProtoMessage

func (*Transaction_ContractGeneric) ProtoMessage()

func (*Transaction_ContractGeneric) ProtoReflect

func (*Transaction_ContractGeneric) Reset

func (x *Transaction_ContractGeneric) Reset()

func (*Transaction_ContractGeneric) String

func (x *Transaction_ContractGeneric) String() string

type Transaction_ContractGeneric_

type Transaction_ContractGeneric_ struct {
	ContractGeneric *Transaction_ContractGeneric `protobuf:"bytes,6,opt,name=contract_generic,json=contractGeneric,proto3,oneof"`
}

type Transaction_ERC1155Transfer

type Transaction_ERC1155Transfer struct {

	// Source address
	From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	// Destination address
	To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	// ID of the token (uint256, serialized little endian)
	TokenId []byte `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
	// The amount of tokens being transferred (uint256, serialized little endian)
	Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	Data  []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

ERC1155 NFT transfer transaction

func (*Transaction_ERC1155Transfer) Descriptor deprecated

func (*Transaction_ERC1155Transfer) Descriptor() ([]byte, []int)

Deprecated: Use Transaction_ERC1155Transfer.ProtoReflect.Descriptor instead.

func (*Transaction_ERC1155Transfer) GetData

func (x *Transaction_ERC1155Transfer) GetData() []byte

func (*Transaction_ERC1155Transfer) GetFrom

func (x *Transaction_ERC1155Transfer) GetFrom() string

func (*Transaction_ERC1155Transfer) GetTo

func (*Transaction_ERC1155Transfer) GetTokenId

func (x *Transaction_ERC1155Transfer) GetTokenId() []byte

func (*Transaction_ERC1155Transfer) GetValue

func (x *Transaction_ERC1155Transfer) GetValue() []byte

func (*Transaction_ERC1155Transfer) ProtoMessage

func (*Transaction_ERC1155Transfer) ProtoMessage()

func (*Transaction_ERC1155Transfer) ProtoReflect

func (*Transaction_ERC1155Transfer) Reset

func (x *Transaction_ERC1155Transfer) Reset()

func (*Transaction_ERC1155Transfer) String

func (x *Transaction_ERC1155Transfer) String() string

type Transaction_ERC20Approve

type Transaction_ERC20Approve struct {

	// Target of the approval
	Spender string `protobuf:"bytes,1,opt,name=spender,proto3" json:"spender,omitempty"`
	// Amount to send (uint256, serialized little endian)
	Amount []byte `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

ERC20 approve transaction

func (*Transaction_ERC20Approve) Descriptor deprecated

func (*Transaction_ERC20Approve) Descriptor() ([]byte, []int)

Deprecated: Use Transaction_ERC20Approve.ProtoReflect.Descriptor instead.

func (*Transaction_ERC20Approve) GetAmount

func (x *Transaction_ERC20Approve) GetAmount() []byte

func (*Transaction_ERC20Approve) GetSpender

func (x *Transaction_ERC20Approve) GetSpender() string

func (*Transaction_ERC20Approve) ProtoMessage

func (*Transaction_ERC20Approve) ProtoMessage()

func (*Transaction_ERC20Approve) ProtoReflect

func (x *Transaction_ERC20Approve) ProtoReflect() protoreflect.Message

func (*Transaction_ERC20Approve) Reset

func (x *Transaction_ERC20Approve) Reset()

func (*Transaction_ERC20Approve) String

func (x *Transaction_ERC20Approve) String() string

type Transaction_ERC20Transfer

type Transaction_ERC20Transfer struct {

	// destination address (string)
	To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
	// Amount to send (uint256, serialized little endian)
	Amount []byte `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

ERC20 token transfer transaction

func (*Transaction_ERC20Transfer) Descriptor deprecated

func (*Transaction_ERC20Transfer) Descriptor() ([]byte, []int)

Deprecated: Use Transaction_ERC20Transfer.ProtoReflect.Descriptor instead.

func (*Transaction_ERC20Transfer) GetAmount

func (x *Transaction_ERC20Transfer) GetAmount() []byte

func (*Transaction_ERC20Transfer) GetTo

func (x *Transaction_ERC20Transfer) GetTo() string

func (*Transaction_ERC20Transfer) ProtoMessage

func (*Transaction_ERC20Transfer) ProtoMessage()

func (*Transaction_ERC20Transfer) ProtoReflect

func (*Transaction_ERC20Transfer) Reset

func (x *Transaction_ERC20Transfer) Reset()

func (*Transaction_ERC20Transfer) String

func (x *Transaction_ERC20Transfer) String() string

type Transaction_ERC721Transfer

type Transaction_ERC721Transfer struct {

	// Source address
	From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	// Destination address
	To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	// ID of the token (uint256, serialized little endian)
	TokenId []byte `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
	// contains filtered or unexported fields
}

ERC721 NFT transfer transaction

func (*Transaction_ERC721Transfer) Descriptor deprecated

func (*Transaction_ERC721Transfer) Descriptor() ([]byte, []int)

Deprecated: Use Transaction_ERC721Transfer.ProtoReflect.Descriptor instead.

func (*Transaction_ERC721Transfer) GetFrom

func (x *Transaction_ERC721Transfer) GetFrom() string

func (*Transaction_ERC721Transfer) GetTo

func (*Transaction_ERC721Transfer) GetTokenId

func (x *Transaction_ERC721Transfer) GetTokenId() []byte

func (*Transaction_ERC721Transfer) ProtoMessage

func (*Transaction_ERC721Transfer) ProtoMessage()

func (*Transaction_ERC721Transfer) ProtoReflect

func (*Transaction_ERC721Transfer) Reset

func (x *Transaction_ERC721Transfer) Reset()

func (*Transaction_ERC721Transfer) String

func (x *Transaction_ERC721Transfer) String() string

type Transaction_Erc1155Transfer

type Transaction_Erc1155Transfer struct {
	Erc1155Transfer *Transaction_ERC1155Transfer `protobuf:"bytes,5,opt,name=erc1155_transfer,json=erc1155Transfer,proto3,oneof"`
}

type Transaction_Erc20Approve

type Transaction_Erc20Approve struct {
	Erc20Approve *Transaction_ERC20Approve `protobuf:"bytes,3,opt,name=erc20_approve,json=erc20Approve,proto3,oneof"`
}

type Transaction_Erc20Transfer

type Transaction_Erc20Transfer struct {
	Erc20Transfer *Transaction_ERC20Transfer `protobuf:"bytes,2,opt,name=erc20_transfer,json=erc20Transfer,proto3,oneof"`
}

type Transaction_Erc721Transfer

type Transaction_Erc721Transfer struct {
	Erc721Transfer *Transaction_ERC721Transfer `protobuf:"bytes,4,opt,name=erc721_transfer,json=erc721Transfer,proto3,oneof"`
}

type Transaction_Transfer

type Transaction_Transfer struct {

	// Amount to send in wei (uint256, serialized little endian)
	Amount []byte `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"`
	// Optional payload data
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

Native coin transfer transaction

func (*Transaction_Transfer) Descriptor deprecated

func (*Transaction_Transfer) Descriptor() ([]byte, []int)

Deprecated: Use Transaction_Transfer.ProtoReflect.Descriptor instead.

func (*Transaction_Transfer) GetAmount

func (x *Transaction_Transfer) GetAmount() []byte

func (*Transaction_Transfer) GetData

func (x *Transaction_Transfer) GetData() []byte

func (*Transaction_Transfer) ProtoMessage

func (*Transaction_Transfer) ProtoMessage()

func (*Transaction_Transfer) ProtoReflect

func (x *Transaction_Transfer) ProtoReflect() protoreflect.Message

func (*Transaction_Transfer) Reset

func (x *Transaction_Transfer) Reset()

func (*Transaction_Transfer) String

func (x *Transaction_Transfer) String() string

type Transaction_Transfer_

type Transaction_Transfer_ struct {
	Transfer *Transaction_Transfer `protobuf:"bytes,1,opt,name=transfer,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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