avantis_trader_sdk.signers package

Submodules

avantis_trader_sdk.signers.base module

class avantis_trader_sdk.signers.base.BaseSigner[source]

Bases: ABC

Base class for signers.

abstract get_ethereum_address()[source]
abstract async sign_transaction(transaction)[source]

avantis_trader_sdk.signers.kms_signer module

class avantis_trader_sdk.signers.kms_signer.KMSSigner(web3, kms_key_id, region_name='us-east-1')[source]

Bases: BaseSigner

get_eth_address()[source]

Calculate ethereum address for given AWS KMS key.

Return type:

str

get_ethereum_address()[source]

Derives the Ethereum wallet address from the public key.

Returns:

The Ethereum wallet address in checksum format.

Return type:

str

get_public_key()[source]

Retrieves the public key associated with the KMS key.

sign_msg_hash(msg_hash)[source]
Return type:

Signature

Parameters:

msg_hash (HexBytes)

async sign_transaction(transaction)[source]

Signs a transaction using AWS KMS.

Parameters:

transaction – The transaction object to be signed.

Returns:

The signed transaction object.

class avantis_trader_sdk.signers.kms_signer.Signature(r, s, v)[source]

Bases: object

Kinda compatible Signature class

Parameters:
  • r (int)

  • s (int)

  • v (int)

property vrs: Tuple[int, int, int]
class avantis_trader_sdk.signers.kms_signer.SignedTransaction(rawTransaction, hash, r, s, v)[source]

Bases: NamedTuple

Kinda compatible SignedTransaction class

Parameters:
  • rawTransaction (HexBytes)

  • hash (HexBytes)

  • r (int)

  • s (int)

  • v (int)

hash: HexBytes

Alias for field number 1

r: int

Alias for field number 2

rawTransaction: HexBytes

Alias for field number 0

s: int

Alias for field number 3

v: int

Alias for field number 4

avantis_trader_sdk.signers.local_signer module

class avantis_trader_sdk.signers.local_signer.LocalSigner(private_key, async_web3)[source]

Bases: BaseSigner

Parameters:

async_web3 (AsyncWeb3)

get_ethereum_address()[source]
async sign_transaction(transaction)[source]

Module contents