Turnkey Integration (coming soon)
How to open and close leveraged positions from a Turnkey embedded wallet by bridging Turnkey's signer into wagmi with a small custom connector.
1. Install and wrap your app
npm install @turnkey/react-wallet-kit @turnkey/viemimport {TurnkeyProvider} from "@turnkey/react-wallet-kit";
import "@turnkey/react-wallet-kit/styles.css";
export function Providers({children}: {children: React.ReactNode}) {
return (
<TurnkeyProvider
config={{
organizationId: import.meta.env.VITE_TURNKEY_ORG_ID,
authProxyConfigId: import.meta.env.VITE_TURNKEY_AUTH_PROXY_CONFIG_ID,
}}
>
{children}
</TurnkeyProvider>
);
}2. Log in and derive a viem account
3a. Open and close — plain viem (no wagmi)
3b. Open and close — bridging into wagmi
Funding the embedded wallet
Notes
Last updated

