Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular Wallet Types #834

Open
wants to merge 7 commits into
base: v2.2
Choose a base branch
from
Open

Modular Wallet Types #834

wants to merge 7 commits into from

Conversation

d4mr
Copy link
Member

@d4mr d4mr commented Jan 22, 2025

PR-Codex overview

This PR focuses on restructuring the wallet management system, particularly enhancing AWS KMS and GCP integration, improving encryption methods, and introducing credential handling. It also includes schema updates for better validation and organization of wallet-related configurations.

Detailed summary

  • Removed src/server/utils/wallets/aws-kms-arn.ts.
  • Updated import paths for getAwsKmsAccount.
  • Renamed decrypt to decryptWithCustomPassword in src/shared/utils/crypto.ts.
  • Added a new decrypt function that uses the custom password.
  • Introduced LOGGER_SERVICES constant in src/shared/utils/logger.ts.
  • Created evmAddressSchema in src/shared/schemas/address.ts for EVM address validation.
  • Modified wallet details model to use new credential structures.
  • Added WalletCredentials model to manage wallet credentials.
  • Enhanced AWS KMS plugin with better credential handling and account provisioning.
  • Updated updateConfiguration to encrypt AWS and GCP credentials.
  • Improved error handling and validation across various schemas and functions.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}


// type WalletType =
// | (typeof ACCOUNT_PLUGINS)[number]["type"]
// | `smart:${(typeof ACCOUNT_PLUGINS)[number]["type"]}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup

const awsKmsArn = res.KeyMetadata.Arn;
const { keyId } = splitAwsKmsArn(awsKmsArn);

const account = await getAwsKmsAccount({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one day you should extract this into the sdk :D

type AwsKmsCredential = z.infer<typeof awsKmsCredentialSchema>;

// AWS KMS Plugin Definition
export const awsKmsPlugin = defineAccountPlugin({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was expecting to see a plugin for GCP and one for private key as well? is it just not implemented yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, need to extract the exiting code into this plugin format. Will also be adding one for circle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants