@@ -2,8 +2,7 @@ import * as path from "path";
22import * as dotenv from "dotenv" ;
33
44import { createAccount } from "@turnkey/viem" ;
5- import { TurnkeyClient } from "@turnkey/http" ;
6- import { ApiKeyStamper } from "@turnkey/api-key-stamper" ;
5+ import { Turnkey as TurnkeyServerSDK } from "@turnkey/sdk-server" ;
76import {
87 createWalletClient ,
98 http ,
@@ -27,18 +26,15 @@ async function main() {
2726 return ;
2827 }
2928
30- const turnkeyClient = new TurnkeyClient (
31- {
32- baseUrl : process . env . BASE_URL ! ,
33- } ,
34- new ApiKeyStamper ( {
35- apiPublicKey : process . env . API_PUBLIC_KEY ! ,
36- apiPrivateKey : process . env . API_PRIVATE_KEY ! ,
37- } )
38- ) ;
29+ const turnkeyClient = new TurnkeyServerSDK ( {
30+ apiBaseUrl : process . env . BASE_URL ! ,
31+ apiPrivateKey : process . env . API_PRIVATE_KEY ! ,
32+ apiPublicKey : process . env . API_PUBLIC_KEY ! ,
33+ defaultOrganizationId : process . env . ORGANIZATION_ID ! ,
34+ } ) ;
3935
4036 const turnkeyAccount = await createAccount ( {
41- client : turnkeyClient ,
37+ client : turnkeyClient . apiClient ( ) ,
4238 organizationId : process . env . ORGANIZATION_ID ! ,
4339 signWith : process . env . SIGN_WITH ! ,
4440 } ) ;
@@ -129,6 +125,10 @@ async function main() {
129125
130126 print ( "Turnkey-powered signature - typed data (EIP-712):" , `${ signature } ` ) ;
131127 assertEqual ( address , recoveredAddress ) ;
128+
129+ // 4. Sign type-3 transaction
130+
131+
132132}
133133
134134main ( ) . catch ( ( error ) => {
0 commit comments