1.2.4 • Published 2 years ago

@sulake-nft/eth-signer-kms v1.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@sulake-nft/eth-signer-kms

This is a fork from https://github.com/rumblefishdev/eth-signer-kms in order to work with ImmutableX and the new version of the Ethereum chains.

The fork also include an utility to get the EC public key from the KMSProvider.

Web3 provider that derives address and signs transactions using AWS KMS.

Install

$ npm i @sulake-nft/eth-signer-kms

Requirements

aws-sdk

In order to work properly AWS KMS managed key must be:

  • asymmetric
  • able to sign and verify
  • ECC_SECG_P256K1 specified

Usage

* Before use, make sure that AWS SDK is properly configured! Find out how to do it here.

KMSProvider can be used as a standalone Web3 provider and within Truffle config. It's based on @truffle/hdwallet-provider so wallet non-related params (providerOrUrl, shareNonce and poolingInterval and chainId) remain the same. In addition, it uses @ethereumjs/tx under the hood which offers EIP-2718 support.

keyId can be obtained via KMS package of aws-sdk or directly via AWS console. https://github.com/ethereumjs/ethereumjs-monorepo

Parameters:

ParameterTypeDefaultRequiredDescription
keyIdstringnullxKey ID of AWS KMS managed private key
providerOrUrlstring/objectnullxOfficial doc
chainSettingsCommon{} Common object used to configure tx options. If chainId is not passed, it will be obtained automatically via eth_chainId. For details instructions please refer to Common and Tx official docs
shareNoncebooleantrue Official doc
pollingIntervalnumber4000 Official doc

Examples

Truffle usage example

Nodejs + ethersjs usage example

Credits:

@lucashenning @truffle team