Skip to main content

Examples

Turnkey infrastructure is flexible by default. We intentionally prioritize low-level primitives in our product to avoid creating blockers for developers building new kinds of applications on Turnkey.

That said, we have built out several example services and applications to help illustrate the types of functionality that Turnkey can enable.

SDK code examples

Clone or fork the Turnkey SDK repo here to explore a few “turnkey” examples:

ExampleDescription
deployerCompile and deploy a smart contract
rebalancerA demo application which showcases an example of how to use Turnkey for managing multiple types of keys & users
sweeperSweep funds from one address to a different address
trading-runnerA sample application demonstrating a trading operation, using various private keys, users, and policies, powered by Uniswap.
with-ethersCreate a new Ethereum address, then sign and broadcast a transaction using the Ethers signer with Infura
with-viemSign and broadcast a transaction using the Turnkey Custom Account and Infura
with-cosmjsCreate a new Cosmos address, then sign and broadcast a transaction on Celestia testnet using the CosmJS signer
with-solanaCreate a new Solana address, then sign and broadcast a transaction on Solana's devnet
with-gnosisCreate new Ethereum addresses, configure a 3/3 Gnosis safe, and create + execute a transaction from it
with-uniswapSign and broadcast a Uniswap v3 trade using the Ethers signer with Infura
with-nonce-managerCreate a new Ethereum address, then sign and broadcast multiple transactions in a sequential or optimistic manner.
with-offlineSign a Turnkey request in offline context
with-federated-passkeysA NextJS app that demonstrates how to use Turnkey to build a federated, webauthn powered authentication flow

Demos built with Turnkey

Demo Consumer Wallet (code)

A minimal consumer wallet app powered by Turnkey. Behind the scenes, it uses @turnkey/ethers for signing and WalletConnect (v1) for accessing dapps.

See https://github.com/tkhq/demo-consumer-wallet for the code.

A wallet application showing how users can register and authenticate using passkeys. This demo uses the Turnkey API to create a new Turnkey Sub-Organization for each user, create a testnet Ethereum address and send a transaction on Sepolia (ETH testnet).

homepage screenshot

See https://wallet.tx.xyz (and https://github.com/tkhq/demo-passkey-wallet for the code).

Demo Ethers Passkeys (code)

A simple application demonstrating how to create sub-organizations, create private keys, and sign with the @turnkey/ethers signer, using passkeys.

homepage screenshot

See https://github.com/tkhq/demo-ethers-passkeys for the code.

Demo Viem Passkeys (code)

A similar, simple application demonstrating how to create sub-organizations, create private keys, and sign with the @turnkey/viem signer, using passkeys.

homepage screenshot

See https://github.com/tkhq/demo-viem-passkeys for the code.