Skip to content

Dev/viqex/update secret storage#310

Draft
ArkadiyStena wants to merge 10 commits intomainfrom
dev/viqex/update-secret-storage
Draft

Dev/viqex/update secret storage#310
ArkadiyStena wants to merge 10 commits intomainfrom
dev/viqex/update-secret-storage

Conversation

@ArkadiyStena
Copy link
Contributor

  1. Accept signers instead of walletAdapters in factory
  2. Save private keys in separate files
  3. Encrypt config

@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kit-demo-wallet Ready Ready Preview, Comment Mar 19, 2026 9:58pm

Request Review

id: string;
network: TonNetwork;
operator_private_key: string;
secret_file?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

lets introduce field
private_key_source: {type: 'local_file', file: ...}
In this case we may easily update config in the future with remote methods of signature

throw new ConfigError('Unsupported config format.');
}

const version = (raw as { version?: unknown }).version;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove as, redundant

throw new ConfigError(`Unsupported config version ${String(version)}.`);
}

const migrated = migrateFromV2Config(raw as TonConfig);
Copy link
Contributor

Choose a reason for hiding this comment

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

we should try to mitigate all "as" conversions, because they will lead to worse code quality and harder support in the future. Typescript system is powerfull enough to handle almost all usecases without as conversion

Comment on lines +24 to +31
export function sanitizePrivateKeyBackedValue(
value: StoredAgenticWallet | PendingAgenticDeployment | PendingAgenticKeyRotation,
) {
const secret = readSecretMaterial(value);
return {
...(omitSecretRefFields(omitInlineSecretFields(value)) as Omit<typeof value, 'secret_file' | 'secret_type'>),
has_private_key: Boolean(secret),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we shoudn't even read in this case, because this function only used to determine, if secret key exists. (has_private_key and has_mnemonic fields). Can't we just read if file exists in this case?

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