# @fwen/eth-signer-kms

> Web3 provider that derives address and signs transactions using [AWS KMS](https://aws.amazon.com/kms/).

Latest version **1.2.0** (published 2022-01-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @fwen/eth-signer-kms
pnpm add @fwen/eth-signer-kms
yarn add @fwen/eth-signer-kms
bun add @fwen/eth-signer-kms
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-01-14 |
| First published | 2022-01-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 39.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Maintainers | fwenclub |

## Links

- npm: https://www.npmjs.com/package/@fwen/eth-signer-kms
- Repository: https://github.com/rumblefishdev/eth-signer-kms
- Homepage: https://github.com/rumblefishdev/eth-signer-kms#readme
- Issues: https://github.com/rumblefishdev/eth-signer-kms/issues
- npm.io page: https://npm.io/package/@fwen/eth-signer-kms

## Dependencies (13)

- [url](https://npm.io/package/url.md) ^0.10.3
- [bn.js](https://npm.io/package/bn.js.md) ^4.12.0
- [asn1.js](https://npm.io/package/asn1.js.md) ^5.4.1
- [js-sha3](https://npm.io/package/js-sha3.md) ^0.8.0
- [@ethereumjs/tx](https://npm.io/package/@ethereumjs/tx.md) ^3.3.2
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^6.2.1
- [ethereum-protocol](https://npm.io/package/ethereum-protocol.md) ^1.0.1
- [ethereumjs-wallet](https://npm.io/package/ethereumjs-wallet.md) ^1.0.1
- [@ethereumjs/common](https://npm.io/package/@ethereumjs/common.md) ^2.5.0
- [@ethersproject/hash](https://npm.io/package/@ethersproject/hash.md) ^5.5.0
- [@ethersproject/bytes](https://npm.io/package/@ethersproject/bytes.md) ^5.5.0
- [web3-provider-engine](https://npm.io/package/web3-provider-engine.md) ^16.0.1
- [@types/ethereum-protocol](https://npm.io/package/@types/ethereum-protocol.md) ^1.0.1

## Recent versions

- 1.2.0 (latest) — 2022-01-14

## README

# @rumblefishdev/eth-signer-kms

Web3 provider that derives address and signs transactions using [AWS KMS](https://aws.amazon.com/kms/).

## Install
```
$ npm i @rumblefishdev/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](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html).


KMSProvider can be used as a standalone Web3 provider and within Truffle config. It's based on [@truffle/hdwallet-provider](https://www.npmjs.com/package/@truffle/hdwallet-provider) so wallet non-related params (`providerOrUrl`, `shareNonce` and `poolingInterval` and `chainId`) remain the same. In addition, it uses [@ethereumjs/tx](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx) under the hood which offers [EIP-2718](https://eips.ethereum.org/EIPS/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:

| Parameter | Type | Default | Required | Description |
| ------ | ---- | ------- | ----------- | ----------- |
|`keyId`|`string`| `null`| [x] | Key ID of AWS KMS managed private key |
| `providerOrUrl` | `string/object` | `null` | [x] | [Official doc](https://github.com/trufflesuite/truffle/blob/develop/packages/hdwallet-provider/README.md#instantiation) |
|`chainSettings` | `Common` | `{}` | [ ] | 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](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common) and [Tx]() official docs|
| `shareNonce` | `boolean` | `true` | [ ] | [Official doc](https://github.com/trufflesuite/truffle/blob/develop/packages/hdwallet-provider/README.md#instantiation) |
| `pollingInterval` | `number` | `4000` | [ ] | [Official doc](https://github.com/trufflesuite/truffle/blob/develop/packages/hdwallet-provider/README.md#instantiation) |

## Examples
[Truffle usage example](https://github.com/rumblefishdev/eth-signer-kms/tree/master/examples/truffle)

[Nodejs + ethersjs usage example ](https://github.com/rumblefishdev/eth-signer-kms/tree/master/examples/ethers)

## Credits:

[@lucashenning](https://github.com/lucashenning/aws-kms-ethereum-signing)
[@truffle team](https://github.com/trufflesuite/truffle/tree/develop/packages/hdwallet-provider)

---
_Source: https://npm.io/package/@fwen/eth-signer-kms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
