Skip to content

Latest commit

 

History

History
182 lines (107 loc) · 3.81 KB

API.md

File metadata and controls

182 lines (107 loc) · 3.81 KB

API Reference

Constructs

Wallet

The Wallet Construct generates an Ethereum compatible wallet and stores it as an encrypted keystore in an AWS Secret encrypted with an AWS KMS Key.

To create a new wallet:

const wallet = new cdk3.Wallet(this, "Wallet");

To access the public key and address Resource Properties:

wallet.publicKey;
wallet.address;

By default, the KMS Key and AWS Secret Resources have generated names. To help with organization, you can set the walletName so that those Resources are named according to the convention, ${walletName}-<prefix>. For example: my-wallet-key and my-wallet-secret.

new cdk3.Wallet(this, "Wallet", {
   walletName: "my-wallet",
});

To use an existing KMS Key to encrypt the AWS Secret (instead of generating a new one), set the encryptionKey property.

new cdk3.Wallet(this, "Wallet", {
   encryptionKey: myKey,
});

Initializers

import { Wallet } from 'cdk3'

new Wallet(scope: Construct, id: string, props?: WalletProps)
scopeRequired

idRequired
  • Type: string

propsOptional

Properties

addressRequired
public readonly address: string;
  • Type: string

checksumAddressRequired
public readonly checksumAddress: string;
  • Type: string

encryptionKeyRequired
public readonly encryptionKey: IKey;

KMS Encryption Key used to encrypt the Private Key.


keyGeneratorRequired
public readonly keyGenerator: SingletonFunction;

Lambda Function which is invoked by CloudFormation during the CRUD lifecycle.


privateKeyRequired
public readonly privateKey: Secret;

AWS Secret securely storing the Private Key.


publicKeyRequired
public readonly publicKey: string;
  • Type: string

walletNameRequired
public readonly walletName: string;
  • Type: string

Structs

WalletProps

Initializer

import { WalletProps } from 'cdk3'

const walletProps: WalletProps = { ... }
encryptionKeyOptional
public readonly encryptionKey: IKey;

walletNameOptional
public readonly walletName: string;
  • Type: string
  • Default: generated physical name

Name of the Wallet.