Skip to content

Commit 53ac80e

Browse files
Add Insight API client for blockchain data access
1 parent aa733b7 commit 53ac80e

26 files changed

+6583
-243
lines changed

Diff for: apps/playground-web/src/components/pay/embed.tsx

+1-28
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
defineChain,
1010
treasure,
1111
} from "thirdweb/chains";
12-
import { PayEmbed, getDefaultToken } from "thirdweb/react";
12+
import { PayEmbed } from "thirdweb/react";
1313
import { StyledConnectButton } from "../styled-connect-button";
1414
export function StyledPayEmbedPreview() {
1515
const { theme } = useTheme();
@@ -18,33 +18,6 @@ export function StyledPayEmbedPreview() {
1818
<div className="flex flex-col items-center justify-center">
1919
<StyledConnectButton
2020
chains={[base, defineChain(466), arbitrum, treasure, arbitrumNova]}
21-
supportedTokens={{
22-
466: [
23-
{
24-
address: "0x675C3ce7F43b00045a4Dab954AF36160fb57cB45",
25-
name: "USDC",
26-
symbol: "USDC",
27-
icon: getDefaultToken(base, "USDC")?.icon,
28-
},
29-
],
30-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
31-
8453: [getDefaultToken(base, "USDC")!],
32-
42161: [
33-
{
34-
address: "0x539bde0d7dbd336b79148aa742883198bbf60342",
35-
name: "MAGIC",
36-
symbol: "MAGIC",
37-
},
38-
],
39-
[arbitrumNova.id]: [
40-
{
41-
name: "Godcoin",
42-
symbol: "GOD",
43-
address: "0xb5130f4767ab0acc579f25a76e8f9e977cb3f948",
44-
icon: "https://assets.coingecko.com/coins/images/53848/standard/GodcoinTickerIcon_02.png",
45-
},
46-
],
47-
}}
4821
/>
4922
<div className="h-10" />
5023
<PayEmbed

Diff for: apps/playground-web/src/components/styled-connect-button.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ export function StyledConnectButton(
3030
abstract,
3131
]}
3232
wallets={WALLETS}
33-
supportedNFTs={{
34-
"84532": ["0x638263e3eAa3917a53630e61B1fBa685308024fa"],
35-
}}
3633
client={THIRDWEB_CLIENT}
3734
theme={theme === "light" ? "light" : "dark"}
3835
{...props}

Diff for: packages/insight/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Insight TypeScript SDK

Diff for: packages/insight/biome.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
3+
"extends": ["../../biome.json"],
4+
"files": {
5+
"ignore": ["src/client/**"]
6+
}
7+
}

Diff for: packages/insight/openapi-ts.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from "@hey-api/openapi-ts";
2+
3+
export default defineConfig({
4+
input: "https://insight.thirdweb.com/openapi.json",
5+
output: { path: "src/client" },
6+
plugins: ["@hey-api/client-fetch"],
7+
});

Diff for: packages/insight/package.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "@thirdweb-dev/insight",
3+
"version": "1.0.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/thirdweb-dev/js.git#main"
7+
},
8+
"license": "Apache-2.0",
9+
"bugs": {
10+
"url": "https://github.com/thirdweb-dev/js/issues"
11+
},
12+
"author": "thirdweb eng <[email protected]>",
13+
"type": "module",
14+
"main": "./dist/cjs/exports/thirdweb.js",
15+
"module": "./dist/esm/exports/thirdweb.js",
16+
"types": "./dist/types/exports/thirdweb.d.ts",
17+
"typings": "./dist/types/exports/thirdweb.d.ts",
18+
"exports": {
19+
".": {
20+
"types": "./dist/types/exports/thirdweb.d.ts",
21+
"import": "./dist/esm/exports/thirdweb.js",
22+
"default": "./dist/cjs/exports/thirdweb.js"
23+
},
24+
"./package.json": "./package.json"
25+
},
26+
"files": [
27+
"dist/*",
28+
"src/*"
29+
],
30+
"dependencies": {
31+
"@hey-api/client-fetch": "0.10.0",
32+
"tslib": "^2.8.1"
33+
},
34+
"devDependencies": {
35+
"@hey-api/openapi-ts": "0.66.1",
36+
"rimraf": "6.0.1"
37+
},
38+
"peerDependencies": {
39+
"typescript": ">=5.0.4"
40+
},
41+
"peerDependenciesMeta": {
42+
"typescript": {
43+
"optional": true
44+
}
45+
},
46+
"scripts": {
47+
"format": "biome format ./src --write",
48+
"lint": "biome check ./src",
49+
"fix": "biome check ./src --fix",
50+
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types",
51+
"build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
52+
"build:esm": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
53+
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
54+
"clean": "rimraf dist",
55+
"build:generate": "openapi-ts && pnpm format"
56+
},
57+
"engines": {
58+
"node": ">=18"
59+
}
60+
}

Diff for: packages/insight/src/client/client.gen.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import {
4+
type Config,
5+
type ClientOptions as DefaultClientOptions,
6+
createClient,
7+
createConfig,
8+
} from "@hey-api/client-fetch";
9+
import type { ClientOptions } from "./types.gen.js";
10+
11+
/**
12+
* The `createClientConfig()` function will be called on client initialization
13+
* and the returned object will become the client's initial configuration.
14+
*
15+
* You may want to initialize your client this way instead of calling
16+
* `setConfig()`. This is useful for example if you're using Next.js
17+
* to ensure your client always has the correct values.
18+
*/
19+
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
20+
(
21+
override?: Config<DefaultClientOptions & T>,
22+
) => Config<Required<DefaultClientOptions> & T>;
23+
24+
export const client = createClient(createConfig<ClientOptions>());

Diff for: packages/insight/src/client/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
export * from "./types.gen.js";
3+
export * from "./sdk.gen.js";

0 commit comments

Comments
 (0)