Conversation
ArkadiyStena
commented
Mar 17, 2026
- Accept signers instead of walletAdapters in factory
- Save private keys in separate files
- Encrypt config
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
67395a9 to
c0ed0dd
Compare
packages/mcp/src/registry/config.ts
Outdated
| id: string; | ||
| network: TonNetwork; | ||
| operator_private_key: string; | ||
| secret_file?: string; |
There was a problem hiding this comment.
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; |
| throw new ConfigError(`Unsupported config version ${String(version)}.`); | ||
| } | ||
|
|
||
| const migrated = migrateFromV2Config(raw as TonConfig); |
There was a problem hiding this comment.
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
| 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), | ||
| }; |
There was a problem hiding this comment.
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?
09b1445 to
c3c5000
Compare
c3c5000 to
aa95507
Compare
aa95507 to
b2bc1ef
Compare