SignedTransactionWithNonce

Documentation for eth_defi.hotwallet.SignedTransactionWithNonce Python class.

class SignedTransactionWithNonce

Bases: NamedTuple

A better signed transaction structure.

Helper class to pass around the used nonce when signing txs from the wallet.

  • Compatible with eth_accounts.datastructures.SignedTransaction. Emulates its behavior and should be backwards compatible.

  • Retains more information about the transaction source, to allow us to diagnose broadcasting failures better

  • Add some debugging helpers

Create new instance of SignedTransactionWithNonce(rawTransaction, hash, r, s, v, nonce, address, source)

Attributes summary

address

Alias for field number 6

hash

Alias for field number 1

nonce

Alias for field number 5

r

Alias for field number 2

rawTransaction

Alias for field number 0

raw_transaction

Get the bytes to be broadcasted to the P2P network.

s

Alias for field number 3

source

Alias for field number 7

v

Alias for field number 4

Methods summary

__init__()

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

static __new__(_cls, rawTransaction, hash, r, s, v, nonce, address, source=None)

Create new instance of SignedTransactionWithNonce(rawTransaction, hash, r, s, v, nonce, address, source)

Parameters
  • rawTransaction (hexbytes.main.HexBytes) –

  • hash (hexbytes.main.HexBytes) –

  • r (int) –

  • s (int) –

  • v (int) –

  • nonce (int) –

  • address (str) –

  • source (Optional[dict]) –

address: str

Alias for field number 6

count(value, /)

Return number of occurrences of value.

hash: hexbytes.main.HexBytes

Alias for field number 1

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

nonce: int

Alias for field number 5

r: int

Alias for field number 2

rawTransaction: hexbytes.main.HexBytes

Alias for field number 0

property raw_transaction: hexbytes.main.HexBytes

Get the bytes to be broadcasted to the P2P network.

Legacy web3.py compatibility.

s: int

Alias for field number 3

source: Optional[dict]

Alias for field number 7

v: int

Alias for field number 4