Skip to main content

eth_kms_signer

codecov PyPI Downloads PyPI - License Documentation Status

AWS KMS Signer for ETH transactions(EIP 155/EIP 1559/ EIP 2930)

>> Go to documentation

Dependencies

  • Python 3.5+

QuickStart

This library is available on PyPI. Install via pip as:

  pip install eth-kms-signer

Usage

  1. Instantiate eth kms signer client
from eth_kms_signer import EthKmsClient

client = EthKmsClient(region_name="{aws-kms-region}")
  1. Initailize web3
from web3 import Web3

w3 = Web3(Web3.HTTPProvider(endpoint_uri="{rpc_url}"))
  1. Sign a EIP 155 transaction
tx = {
    "nonce": nonce,
    "to": "0x7EeD368F105a6eaC9Ac645bC3440fEa9A6C3D531",
    "value": w3.toWei(12, "wei"),
    "gas": 21000,
    "gasPrice": w3.toWei(1, "gwei"),
    "chainId": "0x4",
}
signed_tx = client.sign_transaction(tx, key_id)
tx_hash = w3.eth.sendRawTransaction(signed_tx)
  1. Sign a EIP 1559 Dynamic Fee transaction
tx = {
    "nonce": nonce,
    "to": "0x7EeD368F105a6eaC9Ac645bC3440fEa9A6C3D531",
    "value": w3.toWei(12, "wei"),
    "gas": 21000,
    "maxFeePerGas": w3.toWei(1, "gwei"),
    "maxPriorityFeePerGas": w3.toWei(1, "gwei"),
    "type": "0x2",
    "chainId": "0x4",
}
signed_tx = client.sign_transaction(tx, key_id)
tx_hash = w3.eth.sendRawTransaction(signed_tx)

Examples

Choose one of the following for a fully detailed example:

Terraform to provision AWS KMS Key

The following example makes use of the CloudPosse Terraform Module:

Detailed Example

Release files for eth-kms-signer 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eth-kms-signer 0.1.5
File Size Uploaded
eth_kms_signer-0.1.5.tar.gz 6.2 kB Details

Release files / eth_kms_signer-0.1.5.tar.gz

Download URL eth_kms_signer-0.1.5.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
73b39ca3bb60b33e535de66b597526e70227997e3ee123cab87171ec6da47680
BLAKE2b-256 checksum
How to use checksums
b2e7de6ed713c4cb116dbd6222f3e2b5eaf2e41b451addea39c52522e4471c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.3

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page