Skip to content

Commit 43faec6

Browse files
committed
other ethers examples
1 parent 7fa37d2 commit 43faec6

6 files changed

Lines changed: 17 additions & 16 deletions

File tree

examples/deployer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@turnkey/ethers": "workspace:*",
1414
"@turnkey/http": "workspace:*",
1515
"dotenv": "^16.0.3",
16-
"ethers": "^6.10.0",
16+
"ethers": "^6.13.0",
1717
"solc": "0.8.13"
1818
}
1919
}

examples/sweeper/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@turnkey/http": "workspace:*",
1414
"@uniswap/sdk-core": "^3.1.1",
1515
"dotenv": "^16.0.3",
16-
"ethers": "^6.10.0",
16+
"ethers": "^6.13.0",
1717
"hardhat": "^2.12.7",
1818
"prompts": "^2.4.2"
1919
},

examples/trading-runner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@uniswap/v3-core": "^1.0.1",
1717
"@uniswap/v3-sdk": "^3.9.0",
1818
"dotenv": "^16.0.3",
19-
"ethers": "^6.10.0",
19+
"ethers": "^6.13.0",
2020
"jsbi": "^3.2.5",
2121
"prompts": "^2.4.2"
2222
},

examples/with-uniswap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@uniswap/v3-core": "^1.0.1",
1616
"@uniswap/v3-sdk": "^3.9.0",
1717
"dotenv": "^16.0.3",
18-
"ethers": "^6.10.0",
18+
"ethers": "^6.13.0",
1919
"hardhat": "^2.12.7",
2020
"jsbi": "^3.2.5"
2121
}

examples/with-viem/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@turnkey/sdk-server": "workspace:*",
2020
"@turnkey/viem": "workspace:*",
2121
"dotenv": "^16.0.3",
22+
"ethers": "6.13.0",
2223
"fetch": "^1.1.0",
2324
"prompts": "^2.4.2",
2425
"typescript": "5.1",

examples/with-viem/src/advanced.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import * as path from "path";
22
import * as dotenv from "dotenv";
33

44
import { 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";
76
import {
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

134134
main().catch((error) => {

0 commit comments

Comments
 (0)