diff --git a/examples/trading-runner/package.json b/examples/trading-runner/package.json index 3464f3f9b..0300eaa11 100644 --- a/examples/trading-runner/package.json +++ b/examples/trading-runner/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "pnpm -w run build-all", - "cli": "pnpm build && tsx src/index.ts", + "cli": "tsx src/index.ts", "clean": "rimraf ./dist ./.cache", "typecheck": "tsc --noEmit" }, diff --git a/examples/trading-runner/src/index.ts b/examples/trading-runner/src/index.ts index e3e204b84..b1b8102e1 100644 --- a/examples/trading-runner/src/index.ts +++ b/examples/trading-runner/src/index.ts @@ -39,7 +39,7 @@ import { toReadableAmount } from "./utils"; // For demonstration purposes, create a globally accessible TurnkeyClient const turnkeyClient = new TurnkeySDKServer({ - apiBaseUrl: "https://api.turnkey.com", + apiBaseUrl: process.env.BASE_URL!, apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!, diff --git a/examples/trading-runner/src/requests/createPolicy.ts b/examples/trading-runner/src/requests/createPolicy.ts index 8d1b49640..afd2f040b 100644 --- a/examples/trading-runner/src/requests/createPolicy.ts +++ b/examples/trading-runner/src/requests/createPolicy.ts @@ -13,7 +13,7 @@ export default async function createPolicy( condition: string ): Promise { try { - const { policyId } = await turnkeyClient.apiClient().createPolicy({ + const { policyId } = await turnkeyClient.createPolicy({ policyName, condition, consensus, diff --git a/examples/trading-runner/src/requests/createPrivateKey.ts b/examples/trading-runner/src/requests/createPrivateKey.ts index 2c0cb2081..01eb30f0a 100644 --- a/examples/trading-runner/src/requests/createPrivateKey.ts +++ b/examples/trading-runner/src/requests/createPrivateKey.ts @@ -12,7 +12,7 @@ export default async function createPrivateKey( console.log("creating a new Ethereum private key on Turnkey...\n"); try { - const { privateKeys } = await turnkeyClient.apiClient().createPrivateKeys({ + const { privateKeys } = await turnkeyClient.createPrivateKeys({ privateKeys: [ { privateKeyName, diff --git a/examples/trading-runner/src/requests/createUser.ts b/examples/trading-runner/src/requests/createUser.ts index f18a24bc0..3ccbefdb8 100644 --- a/examples/trading-runner/src/requests/createUser.ts +++ b/examples/trading-runner/src/requests/createUser.ts @@ -13,7 +13,7 @@ export default async function createUser( publicKey: string ): Promise { try { - const { userIds } = await turnkeyClient.apiClient().createApiOnlyUsers({ + const { userIds } = await turnkeyClient.createApiOnlyUsers({ apiOnlyUsers: [ { userName,