This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Creates a viem-compatible PrivateKeyAccount from a KMS signer | |
| * | |
| * @param signer The KMS signer instance | |
| * @param address The Ethereum address as Hex | |
| * @param keyAlias The AWS KMS key alias | |
| * @returns A viem-compatible PrivateKeyAccount | |
| */ | |
| export const createKMSWallet = async ( | |
| signer: Signer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Send an Account Abstraction transaction using KMS for signing | |
| */ | |
| export const sendTxn = async( | |
| environment, | |
| rpcUrl, | |
| bundlerRpcUrl, | |
| awsRegion, | |
| secretKeyName, | |
| accessKeyId, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createPublicClient, http, toHex } from "viem"; | |
| import { toAccount } from "viem/accounts"; | |
| import { keccak256 } from "viem/utils"; | |
| import { toSafeSmartAccount } from "permissionless/accounts"; | |
| import { toCoinbaseSmartAccount, createBundlerClient, entryPoint07Address } from "viem/account-abstraction"; | |
| import { KMSProviderAWS } from "@web3-kms-signer/kms-provider-aws"; | |
| import { KMSWallets } from "@web3-kms-signer/kms-wallets"; | |
| import { Signer } from "@web3-kms-signer/core"; | |
| /** |