Skip to content

Conversation

aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev commented Sep 4, 2025

  • Adds kmd client generation in rust and ts
  • Moves localnet dispenser to leverage native kmd client over algokit cli -> cuts down tests suite run from ~10 to ~4 minutes
  • Adds kmd related fields to rust client manager
  • KMD upstream api spec includes request bodies in GET requests, many of the associated schemas are empty objects/structs -> generators have been tweak to account for this and to exclude empty request bodies from GET calls
  • Generic fix in the rust and ts generators to skip including content type header to GET/HEAD/DELETE requests, as well as omitting request params if model is an empty object (found a few of such schemas in kmd spec where spec non idiomatically includes request bodies for GET calls where specified schemas are empty objects)

@aorumbayev aorumbayev force-pushed the feat/kmd-client branch 2 times, most recently from 24b2acf to 66aa418 Compare September 26, 2025 12:46
@aorumbayev aorumbayev requested review from PatrickDinh and removed request for neilcampbell September 26, 2025 12:47

Note: You will need to perform steps 2-4 each time your either install a package for the first time or update a GitHub package hosted dependency. Installing from the lock file only requires the token.

## Per-model DTO codecs (TypeScript clients)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@PatrickDinh this redundant section leaked through in the ts client generator pr - removing it in this pr

"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
"type": "string",
"format": "byte",
"x-go-name": "SignedTransaction"
Copy link
Collaborator Author

@aorumbayev aorumbayev Sep 26, 2025

Choose a reason for hiding this comment

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

@joe-p do you know if this is the same signed txn model used in algod? If yes i can align it by adding out own x algokit vendor extension here so generators embed the model from transact crate/package. Otherwise we can keep as is

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the model kmd uses I think this is just an array of bytes

type APIV1POSTTransactionSignResponse struct {
	APIV1ResponseEnvelope

	// swagger:strfmt byte
	SignedTransaction []byte `json:"signed_transaction"`
}

@aorumbayev aorumbayev marked this pull request as ready for review September 26, 2025 13:12
@aorumbayev aorumbayev requested a review from a team as a code owner September 26, 2025 13:12
@Copilot Copilot AI review requested due to automatic review settings September 26, 2025 13:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces KMD (Key Management Daemon) client support for both Rust and TypeScript, enabling direct interaction with the KMD API instead of relying on AlgoKit CLI. The changes significantly improve test suite performance by leveraging native KMD clients.

  • Adds comprehensive KMD client generation for both Rust and TypeScript ecosystems
  • Extends the API tools to support KMD alongside existing algod and indexer clients
  • Includes test coverage for KMD wallet lifecycle and key management operations

Reviewed Changes

Copilot reviewed 195 out of 197 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/api_tools/src/main.rs Adds KMD client generation commands and configuration
packages/typescript/kmd_client/* Generated TypeScript KMD client with models, APIs, and configuration
crates/kmd_client/src/* Generated Rust KMD client with models and API endpoints
packages/typescript/algokit_utils/tests/kmd/* Test suite for KMD functionality
docs/book/contributing/contributing_guide.md Updates documentation for new KMD commands
Files not reviewed (1)
  • packages/typescript/package-lock.json: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

 - Rust Clients (algod, indexer, kmd):
    - Removed Content-Type headers from all GET/HEAD/DELETE requests
    - Removed empty request body parameters from methods like list_wallets()
    - Now: client.list_wallets() instead of client.list_wallets(None)
  - TypeScript Clients (algod, indexer, kmd):
    - Removed body parameters from GET/HEAD/DELETE methods
    - Now: client.listWallets() instead of client.listWallets({ body: {} })
@aorumbayev aorumbayev changed the title feat: rust kmd api client; minor jinja generator tweaks feat: rust and ts kmd api client; minor jinja generator tweaks Sep 26, 2025
@aorumbayev aorumbayev merged commit 03b4e15 into main Sep 29, 2025
25 of 28 checks passed
@aorumbayev aorumbayev deleted the feat/kmd-client branch September 29, 2025 16:31
@engineering-ci
Copy link
Contributor

🎉 This PR is included in version 1.0.0-alpha.70 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants