AwsSecretsManagerWallet
Connect to a wallet with a private key stored in AWS Secrets Manager .
To instantiate a wallet with AWS Secrets Manager, you need to gather the necessary secret ID and secret name from AWS.
import { AwsSecretsManagerWallet } from "@thirdweb-dev/wallets/evm/wallets/aws-secrets-manager"; const wallet = new AwsSecretsManagerWallet({ secretId: "{{secret-id}}", // ID of the secret value secretKeyName: "{{secret-key-name}}", // Name of the secret value awsConfig: { region: "us-east-1", // Region where your secret is stored credentials: { accessKeyId: process.env.AWS_ACCESS_KEY_ID, // Add environment variables to store your AWS credentials secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, // Add environment variables to store your AWS credentials }, },});
Create an instance of AwsSecretsManagerWallet
function constructor(
The options object includes the following properties:
The ID of the secret value.
The name of the secret value.
The object of type SecretsManagerClientConfig from @aws-sdk/client-secrets-manager package.
Get ethers signer of the connected wallet
function getSigner(): Promise<Signer>;
AbstractWallet.addListenerfunction addListener( event: T, fn: ( ) => void, context?: any,): this;
let fn: () => void;
AbstractWallet.emitCalls each of the listeners registered for a given event.
function emit( event: T,): boolean;
AbstractWallet.eventNamesReturn an array listing the events for which the emitter has registered listeners.
AbstractWallet.getAddressReturns the account address of the connected wallet
function getAddress(): Promise<string>;
AbstractWallet.getBalanceReturns the balance of the connected wallet for the specified token address. If no token address is specified, it returns the balance of the native token
function getBalance( tokenAddress: string,): Promise<{ decimals: number; displayValue: string; name: string; symbol: string; value: BigNumber;}>;
AbstractWallet.getChainIdReturns the chain id of the network that the wallet is connected to
function getChainId(): Promise<number>;
AbstractWallet.listenerCountReturn the number of listeners listening to a given event.
AbstractWallet.listenersReturn the listeners registered for a given event.
function listeners( event: T,): Array< ( ) => void>;
let returnType: Array< ( ) => void>;
AbstractWallet.offfunction off( event: T, fn?: ( ) => void, context?: any, once?: boolean,): this;
let fn: () => void;
AbstractWallet.onAdd a listener for a given event.
function on( event: T, fn: ( ) => void, context?: any,): this;
let fn: () => void;
AbstractWallet.onceAdd a one-time listener for a given event.
function once( event: T, fn: ( ) => void, context?: any,): this;
let fn: () => void;
AbstractWallet.removeListenerRemove the listeners of a given event.
function removeListener( event: T, fn?: ( ) => void, context?: any, once?: boolean,): this;
let fn: () => void;
AbstractWallet.signMessageSign a message with the connected wallet and return the signature
function signMessage(message: string | Bytes): Promise<string>;
AbstractWallet.transferTransfers some amount of tokens to the specified address
function transfer( to: string, amount: string | number, currencyAddress: string,): Promise<Omit<TransactionResultWithMetadata<unknown>, "data">>;
AbstractWallet.verifySignature Verify the signature of a message. It returns true if the signature is valid, false otherwise
function verifySignature( message: string, signature: string, address: string, _chainId?: number,): Promise<boolean>;