{"id":28380671,"url":"https://github.com/0xsequence/aws-kms-signer","last_synced_at":"2025-06-24T21:31:31.451Z","repository":{"id":278436179,"uuid":"935611803","full_name":"0xsequence/aws-kms-signer","owner":"0xsequence","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-28T11:17:43.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-06T03:39:55.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsequence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-19T18:17:05.000Z","updated_at":"2025-03-18T04:53:02.000Z","dependencies_parsed_at":"2025-02-19T19:34:48.563Z","dependency_job_id":"51cfeea5-cb59-4d25-b3b9-f26c6468042a","html_url":"https://github.com/0xsequence/aws-kms-signer","commit_stats":null,"previous_names":["0xsequence/aws-kms-signer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xsequence/aws-kms-signer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Faws-kms-signer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Faws-kms-signer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Faws-kms-signer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Faws-kms-signer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsequence","download_url":"https://codeload.github.com/0xsequence/aws-kms-signer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Faws-kms-signer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261759119,"owners_count":23205498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T03:09:03.150Z","updated_at":"2025-06-24T21:31:31.439Z","avatar_url":"https://github.com/0xsequence.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-kms-signer\n\nAn [ethers.js](https://ethers.org) and [sequence.js](https://github.com/0xsequence/sequence.js)-compatible signer using [AWS Key Management Service](https://aws.amazon.com/kms/) keys.\n\n## Prerequisites\n\n### Set up AWS KMS\n\n1. Create an AWS account if you don't have one\n2. Go to AWS KMS in your AWS Console: https://console.aws.amazon.com/kms\n3. Switch to your desired region (e.g., us-east-1)\n4. Click \"Create key\"\n5. Choose these settings:\n   - Key type: `Asymmetric`\n   - Key usage: `Sign and verify`\n   - Key spec: `ECC_SECG_P256K1` (This is crucial for Ethereum compatibility)\n   - Alias: Give your key a name (e.g., `eth-signer`)\n6. Configure key administrative permissions and key usage permissions as needed\n7. Create the key\n\n### Get AWS Credentials\n\n1. Go to AWS IAM Console: https://console.aws.amazon.com/iam\n2. Create a new IAM user or select an existing one\n3. Under \"Security credentials\", create new access keys\n4. Save these values - you'll need them for environment variables:\n   - AWS_ACCESS_KEY_ID\n   - AWS_SECRET_ACCESS_KEY\n   - AWS_REGION (the region where you created your key)\n   - AWS_KMS_KEY_ID (the ARN of your key, looks like: `arn:aws:kms:region:account:key/key-id`)\n\n## Installation\n\n```bash\nnpm install @0xsequence/aws-kms-signer\n# or\nyarn add @0xsequence/aws-kms-signer\n# or\npnpm add @0xsequence/aws-kms-signer\n```\n\n## Usage\n\n### Basic Setup\n\n```typescript\nimport { AwsKmsSigner } from 'aws-kms-signer'\nimport { KMSClient } from '@aws-sdk/client-kms'\n\nconst signer = new AwsKmsSigner(\n  process.env.AWS_REGION,\n  process.env.AWS_KMS_KEY_ID\n)\n```\n\n### Get Signer's Address\n\n```typescript\nconst address = await signer.getAddress()\nconsole.log('Signer address:', address)\n```\n\n### Sign a Message\n\n```typescript\nconst message = 'Hello World'\nconst signature = await signer.signMessage(message)\nconsole.log('Signature:', signature)\n```\n\n### Send a Transaction\n\n```typescript\nconst provider = new ethers.JsonRpcProvider('YOUR_RPC_URL')\nconst connectedSigner = signer.connect(provider)\n\nconst tx = {\n  to: '0x...',\n  value: 1\n}\n\nconst response = await connectedSigner.sendTransaction(tx)\nconst receipt = await response.wait()\nconsole.log('Transaction receipt:', receipt)\n```\n\n### Sign Typed Data (EIP-712)\n\n```typescript\nconst domain = {\n  name: 'My Dapp',\n  version: '1',\n  chainId: 1,\n  verifyingContract: '0x...'\n}\n\nconst types = {\n  Person: [\n    { name: 'name', type: 'string' },\n    { name: 'wallet', type: 'address' }\n  ]\n}\n\nconst value = {\n  name: 'John Doe',\n  wallet: '0x...'\n}\n\nconst signature = await signer.signTypedData(domain, types, value)\n```\n\n### Use with Sequence Wallet\n\n```typescript\nimport { Session } from '@0xsequence/auth'\nimport { AwsKmsSigner } from 'aws-kms-signer'\nimport { KMSClient } from '@aws-sdk/client-kms'\n\nconst signer = new AwsKmsSigner(\n  process.env.AWS_REGION,\n  process.env.AWS_KMS_KEY_ID\n)\n\nconst session = await Session.singleSigner({\n  signer,\n  projectAccessKey: 'YOUR_PROJECT_ACCESS_KEY'\n})\n\nconst tx = {\n  to: '0x...',\n  value: 1\n}\n\nconst chainId = 421614 //\n\nconst response = await session.account.sendTransaction(tx, chainId)\nconst receipt = await response.wait()\nconsole.log('Transaction receipt:', receipt)\n```\n\n## Development\n\n### Environment Setup\n\nCreate a `.env` file in the root directory:\n\n```env\nAWS_REGION=\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\nAWS_KMS_KEY_ID=\nPROJECT_ACCESS_KEY=\n```\n\n### Running Tests\n\n```bash\n# Install dependencies\npnpm install\n\n# Run tests\npnpm test\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Faws-kms-signer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsequence%2Faws-kms-signer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Faws-kms-signer/lists"}