turnkey_client
to interact with the Turnkey API.
Using Turnkey in your Ruby projects
To installturnkey_client
, install it with bundler:
require
it in Ruby files to use it:
Examples
- Whoami: example showcasing API request signing in its simplest form
- Signing: example showcasing wallet creation and ETH message signing
Using Turnkey in your Rails projects
To use in Rails we recommend creating a newconfig/initializers/turnkey.rb
file:
Re-generating turnkey_client
We use a swagger spec and Swagger Codegen to generate turnkey_client
. To update this gem:
- Update the swagger spec in
turnkey_client_inputs
- Bump
gemVersion
inconfig.json
- Run
make
Updating codegen templates
We use custom templates to insert custom functionality, namely:- added
openssl
as a dependency to load API keys - added functionality to insert
X-Stamp
headers to requests for authentication - modified
configure
function to require a valid P256 public/private key pair at initialization time
turnkey_client
If you want to update templates with upstream this is a bit harder but possible: these templates were downloaded from this folder (this is a permalink to the right git SHA). You can see all the changes made to these by looking at the history of changes in the templates folder: https://github.com/tkhq/ruby-sdk/commits/main/turnkey_client_inputs/templates.