Skip to content

Commit ae2ff74

Browse files
[Engine] Update OpenAPI spec and configuration (#7050)
Signed-off-by: Joaquim Verges <[email protected]> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
1 parent dfa8603 commit ae2ff74

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

.changeset/shiny-olives-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/engine": patch
3+
---
4+
5+
Update openAPI spec

packages/engine/README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,38 @@ This package is a thin openAPI wrapper for insight, our in-house indexer.
55
## Configuration
66

77
```ts
8-
import { configure } from "@thirdweb-dev/insight";
8+
import { configure } from "@thirdweb-dev/engine";
99

1010
// call this once at the startup of your application
1111
configure({
12-
clientId: "<YOUR_CLIENT_ID>",
12+
secretKey: "<PROJECT_SECRET_KEY>",
1313
});
1414
```
1515

1616
## Example Usage
1717

1818
```ts
19-
import { getV1Events } from "@thirdweb-dev/insight";
19+
import { writeContract } from "@thirdweb-dev/engine";
2020

21-
const events = await getV1Events({
22-
query: {
23-
chain: [1, 137],
24-
filter_address: "0x1234567890123456789012345678901234567890",
21+
const result = await writeContract({
22+
headers: {
23+
"x-vault-access-token": "<VAULT_ACCESS_TOKEN>",
24+
},
25+
body: {
26+
executionOptions: {
27+
from: "0x1234567891234567891234567891234567891234",
28+
chainId: "1",
29+
},
30+
params: [
31+
{
32+
contractAddress: "0x1234567890123456789012345678901234567890",
33+
method: "function transfer(address to, uint256 amount)",
34+
params: [
35+
"0x1234567890123456789012345678901234567890",
36+
"1000000000000000000",
37+
],
38+
},
39+
],
2540
},
2641
});
2742
```

packages/engine/openapi-ts.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "@hey-api/openapi-ts";
22

33
export default defineConfig({
4-
input: "http://localhost:3009/openapi", // TODO: update to prod
4+
input: "https://engine.thirdweb.com/openapi",
55
output: { path: "src/client", lint: "biome", format: "biome" },
66
plugins: ["@hey-api/client-fetch"],
77
});

packages/engine/src/client/client.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
2323

2424
export const client = createClient(
2525
createConfig<ClientOptions>({
26-
baseUrl: "http://localhost:3009",
26+
baseUrl: "https://engine.thirdweb.com",
2727
}),
2828
);

packages/engine/src/client/types.gen.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export type WriteContractResponses = {
144144
transactions: Array<{
145145
id: string;
146146
batchIndex: number;
147+
clientId: string;
147148
chainId: string;
148149
from: string | null;
149150
transactionParams:
@@ -188,6 +189,7 @@ export type WriteContractResponses = {
188189
transactions: Array<{
189190
id: string;
190191
batchIndex: number;
192+
clientId: string;
191193
chainId: string;
192194
from: string | null;
193195
transactionParams:
@@ -273,6 +275,7 @@ export type SendTransactionResponses = {
273275
transactions: Array<{
274276
id: string;
275277
batchIndex: number;
278+
clientId: string;
276279
chainId: string;
277280
from: string | null;
278281
transactionParams:
@@ -317,6 +320,7 @@ export type SendTransactionResponses = {
317320
transactions: Array<{
318321
id: string;
319322
batchIndex: number;
323+
clientId: string;
320324
chainId: string;
321325
from: string | null;
322326
transactionParams:
@@ -876,6 +880,7 @@ export type SearchTransactionsResponses = {
876880
transactions: Array<{
877881
id: string;
878882
batchIndex: number;
883+
clientId: string;
879884
chainId: string;
880885
from: string | null;
881886
transactionParams:
@@ -1013,5 +1018,5 @@ export type GetTransactionAnalyticsSummaryResponse =
10131018
GetTransactionAnalyticsSummaryResponses[keyof GetTransactionAnalyticsSummaryResponses];
10141019

10151020
export type ClientOptions = {
1016-
baseUrl: "http://localhost:3009" | (string & {});
1021+
baseUrl: "https://engine.thirdweb.com" | (string & {});
10171022
};

0 commit comments

Comments
 (0)