From e6f0fb2dde89b2dcf290e0244001a324b545da57 Mon Sep 17 00:00:00 2001 From: Shane Engelman Date: Mon, 12 Jan 2026 14:21:35 +1000 Subject: [PATCH 1/3] Update README, correct outdated 'usage' instructions, fix: #100 --- README.md | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index a337364..ffe3a93 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,6 @@ to attempt to force one or more of us to tamper with the software. ``` 2. Review source - - Ideal: Review the entire supply chain is recommended for high risk uses - Minimal: review the "attest" "sign" and "verify" targets in the Makefile @@ -194,10 +193,10 @@ to attempt to force one or more of us to tamper with the software. ## Usage -Create a new API key: +### Generate a new API key ```sh -$ turnkey generate api-key --organization $ORGANIZATION_ID +$ turnkey generate api-key --organization $ORGANIZATION_ID --key-name default { "privateKeyFile": "/Users/andrew/Library/Application Support/turnkey/keys/default.private", "publicKey": "0236f17892a4649d97b2e4a4ad3c22d815e4e77848a0b8e4a5b0956ae4d6be382e", @@ -205,34 +204,16 @@ $ turnkey generate api-key --organization $ORGANIZATION_ID } ``` -Make an API request (using the default API key created above): +### Add your public API key -```sh -$ turnkey request --path /api/v1/sign --body '{"payload": "hello from TKHQ"}' -{ - "result": "I am a teapot" -} -``` - -If you need to sign a request with a different key, use the `--key-name` and/or `--keys-folder` flags: +As an authenticated user on the Turnkey dashboard, navigate to your user page by clicking on "User Details" in the user dropdown menu. -```sh -$ turnkey request --path /api/v1/sign --body '{"payload": "hello from TKHQ"}' --keys-folder /path/to/keys --key-name another-key -{ - "result": "I am a teapot" -} -``` +Click on "Create API keys and follow the prompts to add the generated public API key. You'll be required to authenticate with the same authenticator used during onboarding. After this succeeds, you should be all set to interact with our API. -Create, but do not _post_ a request: +#### Notes -```sh -$ turnkey request --no-post --path /api/v1/sign --body '{"payload": "hello from TKHQ"}' -{ - "curlCommand": "curl -X POST -d'{\"payload\": \"hello from TKHQ\"}' -H'X-Stamp: eyJwdWJsaWNLZXkiOiIwM2JmMTYyNTc2ZWI4ZGZlY2YzM2Q5Mjc1ZDA5NTk1Mjg0ZjZjNGRmMGRiNjE1NmMzYzU4Mjc3Nzg4NmEwZWUwYWMiLCJzaWduYXR1cmUiOiIzMDQ0MDIyMDZiMmRlYmIwYjA3YmYwMDJlMjI1ZmQ4NTgzZjZmNGUxNGE5YTUxYWRiYWJjNDAyYzY5YTZlN2Q4N2ViNWNjMDgwMjIwMjE0ZTdkMGJlODFjMGYyNDEyOWE0MmNkZGFlOTUxYTBmZTViMGM1Mzc3YjM2NzZiOTUyNDgyNmYwODdhMWU4ZiIsInNjaGVtZSI6IlNJR05BVFVSRV9TQ0hFTUVfVEtfQVBJX1AyNTYifQ' -v 'https://coordinator-beta.turnkey.io/api/v1/sign'", - "message": "{\"payload\": \"hello from TKHQ\"}", - "stamp": "eyJwdWJsaWNLZXkiOiIwM2JmMTYyNTc2ZWI4ZGZlY2YzM2Q5Mjc1ZDA5NTk1Mjg0ZjZjNGRmMGRiNjE1NmMzYzU4Mjc3Nzg4NmEwZWUwYWMiLCJzaWduYXR1cmUiOiIzMDQ0MDIyMDZiMmRlYmIwYjA3YmYwMDJlMjI1ZmQ4NTgzZjZmNGUxNGE5YTUxYWRiYWJjNDAyYzY5YTZlN2Q4N2ViNWNjMDgwMjIwMjE0ZTdkMGJlODFjMGYyNDEyOWE0MmNkZGFlOTUxYTBmZTViMGM1Mzc3YjM2NzZiOTUyNDgyNmYwODdhMWU4ZiIsInNjaGVtZSI6IlNJR05BVFVSRV9TQ0hFTUVfVEtfQVBJX1AyNTYifQ" -} -``` +- If you would like to manually copy your locally-stored public/private API key files (e.g. `default.public`, `default.private`), you will have to save the files without newlines (which occupy extra bytes). For example, for VIM, use `:set binary noeol` or `:set binary noendofline` before writing. +- Only P-256 keys (`API_KEY_CURVE_P256`) are currently supported. ## Building From 1d8526e8bd1a329eea9fa77e28463fd698be1a57 Mon Sep 17 00:00:00 2001 From: Shane Engelman Date: Mon, 12 Jan 2026 14:41:56 +1000 Subject: [PATCH 2/3] Update README, add example for creating wallet and signing transactions --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index ffe3a93..94c7062 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,49 @@ Click on "Create API keys and follow the prompts to add the generated public API - If you would like to manually copy your locally-stored public/private API key files (e.g. `default.public`, `default.private`), you will have to save the files without newlines (which occupy extra bytes). For example, for VIM, use `:set binary noeol` or `:set binary noendofline` before writing. - Only P-256 keys (`API_KEY_CURVE_P256`) are currently supported. +### Create a Wallet + +Wallets are collections of cryptographic key pairs typically used for sending and receiving digital assets. To create on, we need to provide a name: + +```sh +turnkey wallets create --name default --key-name default +``` + +### Create an Ethereum account + +To create a cryptographic key pair on our new Wallet, we neet to pass our desired address format: + +```sh +turnkey wallets accounts create --wallet default --address-format ADDRESS_FORMAT_ETHEREUM --key-name default +``` + +This command will produce an Ethereum address (e.g. `0x08cb1216C95149DF66978b574E484869512CE2bF`) that we'll need to sign a transaction. You can see your new Wallet account with: + +```sh +turnkey wallets accounts list --wallet default --key-name default +``` + +### Sign a Transaction + +Now you can sign an Ethereum transaction with this new address with our [`sign_transaction` endpoint](https://docs.turnkey.com/api-reference/signing/sign-transaction). Make sure to replace the `unsignedTransaction` below with your own. You can use our [simple transaction generator](https://build.tx.xyz/) if you need a quick transaction for testing: + +```json +turnkey request --path /public/v1/submit/sign_transaction --body '{ + "timestampMs": "'"$(date +%s)"'000", + "type": "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + "organizationId": "'"$ORGANIZATION_ID"'", + "parameters": { + "type": "TRANSACTION_TYPE_ETHEREUM", + "signWith": "", + "unsignedTransaction": "" + } +}' --key-name default +``` + +### Next Steps + +See the [official docs](https://docs.turnkey.com/sdks/cli#next-steps) for additional usage information and examples. + ## Building ### Build for all platforms From dc8d1552f88034e99be630947e420932c4a27486 Mon Sep 17 00:00:00 2001 From: Shane Engelman Date: Mon, 12 Jan 2026 14:43:34 +1000 Subject: [PATCH 3/3] Update README, correct syntax hint for signing from json to sh --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94c7062..cebba4a 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ turnkey wallets accounts list --wallet default --key-name default Now you can sign an Ethereum transaction with this new address with our [`sign_transaction` endpoint](https://docs.turnkey.com/api-reference/signing/sign-transaction). Make sure to replace the `unsignedTransaction` below with your own. You can use our [simple transaction generator](https://build.tx.xyz/) if you need a quick transaction for testing: -```json +```sh turnkey request --path /public/v1/submit/sign_transaction --body '{ "timestampMs": "'"$(date +%s)"'000", "type": "ACTIVITY_TYPE_SIGN_TRANSACTION_V2",