diff --git a/.changeset/shiny-olives-pay.md b/.changeset/shiny-olives-pay.md new file mode 100644 index 00000000000..1d3769c1a7b --- /dev/null +++ b/.changeset/shiny-olives-pay.md @@ -0,0 +1,5 @@ +--- +"@thirdweb-dev/engine": patch +--- + +Update openAPI spec diff --git a/packages/engine/README.md b/packages/engine/README.md index 0e55b8cdbe5..859a0cd378c 100644 --- a/packages/engine/README.md +++ b/packages/engine/README.md @@ -5,23 +5,38 @@ This package is a thin openAPI wrapper for insight, our in-house indexer. ## Configuration ```ts -import { configure } from "@thirdweb-dev/insight"; +import { configure } from "@thirdweb-dev/engine"; // call this once at the startup of your application configure({ - clientId: "", + secretKey: "", }); ``` ## Example Usage ```ts -import { getV1Events } from "@thirdweb-dev/insight"; +import { writeContract } from "@thirdweb-dev/engine"; -const events = await getV1Events({ - query: { - chain: [1, 137], - filter_address: "0x1234567890123456789012345678901234567890", +const result = await writeContract({ + headers: { + "x-vault-access-token": "", + }, + body: { + executionOptions: { + from: "0x1234567891234567891234567891234567891234", + chainId: "1", + }, + params: [ + { + contractAddress: "0x1234567890123456789012345678901234567890", + method: "function transfer(address to, uint256 amount)", + params: [ + "0x1234567890123456789012345678901234567890", + "1000000000000000000", + ], + }, + ], }, }); ``` diff --git a/packages/engine/openapi-ts.config.ts b/packages/engine/openapi-ts.config.ts index f21fc337c5c..e1873082942 100644 --- a/packages/engine/openapi-ts.config.ts +++ b/packages/engine/openapi-ts.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from "@hey-api/openapi-ts"; export default defineConfig({ - input: "http://localhost:3009/openapi", // TODO: update to prod + input: "https://engine.thirdweb.com/openapi", output: { path: "src/client", lint: "biome", format: "biome" }, plugins: ["@hey-api/client-fetch"], }); diff --git a/packages/engine/src/client/client.gen.ts b/packages/engine/src/client/client.gen.ts index a0b05b5e1c0..3dca3c31b50 100644 --- a/packages/engine/src/client/client.gen.ts +++ b/packages/engine/src/client/client.gen.ts @@ -23,6 +23,6 @@ export type CreateClientConfig = export const client = createClient( createConfig({ - baseUrl: "http://localhost:3009", + baseUrl: "https://engine.thirdweb.com", }), ); diff --git a/packages/engine/src/client/types.gen.ts b/packages/engine/src/client/types.gen.ts index 0c35fc41fca..61c6801af2a 100644 --- a/packages/engine/src/client/types.gen.ts +++ b/packages/engine/src/client/types.gen.ts @@ -144,6 +144,7 @@ export type WriteContractResponses = { transactions: Array<{ id: string; batchIndex: number; + clientId: string; chainId: string; from: string | null; transactionParams: @@ -188,6 +189,7 @@ export type WriteContractResponses = { transactions: Array<{ id: string; batchIndex: number; + clientId: string; chainId: string; from: string | null; transactionParams: @@ -273,6 +275,7 @@ export type SendTransactionResponses = { transactions: Array<{ id: string; batchIndex: number; + clientId: string; chainId: string; from: string | null; transactionParams: @@ -317,6 +320,7 @@ export type SendTransactionResponses = { transactions: Array<{ id: string; batchIndex: number; + clientId: string; chainId: string; from: string | null; transactionParams: @@ -876,6 +880,7 @@ export type SearchTransactionsResponses = { transactions: Array<{ id: string; batchIndex: number; + clientId: string; chainId: string; from: string | null; transactionParams: @@ -1013,5 +1018,5 @@ export type GetTransactionAnalyticsSummaryResponse = GetTransactionAnalyticsSummaryResponses[keyof GetTransactionAnalyticsSummaryResponses]; export type ClientOptions = { - baseUrl: "http://localhost:3009" | (string & {}); + baseUrl: "https://engine.thirdweb.com" | (string & {}); };