diff --git a/.changeset/quick-bugs-remain.md b/.changeset/quick-bugs-remain.md new file mode 100644 index 00000000000..525ca470d98 --- /dev/null +++ b/.changeset/quick-bugs-remain.md @@ -0,0 +1,31 @@ +--- +"@thirdweb-dev/insight": major +--- + +Initial release of dedicated insight TS sdk + +This package is a thin openAPI wrapper for insight, our in-house indexer. + +## Configuration + +```ts +import { configure } from "@thirdweb-dev/insight"; + +// call this once at the startup of your application +configure({ + clientId: "", +}); +``` + +## Example Usage + +```ts +import { getV1Events } from "@thirdweb-dev/insight"; + +const events = await getV1Events({ + query: { + chain: [1, 137], + filter_address: "0x1234567890123456789012345678901234567890", + }, +}); +``` diff --git a/.changeset/wicked-pianos-carry.md b/.changeset/wicked-pianos-carry.md new file mode 100644 index 00000000000..618c33eda5c --- /dev/null +++ b/.changeset/wicked-pianos-carry.md @@ -0,0 +1,45 @@ +--- +"thirdweb": minor +--- + +Expose getOwnedTokens, getOwnedNFTs and getTransaction functions + +You can now use Insight, our in-house indexer directly from the SDK with a simple API: + +## Get Owned ERC20 tokens + +```ts +import { Insight } from "thirdweb"; + +const tokens = await Insight.getOwnedTokens({ + client, + ownerAddress, + chains: [base, polygon, arbitrum], +}); +``` + +## Get Owned NFTs (ERC721 and ERC1155) + +```ts +import { Insight } from "thirdweb"; + +const nfts = await Insight.getOwnedNFTs({ + client, + ownerAddress, + chains: [sepolia], +}); +``` + +## Get Transactions for a given wallet address + +```ts +import { Insight } from "thirdweb"; + +const transactions = await Insight.getTransactions({ + client, + walletAddress, + chains: [sepolia], +}); +``` + +All functions come with extra query filters for more granular queries, refer to the documentation for more details. diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f1bfbc4ce17..52c85fe81f3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -102,7 +102,7 @@ jobs: runs-on: ubuntu-latest-8 strategy: matrix: - package_manager: [npm, yarn, pnpm, bun] + package_manager: [pnpm] # TODO, reenable [npm, yarn, pnpm, bun] bundler: [vite, webpack, esbuild] steps: - name: Check out the code @@ -123,7 +123,14 @@ jobs: mkdir test-project cd test-project npm init -y - ${{ matrix.package_manager }} add react react-dom ../packages/thirdweb + + # Handle different package managers + if [ "${{ matrix.package_manager }}" = "pnpm" ]; then + # Create pnpm workspace + echo '{"name": "test-project", "private": true, "workspaces": ["."]}' > package.json + echo '{"packages": ["../packages/*"]}' > pnpm-workspace.yaml + pnpm add react react-dom ../packages/thirdweb -w + fi - name: Create test file run: | cd test-project @@ -133,7 +140,7 @@ jobs: if: matrix.bundler == 'vite' run: | cd test-project - ${{matrix.package_manager}} add vite + ${{matrix.package_manager}} add vite -w echo 'import { defineConfig } from "vite"; import {resolve} from "path"; export default defineConfig({ build: { lib: { entry: resolve(__dirname, "index.js"), name: "e2e_test" }, outDir: "dist" }});' > vite.config.js npx vite build @@ -141,7 +148,7 @@ jobs: if: matrix.bundler == 'webpack' run: | cd test-project - ${{matrix.package_manager}} add webpack webpack-cli + ${{matrix.package_manager}} add webpack webpack-cli -w echo 'const path = require("path"); module.exports = { mode: "production", entry: "./index.js", output: { path: path.resolve(__dirname, "dist"), filename: "bundle.js" }};' > webpack.config.js npx webpack @@ -149,7 +156,7 @@ jobs: if: matrix.bundler == 'esbuild' run: | cd test-project - ${{matrix.package_manager}} add esbuild + ${{matrix.package_manager}} add esbuild -w npx esbuild index.js --bundle --outdir=dist - name: Verify bundle @@ -177,6 +184,9 @@ jobs: - name: Setup & Install uses: ./.github/composite-actions/install + - name: Build Packages + run: pnpm build + - name: Report bundle size uses: andresz1/size-limit-action@94bc357df29c36c8f8d50ea497c3e225c3c95d1d # v1.8.0 with: diff --git a/apps/playground-web/src/components/pay/embed.tsx b/apps/playground-web/src/components/pay/embed.tsx index 5821666189c..5fb83859ce8 100644 --- a/apps/playground-web/src/components/pay/embed.tsx +++ b/apps/playground-web/src/components/pay/embed.tsx @@ -9,46 +9,21 @@ import { defineChain, treasure, } from "thirdweb/chains"; -import { PayEmbed, getDefaultToken } from "thirdweb/react"; +import { PayEmbed } from "thirdweb/react"; +import { StyledConnectButton } from "../styled-connect-button"; export function StyledPayEmbedPreview() { const { theme } = useTheme(); return (
+ +
- 8453: [getDefaultToken(base, "USDC")!], - 42161: [ - { - address: "0x539bde0d7dbd336b79148aa742883198bbf60342", - name: "MAGIC", - symbol: "MAGIC", - }, - ], - [arbitrumNova.id]: [ - { - name: "Godcoin", - symbol: "GOD", - address: "0xb5130f4767ab0acc579f25a76e8f9e977cb3f948", - icon: "https://assets.coingecko.com/coins/images/53848/standard/GodcoinTickerIcon_02.png", - }, - ], - }} payOptions={{ mode: "fund_wallet", metadata: { diff --git a/apps/playground-web/src/components/styled-connect-button.tsx b/apps/playground-web/src/components/styled-connect-button.tsx index 95f2686e04e..668943ffbcb 100644 --- a/apps/playground-web/src/components/styled-connect-button.tsx +++ b/apps/playground-web/src/components/styled-connect-button.tsx @@ -30,9 +30,6 @@ export function StyledConnectButton( abstract, ]} wallets={WALLETS} - supportedNFTs={{ - "84532": ["0x638263e3eAa3917a53630e61B1fBa685308024fa"], - }} client={THIRDWEB_CLIENT} theme={theme === "light" ? "light" : "dark"} {...props} diff --git a/apps/playground-web/src/lib/client.ts b/apps/playground-web/src/lib/client.ts index ed34bcc545f..21b53ae2a2c 100644 --- a/apps/playground-web/src/lib/client.ts +++ b/apps/playground-web/src/lib/client.ts @@ -9,6 +9,7 @@ setThirdwebDomains({ bundler: process.env.NEXT_PUBLIC_BUNDLER_URL, pay: process.env.NEXT_PUBLIC_PAY_URL, analytics: process.env.NEXT_PUBLIC_ANALYTICS_URL, + insight: process.env.NEXT_PUBLIC_INSIGHT_URL, }); const isDev = diff --git a/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts b/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts index 66ec3c03803..8c2cc36c62e 100644 --- a/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts +++ b/apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts @@ -44,6 +44,7 @@ const tagsToGroup = { "@client": "Client", "@account": "Account", "@nebula": "Nebula", + "@insight": "Insight", } as const; type TagKey = keyof typeof tagsToGroup; @@ -61,6 +62,7 @@ const sidebarGroupOrder: TagKey[] = [ "@account", "@contract", "@transaction", + "@insight", "@bridge", "@nebula", "@social", diff --git a/packages/insight/README.md b/packages/insight/README.md new file mode 100644 index 00000000000..0e55b8cdbe5 --- /dev/null +++ b/packages/insight/README.md @@ -0,0 +1,29 @@ +# Insight TypeScript SDK + +This package is a thin openAPI wrapper for insight, our in-house indexer. + +## Configuration + +```ts +import { configure } from "@thirdweb-dev/insight"; + +// call this once at the startup of your application +configure({ + clientId: "", +}); +``` + +## Example Usage + +```ts +import { getV1Events } from "@thirdweb-dev/insight"; + +const events = await getV1Events({ + query: { + chain: [1, 137], + filter_address: "0x1234567890123456789012345678901234567890", + }, +}); +``` + +This package was autogenerated from the [Insight openAPI spec](https://insight-api.thirdweb.com/reference) using [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) diff --git a/packages/insight/biome.json b/packages/insight/biome.json new file mode 100644 index 00000000000..7520ee9c4d2 --- /dev/null +++ b/packages/insight/biome.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.2/schema.json", + "extends": ["../../biome.json"], + "files": { + "ignore": ["src/client/**"] + } +} diff --git a/packages/insight/openapi-ts.config.ts b/packages/insight/openapi-ts.config.ts new file mode 100644 index 00000000000..038e4b81761 --- /dev/null +++ b/packages/insight/openapi-ts.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from "@hey-api/openapi-ts"; + +export default defineConfig({ + input: "https://insight.thirdweb.com/openapi.json", + output: { path: "src/client" }, + plugins: ["@hey-api/client-fetch"], +}); diff --git a/packages/insight/package.json b/packages/insight/package.json new file mode 100644 index 00000000000..8559bd956fb --- /dev/null +++ b/packages/insight/package.json @@ -0,0 +1,57 @@ +{ + "name": "@thirdweb-dev/insight", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git+https://github.com/thirdweb-dev/js.git#main" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/thirdweb-dev/js/issues" + }, + "author": "thirdweb eng ", + "type": "module", + "main": "./dist/cjs/exports/thirdweb.js", + "module": "./dist/esm/exports/thirdweb.js", + "types": "./dist/types/exports/thirdweb.d.ts", + "typings": "./dist/types/exports/thirdweb.d.ts", + "exports": { + ".": { + "types": "./dist/types/exports/thirdweb.d.ts", + "import": "./dist/esm/exports/thirdweb.js", + "default": "./dist/cjs/exports/thirdweb.js" + }, + "./package.json": "./package.json" + }, + "files": ["dist/*", "src/*"], + "dependencies": { + "@hey-api/client-fetch": "0.10.0", + "tslib": "^2.8.1" + }, + "devDependencies": { + "@hey-api/openapi-ts": "0.66.1", + "rimraf": "6.0.1" + }, + "peerDependencies": { + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "scripts": { + "format": "biome format ./src --write", + "lint": "biome check ./src", + "fix": "biome check ./src --fix", + "build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types", + "build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json", + "build:esm": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json", + "build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", + "clean": "rimraf dist", + "build:generate": "openapi-ts && pnpm format" + }, + "engines": { + "node": ">=18" + } +} diff --git a/packages/insight/src/client/client.gen.ts b/packages/insight/src/client/client.gen.ts new file mode 100644 index 00000000000..109987a0539 --- /dev/null +++ b/packages/insight/src/client/client.gen.ts @@ -0,0 +1,24 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { + type Config, + type ClientOptions as DefaultClientOptions, + createClient, + createConfig, +} from "@hey-api/client-fetch"; +import type { ClientOptions } from "./types.gen.js"; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = + ( + override?: Config, + ) => Config & T>; + +export const client = createClient(createConfig()); diff --git a/packages/insight/src/client/index.ts b/packages/insight/src/client/index.ts new file mode 100644 index 00000000000..65f317569c2 --- /dev/null +++ b/packages/insight/src/client/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from "./types.gen.js"; +export * from "./sdk.gen.js"; diff --git a/packages/insight/src/client/sdk.gen.ts b/packages/insight/src/client/sdk.gen.ts new file mode 100644 index 00000000000..eeb90077478 --- /dev/null +++ b/packages/insight/src/client/sdk.gen.ts @@ -0,0 +1,1544 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { + Client, + Options as ClientOptions, + TDataShape, +} from "@hey-api/client-fetch"; +import { client as _heyApiClient } from "./client.gen.js"; +import type { + DeleteV1WebhooksByWebhookIdData, + DeleteV1WebhooksByWebhookIdError, + DeleteV1WebhooksByWebhookIdResponse, + GetV1BlocksData, + GetV1BlocksError, + GetV1BlocksResponse, + GetV1ContractsAbiByContractAddressData, + GetV1ContractsAbiByContractAddressError, + GetV1ContractsAbiByContractAddressResponse, + GetV1ContractsMetadataByContractAddressData, + GetV1ContractsMetadataByContractAddressError, + GetV1ContractsMetadataByContractAddressResponse, + GetV1EventsByContractAddressBySignatureData, + GetV1EventsByContractAddressBySignatureError, + GetV1EventsByContractAddressBySignatureResponse, + GetV1EventsByContractAddressData, + GetV1EventsByContractAddressError, + GetV1EventsByContractAddressResponse, + GetV1EventsData, + GetV1EventsError, + GetV1EventsResponse, + GetV1NftsBalanceByOwnerAddressData, + GetV1NftsBalanceByOwnerAddressResponse, + GetV1NftsByContractAddressByTokenIdData, + GetV1NftsByContractAddressByTokenIdError, + GetV1NftsByContractAddressByTokenIdResponse, + GetV1NftsByContractAddressData, + GetV1NftsByContractAddressError, + GetV1NftsByContractAddressResponse, + GetV1NftsCollectionsByContractAddressData, + GetV1NftsCollectionsByContractAddressError, + GetV1NftsCollectionsByContractAddressResponse, + GetV1NftsData, + GetV1NftsError, + GetV1NftsMetadataRefreshByContractAddressByTokenIdData, + GetV1NftsMetadataRefreshByContractAddressByTokenIdError, + GetV1NftsMetadataRefreshByContractAddressByTokenIdResponse, + GetV1NftsMetadataRefreshByContractAddressData, + GetV1NftsMetadataRefreshByContractAddressError, + GetV1NftsMetadataRefreshByContractAddressResponse, + GetV1NftsOwnersByContractAddressByTokenIdData, + GetV1NftsOwnersByContractAddressByTokenIdError, + GetV1NftsOwnersByContractAddressByTokenIdResponse, + GetV1NftsOwnersByContractAddressData, + GetV1NftsOwnersByContractAddressError, + GetV1NftsOwnersByContractAddressResponse, + GetV1NftsResponse, + GetV1NftsTransfersByContractAddressByTokenIdData, + GetV1NftsTransfersByContractAddressByTokenIdError, + GetV1NftsTransfersByContractAddressByTokenIdResponse, + GetV1NftsTransfersByContractAddressData, + GetV1NftsTransfersByContractAddressError, + GetV1NftsTransfersByContractAddressResponse, + GetV1NftsTransfersData, + GetV1NftsTransfersError, + GetV1NftsTransfersResponse, + GetV1NftsTransfersTransactionByTransactionHashData, + GetV1NftsTransfersTransactionByTransactionHashError, + GetV1NftsTransfersTransactionByTransactionHashResponse, + GetV1ResolveByInputData, + GetV1ResolveByInputError, + GetV1ResolveByInputResponse, + GetV1TokensErc20ByOwnerAddressData, + GetV1TokensErc20ByOwnerAddressResponse, + GetV1TokensErc721ByOwnerAddressData, + GetV1TokensErc721ByOwnerAddressResponse, + GetV1TokensErc1155ByOwnerAddressData, + GetV1TokensErc1155ByOwnerAddressResponse, + GetV1TokensLookupData, + GetV1TokensLookupResponse, + GetV1TokensPriceData, + GetV1TokensPriceResponse, + GetV1TokensPriceSupportedData, + GetV1TokensPriceSupportedResponse, + GetV1TokensTransfersByContractAddressData, + GetV1TokensTransfersByContractAddressError, + GetV1TokensTransfersByContractAddressResponse, + GetV1TokensTransfersData, + GetV1TokensTransfersError, + GetV1TokensTransfersResponse, + GetV1TokensTransfersTransactionByTransactionHashData, + GetV1TokensTransfersTransactionByTransactionHashError, + GetV1TokensTransfersTransactionByTransactionHashResponse, + GetV1TransactionsByContractAddressBySignatureData, + GetV1TransactionsByContractAddressBySignatureError, + GetV1TransactionsByContractAddressBySignatureResponse, + GetV1TransactionsByContractAddressData, + GetV1TransactionsByContractAddressError, + GetV1TransactionsByContractAddressResponse, + GetV1TransactionsData, + GetV1TransactionsError, + GetV1TransactionsResponse, + GetV1WalletsByWalletAddressTransactionsData, + GetV1WalletsByWalletAddressTransactionsError, + GetV1WalletsByWalletAddressTransactionsResponse, + GetV1WebhooksData, + GetV1WebhooksError, + GetV1WebhooksResponse, + PatchV1WebhooksByWebhookIdData, + PatchV1WebhooksByWebhookIdError, + PatchV1WebhooksByWebhookIdResponse, + PostV1DecodeByContractAddressData, + PostV1DecodeByContractAddressError, + PostV1DecodeByContractAddressResponse, + PostV1WebhooksByWebhookIdResendOtpData, + PostV1WebhooksByWebhookIdResendOtpError, + PostV1WebhooksByWebhookIdResendOtpResponse, + PostV1WebhooksByWebhookIdVerifyData, + PostV1WebhooksByWebhookIdVerifyError, + PostV1WebhooksByWebhookIdVerifyResponse, + PostV1WebhooksData, + PostV1WebhooksError, + PostV1WebhooksResponse, + PostV1WebhooksTestData, + PostV1WebhooksTestError, + PostV1WebhooksTestResponse, +} from "./types.gen.js"; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, +> = ClientOptions & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +/** + * Get webhooks + * Get a list of webhooks or a single webhook by ID + */ +export const getV1Webhooks = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + GetV1WebhooksResponse, + GetV1WebhooksError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks", + ...options, + }); +}; + +/** + * Create webhook + * Create a new webhook. The webhook will start out as suspended and an OTP code will be sent to the webhook URL. This OTP code must be verified using the Verify Webhook endpoint within 15 minutes. + */ +export const postV1Webhooks = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).post< + PostV1WebhooksResponse, + PostV1WebhooksError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); +}; + +/** + * Delete webhook + * Delete a webhook. This action cannot be undone. + */ +export const deleteV1WebhooksByWebhookId = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).delete< + DeleteV1WebhooksByWebhookIdResponse, + DeleteV1WebhooksByWebhookIdError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks/{webhook_id}", + ...options, + }); +}; + +/** + * Update webhook + * Update a webhook. If the URL is updated, it needs to verified again the same way as when creating a webhook. + */ +export const patchV1WebhooksByWebhookId = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).patch< + PatchV1WebhooksByWebhookIdResponse, + PatchV1WebhooksByWebhookIdError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks/{webhook_id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); +}; + +/** + * Verify webhook + * Verify a webhook using a OTP code that was sent to the webhook URL. The webhook will be activated after verification. + */ +export const postV1WebhooksByWebhookIdVerify = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + PostV1WebhooksByWebhookIdVerifyResponse, + PostV1WebhooksByWebhookIdVerifyError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks/{webhook_id}/verify", + ...options, + }); +}; + +/** + * Resend OTP code + * Resend a OTP code to the webhook URL. This will invalidate the old OTP and will again expire after 15 minutes. + */ +export const postV1WebhooksByWebhookIdResendOtp = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + PostV1WebhooksByWebhookIdResendOtpResponse, + PostV1WebhooksByWebhookIdResendOtpError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks/{webhook_id}/resend-otp", + ...options, + }); +}; + +/** + * Test webhook + * Test your webhook URL. This will send a test event to the webhook URL signed with an example secret 'test123'. NB! The payload does not necessarily match your webhook filters. You can however use it to test signature verification and payload format handling. + */ +export const postV1WebhooksTest = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).post< + PostV1WebhooksTestResponse, + PostV1WebhooksTestError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/webhooks/test", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); +}; + +/** + * Get events + * Get events + */ +export const getV1Events = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + GetV1EventsResponse, + GetV1EventsError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/events", + ...options, + }); +}; + +/** + * Get contract events + * Get contract events + */ +export const getV1EventsByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1EventsByContractAddressResponse, + GetV1EventsByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/events/{contractAddress}", + ...options, + }); +}; + +/** + * Get contract events with specific signature + * Get specific contract events + */ +export const getV1EventsByContractAddressBySignature = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1EventsByContractAddressBySignatureResponse, + GetV1EventsByContractAddressBySignatureError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/events/{contractAddress}/{signature}", + ...options, + }); +}; + +/** + * Get transactions + * Get transactions + */ +export const getV1Transactions = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + GetV1TransactionsResponse, + GetV1TransactionsError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/transactions", + ...options, + }); +}; + +/** + * Get contract transactions + * Get contract transactions + */ +export const getV1TransactionsByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TransactionsByContractAddressResponse, + GetV1TransactionsByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/transactions/{contractAddress}", + ...options, + }); +}; + +/** + * Get contract transactions with specific signature + * Get specific contract transactions + */ +export const getV1TransactionsByContractAddressBySignature = < + ThrowOnError extends boolean = false, +>( + options: Options< + GetV1TransactionsByContractAddressBySignatureData, + ThrowOnError + >, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TransactionsByContractAddressBySignatureResponse, + GetV1TransactionsByContractAddressBySignatureError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/transactions/{contractAddress}/{signature}", + ...options, + }); +}; + +/** + * Get token transfers by transaction + * Get token transfers by transaction + */ +export const getV1TokensTransfersTransactionByTransactionHash = < + ThrowOnError extends boolean = false, +>( + options: Options< + GetV1TokensTransfersTransactionByTransactionHashData, + ThrowOnError + >, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensTransfersTransactionByTransactionHashResponse, + GetV1TokensTransfersTransactionByTransactionHashError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/transfers/transaction/{transaction_hash}", + ...options, + }); +}; + +/** + * Get token transfers by contract + * Get token transfers by contract + */ +export const getV1TokensTransfersByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensTransfersByContractAddressResponse, + GetV1TokensTransfersByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/transfers/{contract_address}", + ...options, + }); +}; + +/** + * Get token transfers by wallet address + * Get token transfers by wallet address + */ +export const getV1TokensTransfers = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensTransfersResponse, + GetV1TokensTransfersError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/transfers", + ...options, + }); +}; + +/** + * Get ERC-20 balances by address + * Get ERC-20 balances for a given address + */ +export const getV1TokensErc20ByOwnerAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensErc20ByOwnerAddressResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/erc20/{ownerAddress}", + ...options, + }); +}; + +/** + * @deprecated + * Get ERC-721 balances by address + * Get ERC-721 (NFT) balances for a given address [BEING DEPRECATED IN FAVOR OF /nfts/balance] + */ +export const getV1TokensErc721ByOwnerAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensErc721ByOwnerAddressResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/erc721/{ownerAddress}", + ...options, + }); +}; + +/** + * @deprecated + * Get ERC-1155 balances by address + * Get ERC-1155 (Multi Token) balances for a given address [BEING DEPRECATED IN FAVOR OF /nfts/balance] + */ +export const getV1TokensErc1155ByOwnerAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensErc1155ByOwnerAddressResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/erc1155/{ownerAddress}", + ...options, + }); +}; + +/** + * Get supported tokens for price data + * Get supported tokens for price data + */ +export const getV1TokensPriceSupported = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + GetV1TokensPriceSupportedResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/price/supported", + ...options, + }); +}; + +/** + * Get token price + * Get price in USD for given token(s) + */ +export const getV1TokensPrice = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + GetV1TokensPriceResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/price", + ...options, + }); +}; + +/** + * Token lookup + * Look up a fungible token by symbol + */ +export const getV1TokensLookup = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensLookupResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/tokens/lookup", + ...options, + }); +}; + +/** + * Resolve + * Resolve + */ +export const getV1ResolveByInput = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1ResolveByInputResponse, + GetV1ResolveByInputError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/resolve/{input}", + ...options, + }); +}; + +/** + * Get blocks + * Get blocks + */ +export const getV1Blocks = ( + options?: Options, +) => { + return (options?.client ?? _heyApiClient).get< + GetV1BlocksResponse, + GetV1BlocksError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/blocks", + ...options, + }); +}; + +/** + * Get contract ABI​ + * Get contract ABI​ + */ +export const getV1ContractsAbiByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1ContractsAbiByContractAddressResponse, + GetV1ContractsAbiByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/contracts/abi/{contractAddress}", + ...options, + }); +}; + +/** + * Get contract metadata​ + * Get contract metadata​ + */ +export const getV1ContractsMetadataByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1ContractsMetadataByContractAddressResponse, + GetV1ContractsMetadataByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/contracts/metadata/{contractAddress}", + ...options, + }); +}; + +/** + * Decode logs and transactions​ + * Decode logs and transactions​ + */ +export const postV1DecodeByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).post< + PostV1DecodeByContractAddressResponse, + PostV1DecodeByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/decode/{contractAddress}", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); +}; + +/** + * Get NFT balances by address + * Get NFT balances for a given address + */ +export const getV1NftsBalanceByOwnerAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsBalanceByOwnerAddressResponse, + unknown, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/balance/{ownerAddress}", + ...options, + }); +}; + +/** + * Get collection + * Retrieve metadata about a collection + */ +export const getV1NftsCollectionsByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsCollectionsByContractAddressResponse, + GetV1NftsCollectionsByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/collections/{contract_address}", + ...options, + }); +}; + +/** + * Get NFTs by owner + * Get NFTs by owner + */ +export const getV1Nfts = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsResponse, + GetV1NftsError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts", + ...options, + }); +}; + +/** + * Get NFT owners by contract + * Get NFT owners by contract + */ +export const getV1NftsOwnersByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsOwnersByContractAddressResponse, + GetV1NftsOwnersByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/owners/{contract_address}", + ...options, + }); +}; + +/** + * Get NFT owners by token + * Get NFT owners by token + */ +export const getV1NftsOwnersByContractAddressByTokenId = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsOwnersByContractAddressByTokenIdResponse, + GetV1NftsOwnersByContractAddressByTokenIdError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/owners/{contract_address}/{token_id}", + ...options, + }); +}; + +/** + * Get NFT transfers by owner + * Get NFT transfers by owner + */ +export const getV1NftsTransfers = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersResponse, + GetV1NftsTransfersError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers", + ...options, + }); +}; + +/** + * Get NFT transfers by transaction + * Get NFT transfers by transaction + */ +export const getV1NftsTransfersTransactionByTransactionHash = < + ThrowOnError extends boolean = false, +>( + options: Options< + GetV1NftsTransfersTransactionByTransactionHashData, + ThrowOnError + >, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersTransactionByTransactionHashResponse, + GetV1NftsTransfersTransactionByTransactionHashError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers/transaction/{transaction_hash}", + ...options, + }); +}; + +/** + * Get NFT transfers by contract + * Get NFT transfers by contract + */ +export const getV1NftsTransfersByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersByContractAddressResponse, + GetV1NftsTransfersByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers/{contract_address}", + ...options, + }); +}; + +/** + * Get NFTs by contract + * Get NFTs by contract + */ +export const getV1NftsByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsByContractAddressResponse, + GetV1NftsByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/{contract_address}", + ...options, + }); +}; + +/** + * Get NFT transfers by token + * Get NFT transfers by token + */ +export const getV1NftsTransfersByContractAddressByTokenId = < + ThrowOnError extends boolean = false, +>( + options: Options< + GetV1NftsTransfersByContractAddressByTokenIdData, + ThrowOnError + >, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersByContractAddressByTokenIdResponse, + GetV1NftsTransfersByContractAddressByTokenIdError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers/{contract_address}/{token_id}", + ...options, + }); +}; + +/** + * Get NFT by token ID + * Get NFT by token ID + */ +export const getV1NftsByContractAddressByTokenId = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsByContractAddressByTokenIdResponse, + GetV1NftsByContractAddressByTokenIdError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/{contract_address}/{token_id}", + ...options, + }); +}; + +/** + * Force refresh collection metadata + * Force refresh collection metadata for the specified contract (across multiple chains if provided) + */ +export const getV1NftsMetadataRefreshByContractAddress = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsMetadataRefreshByContractAddressResponse, + GetV1NftsMetadataRefreshByContractAddressError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/metadata/refresh/{contract_address}", + ...options, + }); +}; + +/** + * Force refresh token metadata + * Force refresh token metadata for the specified contract and token ID (across multiple chains if provided) + */ +export const getV1NftsMetadataRefreshByContractAddressByTokenId = < + ThrowOnError extends boolean = false, +>( + options: Options< + GetV1NftsMetadataRefreshByContractAddressByTokenIdData, + ThrowOnError + >, +) => { + return (options.client ?? _heyApiClient).get< + GetV1NftsMetadataRefreshByContractAddressByTokenIdResponse, + GetV1NftsMetadataRefreshByContractAddressByTokenIdError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}", + ...options, + }); +}; + +/** + * Get wallet transactions + * Get incoming and outgoing transactions for a wallet + */ +export const getV1WalletsByWalletAddressTransactions = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1WalletsByWalletAddressTransactionsResponse, + GetV1WalletsByWalletAddressTransactionsError, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + { + scheme: "bearer", + type: "http", + }, + { + in: "query", + name: "clientId", + type: "apiKey", + }, + ], + url: "/v1/wallets/{wallet_address}/transactions", + ...options, + }); +}; diff --git a/packages/insight/src/client/types.gen.ts b/packages/insight/src/client/types.gen.ts new file mode 100644 index 00000000000..3de4df45396 --- /dev/null +++ b/packages/insight/src/client/types.gen.ts @@ -0,0 +1,4319 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type GetV1WebhooksData = { + body?: never; + path?: never; + query?: { + /** + * The webhook ID to request the data for + */ + webhook_id?: string; + }; + url: "/v1/webhooks"; +}; + +export type GetV1WebhooksErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1WebhooksError = GetV1WebhooksErrors[keyof GetV1WebhooksErrors]; + +export type GetV1WebhooksResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + id: string; + team_id: string; + project_id: string; + webhook_url: string; + webhook_secret: string; + filters: string | number | boolean | unknown | {} | Array; + suspended_at: string | null; + suspended_reason: string | null; + disabled: boolean; + created_at: string; + updated_at: string | null; + }>; + }; +}; + +export type GetV1WebhooksResponse = + GetV1WebhooksResponses[keyof GetV1WebhooksResponses]; + +export type PostV1WebhooksData = { + body?: { + webhook_url: string; + filters: { + "v1.events"?: { + chain_ids?: Array; + addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: {}; + }>; + }; + "v1.transactions"?: { + chain_ids?: Array; + from_addresses?: Array; + to_addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: Array; + }>; + }; + }; + }; + path?: never; + query?: never; + url: "/v1/webhooks"; +}; + +export type PostV1WebhooksErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PostV1WebhooksError = + PostV1WebhooksErrors[keyof PostV1WebhooksErrors]; + +export type PostV1WebhooksResponses = { + /** + * Successful response + */ + 200: { + data: { + id: string; + team_id: string; + project_id: string; + webhook_url: string; + webhook_secret: string; + filters: string | number | boolean | unknown | {} | Array; + suspended_at: string | null; + suspended_reason: string | null; + disabled: boolean; + created_at: string; + updated_at: string | null; + }; + }; +}; + +export type PostV1WebhooksResponse = + PostV1WebhooksResponses[keyof PostV1WebhooksResponses]; + +export type DeleteV1WebhooksByWebhookIdData = { + body?: never; + path: { + webhook_id: string; + }; + query?: never; + url: "/v1/webhooks/{webhook_id}"; +}; + +export type DeleteV1WebhooksByWebhookIdErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Webhook not found + */ + 404: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type DeleteV1WebhooksByWebhookIdError = + DeleteV1WebhooksByWebhookIdErrors[keyof DeleteV1WebhooksByWebhookIdErrors]; + +export type DeleteV1WebhooksByWebhookIdResponses = { + /** + * Successful response + */ + 200: { + data: { + id: string; + team_id: string; + project_id: string; + webhook_url: string; + webhook_secret: string; + filters: string | number | boolean | unknown | {} | Array; + suspended_at: string | null; + suspended_reason: string | null; + disabled: boolean; + created_at: string; + updated_at: string | null; + }; + }; +}; + +export type DeleteV1WebhooksByWebhookIdResponse = + DeleteV1WebhooksByWebhookIdResponses[keyof DeleteV1WebhooksByWebhookIdResponses]; + +export type PatchV1WebhooksByWebhookIdData = { + body?: { + webhook_url?: string; + filters?: { + "v1.events"?: { + chain_ids?: Array; + addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: {}; + }>; + }; + "v1.transactions"?: { + chain_ids?: Array; + from_addresses?: Array; + to_addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: Array; + }>; + }; + }; + disabled?: boolean; + }; + path: { + webhook_id: string; + }; + query?: never; + url: "/v1/webhooks/{webhook_id}"; +}; + +export type PatchV1WebhooksByWebhookIdErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Webhook not found + */ + 404: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PatchV1WebhooksByWebhookIdError = + PatchV1WebhooksByWebhookIdErrors[keyof PatchV1WebhooksByWebhookIdErrors]; + +export type PatchV1WebhooksByWebhookIdResponses = { + /** + * Successful response + */ + 200: { + data: { + id: string; + team_id: string; + project_id: string; + webhook_url: string; + webhook_secret: string; + filters: string | number | boolean | unknown | {} | Array; + suspended_at: string | null; + suspended_reason: string | null; + disabled: boolean; + created_at: string; + updated_at: string | null; + }; + }; +}; + +export type PatchV1WebhooksByWebhookIdResponse = + PatchV1WebhooksByWebhookIdResponses[keyof PatchV1WebhooksByWebhookIdResponses]; + +export type PostV1WebhooksByWebhookIdVerifyData = { + body?: never; + path: { + webhook_id: string; + }; + query: { + otp: string; + }; + url: "/v1/webhooks/{webhook_id}/verify"; +}; + +export type PostV1WebhooksByWebhookIdVerifyErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Webhook not found + */ + 404: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PostV1WebhooksByWebhookIdVerifyError = + PostV1WebhooksByWebhookIdVerifyErrors[keyof PostV1WebhooksByWebhookIdVerifyErrors]; + +export type PostV1WebhooksByWebhookIdVerifyResponses = { + /** + * Successful response + */ + 200: { + success: boolean; + }; +}; + +export type PostV1WebhooksByWebhookIdVerifyResponse = + PostV1WebhooksByWebhookIdVerifyResponses[keyof PostV1WebhooksByWebhookIdVerifyResponses]; + +export type PostV1WebhooksByWebhookIdResendOtpData = { + body?: never; + path: { + webhook_id: string; + }; + query?: never; + url: "/v1/webhooks/{webhook_id}/resend-otp"; +}; + +export type PostV1WebhooksByWebhookIdResendOtpErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Webhook not found + */ + 404: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PostV1WebhooksByWebhookIdResendOtpError = + PostV1WebhooksByWebhookIdResendOtpErrors[keyof PostV1WebhooksByWebhookIdResendOtpErrors]; + +export type PostV1WebhooksByWebhookIdResendOtpResponses = { + /** + * OTP code resent successfully + */ + 200: { + success: boolean; + }; +}; + +export type PostV1WebhooksByWebhookIdResendOtpResponse = + PostV1WebhooksByWebhookIdResendOtpResponses[keyof PostV1WebhooksByWebhookIdResendOtpResponses]; + +export type PostV1WebhooksTestData = { + body?: { + webhook_url: string; + type?: "event" | "transaction"; + }; + path?: never; + query?: never; + url: "/v1/webhooks/test"; +}; + +export type PostV1WebhooksTestErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Rate limit exceeded + */ + 429: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PostV1WebhooksTestError = + PostV1WebhooksTestErrors[keyof PostV1WebhooksTestErrors]; + +export type PostV1WebhooksTestResponses = { + /** + * Test event sent successfully + */ + 200: { + success: boolean; + }; +}; + +export type PostV1WebhooksTestResponse = + PostV1WebhooksTestResponses[keyof PostV1WebhooksTestResponses]; + +export type GetV1EventsData = { + body?: never; + path?: never; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_transaction_hash?: string; + /** + * Filter by log index + */ + filter_log_index?: number | null; + /** + * Filter by log index greater than or equal to + */ + filter_log_index_gte?: number | null; + /** + * Filter by log index greater than + */ + filter_log_index_gt?: number | null; + /** + * Filter by log index less than or equal to + */ + filter_log_index_lte?: number | null; + /** + * Filter by log index less than + */ + filter_log_index_lt?: number | null; + /** + * Filter by topic 1 + */ + filter_topic_1?: string; + /** + * Filter by topic 2 + */ + filter_topic_2?: string; + /** + * Filter by topic 3 + */ + filter_topic_3?: string; + /** + * Filter by topic 0 + */ + filter_topic_0?: string; + /** + * Filter by address + */ + filter_address?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/events"; +}; + +export type GetV1EventsErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1EventsError = GetV1EventsErrors[keyof GetV1EventsErrors]; + +export type GetV1EventsResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + decoded?: { + name: string; + signature: string; + indexed_params: { + [key: string]: unknown; + }; + non_indexed_params: { + [key: string]: unknown; + }; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1EventsResponse = + GetV1EventsResponses[keyof GetV1EventsResponses]; + +export type GetV1EventsByContractAddressData = { + body?: never; + path: { + contractAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_transaction_hash?: string; + /** + * Filter by log index + */ + filter_log_index?: number | null; + /** + * Filter by log index greater than or equal to + */ + filter_log_index_gte?: number | null; + /** + * Filter by log index greater than + */ + filter_log_index_gt?: number | null; + /** + * Filter by log index less than or equal to + */ + filter_log_index_lte?: number | null; + /** + * Filter by log index less than + */ + filter_log_index_lt?: number | null; + /** + * Filter by topic 1 + */ + filter_topic_1?: string; + /** + * Filter by topic 2 + */ + filter_topic_2?: string; + /** + * Filter by topic 3 + */ + filter_topic_3?: string; + /** + * Filter by topic 0 + */ + filter_topic_0?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/events/{contractAddress}"; +}; + +export type GetV1EventsByContractAddressErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1EventsByContractAddressError = + GetV1EventsByContractAddressErrors[keyof GetV1EventsByContractAddressErrors]; + +export type GetV1EventsByContractAddressResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + decoded?: { + name: string; + signature: string; + indexed_params: { + [key: string]: unknown; + }; + non_indexed_params: { + [key: string]: unknown; + }; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1EventsByContractAddressResponse = + GetV1EventsByContractAddressResponses[keyof GetV1EventsByContractAddressResponses]; + +export type GetV1EventsByContractAddressBySignatureData = { + body?: never; + path: { + contractAddress: string; + signature: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_transaction_hash?: string; + /** + * Filter by log index + */ + filter_log_index?: number | null; + /** + * Filter by log index greater than or equal to + */ + filter_log_index_gte?: number | null; + /** + * Filter by log index greater than + */ + filter_log_index_gt?: number | null; + /** + * Filter by log index less than or equal to + */ + filter_log_index_lte?: number | null; + /** + * Filter by log index less than + */ + filter_log_index_lt?: number | null; + /** + * Filter by topic 1 + */ + filter_topic_1?: string; + /** + * Filter by topic 2 + */ + filter_topic_2?: string; + /** + * Filter by topic 3 + */ + filter_topic_3?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/events/{contractAddress}/{signature}"; +}; + +export type GetV1EventsByContractAddressBySignatureErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1EventsByContractAddressBySignatureError = + GetV1EventsByContractAddressBySignatureErrors[keyof GetV1EventsByContractAddressBySignatureErrors]; + +export type GetV1EventsByContractAddressBySignatureResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + decoded?: { + name: string; + signature: string; + indexed_params: { + [key: string]: unknown; + }; + non_indexed_params: { + [key: string]: unknown; + }; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1EventsByContractAddressBySignatureResponse = + GetV1EventsByContractAddressBySignatureResponses[keyof GetV1EventsByContractAddressBySignatureResponses]; + +export type GetV1TransactionsData = { + body?: never; + path?: never; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_hash?: string; + /** + * Filter by from address + */ + filter_from_address?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * Filter by function selector + */ + filter_function_selector?: string; + /** + * Filter by to address + */ + filter_to_address?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/transactions"; +}; + +export type GetV1TransactionsErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1TransactionsError = + GetV1TransactionsErrors[keyof GetV1TransactionsErrors]; + +export type GetV1TransactionsResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: {}; + }; + /** + * @deprecated + */ + decodedData?: { + name: string; + signature: string; + inputs?: {}; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1TransactionsResponse = + GetV1TransactionsResponses[keyof GetV1TransactionsResponses]; + +export type GetV1TransactionsByContractAddressData = { + body?: never; + path: { + contractAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_hash?: string; + /** + * Filter by from address + */ + filter_from_address?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * Filter by function selector + */ + filter_function_selector?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/transactions/{contractAddress}"; +}; + +export type GetV1TransactionsByContractAddressErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1TransactionsByContractAddressError = + GetV1TransactionsByContractAddressErrors[keyof GetV1TransactionsByContractAddressErrors]; + +export type GetV1TransactionsByContractAddressResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1TransactionsByContractAddressResponse = + GetV1TransactionsByContractAddressResponses[keyof GetV1TransactionsByContractAddressResponses]; + +export type GetV1TransactionsByContractAddressBySignatureData = { + body?: never; + path: { + contractAddress: string; + signature: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_hash?: string; + /** + * Filter by from address + */ + filter_from_address?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/transactions/{contractAddress}/{signature}"; +}; + +export type GetV1TransactionsByContractAddressBySignatureErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1TransactionsByContractAddressBySignatureError = + GetV1TransactionsByContractAddressBySignatureErrors[keyof GetV1TransactionsByContractAddressBySignatureErrors]; + +export type GetV1TransactionsByContractAddressBySignatureResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: {}; + }; + /** + * @deprecated + */ + decodedData?: { + name: string; + signature: string; + inputs?: {}; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1TransactionsByContractAddressBySignatureResponse = + GetV1TransactionsByContractAddressBySignatureResponses[keyof GetV1TransactionsByContractAddressBySignatureResponses]; + +export type GetV1TokensTransfersTransactionByTransactionHashData = { + body?: never; + path: { + transaction_hash: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/tokens/transfers/transaction/{transaction_hash}"; +}; + +export type GetV1TokensTransfersTransactionByTransactionHashErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: "erc20"; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; +}; + +export type GetV1TokensTransfersTransactionByTransactionHashError = + GetV1TokensTransfersTransactionByTransactionHashErrors[keyof GetV1TokensTransfersTransactionByTransactionHashErrors]; + +export type GetV1TokensTransfersTransactionByTransactionHashResponses = { + /** + * Success + */ + 200: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: "erc20"; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; +}; + +export type GetV1TokensTransfersTransactionByTransactionHashResponse = + GetV1TokensTransfersTransactionByTransactionHashResponses[keyof GetV1TokensTransfersTransactionByTransactionHashResponses]; + +export type GetV1TokensTransfersByContractAddressData = { + body?: never; + path: { + contract_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/tokens/transfers/{contract_address}"; +}; + +export type GetV1TokensTransfersByContractAddressErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: "erc20"; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; +}; + +export type GetV1TokensTransfersByContractAddressError = + GetV1TokensTransfersByContractAddressErrors[keyof GetV1TokensTransfersByContractAddressErrors]; + +export type GetV1TokensTransfersByContractAddressResponses = { + /** + * Success + */ + 200: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: "erc20"; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; +}; + +export type GetV1TokensTransfersByContractAddressResponse = + GetV1TokensTransfersByContractAddressResponses[keyof GetV1TokensTransfersByContractAddressResponses]; + +export type GetV1TokensTransfersData = { + body?: never; + path?: never; + query: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + owner_address: string; + }; + url: "/v1/tokens/transfers"; +}; + +export type GetV1TokensTransfersErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: "erc20"; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; +}; + +export type GetV1TokensTransfersError = + GetV1TokensTransfersErrors[keyof GetV1TokensTransfersErrors]; + +export type GetV1TokensTransfersResponses = { + /** + * Success + */ + 200: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: "erc20"; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; +}; + +export type GetV1TokensTransfersResponse = + GetV1TokensTransfersResponses[keyof GetV1TokensTransfersResponses]; + +export type GetV1TokensErc20ByOwnerAddressData = { + body?: never; + path: { + ownerAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include spam tokens + */ + include_spam?: "true" | "false"; + }; + url: "/v1/tokens/erc20/{ownerAddress}"; +}; + +export type GetV1TokensErc20ByOwnerAddressErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1TokensErc20ByOwnerAddressResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + balance: string; + name?: string; + symbol?: string; + decimals?: number; + }>; + }; +}; + +export type GetV1TokensErc20ByOwnerAddressResponse = + GetV1TokensErc20ByOwnerAddressResponses[keyof GetV1TokensErc20ByOwnerAddressResponses]; + +export type GetV1TokensErc721ByOwnerAddressData = { + body?: never; + path: { + ownerAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + }; + url: "/v1/tokens/erc721/{ownerAddress}"; +}; + +export type GetV1TokensErc721ByOwnerAddressErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1TokensErc721ByOwnerAddressResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + token_id: string; + balance: string; + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; +}; + +export type GetV1TokensErc721ByOwnerAddressResponse = + GetV1TokensErc721ByOwnerAddressResponses[keyof GetV1TokensErc721ByOwnerAddressResponses]; + +export type GetV1TokensErc1155ByOwnerAddressData = { + body?: never; + path: { + ownerAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + }; + url: "/v1/tokens/erc1155/{ownerAddress}"; +}; + +export type GetV1TokensErc1155ByOwnerAddressErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1TokensErc1155ByOwnerAddressResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + token_id: string; + balance: string; + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; +}; + +export type GetV1TokensErc1155ByOwnerAddressResponse = + GetV1TokensErc1155ByOwnerAddressResponses[keyof GetV1TokensErc1155ByOwnerAddressResponses]; + +export type GetV1TokensPriceSupportedData = { + body?: never; + path?: never; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/tokens/price/supported"; +}; + +export type GetV1TokensPriceSupportedErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1TokensPriceSupportedResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + symbol?: string; + }>; + }; +}; + +export type GetV1TokensPriceSupportedResponse = + GetV1TokensPriceSupportedResponses[keyof GetV1TokensPriceSupportedResponses]; + +export type GetV1TokensPriceData = { + body?: never; + path?: never; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The address of the token to get the price for + */ + address?: Array | string; + /** + * The symbol of the token to get the price for + */ + symbol?: Array | (string | null) | unknown; + /** + * Timestamp in seconds or milliseconds + */ + timestamp?: number; + }; + url: "/v1/tokens/price"; +}; + +export type GetV1TokensPriceErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1TokensPriceResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + symbol?: string; + /** + * Precise price in USD + */ + price_usd: number; + /** + * Price in USD cents + */ + price_usd_cents: number; + }>; + }; +}; + +export type GetV1TokensPriceResponse = + GetV1TokensPriceResponses[keyof GetV1TokensPriceResponses]; + +export type GetV1TokensLookupData = { + body?: never; + path?: never; + query: { + /** + * The symbol(s) of the token to lookup. You can specify multiple symbols, up to a maximum of 10. + * Use repeated query parameters, e.g., `?symbol=ETH&symbol=USDC`. + */ + symbol: Array | string; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/tokens/lookup"; +}; + +export type GetV1TokensLookupErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1TokensLookupResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + name?: string; + symbol?: string; + decimals?: number; + }>; + }; +}; + +export type GetV1TokensLookupResponse = + GetV1TokensLookupResponses[keyof GetV1TokensLookupResponses]; + +export type GetV1ResolveByInputData = { + body?: never; + path: { + /** + * Can be a block number, transaction or block hash, address, event signature or function selector + */ + input: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/resolve/{input}"; +}; + +export type GetV1ResolveByInputErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1ResolveByInputError = + GetV1ResolveByInputErrors[keyof GetV1ResolveByInputErrors]; + +export type GetV1ResolveByInputResponses = { + /** + * Successful response + */ + 200: { + data?: { + blocks?: Array<{ + chain_id: number; + block_number: number; + block_hash: string; + parent_hash: string; + block_timestamp: number; + nonce: string; + sha3_uncles: string; + mix_hash: string; + miner: string; + state_root: string; + transactions_root: string; + receipts_root: string; + logs_bloom: string; + size: number; + extra_data: string; + difficulty: string; + total_difficulty: string; + transaction_count: number; + gas_limit: number; + gas_used: number; + withdrawals_root: string; + base_fee_per_gas: number; + }>; + transactions?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + }>; + events?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + }>; + type: + | "block" + | "transaction" + | "event_signature" + | "function_signature" + | "address" + | "contract" + | "unknown"; + }; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1ResolveByInputResponse = + GetV1ResolveByInputResponses[keyof GetV1ResolveByInputResponses]; + +export type GetV1BlocksData = { + body?: never; + path?: never; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by hash + */ + filter_hash?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/blocks"; +}; + +export type GetV1BlocksErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1BlocksError = GetV1BlocksErrors[keyof GetV1BlocksErrors]; + +export type GetV1BlocksResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: number; + block_hash: string; + parent_hash: string; + block_timestamp: number; + nonce: string; + sha3_uncles: string; + mix_hash: string; + miner: string; + state_root: string; + transactions_root: string; + receipts_root: string; + logs_bloom: string; + size: number; + extra_data: string; + difficulty: string; + total_difficulty: string; + transaction_count: number; + gas_limit: number; + gas_used: number; + withdrawals_root: string; + base_fee_per_gas: number; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1BlocksResponse = + GetV1BlocksResponses[keyof GetV1BlocksResponses]; + +export type GetV1ContractsAbiByContractAddressData = { + body?: never; + path: { + contractAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/contracts/abi/{contractAddress}"; +}; + +export type GetV1ContractsAbiByContractAddressErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1ContractsAbiByContractAddressError = + GetV1ContractsAbiByContractAddressErrors[keyof GetV1ContractsAbiByContractAddressErrors]; + +export type GetV1ContractsAbiByContractAddressResponses = { + /** + * Success + */ + 200: { + [key: string]: unknown; + }; +}; + +export type GetV1ContractsAbiByContractAddressResponse = + GetV1ContractsAbiByContractAddressResponses[keyof GetV1ContractsAbiByContractAddressResponses]; + +export type GetV1ContractsMetadataByContractAddressData = { + body?: never; + path: { + contractAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/contracts/metadata/{contractAddress}"; +}; + +export type GetV1ContractsMetadataByContractAddressErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1ContractsMetadataByContractAddressError = + GetV1ContractsMetadataByContractAddressErrors[keyof GetV1ContractsMetadataByContractAddressErrors]; + +export type GetV1ContractsMetadataByContractAddressResponses = { + /** + * Success + */ + 200: { + [key: string]: unknown; + }; +}; + +export type GetV1ContractsMetadataByContractAddressResponse = + GetV1ContractsMetadataByContractAddressResponses[keyof GetV1ContractsMetadataByContractAddressResponses]; + +export type PostV1DecodeByContractAddressData = { + body?: { + transactions?: Array<{ + data: string; + }>; + logs?: Array<{ + data?: string; + topics: Array; + }>; + }; + path: { + contractAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/decode/{contractAddress}"; +}; + +export type PostV1DecodeByContractAddressErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PostV1DecodeByContractAddressError = + PostV1DecodeByContractAddressErrors[keyof PostV1DecodeByContractAddressErrors]; + +export type PostV1DecodeByContractAddressResponses = { + /** + * Success + */ + 200: { + data?: { + transactions?: Array<{ + data: string; + function_name?: string; + args?: Array; + }>; + logs?: Array<{ + data?: string; + topics: Array; + event_name?: string; + args?: Array; + }>; + }; + }; +}; + +export type PostV1DecodeByContractAddressResponse = + PostV1DecodeByContractAddressResponses[keyof PostV1DecodeByContractAddressResponses]; + +export type GetV1NftsBalanceByOwnerAddressData = { + body?: never; + path: { + ownerAddress: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * The types of NFTs to include in the response. Can be an empty array to include all types + */ + token_types?: Array<"erc1155" | "erc721">; + }; + url: "/v1/nfts/balance/{ownerAddress}"; +}; + +export type GetV1NftsBalanceByOwnerAddressErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type GetV1NftsBalanceByOwnerAddressResponses = { + /** + * Success + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + token_id: string; + balance: string; + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; +}; + +export type GetV1NftsBalanceByOwnerAddressResponse = + GetV1NftsBalanceByOwnerAddressResponses[keyof GetV1NftsBalanceByOwnerAddressResponses]; + +export type GetV1NftsCollectionsByContractAddressData = { + body?: never; + path: { + contract_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Whether to include stats for the collection + */ + include_stats?: "true" | "false"; + }; + url: "/v1/nfts/collections/{contract_address}"; +}; + +export type GetV1NftsCollectionsByContractAddressErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsCollectionsByContractAddressError = + GetV1NftsCollectionsByContractAddressErrors[keyof GetV1NftsCollectionsByContractAddressErrors]; + +export type GetV1NftsCollectionsByContractAddressResponses = { + /** + * Success + */ + 200: { + data: Array<{ + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + stats?: { + owner_count: number; + token_count: number; + mint_count: number; + total_quantity: number; + }; + }>; + }; +}; + +export type GetV1NftsCollectionsByContractAddressResponse = + GetV1NftsCollectionsByContractAddressResponses[keyof GetV1NftsCollectionsByContractAddressResponses]; + +export type GetV1NftsData = { + body?: never; + path?: never; + query: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + owner_address: string; + }; + url: "/v1/nfts"; +}; + +export type GetV1NftsErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsError = GetV1NftsErrors[keyof GetV1NftsErrors]; + +export type GetV1NftsResponses = { + /** + * Success + */ + 200: { + data: Array<{ + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + chain_id: number; + contract_address: string; + token_id: string; + token_type: string; + balance?: string; + }>; + }; +}; + +export type GetV1NftsResponse = GetV1NftsResponses[keyof GetV1NftsResponses]; + +export type GetV1NftsOwnersByContractAddressData = { + body?: never; + path: { + contract_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/nfts/owners/{contract_address}"; +}; + +export type GetV1NftsOwnersByContractAddressErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsOwnersByContractAddressError = + GetV1NftsOwnersByContractAddressErrors[keyof GetV1NftsOwnersByContractAddressErrors]; + +export type GetV1NftsOwnersByContractAddressResponses = { + /** + * Success + */ + 200: Array<{ + chain_id: string; + owner_addresses: Array; + }>; +}; + +export type GetV1NftsOwnersByContractAddressResponse = + GetV1NftsOwnersByContractAddressResponses[keyof GetV1NftsOwnersByContractAddressResponses]; + +export type GetV1NftsOwnersByContractAddressByTokenIdData = { + body?: never; + path: { + contract_address: string; + token_id: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/nfts/owners/{contract_address}/{token_id}"; +}; + +export type GetV1NftsOwnersByContractAddressByTokenIdErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsOwnersByContractAddressByTokenIdError = + GetV1NftsOwnersByContractAddressByTokenIdErrors[keyof GetV1NftsOwnersByContractAddressByTokenIdErrors]; + +export type GetV1NftsOwnersByContractAddressByTokenIdResponses = { + /** + * Success + */ + 200: Array<{ + chain_id: string; + owner_addresses: Array; + }>; +}; + +export type GetV1NftsOwnersByContractAddressByTokenIdResponse = + GetV1NftsOwnersByContractAddressByTokenIdResponses[keyof GetV1NftsOwnersByContractAddressByTokenIdResponses]; + +export type GetV1NftsTransfersData = { + body?: never; + path?: never; + query: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + owner_address: string; + }; + url: "/v1/nfts/transfers"; +}; + +export type GetV1NftsTransfersErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsTransfersError = + GetV1NftsTransfersErrors[keyof GetV1NftsTransfersErrors]; + +export type GetV1NftsTransfersResponses = { + /** + * Success + */ + 200: { + data: Array<{ + token_id: string; + chain_id: number; + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: string; + amount: string; + nft_metadata?: { + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; +}; + +export type GetV1NftsTransfersResponse = + GetV1NftsTransfersResponses[keyof GetV1NftsTransfersResponses]; + +export type GetV1NftsTransfersTransactionByTransactionHashData = { + body?: never; + path: { + transaction_hash: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/nfts/transfers/transaction/{transaction_hash}"; +}; + +export type GetV1NftsTransfersTransactionByTransactionHashErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsTransfersTransactionByTransactionHashError = + GetV1NftsTransfersTransactionByTransactionHashErrors[keyof GetV1NftsTransfersTransactionByTransactionHashErrors]; + +export type GetV1NftsTransfersTransactionByTransactionHashResponses = { + /** + * Success + */ + 200: { + data: Array<{ + token_id: string; + chain_id: number; + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: string; + amount: string; + nft_metadata?: { + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; +}; + +export type GetV1NftsTransfersTransactionByTransactionHashResponse = + GetV1NftsTransfersTransactionByTransactionHashResponses[keyof GetV1NftsTransfersTransactionByTransactionHashResponses]; + +export type GetV1NftsTransfersByContractAddressData = { + body?: never; + path: { + contract_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/nfts/transfers/{contract_address}"; +}; + +export type GetV1NftsTransfersByContractAddressErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsTransfersByContractAddressError = + GetV1NftsTransfersByContractAddressErrors[keyof GetV1NftsTransfersByContractAddressErrors]; + +export type GetV1NftsTransfersByContractAddressResponses = { + /** + * Success + */ + 200: { + data: Array<{ + token_id: string; + chain_id: number; + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: string; + amount: string; + nft_metadata?: { + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; +}; + +export type GetV1NftsTransfersByContractAddressResponse = + GetV1NftsTransfersByContractAddressResponses[keyof GetV1NftsTransfersByContractAddressResponses]; + +export type GetV1NftsByContractAddressData = { + body?: never; + path: { + contract_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/nfts/{contract_address}"; +}; + +export type GetV1NftsByContractAddressErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsByContractAddressError = + GetV1NftsByContractAddressErrors[keyof GetV1NftsByContractAddressErrors]; + +export type GetV1NftsByContractAddressResponses = { + /** + * Success + */ + 200: { + data: Array<{ + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + chain_id: number; + contract_address: string; + token_id: string; + token_type: string; + balance?: string; + }>; + }; +}; + +export type GetV1NftsByContractAddressResponse = + GetV1NftsByContractAddressResponses[keyof GetV1NftsByContractAddressResponses]; + +export type GetV1NftsTransfersByContractAddressByTokenIdData = { + body?: never; + path: { + contract_address: string; + token_id: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/nfts/transfers/{contract_address}/{token_id}"; +}; + +export type GetV1NftsTransfersByContractAddressByTokenIdErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsTransfersByContractAddressByTokenIdError = + GetV1NftsTransfersByContractAddressByTokenIdErrors[keyof GetV1NftsTransfersByContractAddressByTokenIdErrors]; + +export type GetV1NftsTransfersByContractAddressByTokenIdResponses = { + /** + * Success + */ + 200: { + data: Array<{ + token_id: string; + chain_id: number; + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: "mint" | "sale" | "transfer"; + token_type: string; + amount: string; + nft_metadata?: { + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; +}; + +export type GetV1NftsTransfersByContractAddressByTokenIdResponse = + GetV1NftsTransfersByContractAddressByTokenIdResponses[keyof GetV1NftsTransfersByContractAddressByTokenIdResponses]; + +export type GetV1NftsByContractAddressByTokenIdData = { + body?: never; + path: { + contract_address: string; + token_id: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Whether to include owner addresses in the response (only if NFT metadata is requested) + */ + include_owners?: "true" | "false"; + }; + url: "/v1/nfts/{contract_address}/{token_id}"; +}; + +export type GetV1NftsByContractAddressByTokenIdErrors = { + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsByContractAddressByTokenIdError = + GetV1NftsByContractAddressByTokenIdErrors[keyof GetV1NftsByContractAddressByTokenIdErrors]; + +export type GetV1NftsByContractAddressByTokenIdResponses = { + /** + * Success + */ + 200: { + data: Array<{ + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses: Array; + extra_metadata?: {} & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | {}; + properties?: {}; + }; + collection?: { + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + }; + contract?: { + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + chain_id: number; + contract_address: string; + token_id: string; + token_type: string; + balance?: string; + }>; + }; +}; + +export type GetV1NftsByContractAddressByTokenIdResponse = + GetV1NftsByContractAddressByTokenIdResponses[keyof GetV1NftsByContractAddressByTokenIdResponses]; + +export type GetV1NftsMetadataRefreshByContractAddressData = { + body?: never; + path: { + contract_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/nfts/metadata/refresh/{contract_address}"; +}; + +export type GetV1NftsMetadataRefreshByContractAddressErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsMetadataRefreshByContractAddressError = + GetV1NftsMetadataRefreshByContractAddressErrors[keyof GetV1NftsMetadataRefreshByContractAddressErrors]; + +export type GetV1NftsMetadataRefreshByContractAddressResponses = { + /** + * Success + */ + 200: { + data: { + success: boolean; + message: string; + }; + }; +}; + +export type GetV1NftsMetadataRefreshByContractAddressResponse = + GetV1NftsMetadataRefreshByContractAddressResponses[keyof GetV1NftsMetadataRefreshByContractAddressResponses]; + +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdData = { + body?: never; + path: { + contract_address: string; + token_id: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + }; + url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}"; +}; + +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdError = + GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors]; + +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses = { + /** + * Success + */ + 200: { + data: { + success: boolean; + message: string; + }; + }; +}; + +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdResponse = + GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses]; + +export type GetV1WalletsByWalletAddressTransactionsData = { + body?: never; + path: { + wallet_address: string; + }; + query?: { + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. + * Use repeated query parameters, e.g., `?chain=20&chain=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain?: Array | (number | null) | unknown; + /** + * Filter by block number + */ + filter_block_number?: number | null; + /** + * Filter by block number greater than or equal to + */ + filter_block_number_gte?: number | null; + /** + * Filter by block number greater than + */ + filter_block_number_gt?: number | null; + /** + * Filter by block number less than or equal to + */ + filter_block_number_lte?: number | null; + /** + * Filter by block number less than + */ + filter_block_number_lt?: number | null; + /** + * Filter by block hash + */ + filter_block_hash?: string; + /** + * Filter by block timestamp + */ + filter_block_timestamp?: number | null; + /** + * Filter by block timestamp greater than or equal to + */ + filter_block_timestamp_gte?: number | null; + /** + * Filter by block timestamp greater than + */ + filter_block_timestamp_gt?: number | null; + /** + * Filter by block timestamp less than or equal to + */ + filter_block_timestamp_lte?: number | null; + /** + * Filter by block timestamp less than + */ + filter_block_timestamp_lt?: number | null; + /** + * Field to sort results by + */ + sort_by?: "block_number" | string; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + group_by?: Array | (string | null) | unknown; + aggregate?: Array | (string | null) | unknown; + /** + * Filter by transaction index + */ + filter_transaction_index?: number | null; + /** + * Filter by transaction index greater than or equal to + */ + filter_transaction_index_gte?: number | null; + /** + * Filter by transaction index greater than + */ + filter_transaction_index_gt?: number | null; + /** + * Filter by transaction index less than or equal to + */ + filter_transaction_index_lte?: number | null; + /** + * Filter by transaction index less than + */ + filter_transaction_index_lt?: number | null; + /** + * Enable ABI decoding of the transactions/events data + */ + decode?: boolean | null; + /** + * Filter by transaction hash + */ + filter_hash?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * Filter by function selector + */ + filter_function_selector?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: "/v1/wallets/{wallet_address}/transactions"; +}; + +export type GetV1WalletsByWalletAddressTransactionsErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type GetV1WalletsByWalletAddressTransactionsError = + GetV1WalletsByWalletAddressTransactionsErrors[keyof GetV1WalletsByWalletAddressTransactionsErrors]; + +export type GetV1WalletsByWalletAddressTransactionsResponses = { + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: {}; + }; + /** + * @deprecated + */ + decodedData?: { + name: string; + signature: string; + inputs?: {}; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; +}; + +export type GetV1WalletsByWalletAddressTransactionsResponse = + GetV1WalletsByWalletAddressTransactionsResponses[keyof GetV1WalletsByWalletAddressTransactionsResponses]; + +export type ClientOptions = { + baseUrl: "https://{chainId}.insight.thirdweb.com/" | (string & {}); +}; diff --git a/packages/insight/src/configure.ts b/packages/insight/src/configure.ts new file mode 100644 index 00000000000..ffe2e1bce7b --- /dev/null +++ b/packages/insight/src/configure.ts @@ -0,0 +1,19 @@ +import type { Config } from "@hey-api/client-fetch"; +import { client } from "./client/client.gen.js"; + +export type InsightClientOptions = { + readonly clientId: string; + readonly secretKey?: string; +}; + +export function configure( + options: InsightClientOptions & { override?: Config }, +) { + client.setConfig({ + headers: { + ...(options.clientId && { "x-client-id": options.clientId }), + ...(options.secretKey && { "x-api-key": options.secretKey }), + }, + ...(options.override ?? {}), + }); +} diff --git a/packages/insight/src/exports/thirdweb.ts b/packages/insight/src/exports/thirdweb.ts new file mode 100644 index 00000000000..c25ad75083b --- /dev/null +++ b/packages/insight/src/exports/thirdweb.ts @@ -0,0 +1,3 @@ +export * from "../client/index.js"; +export type { CreateClientConfig } from "../client/client.gen.js"; +export { configure, type InsightClientOptions } from "../configure.js"; diff --git a/packages/insight/tsconfig.base.json b/packages/insight/tsconfig.base.json new file mode 100644 index 00000000000..2b519cac7ea --- /dev/null +++ b/packages/insight/tsconfig.base.json @@ -0,0 +1,47 @@ +{ + // This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config. + "include": [], + "compilerOptions": { + // Incremental builds + // NOTE: Enabling incremental builds speeds up `tsc`. Keep in mind though that it does not reliably bust the cache when the `tsconfig.json` file changes. + "incremental": false, + + // Type checking + "strict": true, + "useDefineForClassFields": true, // Not enabled by default in `strict` mode unless we bump `target` to ES2022. + "noFallthroughCasesInSwitch": true, // Not enabled by default in `strict` mode. + "noImplicitReturns": true, // Not enabled by default in `strict` mode. + "useUnknownInCatchVariables": true, // TODO: This would normally be enabled in `strict` mode but would require some adjustments to the codebase. + "noImplicitOverride": true, // Not enabled by default in `strict` mode. + "noUnusedLocals": true, // Not enabled by default in `strict` mode. + "noUnusedParameters": true, // Not enabled by default in `strict` mode. + "exactOptionalPropertyTypes": false, // Not enabled by default in `strict` mode. + "noUncheckedIndexedAccess": true, // Not enabled by default in `strict` mode. + + // JavaScript support + "allowJs": false, + "checkJs": false, + + // Interop constraints + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "verbatimModuleSyntax": true, + "importHelpers": true, // This is only used for build validation. Since we do not have `tslib` installed, this will fail if we accidentally make use of anything that'd require injection of helpers. + + // Language and environment + "moduleResolution": "NodeNext", + "module": "NodeNext", + "target": "ES2021", // Setting this to `ES2021` enables native support for `Node v16+`: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping. + "lib": [ + "ES2022", // By using ES2022 we get access to the `.cause` property on `Error` instances. + "DOM" // We are adding `DOM` here to get the `fetch`, etc. types. This should be removed once these types are available via DefinitelyTyped. + ], + + // Skip type checking for node modules + "skipLibCheck": true, + + // jsx for "/react" portion + "jsx": "react-jsx" + } +} diff --git a/packages/insight/tsconfig.build.json b/packages/insight/tsconfig.build.json new file mode 100644 index 00000000000..3ae3943df87 --- /dev/null +++ b/packages/insight/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.base.json", + "include": ["src"], + "exclude": [ + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/**/*.test-d.ts", + "src/**/*.bench.ts", + "src/**/*.macro.ts" + ], + "compilerOptions": { + "moduleResolution": "node", + "sourceMap": true, + "rootDir": "./src" + } +} diff --git a/packages/insight/tsconfig.json b/packages/insight/tsconfig.json new file mode 100644 index 00000000000..f8b525d0c97 --- /dev/null +++ b/packages/insight/tsconfig.json @@ -0,0 +1,13 @@ +{ + // This configuration is used for local development and type checking. + "extends": "./tsconfig.base.json", + "include": ["src", "test"], + "exclude": [], + // "references": [{ "path": "./scripts/tsconfig.json" }], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "~test/*": ["./test/src/*"] + } + } +} diff --git a/packages/thirdweb/.size-limit.json b/packages/thirdweb/.size-limit.json index 185300d5bf8..36e8ba6a3b5 100644 --- a/packages/thirdweb/.size-limit.json +++ b/packages/thirdweb/.size-limit.json @@ -2,13 +2,13 @@ { "name": "thirdweb (esm)", "path": "./dist/esm/exports/thirdweb.js", - "limit": "50 kB", + "limit": "52 kB", "import": "*" }, { "name": "thirdweb (cjs)", "path": "./dist/cjs/exports/thirdweb.js", - "limit": "135 kB" + "limit": "140 kB" }, { "name": "thirdweb (minimal + tree-shaking)", diff --git a/packages/thirdweb/knip.json b/packages/thirdweb/knip.json index f229805f1f7..7c6bb456bc6 100644 --- a/packages/thirdweb/knip.json +++ b/packages/thirdweb/knip.json @@ -7,7 +7,8 @@ "ignoreDependencies": [ "@testing-library/jest-dom", "tslib", - "@size-limit/preset-big-lib" + "@size-limit/preset-big-lib", + "@thirdweb-dev/insight" ], "rules": { "optionalPeerDependencies": "off", diff --git a/packages/thirdweb/package.json b/packages/thirdweb/package.json index aee46dbdbf1..c1f027e9e42 100644 --- a/packages/thirdweb/package.json +++ b/packages/thirdweb/package.json @@ -133,70 +133,35 @@ "import": "./dist/esm/exports/bridge.js", "default": "./dist/cjs/exports/bridge.js" }, + "./insight": { + "types": "./dist/types/exports/insight.d.ts", + "import": "./dist/esm/exports/insight.js", + "default": "./dist/cjs/exports/insight.js" + }, "./package.json": "./package.json" }, "typesVersions": { "*": { - "adapters/*": [ - "./dist/types/exports/adapters/*.d.ts" - ], - "auth": [ - "./dist/types/exports/auth.d.ts" - ], - "chains": [ - "./dist/types/exports/chains.d.ts" - ], - "contract": [ - "./dist/types/exports/contract.d.ts" - ], - "deploys": [ - "./dist/types/exports/deploys.d.ts" - ], - "event": [ - "./dist/types/exports/event.d.ts" - ], - "extensions/*": [ - "./dist/types/exports/extensions/*.d.ts" - ], - "pay": [ - "./dist/types/exports/pay.d.ts" - ], - "react": [ - "./dist/types/exports/react.d.ts" - ], - "react-native": [ - "./dist/types/exports/react-native.d.ts" - ], - "rpc": [ - "./dist/types/exports/rpc.d.ts" - ], - "storage": [ - "./dist/types/exports/storage.d.ts" - ], - "transaction": [ - "./dist/types/exports/transaction.d.ts" - ], - "utils": [ - "./dist/types/exports/utils.d.ts" - ], - "wallets": [ - "./dist/types/exports/wallets.d.ts" - ], - "wallets/*": [ - "./dist/types/exports/wallets/*.d.ts" - ], - "modules": [ - "./dist/types/exports/modules.d.ts" - ], - "social": [ - "./dist/types/exports/social.d.ts" - ], - "ai": [ - "./dist/types/exports/ai.d.ts" - ], - "bridge": [ - "./dist/types/exports/bridge.d.ts" - ] + "adapters/*": ["./dist/types/exports/adapters/*.d.ts"], + "auth": ["./dist/types/exports/auth.d.ts"], + "chains": ["./dist/types/exports/chains.d.ts"], + "contract": ["./dist/types/exports/contract.d.ts"], + "deploys": ["./dist/types/exports/deploys.d.ts"], + "event": ["./dist/types/exports/event.d.ts"], + "extensions/*": ["./dist/types/exports/extensions/*.d.ts"], + "pay": ["./dist/types/exports/pay.d.ts"], + "react": ["./dist/types/exports/react.d.ts"], + "react-native": ["./dist/types/exports/react-native.d.ts"], + "rpc": ["./dist/types/exports/rpc.d.ts"], + "storage": ["./dist/types/exports/storage.d.ts"], + "transaction": ["./dist/types/exports/transaction.d.ts"], + "utils": ["./dist/types/exports/utils.d.ts"], + "wallets": ["./dist/types/exports/wallets.d.ts"], + "wallets/*": ["./dist/types/exports/wallets/*.d.ts"], + "modules": ["./dist/types/exports/modules.d.ts"], + "social": ["./dist/types/exports/social.d.ts"], + "ai": ["./dist/types/exports/ai.d.ts"], + "bridge": ["./dist/types/exports/bridge.d.ts"] } }, "browser": { @@ -226,6 +191,7 @@ "@radix-ui/react-icons": "1.3.2", "@radix-ui/react-tooltip": "1.2.0", "@tanstack/react-query": "5.72.1", + "@thirdweb-dev/insight": "workspace:*", "@walletconnect/ethereum-provider": "2.19.1", "@walletconnect/sign-client": "2.19.1", "abitype": "1.0.8", diff --git a/packages/thirdweb/scripts/typedoc.mjs b/packages/thirdweb/scripts/typedoc.mjs index dd7f8ceddff..8366ef4cf6a 100644 --- a/packages/thirdweb/scripts/typedoc.mjs +++ b/packages/thirdweb/scripts/typedoc.mjs @@ -13,6 +13,7 @@ const app = await Application.bootstrapWithPlugins({ "src/bridge/index.ts", "src/bridge/Buy.ts", "src/bridge/Sell.ts", + "src/insight/index.ts", ], exclude: [ "src/exports/*.native.ts", diff --git a/packages/thirdweb/src/exports/insight.ts b/packages/thirdweb/src/exports/insight.ts new file mode 100644 index 00000000000..5706977eec9 --- /dev/null +++ b/packages/thirdweb/src/exports/insight.ts @@ -0,0 +1 @@ +export * from "../insight/index.js"; diff --git a/packages/thirdweb/src/exports/thirdweb.ts b/packages/thirdweb/src/exports/thirdweb.ts index d614b50df13..503b110bfa7 100644 --- a/packages/thirdweb/src/exports/thirdweb.ts +++ b/packages/thirdweb/src/exports/thirdweb.ts @@ -76,6 +76,11 @@ export { */ export * as Bridge from "../bridge/index.js"; +/** + * INSIGHT + */ +export * as Insight from "../insight/index.js"; + /** * WALLETS */ diff --git a/packages/thirdweb/src/insight/get-nfts.ts b/packages/thirdweb/src/insight/get-nfts.ts new file mode 100644 index 00000000000..2406ab13221 --- /dev/null +++ b/packages/thirdweb/src/insight/get-nfts.ts @@ -0,0 +1,62 @@ +import { + type GetV1NftsBalanceByOwnerAddressData, + type GetV1NftsBalanceByOwnerAddressResponse, + getV1NftsBalanceByOwnerAddress, +} from "@thirdweb-dev/insight"; +import { stringify } from "viem"; +import type { Chain } from "../chains/types.js"; +import type { ThirdwebClient } from "../client/client.js"; +import { getThirdwebDomains } from "../utils/domains.js"; +import { getClientFetch } from "../utils/fetch.js"; + +export type OwnedNFT = GetV1NftsBalanceByOwnerAddressResponse["data"][number]; + +/** + * Get NFTs owned by an address + * @example + * ```ts + * import { Insight } from "thirdweb"; + * + * const nfts = await Insight.getOwnedNFTs({ + * client, + * chains: [sepolia], + * ownerAddress: "0x1234567890123456789012345678901234567890", + * }); + * ``` + * @insight + */ +export async function getOwnedNFTs(args: { + client: ThirdwebClient; + chains: Chain[]; + ownerAddress: string; + queryOptions?: Omit; +}): Promise { + const { + client, + chains, + ownerAddress, + queryOptions = { + chain: chains.map((chain) => chain.id), + metadata: "true", + limit: 100, + page: 1, + }, + } = args; + + const result = await getV1NftsBalanceByOwnerAddress({ + baseUrl: `https://${getThirdwebDomains().insight}`, + fetch: getClientFetch(client), + path: { + ownerAddress: ownerAddress, + }, + query: { + ...queryOptions, + chain: chains.map((chain) => chain.id), + }, + }); + + if (!result.data || result.error) { + throw new Error(result.error ? stringify(result.error) : "Unknown error"); + } + return result.data.data; +} diff --git a/packages/thirdweb/src/insight/get-tokens.ts b/packages/thirdweb/src/insight/get-tokens.ts new file mode 100644 index 00000000000..63363017f47 --- /dev/null +++ b/packages/thirdweb/src/insight/get-tokens.ts @@ -0,0 +1,63 @@ +import { + type GetV1TokensErc20ByOwnerAddressData, + type GetV1TokensErc20ByOwnerAddressResponse, + getV1TokensErc20ByOwnerAddress, +} from "@thirdweb-dev/insight"; +import { stringify } from "viem"; +import type { Chain } from "../chains/types.js"; +import type { ThirdwebClient } from "../client/client.js"; +import { getThirdwebDomains } from "../utils/domains.js"; +import { getClientFetch } from "../utils/fetch.js"; + +export type OwnedToken = GetV1TokensErc20ByOwnerAddressResponse["data"][number]; + +/** + * Get ERC20 tokens owned by an address + * @example + * ```ts + * import { Insight } from "thirdweb"; + * + * const tokens = await Insight.getOwnedTokens({ + * client, + * chains: [sepolia], + * ownerAddress: "0x1234567890123456789012345678901234567890", + * }); + * ``` + * @insight + */ +export async function getOwnedTokens(args: { + client: ThirdwebClient; + chains: Chain[]; + ownerAddress: string; + queryOptions?: Omit; +}): Promise { + const { + client, + chains, + ownerAddress, + queryOptions = { + chain: chains.map((chain) => chain.id), + include_spam: "false", + metadata: "true", + limit: 100, + page: 1, + }, + } = args; + + const result = await getV1TokensErc20ByOwnerAddress({ + baseUrl: `https://${getThirdwebDomains().insight}`, + fetch: getClientFetch(client), + path: { + ownerAddress: ownerAddress, + }, + query: { + ...queryOptions, + chain: chains.map((chain) => chain.id), + }, + }); + + if (!result.data || result.error) { + throw new Error(result.error ? stringify(result.error) : "Unknown error"); + } + return result.data.data; +} diff --git a/packages/thirdweb/src/insight/get-transactions.ts b/packages/thirdweb/src/insight/get-transactions.ts new file mode 100644 index 00000000000..38f4a1594e6 --- /dev/null +++ b/packages/thirdweb/src/insight/get-transactions.ts @@ -0,0 +1,66 @@ +import { + type GetV1WalletsByWalletAddressTransactionsData, + type GetV1WalletsByWalletAddressTransactionsResponse, + getV1WalletsByWalletAddressTransactions, +} from "@thirdweb-dev/insight"; +import type { Chain } from "../chains/types.js"; +import type { ThirdwebClient } from "../client/client.js"; +import { getThirdwebDomains } from "../utils/domains.js"; +import { getClientFetch } from "../utils/fetch.js"; + +export type Transaction = NonNullable< + GetV1WalletsByWalletAddressTransactionsResponse["data"] +>[number]; + +/** + * Get transactions for a wallet + * @example + * ```ts + * import { Insight } from "thirdweb"; + * + * const transactions = await Insight.getTransactions({ + * client, + * walletAddress: "0x1234567890123456789012345678901234567890", + * chains: [sepolia], + * }); + * ``` + * @insight + */ +export async function getTransactions(args: { + client: ThirdwebClient; + walletAddress: string; + chains: Chain[]; + queryOptions?: Omit< + GetV1WalletsByWalletAddressTransactionsData["query"], + "chain" + >; +}): Promise { + const threeMonthsAgoInSeconds = Math.floor( + (Date.now() - 3 * 30 * 24 * 60 * 60 * 1000) / 1000, + ); + const { + client, + walletAddress, + chains, + queryOptions = { + filter_block_timestamp_gte: threeMonthsAgoInSeconds, + limit: 100, + page: 1, + }, + } = args; + const result = await getV1WalletsByWalletAddressTransactions({ + baseUrl: `https://${getThirdwebDomains().insight}`, + fetch: getClientFetch(client), + query: { + ...queryOptions, + chain: chains.map((chain) => chain.id), + }, + path: { + wallet_address: walletAddress, + }, + }); + if (result.error) { + throw new Error(result.error.error); + } + return result.data.data || []; +} diff --git a/packages/thirdweb/src/insight/index.ts b/packages/thirdweb/src/insight/index.ts new file mode 100644 index 00000000000..719f832c0e3 --- /dev/null +++ b/packages/thirdweb/src/insight/index.ts @@ -0,0 +1,3 @@ +export { getOwnedNFTs, type OwnedNFT } from "./get-nfts.js"; +export { getOwnedTokens, type OwnedToken } from "./get-tokens.js"; +export { getTransactions, type Transaction } from "./get-transactions.js"; diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx index e55d8309339..fe7230bc36e 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx @@ -703,11 +703,7 @@ export function DetailsModal(props: { }} > - - {props.supportedNFTs - ? locale.viewFunds.viewAssets - : locale.viewFunds.title} - + {locale.viewFunds.viewAssets} )} @@ -841,34 +837,20 @@ export function DetailsModal(props: { /> ); } else if (screen === "view-assets") { - if (props.supportedNFTs) { - content = ( - { - setScreen("main"); - }} - theme={props.theme} - setScreen={setScreen} - client={client} - connectLocale={locale} - assetTabs={props.detailsModal?.assetTabs} - /> - ); - } else { - // Always show tokens (has the native token at least) - content = ( - { - setScreen("main"); - }} - client={client} - connectLocale={locale} - /> - ); - } + content = ( + { + setScreen("main"); + }} + theme={props.theme} + setScreen={setScreen} + client={client} + connectLocale={locale} + assetTabs={props.detailsModal?.assetTabs} + /> + ); } else if (screen === "view-nfts") { content = ( ; } - const filteredWallets = Array.from(walletsAndBalances.data.entries() || []) + const filteredWallets = Array.from(walletsAndBalances.data?.entries() || []) .filter(([w]) => !props.hiddenWallets?.includes(w.id)) .filter(([, balances]) => { const hasEnoughBalance = balances.some((b) => b.balance.value > 0); diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewAssets.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewAssets.tsx index b42cb939ff4..45d523657c3 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewAssets.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewAssets.tsx @@ -82,7 +82,7 @@ export function ViewAssets(props: { > diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewNFTs.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewNFTs.tsx index 90f9e2aae0a..fb4e4ce624a 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewNFTs.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewNFTs.tsx @@ -1,5 +1,4 @@ -import { useQueries } from "@tanstack/react-query"; -import { useMemo } from "react"; +import { useQuery } from "@tanstack/react-query"; import type { Chain } from "../../../../../chains/types.js"; import { getCachedChain } from "../../../../../chains/utils.js"; import type { ThirdwebClient } from "../../../../../client/client.js"; @@ -8,6 +7,9 @@ import { getOwnedNFTs as getErc721OwnedNFTs } from "../../../../../extensions/er import { isERC721 } from "../../../../../extensions/erc721/read/isERC721.js"; import { getOwnedNFTs as getErc1155OwnedNFTs } from "../../../../../extensions/erc1155/read/getOwnedNFTs.js"; import { isERC1155 } from "../../../../../extensions/erc1155/read/isERC1155.js"; +import { getOwnedNFTs } from "../../../../../insight/get-nfts.js"; +import type { Address } from "../../../../../utils/address.js"; +import type { NFT } from "../../../../../utils/nft/parseNft.js"; import type { Theme } from "../../../../core/design-system/index.js"; import { useActiveAccount } from "../../../../core/hooks/wallets/useActiveAccount.js"; import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js"; @@ -16,6 +18,7 @@ import { MediaRenderer } from "../../MediaRenderer/MediaRenderer.js"; import { Skeleton } from "../../components/Skeleton.js"; import { Spacer } from "../../components/Spacer.js"; import { Container, Line, ModalHeader } from "../../components/basic.js"; +import { Text } from "../../components/text.js"; import type { ConnectLocale } from "../locale/types.js"; const fetchNFTs = async ( @@ -108,44 +111,90 @@ export function ViewNFTsContent(props: { const activeAccount = useActiveAccount(); const activeChain = useActiveWalletChain(); - const nftList = useMemo(() => { - const nfts = []; - if (!props.supportedNFTs) return []; - for (const chainId in props.supportedNFTs) { - if (props.supportedNFTs[chainId]) { - nfts.push( - ...props.supportedNFTs[chainId].map((address) => ({ - address, - chain: getCachedChain(Number.parseInt(chainId)), - })), - ); + const nftQuery = useQuery({ + queryKey: ["nfts", activeChain?.id, activeAccount?.address], + queryFn: async (): Promise< + (NFT & { chain: Chain; address: Address; quantityOwned: bigint })[] + > => { + if (!activeAccount) { + throw new Error("No active account"); } - } - return nfts; - }, [props.supportedNFTs]); + if (!activeChain) { + throw new Error("No active chain"); + } + + const result = await getOwnedNFTs({ + client: props.client, + chains: [activeChain], + ownerAddress: activeAccount.address, + }); + + return result + .filter((nft) => !!nft.name && !!nft.image_url) + .map((nft) => { + let parsedNft: NFT; + const metadata = { + name: nft.name, + description: nft.description, + image: nft.image_url, + animation_url: nft.video_url, + external_url: nft.external_url, + background_color: nft.background_color, + uri: nft.metadata_url ?? "", + image_url: nft.image_url, + attributes: Array.isArray(nft.extra_metadata?.attributes) + ? nft.extra_metadata?.attributes?.reduce( + (acc, attr) => { + acc[attr.trait_type] = attr.value; + return acc; + }, + {} as Record, + ) + : {}, + }; - const results = useQueries({ - queries: nftList.map((nft) => ({ - queryKey: ["readContract", nft.chain.id, nft.address], - queryFn: () => { - if (!activeAccount) { - throw new Error("No active account"); - } - return fetchNFTs( - props.client, - nft.chain, - nft.address, - activeAccount.address, - ); - }, - enabled: !!activeAccount, - })), + if (nft.contract?.type === "erc1155") { + parsedNft = { + id: BigInt(nft.token_id), + type: "ERC1155", + owner: activeAccount.address, + tokenURI: nft.metadata_url ?? "", + supply: BigInt(nft.balance), // TODO: this is wrong + metadata, + }; + } else { + parsedNft = { + id: BigInt(nft.token_id), + type: "ERC721", + owner: activeAccount.address, + tokenURI: nft.metadata_url ?? "", + metadata, + }; + } + + return { + chain: getCachedChain(nft.chain_id), + address: nft.token_address as Address, + quantityOwned: BigInt(nft.balance), + ...parsedNft, + }; + }); + }, + enabled: !!activeChain && !!activeAccount, }); if (!activeChain?.id || !activeAccount?.address) { return null; } + const filteredNFTs = props.supportedNFTs?.[activeChain.id] + ? nftQuery.data?.filter((nft) => + props.supportedNFTs?.[activeChain.id] + ?.map((supportedNFTAddress) => supportedNFTAddress.toLowerCase()) + .includes(nft.address.toLowerCase()), + ) + : nftQuery.data; + return ( <> - {results.map((result, index) => { - if (result.error) { - console.error(result.error); - return null; - } - return result.isLoading || !result.data ? ( - Error loading NFTs + ) : nftQuery.isLoading || !filteredNFTs ? ( + + ) : ( + filteredNFTs.map((nft) => ( + - ) : ( - result.data.map((nft) => ( - - )) - ); - })} + )) + )} @@ -198,6 +239,7 @@ function NftCard(
)}
- {props.metadata.name} + + {props.metadata.name} +
); diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewTokens.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewTokens.tsx index 42cf2d08a78..3daf0ab885a 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewTokens.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ViewTokens.tsx @@ -1,5 +1,8 @@ +import { useQuery } from "@tanstack/react-query"; import type { Chain } from "../../../../../chains/types.js"; import type { ThirdwebClient } from "../../../../../client/client.js"; +import { getOwnedTokens } from "../../../../../insight/get-tokens.js"; +import { toTokens } from "../../../../../utils/units.js"; import { fontSize } from "../../../../core/design-system/index.js"; import { useWalletBalance } from "../../../../core/hooks/others/useWalletBalance.js"; import { useActiveAccount } from "../../../../core/hooks/wallets/useActiveAccount.js"; @@ -38,7 +41,7 @@ export function ViewTokens(props: { > @@ -63,15 +66,49 @@ export function ViewTokensContent(props: { client: ThirdwebClient; connectLocale: ConnectLocale; }) { + const account = useActiveAccount(); const activeChain = useActiveWalletChain(); - if (!activeChain) { - return null; - } + const supportedTokens = props.supportedTokens || defaultTokens; const tokenList = (activeChain?.id ? supportedTokens[activeChain.id] : undefined) || []; + const erc20TokensQuery = useQuery({ + queryKey: ["tokens", activeChain?.id, account?.address], + queryFn: async () => { + if (!activeChain) { + throw new Error("No active chain"); + } + + if (!account) { + throw new Error("No account"); + } + + const result = await getOwnedTokens({ + client: props.client, + chains: [activeChain], + ownerAddress: account.address, + }); + + return result.filter( + (token) => + !defaultTokens[activeChain.id]?.some( + (t) => + t.address.toLowerCase() === token.token_address.toLowerCase(), + ), + ); + }, + // only fetch tokens if no explicit supported tokens are provided + enabled: + !!activeChain && + !!account && + (!props.supportedTokens || !props.supportedTokens[activeChain.id]), + }); + + if (!activeChain || !account) { + return null; + } return ( <> ); })} + + {erc20TokensQuery.isLoading && ( + + + + + )} + + {erc20TokensQuery.data?.map((token) => { + return ( + + ); + })} ); } @@ -98,14 +166,27 @@ function TokenInfo(props: { token: ERC20OrNativeToken; chain: Chain; client: ThirdwebClient; + balanceData?: { + symbol: string; + name: string; + decimals: number; + displayValue: string; + }; }) { const account = useActiveAccount(); - const tokenBalanceQuery = useWalletBalance({ - address: account?.address, - chain: props.chain, - tokenAddress: isNativeToken(props.token) ? undefined : props.token.address, - client: props.client, - }); + const tokenBalanceQuery = useWalletBalance( + { + address: account?.address, + chain: props.chain, + tokenAddress: isNativeToken(props.token) + ? undefined + : props.token.address, + client: props.client, + }, + { + enabled: props.balanceData === undefined, + }, + ); const tokenName = isNativeToken(props.token) ? tokenBalanceQuery.data?.name @@ -129,7 +210,9 @@ function TokenInfo(props: { )} - {tokenBalanceQuery.data ? ( + {props.balanceData ? ( + {formatTokenBalance(props.balanceData)} + ) : tokenBalanceQuery.data ? ( {formatTokenBalance(tokenBalanceQuery.data)} ) : ( diff --git a/packages/thirdweb/src/react/web/ui/MediaRenderer/useResolvedMediaType.ts b/packages/thirdweb/src/react/web/ui/MediaRenderer/useResolvedMediaType.ts index 13b84d34005..6725c87ef6b 100644 --- a/packages/thirdweb/src/react/web/ui/MediaRenderer/useResolvedMediaType.ts +++ b/packages/thirdweb/src/react/web/ui/MediaRenderer/useResolvedMediaType.ts @@ -42,7 +42,10 @@ export function useResolvedMediaType( }); return { - mediaInfo: { url: resolvedUrl, mimeType: resolvedMimeType.data }, + mediaInfo: { + url: resolvedUrl, + mimeType: resolvedMimeType.data || "image/", // default to image if no mime type is found + }, isFetched: resolvedMimeType.isFetched || !!mimeType, }; } diff --git a/packages/thirdweb/src/transaction/transaction-store.ts b/packages/thirdweb/src/transaction/transaction-store.ts index 9bc54a0edc8..95976bdb5fd 100644 --- a/packages/thirdweb/src/transaction/transaction-store.ts +++ b/packages/thirdweb/src/transaction/transaction-store.ts @@ -1,9 +1,8 @@ import type { Chain } from "../chains/types.js"; import type { ThirdwebClient } from "../client/client.js"; +import { getTransactions } from "../insight/get-transactions.js"; import { type Store, createStore } from "../reactive/store.js"; -import { getThirdwebDomains } from "../utils/domains.js"; import type { Hex } from "../utils/encoding/hex.js"; -import { getClientFetch } from "../utils/fetch.js"; export type StoredTransaction = { transactionHash: Hex; @@ -76,26 +75,16 @@ export async function getPastTransactions(options: { const oneMonthsAgoInSeconds = Math.floor( (Date.now() - 1 * 30 * 24 * 60 * 60 * 1000) / 1000, ); - const url = new URL( - `https://${getThirdwebDomains().insight}/v1/wallets/${walletAddress}/transactions`, - ); - url.searchParams.set("limit", "10"); - url.searchParams.set("chain", chain.id.toString()); - url.searchParams.set( - "filter_block_timestamp_gte", - oneMonthsAgoInSeconds.toString(), - ); - const clientFetch = getClientFetch(client); - const result = await clientFetch(url.toString()); - const json = (await result.json()) as { - data: { - chain_id: number; - hash: string; - status: number; - to_address: string; - }[]; - }; - return json.data.map((tx) => ({ + const result = await getTransactions({ + client, + walletAddress, + chains: [chain], + queryOptions: { + filter_block_timestamp_gte: oneMonthsAgoInSeconds, + limit: 20, + }, + }); + return result.map((tx) => ({ transactionHash: tx.hash as Hex, chainId: tx.chain_id, receipt: { diff --git a/packages/thirdweb/src/utils/fetch.ts b/packages/thirdweb/src/utils/fetch.ts index 2526a98d6f6..b7f71452ce5 100644 --- a/packages/thirdweb/src/utils/fetch.ts +++ b/packages/thirdweb/src/utils/fetch.ts @@ -20,16 +20,17 @@ export function getClientFetch(client: ThirdwebClient, ecosystem?: Ecosystem) { * @internal */ async function fetchWithHeaders( - url: string, + url: string | Request, init?: Omit & { requestTimeoutMs?: number }, ): Promise { const { requestTimeoutMs = DEFAULT_REQUEST_TIMEOUT, ...restInit } = init || {}; let headers = restInit.headers ? new Headers(restInit.headers) : undefined; + const urlString = typeof url === "string" ? url : url.url; // check if we are making a request to a thirdweb service (we don't want to send any headers to non-thirdweb services) - if (isThirdwebUrl(url)) { + if (isThirdwebUrl(urlString)) { if (!headers) { headers = new Headers(); } @@ -49,9 +50,9 @@ export function getClientFetch(client: ThirdwebClient, ecosystem?: Ecosystem) { // pay urls should never send the auth token, because we always want the "developer" to be the one making the request, not the "end user" if ( authToken && - !isPayUrl(url) && - !isInAppWalletUrl(url) && - !isBundlerUrl(url) + !isPayUrl(urlString) && + !isInAppWalletUrl(urlString) && + !isBundlerUrl(urlString) ) { headers.set("authorization", `Bearer ${authToken}`); } else if (secretKey) { diff --git a/packages/thirdweb/tsdoc.json b/packages/thirdweb/tsdoc.json index cf9bf335f7f..823f07d24fa 100644 --- a/packages/thirdweb/tsdoc.json +++ b/packages/thirdweb/tsdoc.json @@ -100,6 +100,10 @@ { "tagName": "@nebula", "syntaxKind": "block" + }, + { + "tagName": "@insight", + "syntaxKind": "block" } ], "supportForTags": { @@ -127,6 +131,7 @@ "@nft": true, "@account": true, "@beta": true, - "@nebula": true + "@nebula": true, + "@insight": true } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0d79fb5c97c..f51581e7ee8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -949,6 +949,25 @@ importers: specifier: 5.8.3 version: 5.8.3 + packages/insight: + dependencies: + '@hey-api/client-fetch': + specifier: 0.10.0 + version: 0.10.0(@hey-api/openapi-ts@0.66.1(magicast@0.3.5)(typescript@5.8.3)) + tslib: + specifier: ^2.8.1 + version: 2.8.1 + typescript: + specifier: '>=5.0.4' + version: 5.8.3 + devDependencies: + '@hey-api/openapi-ts': + specifier: 0.66.1 + version: 0.66.1(magicast@0.3.5)(typescript@5.8.3) + rimraf: + specifier: 6.0.1 + version: 6.0.1 + packages/react-native-adapter: dependencies: '@aws-sdk/client-kms': @@ -1067,6 +1086,9 @@ importers: '@tanstack/react-query': specifier: 5.72.1 version: 5.72.1(react@19.1.0) + '@thirdweb-dev/insight': + specifier: workspace:* + version: link:../insight '@walletconnect/ethereum-provider': specifier: 2.19.1 version: 2.19.1(@react-native-async-storage/async-storage@2.1.2(react-native@0.78.1(@babel/core@7.26.10)(@babel/preset-env@7.26.9(@babel/core@7.26.10))(@types/react@19.1.0)(bufferutil@4.0.9)(react@19.1.0)(utf-8-validate@5.0.10)))(@types/react@19.1.0)(aws4fetch@1.0.20)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.6.0)(react@19.1.0)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.24.2) @@ -3200,6 +3222,22 @@ packages: peerDependencies: react: '>= 16 || ^19.0.0-rc' + '@hey-api/client-fetch@0.10.0': + resolution: {integrity: sha512-C7vzj4t52qPiHCqjn1l8cRTI2p4pZCd7ViLtJDTHr5ZwI4sWOYC1tmv6bd529qqY6HFFbhGCz4TAZSwKAMJncg==} + peerDependencies: + '@hey-api/openapi-ts': < 2 + + '@hey-api/json-schema-ref-parser@1.0.4': + resolution: {integrity: sha512-IaJ4yFgU5r63KZyeySHRKSM1bavFIda8KdwCFi5BxQCIklltzEByBksNOPms+yHXpWWfR+OopIusVZV8roycYg==} + engines: {node: '>= 16'} + + '@hey-api/openapi-ts@0.66.1': + resolution: {integrity: sha512-Mol3vuM76d8F7xLvcZi502UxM3taXy7TDZzZfFpUMT+VLMdPiGd9cTWfKfQde0kgi+SZPjejvqmad1zk4EIu7A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=22.10.0} + hasBin: true + peerDependencies: + typescript: ^5.5.3 + '@hookform/resolvers@3.10.0': resolution: {integrity: sha512-79Dv+3mDF7i+2ajj7SkypSKHhl1cbln1OGavqrsF7p6mbUv11xpqpacPsGDCTRvCSjEEIez2ef1NveSVL3b0Ag==} peerDependencies: @@ -3533,6 +3571,9 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jsdevtools/ono@7.1.3': + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + '@lit-labs/ssr-dom-shim@1.2.1': resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} @@ -7460,6 +7501,14 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} + c12@2.0.1: + resolution: {integrity: sha512-Z4JgsKXHG37C6PYUtIxCfLJZvo6FyhHJoClwwb9ftUkLpPSkuYqn6Tr+vnaN8hymm0kIbcg6Ey3kv/Q71k5w/A==} + peerDependencies: + magicast: ^0.3.5 + peerDependenciesMeta: + magicast: + optional: true + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -7664,6 +7713,9 @@ packages: resolution: {integrity: sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==} engines: {node: '>= 0.10'} + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + cjs-module-lexer@1.4.3: resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} @@ -7815,6 +7867,10 @@ packages: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} + commander@13.0.0: + resolution: {integrity: sha512-oPYleIY8wmTVzkvQq10AEok6YcTC4sRUBl8F9gVuwchGVUCTbl/vhLTaQqutuuySYOsu8YTgV+OxKc/8Yvx+mQ==} + engines: {node: '>=18'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -7864,6 +7920,9 @@ packages: resolution: {integrity: sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==} engines: {node: '>=12'} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} @@ -9429,6 +9488,10 @@ packages: resolution: {integrity: sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg==} engines: {node: '>=6'} + giget@1.2.5: + resolution: {integrity: sha512-r1ekGw/Bgpi3HLV3h1MRBIlSAdHoIMklpaQ3OQLFcRw9PwAj2rqigvIbg+dBUI51OxVI2jsEtDywDBjSiuf7Ug==} + hasBin: true + git-repo-info@2.1.1: resolution: {integrity: sha512-8aCohiDo4jwjOwma4FmYFd3i97urZulL8XL24nIPxuE+GZnfsAyy/g2Shqx6OjUiFKUXZM+Yy+KHnOmmA3FVcg==} engines: {node: '>= 4.0'} @@ -9525,6 +9588,11 @@ packages: h3@1.14.0: resolution: {integrity: sha512-ao22eiONdgelqcnknw0iD645qW0s9NnrJHr5OBz4WOMdBdycfSas1EQf1wXRsm+PcB2Yoj43pjBPwqIpJQTeWg==} + handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + happy-dom@17.4.4: resolution: {integrity: sha512-/Pb0ctk3HTZ5xEL3BZ0hK1AqDSAUuRQitOmROPHhfUYEWpmTImwfD8vFDGADmMAX0JYgbcgxWoLFKtsWhcpuVA==} engines: {node: '>=18.0.0'} @@ -11358,6 +11426,9 @@ packages: engines: {node: '>=10'} hasBin: true + mlly@1.7.4: + resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + module-details-from-path@1.0.3: resolution: {integrity: sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==} @@ -11741,6 +11812,11 @@ packages: react-router-dom: optional: true + nypm@0.5.4: + resolution: {integrity: sha512-X0SNNrZiGU8/e/zAB7sCTtdxWTMSIO73q+xuKgglm2Yvzwlo8UoC5FNySQFCvl84uPaeADkqHUZUkWy4aH4xOA==} + engines: {node: ^14.16.0 || >=16.10.0} + hasBin: true + ob1@0.81.4: resolution: {integrity: sha512-EZLYM8hfPraC2SYOR5EWLFAPV5e6g+p83m2Jth9bzCpFxP1NDQJYXdmXRB2bfbaWQSmm6NkIQlbzk7uU5lLfgg==} engines: {node: '>=18.18'} @@ -12134,6 +12210,9 @@ packages: pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} @@ -12212,6 +12291,9 @@ packages: resolution: {integrity: sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==} engines: {node: '>=14.16'} + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + pkg-up@3.1.0: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} @@ -12592,6 +12674,9 @@ packages: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} + rc9@2.1.2: + resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -14246,6 +14331,11 @@ packages: ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + uint8arrays@3.1.0: resolution: {integrity: sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==} @@ -15249,7 +15339,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.592.0 + '@aws-sdk/client-sso-oidc': 3.592.0(@aws-sdk/client-sts@3.592.0) '@aws-sdk/client-sts': 3.592.0 '@aws-sdk/core': 3.592.0 '@aws-sdk/credential-provider-node': 3.592.0(@aws-sdk/client-sso-oidc@3.592.0)(@aws-sdk/client-sts@3.592.0) @@ -15295,7 +15385,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.592.0 + '@aws-sdk/client-sso-oidc': 3.592.0(@aws-sdk/client-sts@3.592.0) '@aws-sdk/client-sts': 3.592.0 '@aws-sdk/core': 3.592.0 '@aws-sdk/credential-provider-node': 3.592.0(@aws-sdk/client-sso-oidc@3.592.0)(@aws-sdk/client-sts@3.592.0) @@ -15341,7 +15431,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.592.0 + '@aws-sdk/client-sso-oidc': 3.592.0(@aws-sdk/client-sts@3.592.0) '@aws-sdk/client-sts': 3.592.0 '@aws-sdk/core': 3.592.0 '@aws-sdk/credential-provider-node': 3.592.0(@aws-sdk/client-sso-oidc@3.592.0)(@aws-sdk/client-sts@3.592.0) @@ -15388,7 +15478,7 @@ snapshots: transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso-oidc@3.592.0': + '@aws-sdk/client-sso-oidc@3.592.0(@aws-sdk/client-sts@3.592.0)': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -15431,6 +15521,7 @@ snapshots: '@smithy/util-utf8': 3.0.0 tslib: 2.8.1 transitivePeerDependencies: + - '@aws-sdk/client-sts' - aws-crt '@aws-sdk/client-sso-oidc@3.782.0': @@ -15567,7 +15658,7 @@ snapshots: dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sso-oidc': 3.592.0 + '@aws-sdk/client-sso-oidc': 3.592.0(@aws-sdk/client-sts@3.592.0) '@aws-sdk/core': 3.592.0 '@aws-sdk/credential-provider-node': 3.592.0(@aws-sdk/client-sso-oidc@3.592.0)(@aws-sdk/client-sts@3.592.0) '@aws-sdk/middleware-host-header': 3.577.0 @@ -16009,7 +16100,7 @@ snapshots: '@aws-sdk/token-providers@3.587.0(@aws-sdk/client-sso-oidc@3.592.0)': dependencies: - '@aws-sdk/client-sso-oidc': 3.592.0 + '@aws-sdk/client-sso-oidc': 3.592.0(@aws-sdk/client-sts@3.592.0) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.1.11 '@smithy/shared-ini-file-loader': 3.1.12 @@ -18366,6 +18457,26 @@ snapshots: dependencies: react: 19.1.0 + '@hey-api/client-fetch@0.10.0(@hey-api/openapi-ts@0.66.1(magicast@0.3.5)(typescript@5.8.3))': + dependencies: + '@hey-api/openapi-ts': 0.66.1(magicast@0.3.5)(typescript@5.8.3) + + '@hey-api/json-schema-ref-parser@1.0.4': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + + '@hey-api/openapi-ts@0.66.1(magicast@0.3.5)(typescript@5.8.3)': + dependencies: + '@hey-api/json-schema-ref-parser': 1.0.4 + c12: 2.0.1(magicast@0.3.5) + commander: 13.0.0 + handlebars: 4.7.8 + typescript: 5.8.3 + transitivePeerDependencies: + - magicast + '@hookform/resolvers@3.10.0(react-hook-form@7.55.0(react@19.1.0))': dependencies: react-hook-form: 7.55.0(react@19.1.0) @@ -18691,6 +18802,8 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@jsdevtools/ono@7.1.3': {} + '@lit-labs/ssr-dom-shim@1.2.1': {} '@lit/reactive-element@1.6.3': @@ -24668,6 +24781,23 @@ snapshots: bytes@3.1.2: {} + c12@2.0.1(magicast@0.3.5): + dependencies: + chokidar: 4.0.3 + confbox: 0.1.8 + defu: 6.1.4 + dotenv: 16.4.7 + giget: 1.2.5 + jiti: 2.4.2 + mlly: 1.7.4 + ohash: 1.1.4 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.3.1 + rc9: 2.1.2 + optionalDependencies: + magicast: 0.3.5 + cac@6.7.14: {} cacache@18.0.4: @@ -24907,6 +25037,10 @@ snapshots: inherits: 2.0.4 safe-buffer: 5.2.1 + citty@0.1.6: + dependencies: + consola: 3.4.0 + cjs-module-lexer@1.4.3: {} class-variance-authority@0.7.1: @@ -25045,6 +25179,8 @@ snapshots: commander@12.1.0: {} + commander@13.0.0: {} + commander@2.20.3: {} commander@4.1.1: {} @@ -25101,6 +25237,8 @@ snapshots: pkg-up: 3.1.0 semver: 7.7.1 + confbox@0.1.8: {} + config-chain@1.1.13: dependencies: ini: 1.3.8 @@ -27176,6 +27314,16 @@ snapshots: getenv@1.0.0: {} + giget@1.2.5: + dependencies: + citty: 0.1.6 + consola: 3.4.0 + defu: 6.1.4 + node-fetch-native: 1.6.6 + nypm: 0.5.4 + pathe: 2.0.3 + tar: 6.2.1 + git-repo-info@2.1.1: {} github-slugger@2.0.0: {} @@ -27308,6 +27456,15 @@ snapshots: uncrypto: 0.1.3 unenv: 1.10.0 + handlebars@4.7.8: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + happy-dom@17.4.4: dependencies: webidl-conversions: 7.0.0 @@ -29790,6 +29947,13 @@ snapshots: mkdirp@1.0.4: {} + mlly@1.7.4: + dependencies: + acorn: 8.14.1 + pathe: 2.0.3 + pkg-types: 1.3.1 + ufo: 1.5.4 + module-details-from-path@1.0.3: {} motion-dom@12.5.0: @@ -30127,6 +30291,15 @@ snapshots: optionalDependencies: next: 15.2.4(@babel/core@7.26.10)(@opentelemetry/api@1.9.0)(@playwright/test@1.51.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + nypm@0.5.4: + dependencies: + citty: 0.1.6 + consola: 3.4.0 + pathe: 2.0.3 + pkg-types: 1.3.1 + tinyexec: 0.3.2 + ufo: 1.5.4 + ob1@0.81.4: dependencies: flow-enums-runtime: 0.0.6 @@ -30586,6 +30759,8 @@ snapshots: pend@1.2.0: {} + perfect-debounce@1.0.0: {} + periscopic@3.1.0: dependencies: '@types/estree': 1.0.7 @@ -30677,6 +30852,12 @@ snapshots: dependencies: find-up: 6.3.0 + pkg-types@1.3.1: + dependencies: + confbox: 0.1.8 + mlly: 1.7.4 + pathe: 2.0.3 + pkg-up@3.1.0: dependencies: find-up: 3.0.0 @@ -31038,6 +31219,11 @@ snapshots: range-parser@1.2.1: {} + rc9@2.1.2: + dependencies: + defu: 6.1.4 + destr: 2.0.3 + rc@1.2.8: dependencies: deep-extend: 0.6.0 @@ -33059,6 +33245,9 @@ snapshots: ufo@1.5.4: {} + uglify-js@3.19.3: + optional: true + uint8arrays@3.1.0: dependencies: multiformats: 9.9.0 diff --git a/turbo.json b/turbo.json index aaa593304f9..0fe4c7371f3 100644 --- a/turbo.json +++ b/turbo.json @@ -101,6 +101,7 @@ "dependsOn": ["^build"] }, "lint": { + "dependsOn": ["^build"], "cache": false, "outputs": [] },