diff --git a/.changeset/cyan-facts-smell.md b/.changeset/cyan-facts-smell.md new file mode 100644 index 00000000000..7233fd77a13 --- /dev/null +++ b/.changeset/cyan-facts-smell.md @@ -0,0 +1,5 @@ +--- +"@thirdweb-dev/insight": patch +--- + +Update to latest API diff --git a/.changeset/tidy-dogs-try.md b/.changeset/tidy-dogs-try.md new file mode 100644 index 00000000000..06e69666600 --- /dev/null +++ b/.changeset/tidy-dogs-try.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Add contract filtering to Insight.getOwnedNFTs and getOwnedTokens diff --git a/packages/insight/biome.json b/packages/insight/biome.json index 709230af37e..2548ec8ca6d 100644 --- a/packages/insight/biome.json +++ b/packages/insight/biome.json @@ -1,6 +1,18 @@ { "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", - "extends": "//", + "linter": { + "rules": { + "correctness": { + "useImportExtensions": { + "fix": "safe", + "level": "error", + "options": { + "forceJsExtensions": true + } + } + } + } + }, "overrides": [ { "assist": { diff --git a/packages/insight/openapi-ts.config.ts b/packages/insight/openapi-ts.config.ts index 038e4b81761..68c1ee36116 100644 --- a/packages/insight/openapi-ts.config.ts +++ b/packages/insight/openapi-ts.config.ts @@ -2,6 +2,5 @@ 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"], + output: { format: "biome", lint: "biome", path: "src/client" }, }); diff --git a/packages/insight/package.json b/packages/insight/package.json index 0b42d4ed426..f25d73a6154 100644 --- a/packages/insight/package.json +++ b/packages/insight/package.json @@ -44,7 +44,7 @@ "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:generate": "openapi-ts && pnpm format", + "build:generate": "openapi-ts && pnpm format && pnpm fix", "build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", "clean": "rimraf dist", "fix": "biome check ./src --fix", diff --git a/packages/insight/src/client/client.gen.ts b/packages/insight/src/client/client.gen.ts index accc0a34013..59bcf31f7df 100644 --- a/packages/insight/src/client/client.gen.ts +++ b/packages/insight/src/client/client.gen.ts @@ -1,10 +1,10 @@ // This file is auto-generated by @hey-api/openapi-ts import { - type Config, - createClient, - createConfig, - type ClientOptions as DefaultClientOptions, + type Config, + createClient, + createConfig, + type ClientOptions as DefaultClientOptions, } from "./client/index.js"; import type { ClientOptions } from "./types.gen.js"; @@ -17,8 +17,8 @@ import type { ClientOptions } from "./types.gen.js"; * to ensure your client always has the correct values. */ export type CreateClientConfig = - ( - override?: Config, - ) => Config & T>; + ( + override?: Config, + ) => Config & T>; export const client = createClient(createConfig()); diff --git a/packages/insight/src/client/client/client.ts b/packages/insight/src/client/client/client.ts index 8cb5e5bde84..0b528190390 100644 --- a/packages/insight/src/client/client/client.ts +++ b/packages/insight/src/client/client/client.ts @@ -1,189 +1,189 @@ import type { Client, Config, RequestOptions } from "./types.js"; import { - buildUrl, - createConfig, - createInterceptors, - getParseAs, - mergeConfigs, - mergeHeaders, - setAuthParams, + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, } from "./utils.js"; type ReqInit = Omit & { - body?: any; - headers: ReturnType; + body?: any; + headers: ReturnType; }; export const createClient = (config: Config = {}): Client => { - let _config = mergeConfigs(createConfig(), config); - - const getConfig = (): Config => ({ ..._config }); - - const setConfig = (config: Config): Config => { - _config = mergeConfigs(_config, config); - return getConfig(); - }; - - const interceptors = createInterceptors< - Request, - Response, - unknown, - RequestOptions - >(); - - const request: Client["request"] = async (options) => { - const opts = { - ..._config, - ...options, - fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, - headers: mergeHeaders(_config.headers, options.headers), - }; - - if (opts.security) { - await setAuthParams({ - ...opts, - security: opts.security, - }); - } - - if (opts.body && opts.bodySerializer) { - opts.body = opts.bodySerializer(opts.body); - } - - // remove Content-Type header if body is empty to avoid sending invalid requests - if (opts.body === undefined || opts.body === "") { - opts.headers.delete("Content-Type"); - } - - const url = buildUrl(opts); - const requestInit: ReqInit = { - redirect: "follow", - ...opts, - }; - - let request = new Request(url, requestInit); - - for (const fn of interceptors.request._fns) { - if (fn) { - request = await fn(request, opts); - } - } - - // fetch must be assigned here, otherwise it would throw the error: - // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation - const _fetch = opts.fetch!; - let response = await _fetch(request); - - for (const fn of interceptors.response._fns) { - if (fn) { - response = await fn(response, request, opts); - } - } - - const result = { - request, - response, - }; - - if (response.ok) { - if ( - response.status === 204 || - response.headers.get("Content-Length") === "0" - ) { - return opts.responseStyle === "data" - ? {} - : { - data: {}, - ...result, - }; - } - - const parseAs = - (opts.parseAs === "auto" - ? getParseAs(response.headers.get("Content-Type")) - : opts.parseAs) ?? "json"; - - let data: any; - switch (parseAs) { - case "arrayBuffer": - case "blob": - case "formData": - case "json": - case "text": - data = await response[parseAs](); - break; - case "stream": - return opts.responseStyle === "data" - ? response.body - : { - data: response.body, - ...result, - }; - } - - if (parseAs === "json") { - if (opts.responseValidator) { - await opts.responseValidator(data); - } - - if (opts.responseTransformer) { - data = await opts.responseTransformer(data); - } - } - - return opts.responseStyle === "data" - ? data - : { - data, - ...result, - }; - } - - let error = await response.text(); - - try { - error = JSON.parse(error); - } catch { - // noop - } - - let finalError = error; - - for (const fn of interceptors.error._fns) { - if (fn) { - finalError = (await fn(error, response, request, opts)) as string; - } - } - - finalError = finalError || ({} as string); - - if (opts.throwOnError) { - throw finalError; - } - - // TODO: we probably want to return error and improve types - return opts.responseStyle === "data" - ? undefined - : { - error: finalError, - ...result, - }; - }; - - return { - buildUrl, - connect: (options) => request({ ...options, method: "CONNECT" }), - delete: (options) => request({ ...options, method: "DELETE" }), - get: (options) => request({ ...options, method: "GET" }), - getConfig, - head: (options) => request({ ...options, method: "HEAD" }), - interceptors, - options: (options) => request({ ...options, method: "OPTIONS" }), - patch: (options) => request({ ...options, method: "PATCH" }), - post: (options) => request({ ...options, method: "POST" }), - put: (options) => request({ ...options, method: "PUT" }), - request, - setConfig, - trace: (options) => request({ ...options, method: "TRACE" }), - }; + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors< + Request, + Response, + unknown, + RequestOptions + >(); + + const request: Client["request"] = async (options) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + }; + + if (opts.security) { + await setAuthParams({ + ...opts, + security: opts.security, + }); + } + + if (opts.body && opts.bodySerializer) { + opts.body = opts.bodySerializer(opts.body); + } + + // remove Content-Type header if body is empty to avoid sending invalid requests + if (opts.body === undefined || opts.body === "") { + opts.headers.delete("Content-Type"); + } + + const url = buildUrl(opts); + const requestInit: ReqInit = { + redirect: "follow", + ...opts, + }; + + let request = new Request(url, requestInit); + + for (const fn of interceptors.request._fns) { + if (fn) { + request = await fn(request, opts); + } + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + let response = await _fetch(request); + + for (const fn of interceptors.response._fns) { + if (fn) { + response = await fn(response, request, opts); + } + } + + const result = { + request, + response, + }; + + if (response.ok) { + if ( + response.status === 204 || + response.headers.get("Content-Length") === "0" + ) { + return opts.responseStyle === "data" + ? {} + : { + data: {}, + ...result, + }; + } + + const parseAs = + (opts.parseAs === "auto" + ? getParseAs(response.headers.get("Content-Type")) + : opts.parseAs) ?? "json"; + + let data: any; + switch (parseAs) { + case "arrayBuffer": + case "blob": + case "formData": + case "json": + case "text": + data = await response[parseAs](); + break; + case "stream": + return opts.responseStyle === "data" + ? response.body + : { + data: response.body, + ...result, + }; + } + + if (parseAs === "json") { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return opts.responseStyle === "data" + ? data + : { + data, + ...result, + }; + } + + let error = await response.text(); + + try { + error = JSON.parse(error); + } catch { + // noop + } + + let finalError = error; + + for (const fn of interceptors.error._fns) { + if (fn) { + finalError = (await fn(error, response, request, opts)) as string; + } + } + + finalError = finalError || ({} as string); + + if (opts.throwOnError) { + throw finalError; + } + + // TODO: we probably want to return error and improve types + return opts.responseStyle === "data" + ? undefined + : { + error: finalError, + ...result, + }; + }; + + return { + buildUrl, + connect: (options) => request({ ...options, method: "CONNECT" }), + delete: (options) => request({ ...options, method: "DELETE" }), + get: (options) => request({ ...options, method: "GET" }), + getConfig, + head: (options) => request({ ...options, method: "HEAD" }), + interceptors, + options: (options) => request({ ...options, method: "OPTIONS" }), + patch: (options) => request({ ...options, method: "PATCH" }), + post: (options) => request({ ...options, method: "POST" }), + put: (options) => request({ ...options, method: "PUT" }), + request, + setConfig, + trace: (options) => request({ ...options, method: "TRACE" }), + }; }; diff --git a/packages/insight/src/client/client/index.ts b/packages/insight/src/client/client/index.ts index 33d0123ce32..c0343af4092 100644 --- a/packages/insight/src/client/client/index.ts +++ b/packages/insight/src/client/client/index.ts @@ -1,22 +1,22 @@ export type { Auth } from "../core/auth.js"; export type { QuerySerializerOptions } from "../core/bodySerializer.js"; export { - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, } from "../core/bodySerializer.js"; export { buildClientParams } from "../core/params.js"; export { createClient } from "./client.js"; export type { - Client, - ClientOptions, - Config, - CreateClientConfig, - Options, - OptionsLegacyParser, - RequestOptions, - RequestResult, - ResponseStyle, - TDataShape, + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + OptionsLegacyParser, + RequestOptions, + RequestResult, + ResponseStyle, + TDataShape, } from "./types.js"; export { createConfig, mergeHeaders } from "./utils.js"; diff --git a/packages/insight/src/client/client/types.ts b/packages/insight/src/client/client/types.ts index 6d37980f22f..ef3d74fd17d 100644 --- a/packages/insight/src/client/client/types.ts +++ b/packages/insight/src/client/client/types.ts @@ -1,169 +1,169 @@ import type { Auth } from "../core/auth.js"; import type { - Client as CoreClient, - Config as CoreConfig, + Client as CoreClient, + Config as CoreConfig, } from "../core/types.js"; import type { Middleware } from "./utils.js"; export type ResponseStyle = "data" | "fields"; export interface Config - extends Omit, - CoreConfig { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T["baseUrl"]; - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType; - /** - * Please don't use the Fetch client for Next.js applications. The `next` - * options won't have any effect. - * - * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. - */ - next?: never; - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: - | "arrayBuffer" - | "auto" - | "blob" - | "formData" - | "json" - | "stream" - | "text"; - /** - * Should we return only data or multiple fields (data, error, response, etc.)? - * - * @default 'fields' - */ - responseStyle?: ResponseStyle; - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T["throwOnError"]; + extends Omit, + CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T["baseUrl"]; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: (request: Request) => ReturnType; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: + | "arrayBuffer" + | "auto" + | "blob" + | "formData" + | "json" + | "stream" + | "text"; + /** + * Should we return only data or multiple fields (data, error, response, etc.)? + * + * @default 'fields' + */ + responseStyle?: ResponseStyle; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T["throwOnError"]; } export interface RequestOptions< - TResponseStyle extends ResponseStyle = "fields", - ThrowOnError extends boolean = boolean, - Url extends string = string, + TResponseStyle extends ResponseStyle = "fields", + ThrowOnError extends boolean = boolean, + Url extends string = string, > extends Config<{ - responseStyle: TResponseStyle; - throwOnError: ThrowOnError; - }> { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown; - path?: Record; - query?: Record; - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray; - url: Url; + responseStyle: TResponseStyle; + throwOnError: ThrowOnError; + }> { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; } export type RequestResult< - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = boolean, - TResponseStyle extends ResponseStyle = "fields", + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = "fields", > = ThrowOnError extends true - ? Promise< - TResponseStyle extends "data" - ? TData extends Record - ? TData[keyof TData] - : TData - : { - data: TData extends Record - ? TData[keyof TData] - : TData; - request: Request; - response: Response; - } - > - : Promise< - TResponseStyle extends "data" - ? - | (TData extends Record - ? TData[keyof TData] - : TData) - | undefined - : ( - | { - data: TData extends Record - ? TData[keyof TData] - : TData; - error: undefined; - } - | { - data: undefined; - error: TError extends Record - ? TError[keyof TError] - : TError; - } - ) & { - request: Request; - response: Response; - } - >; + ? Promise< + TResponseStyle extends "data" + ? TData extends Record + ? TData[keyof TData] + : TData + : { + data: TData extends Record + ? TData[keyof TData] + : TData; + request: Request; + response: Response; + } + > + : Promise< + TResponseStyle extends "data" + ? + | (TData extends Record + ? TData[keyof TData] + : TData) + | undefined + : ( + | { + data: TData extends Record + ? TData[keyof TData] + : TData; + error: undefined; + } + | { + data: undefined; + error: TError extends Record + ? TError[keyof TError] + : TError; + } + ) & { + request: Request; + response: Response; + } + >; export interface ClientOptions { - baseUrl?: string; - responseStyle?: ResponseStyle; - throwOnError?: boolean; + baseUrl?: string; + responseStyle?: ResponseStyle; + throwOnError?: boolean; } type MethodFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = "fields", >( - options: Omit, "method">, + options: Omit, "method">, ) => RequestResult; type RequestFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = "fields", >( - options: Omit, "method"> & - Pick>, "method">, + options: Omit, "method"> & + Pick>, "method">, ) => RequestResult; type BuildUrlFn = < - TData extends { - body?: unknown; - path?: Record; - query?: Record; - url: string; - }, + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, >( - options: Pick & Options, + options: Pick & Options, ) => string; export type Client = CoreClient & { - interceptors: Middleware; + interceptors: Middleware; }; /** @@ -175,48 +175,48 @@ export type Client = CoreClient & { * to ensure your client always has the correct values. */ export type CreateClientConfig = ( - override?: Config, + override?: Config, ) => Config & T>; export interface TDataShape { - body?: unknown; - headers?: unknown; - path?: unknown; - query?: unknown; - url: string; + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; } type OmitKeys = Pick>; export type Options< - TData extends TDataShape = TDataShape, - ThrowOnError extends boolean = boolean, - TResponseStyle extends ResponseStyle = "fields", + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = "fields", > = OmitKeys< - RequestOptions, - "body" | "path" | "query" | "url" + RequestOptions, + "body" | "path" | "query" | "url" > & - Omit; + Omit; export type OptionsLegacyParser< - TData = unknown, - ThrowOnError extends boolean = boolean, - TResponseStyle extends ResponseStyle = "fields", + TData = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = "fields", > = TData extends { body?: any } - ? TData extends { headers?: any } - ? OmitKeys< - RequestOptions, - "body" | "headers" | "url" - > & - TData - : OmitKeys, "body" | "url"> & - TData & - Pick, "headers"> - : TData extends { headers?: any } - ? OmitKeys< - RequestOptions, - "headers" | "url" - > & - TData & - Pick, "body"> - : OmitKeys, "url"> & TData; + ? TData extends { headers?: any } + ? OmitKeys< + RequestOptions, + "body" | "headers" | "url" + > & + TData + : OmitKeys, "body" | "url"> & + TData & + Pick, "headers"> + : TData extends { headers?: any } + ? OmitKeys< + RequestOptions, + "headers" | "url" + > & + TData & + Pick, "body"> + : OmitKeys, "url"> & TData; diff --git a/packages/insight/src/client/client/utils.ts b/packages/insight/src/client/client/utils.ts index e56e804226f..2b5bb778117 100644 --- a/packages/insight/src/client/client/utils.ts +++ b/packages/insight/src/client/client/utils.ts @@ -1,19 +1,19 @@ import { getAuthToken } from "../core/auth.js"; import type { - QuerySerializer, - QuerySerializerOptions, + QuerySerializer, + QuerySerializerOptions, } from "../core/bodySerializer.js"; import { jsonBodySerializer } from "../core/bodySerializer.js"; import { - serializeArrayParam, - serializeObjectParam, - serializePrimitiveParam, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, } from "../core/pathSerializer.js"; import type { Client, ClientOptions, Config, RequestOptions } from "./types.js"; interface PathSerializer { - path: Record; - url: string; + path: Record; + url: string; } const PATH_PARAM_RE = /\{[^{}]+\}/g; @@ -23,394 +23,395 @@ type MatrixStyle = "label" | "matrix" | "simple"; type ArraySeparatorStyle = ArrayStyle | MatrixStyle; const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { - let url = _url; - const matches = _url.match(PATH_PARAM_RE); - if (matches) { - for (const match of matches) { - let explode = false; - let name = match.substring(1, match.length - 1); - let style: ArraySeparatorStyle = "simple"; - - if (name.endsWith("*")) { - explode = true; - name = name.substring(0, name.length - 1); - } - - if (name.startsWith(".")) { - name = name.substring(1); - style = "label"; - } else if (name.startsWith(";")) { - name = name.substring(1); - style = "matrix"; - } - - const value = path[name]; - - if (value === undefined || value === null) { - continue; - } - - if (Array.isArray(value)) { - url = url.replace( - match, - serializeArrayParam({ explode, name, style, value }), - ); - continue; - } - - if (typeof value === "object") { - url = url.replace( - match, - serializeObjectParam({ - explode, - name, - style, - value: value as Record, - valueOnly: true, - }), - ); - continue; - } - - if (style === "matrix") { - url = url.replace( - match, - `;${serializePrimitiveParam({ - name, - value: value as string, - })}`, - ); - continue; - } - - const replaceValue = encodeURIComponent( - style === "label" ? `.${value as string}` : (value as string), - ); - url = url.replace(match, replaceValue); - } - } - return url; + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = "simple"; + + if (name.endsWith("*")) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith(".")) { + name = name.substring(1); + style = "label"; + } else if (name.startsWith(";")) { + name = name.substring(1); + style = "matrix"; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace( + match, + serializeArrayParam({ explode, name, style, value }), + ); + continue; + } + + if (typeof value === "object") { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }), + ); + continue; + } + + if (style === "matrix") { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === "label" ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; }; export const createQuerySerializer = ({ - allowReserved, - array, - object, + allowReserved, + array, + object, }: QuerySerializerOptions = {}) => { - const querySerializer = (queryParams: T) => { - const search: string[] = []; - if (queryParams && typeof queryParams === "object") { - for (const name in queryParams) { - const value = queryParams[name]; - - if (value === undefined || value === null) { - continue; - } - - if (Array.isArray(value)) { - const serializedArray = serializeArrayParam({ - allowReserved, - explode: true, - name, - style: "form", - value, - ...array, - }); - if (serializedArray) search.push(serializedArray); - } else if (typeof value === "object") { - const serializedObject = serializeObjectParam({ - allowReserved, - explode: true, - name, - style: "deepObject", - value: value as Record, - ...object, - }); - if (serializedObject) search.push(serializedObject); - } else { - const serializedPrimitive = serializePrimitiveParam({ - allowReserved, - name, - value: value as string, - }); - if (serializedPrimitive) search.push(serializedPrimitive); - } - } - } - return search.join("&"); - }; - return querySerializer; + const querySerializer = (queryParams: T) => { + const search: string[] = []; + if (queryParams && typeof queryParams === "object") { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved, + explode: true, + name, + style: "form", + value, + ...array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === "object") { + const serializedObject = serializeObjectParam({ + allowReserved, + explode: true, + name, + style: "deepObject", + value: value as Record, + ...object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join("&"); + }; + return querySerializer; }; /** * Infers parseAs value from provided Content-Type header. */ export const getParseAs = ( - contentType: string | null, + contentType: string | null, ): Exclude => { - if (!contentType) { - // If no Content-Type header is provided, the best we can do is return the raw response body, - // which is effectively the same as the 'stream' option. - return "stream"; - } - - const cleanContent = contentType.split(";")[0]?.trim(); - - if (!cleanContent) { - return; - } - - if ( - cleanContent.startsWith("application/json") || - cleanContent.endsWith("+json") - ) { - return "json"; - } - - if (cleanContent === "multipart/form-data") { - return "formData"; - } - - if ( - ["application/", "audio/", "image/", "video/"].some((type) => - cleanContent.startsWith(type), - ) - ) { - return "blob"; - } - - if (cleanContent.startsWith("text/")) { - return "text"; - } - - return; + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return "stream"; + } + + const cleanContent = contentType.split(";")[0]?.trim(); + + if (!cleanContent) { + return; + } + + if ( + cleanContent.startsWith("application/json") || + cleanContent.endsWith("+json") + ) { + return "json"; + } + + if (cleanContent === "multipart/form-data") { + return "formData"; + } + + if ( + ["application/", "audio/", "image/", "video/"].some((type) => + cleanContent.startsWith(type), + ) + ) { + return "blob"; + } + + if (cleanContent.startsWith("text/")) { + return "text"; + } + + return; }; export const setAuthParams = async ({ - security, - ...options + security, + ...options }: Pick, "security"> & - Pick & { - headers: Headers; - }) => { - for (const auth of security) { - const token = await getAuthToken(auth, options.auth); - - if (!token) { - continue; - } - - const name = auth.name ?? "Authorization"; - - switch (auth.in) { - case "query": - if (!options.query) { - options.query = {}; - } - options.query[name] = token; - break; - case "cookie": - options.headers.append("Cookie", `${name}=${token}`); - break; - default: - options.headers.set(name, token); - break; - } - - return; - } + Pick & { + headers: Headers; + }) => { + for (const auth of security) { + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? "Authorization"; + + switch (auth.in) { + case "query": + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case "cookie": + options.headers.append("Cookie", `${name}=${token}`); + break; + case "header": + default: + options.headers.set(name, token); + break; + } + + return; + } }; export const buildUrl: Client["buildUrl"] = (options) => { - const url = getUrl({ - baseUrl: options.baseUrl as string, - path: options.path, - query: options.query, - querySerializer: - typeof options.querySerializer === "function" - ? options.querySerializer - : createQuerySerializer(options.querySerializer), - url: options.url, - }); - return url; + const url = getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === "function" + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + return url; }; export const getUrl = ({ - baseUrl, - path, - query, - querySerializer, - url: _url, + baseUrl, + path, + query, + querySerializer, + url: _url, }: { - baseUrl?: string; - path?: Record; - query?: Record; - querySerializer: QuerySerializer; - url: string; + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; }) => { - const pathUrl = _url.startsWith("/") ? _url : `/${_url}`; - let url = (baseUrl ?? "") + pathUrl; - if (path) { - url = defaultPathSerializer({ path, url }); - } - let search = query ? querySerializer(query) : ""; - if (search.startsWith("?")) { - search = search.substring(1); - } - if (search) { - url += `?${search}`; - } - return url; + const pathUrl = _url.startsWith("/") ? _url : `/${_url}`; + let url = (baseUrl ?? "") + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ""; + if (search.startsWith("?")) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; }; export const mergeConfigs = (a: Config, b: Config): Config => { - const config = { ...a, ...b }; - if (config.baseUrl?.endsWith("/")) { - config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); - } - config.headers = mergeHeaders(a.headers, b.headers); - return config; + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith("/")) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + return config; }; export const mergeHeaders = ( - ...headers: Array["headers"] | undefined> + ...headers: Array["headers"] | undefined> ): Headers => { - const mergedHeaders = new Headers(); - for (const header of headers) { - if (!header || typeof header !== "object") { - continue; - } - - const iterator = - header instanceof Headers ? header.entries() : Object.entries(header); - - for (const [key, value] of iterator) { - if (value === null) { - mergedHeaders.delete(key); - } else if (Array.isArray(value)) { - for (const v of value) { - mergedHeaders.append(key, v as string); - } - } else if (value !== undefined) { - // assume object headers are meant to be JSON stringified, i.e. their - // content value in OpenAPI specification is 'application/json' - mergedHeaders.set( - key, - typeof value === "object" ? JSON.stringify(value) : (value as string), - ); - } - } - } - return mergedHeaders; + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header || typeof header !== "object") { + continue; + } + + const iterator = + header instanceof Headers ? header.entries() : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e. their + // content value in OpenAPI specification is 'application/json' + mergedHeaders.set( + key, + typeof value === "object" ? JSON.stringify(value) : (value as string), + ); + } + } + } + return mergedHeaders; }; type ErrInterceptor = ( - error: Err, - response: Res, - request: Req, - options: Options, + error: Err, + response: Res, + request: Req, + options: Options, ) => Err | Promise; type ReqInterceptor = ( - request: Req, - options: Options, + request: Req, + options: Options, ) => Req | Promise; type ResInterceptor = ( - response: Res, - request: Req, - options: Options, + response: Res, + request: Req, + options: Options, ) => Res | Promise; class Interceptors { - _fns: (Interceptor | null)[]; - - constructor() { - this._fns = []; - } - - clear() { - this._fns = []; - } - - getInterceptorIndex(id: number | Interceptor): number { - if (typeof id === "number") { - return this._fns[id] ? id : -1; - } else { - return this._fns.indexOf(id); - } - } - exists(id: number | Interceptor) { - const index = this.getInterceptorIndex(id); - return !!this._fns[index]; - } - - eject(id: number | Interceptor) { - const index = this.getInterceptorIndex(id); - if (this._fns[index]) { - this._fns[index] = null; - } - } - - update(id: number | Interceptor, fn: Interceptor) { - const index = this.getInterceptorIndex(id); - if (this._fns[index]) { - this._fns[index] = fn; - return id; - } else { - return false; - } - } - - use(fn: Interceptor) { - this._fns = [...this._fns, fn]; - return this._fns.length - 1; - } + _fns: (Interceptor | null)[]; + + constructor() { + this._fns = []; + } + + clear() { + this._fns = []; + } + + getInterceptorIndex(id: number | Interceptor): number { + if (typeof id === "number") { + return this._fns[id] ? id : -1; + } else { + return this._fns.indexOf(id); + } + } + exists(id: number | Interceptor) { + const index = this.getInterceptorIndex(id); + return !!this._fns[index]; + } + + eject(id: number | Interceptor) { + const index = this.getInterceptorIndex(id); + if (this._fns[index]) { + this._fns[index] = null; + } + } + + update(id: number | Interceptor, fn: Interceptor) { + const index = this.getInterceptorIndex(id); + if (this._fns[index]) { + this._fns[index] = fn; + return id; + } else { + return false; + } + } + + use(fn: Interceptor) { + this._fns = [...this._fns, fn]; + return this._fns.length - 1; + } } // `createInterceptors()` response, meant for external use as it does not // expose internals export interface Middleware { - error: Pick< - Interceptors>, - "eject" | "use" - >; - request: Pick>, "eject" | "use">; - response: Pick< - Interceptors>, - "eject" | "use" - >; + error: Pick< + Interceptors>, + "eject" | "use" + >; + request: Pick>, "eject" | "use">; + response: Pick< + Interceptors>, + "eject" | "use" + >; } // do not add `Middleware` as return type so we can use _fns internally export const createInterceptors = () => ({ - error: new Interceptors>(), - request: new Interceptors>(), - response: new Interceptors>(), + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), }); const defaultQuerySerializer = createQuerySerializer({ - allowReserved: false, - array: { - explode: true, - style: "form", - }, - object: { - explode: true, - style: "deepObject", - }, + allowReserved: false, + array: { + explode: true, + style: "form", + }, + object: { + explode: true, + style: "deepObject", + }, }); const defaultHeaders = { - "Content-Type": "application/json", + "Content-Type": "application/json", }; export const createConfig = ( - override: Config & T> = {}, + override: Config & T> = {}, ): Config & T> => ({ - ...jsonBodySerializer, - headers: defaultHeaders, - parseAs: "auto", - querySerializer: defaultQuerySerializer, - ...override, + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: "auto", + querySerializer: defaultQuerySerializer, + ...override, }); diff --git a/packages/insight/src/client/core/auth.ts b/packages/insight/src/client/core/auth.ts index 70e9d5dba5e..f9012011fc2 100644 --- a/packages/insight/src/client/core/auth.ts +++ b/packages/insight/src/client/core/auth.ts @@ -1,40 +1,40 @@ export type AuthToken = string | undefined; export interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: "header" | "query" | "cookie"; - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string; - scheme?: "basic" | "bearer"; - type: "apiKey" | "http"; + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: "header" | "query" | "cookie"; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: "basic" | "bearer"; + type: "apiKey" | "http"; } export const getAuthToken = async ( - auth: Auth, - callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, ): Promise => { - const token = - typeof callback === "function" ? await callback(auth) : callback; + const token = + typeof callback === "function" ? await callback(auth) : callback; - if (!token) { - return; - } + if (!token) { + return; + } - if (auth.scheme === "bearer") { - return `Bearer ${token}`; - } + if (auth.scheme === "bearer") { + return `Bearer ${token}`; + } - if (auth.scheme === "basic") { - return `Basic ${btoa(token)}`; - } + if (auth.scheme === "basic") { + return `Basic ${btoa(token)}`; + } - return token; + return token; }; diff --git a/packages/insight/src/client/core/bodySerializer.ts b/packages/insight/src/client/core/bodySerializer.ts index e68daa47a7b..7d254a96ebe 100644 --- a/packages/insight/src/client/core/bodySerializer.ts +++ b/packages/insight/src/client/core/bodySerializer.ts @@ -1,7 +1,7 @@ import type { - ArrayStyle, - ObjectStyle, - SerializerOptions, + ArrayStyle, + ObjectStyle, + SerializerOptions, } from "./pathSerializer.js"; export type QuerySerializer = (query: Record) => string; @@ -9,76 +9,76 @@ export type QuerySerializer = (query: Record) => string; export type BodySerializer = (body: any) => any; export interface QuerySerializerOptions { - allowReserved?: boolean; - array?: SerializerOptions; - object?: SerializerOptions; + allowReserved?: boolean; + array?: SerializerOptions; + object?: SerializerOptions; } const serializeFormDataPair = (data: FormData, key: string, value: unknown) => { - if (typeof value === "string" || value instanceof Blob) { - data.append(key, value); - } else { - data.append(key, JSON.stringify(value)); - } + if (typeof value === "string" || value instanceof Blob) { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } }; const serializeUrlSearchParamsPair = ( - data: URLSearchParams, - key: string, - value: unknown, + data: URLSearchParams, + key: string, + value: unknown, ) => { - if (typeof value === "string") { - data.append(key, value); - } else { - data.append(key, JSON.stringify(value)); - } + if (typeof value === "string") { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } }; export const formDataBodySerializer = { - bodySerializer: | Array>>( - body: T, - ) => { - const data = new FormData(); + bodySerializer: | Array>>( + body: T, + ) => { + const data = new FormData(); - Object.entries(body).forEach(([key, value]) => { - if (value === undefined || value === null) { - return; - } - if (Array.isArray(value)) { - value.forEach((v) => serializeFormDataPair(data, key, v)); - } else { - serializeFormDataPair(data, key, value); - } - }); + Object.entries(body).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); - return data; - }, + return data; + }, }; export const jsonBodySerializer = { - bodySerializer: (body: T) => - JSON.stringify(body, (_key, value) => - typeof value === "bigint" ? value.toString() : value, - ), + bodySerializer: (body: T) => + JSON.stringify(body, (_key, value) => + typeof value === "bigint" ? value.toString() : value, + ), }; export const urlSearchParamsBodySerializer = { - bodySerializer: | Array>>( - body: T, - ) => { - const data = new URLSearchParams(); + bodySerializer: | Array>>( + body: T, + ) => { + const data = new URLSearchParams(); - Object.entries(body).forEach(([key, value]) => { - if (value === undefined || value === null) { - return; - } - if (Array.isArray(value)) { - value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); - } else { - serializeUrlSearchParamsPair(data, key, value); - } - }); + Object.entries(body).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); - return data.toString(); - }, + return data.toString(); + }, }; diff --git a/packages/insight/src/client/core/params.ts b/packages/insight/src/client/core/params.ts index 0771542b148..2b3490369bc 100644 --- a/packages/insight/src/client/core/params.ts +++ b/packages/insight/src/client/core/params.ts @@ -1,141 +1,141 @@ type Slot = "body" | "headers" | "path" | "query"; export type Field = - | { - in: Exclude; - key: string; - map?: string; - } - | { - in: Extract; - key?: string; - map?: string; - }; + | { + in: Exclude; + key: string; + map?: string; + } + | { + in: Extract; + key?: string; + map?: string; + }; export interface Fields { - allowExtra?: Partial>; - args?: ReadonlyArray; + allowExtra?: Partial>; + args?: ReadonlyArray; } export type FieldsConfig = ReadonlyArray; const extraPrefixesMap: Record = { - $body_: "body", - $headers_: "headers", - $path_: "path", - $query_: "query", + $body_: "body", + $headers_: "headers", + $path_: "path", + $query_: "query", }; const extraPrefixes = Object.entries(extraPrefixesMap); type KeyMap = Map< - string, - { - in: Slot; - map?: string; - } + string, + { + in: Slot; + map?: string; + } >; const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { - if (!map) { - map = new Map(); - } - - for (const config of fields) { - if ("in" in config) { - if (config.key) { - map.set(config.key, { - in: config.in, - map: config.map, - }); - } - } else if (config.args) { - buildKeyMap(config.args, map); - } - } - - return map; + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ("in" in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; }; interface Params { - body: unknown; - headers: Record; - path: Record; - query: Record; + body: unknown; + headers: Record; + path: Record; + query: Record; } const stripEmptySlots = (params: Params) => { - for (const [slot, value] of Object.entries(params)) { - if (value && typeof value === "object" && !Object.keys(value).length) { - delete params[slot as Slot]; - } - } + for (const [slot, value] of Object.entries(params)) { + if (value && typeof value === "object" && !Object.keys(value).length) { + delete params[slot as Slot]; + } + } }; export const buildClientParams = ( - args: ReadonlyArray, - fields: FieldsConfig, + args: ReadonlyArray, + fields: FieldsConfig, ) => { - const params: Params = { - body: {}, - headers: {}, - path: {}, - query: {}, - }; - - const map = buildKeyMap(fields); - - let config: FieldsConfig[number] | undefined; - - for (const [index, arg] of args.entries()) { - if (fields[index]) { - config = fields[index]; - } - - if (!config) { - continue; - } - - if ("in" in config) { - if (config.key) { - const field = map.get(config.key)!; - const name = field.map || config.key; - (params[field.in] as Record)[name] = arg; - } else { - params.body = arg; - } - } else { - for (const [key, value] of Object.entries(arg ?? {})) { - const field = map.get(key); - - if (field) { - const name = field.map || key; - (params[field.in] as Record)[name] = value; - } else { - const extra = extraPrefixes.find(([prefix]) => - key.startsWith(prefix), - ); - - if (extra) { - const [prefix, slot] = extra; - (params[slot] as Record)[ - key.slice(prefix.length) - ] = value; - } else { - for (const [slot, allowed] of Object.entries( - config.allowExtra ?? {}, - )) { - if (allowed) { - (params[slot as Slot] as Record)[key] = value; - break; - } - } - } - } - } - } - } - - stripEmptySlots(params); - - return params; + const params: Params = { + body: {}, + headers: {}, + path: {}, + query: {}, + }; + + const map = buildKeyMap(fields); + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ("in" in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + (params[field.in] as Record)[name] = arg; + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + const name = field.map || key; + (params[field.in] as Record)[name] = value; + } else { + const extra = extraPrefixes.find(([prefix]) => + key.startsWith(prefix), + ); + + if (extra) { + const [prefix, slot] = extra; + (params[slot] as Record)[ + key.slice(prefix.length) + ] = value; + } else { + for (const [slot, allowed] of Object.entries( + config.allowExtra ?? {}, + )) { + if (allowed) { + (params[slot as Slot] as Record)[key] = value; + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; }; diff --git a/packages/insight/src/client/core/pathSerializer.ts b/packages/insight/src/client/core/pathSerializer.ts index 4052ad12795..2f5d1bf4148 100644 --- a/packages/insight/src/client/core/pathSerializer.ts +++ b/packages/insight/src/client/core/pathSerializer.ts @@ -1,18 +1,18 @@ interface SerializeOptions - extends SerializePrimitiveOptions, - SerializerOptions {} + extends SerializePrimitiveOptions, + SerializerOptions {} interface SerializePrimitiveOptions { - allowReserved?: boolean; - name: string; + allowReserved?: boolean; + name: string; } export interface SerializerOptions { - /** - * @default true - */ - explode: boolean; - style: T; + /** + * @default true + */ + explode: boolean; + style: T; } export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited"; @@ -22,158 +22,158 @@ export type ObjectStyle = "form" | "deepObject"; type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; interface SerializePrimitiveParam extends SerializePrimitiveOptions { - value: string; + value: string; } export const separatorArrayExplode = (style: ArraySeparatorStyle) => { - switch (style) { - case "label": - return "."; - case "matrix": - return ";"; - case "simple": - return ","; - default: - return "&"; - } + switch (style) { + case "label": + return "."; + case "matrix": + return ";"; + case "simple": + return ","; + default: + return "&"; + } }; export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { - switch (style) { - case "form": - return ","; - case "pipeDelimited": - return "|"; - case "spaceDelimited": - return "%20"; - default: - return ","; - } + switch (style) { + case "form": + return ","; + case "pipeDelimited": + return "|"; + case "spaceDelimited": + return "%20"; + default: + return ","; + } }; export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { - switch (style) { - case "label": - return "."; - case "matrix": - return ";"; - case "simple": - return ","; - default: - return "&"; - } + switch (style) { + case "label": + return "."; + case "matrix": + return ";"; + case "simple": + return ","; + default: + return "&"; + } }; export const serializeArrayParam = ({ - allowReserved, - explode, - name, - style, - value, + allowReserved, + explode, + name, + style, + value, }: SerializeOptions & { - value: unknown[]; + value: unknown[]; }) => { - if (!explode) { - const joinedValues = ( - allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) - ).join(separatorArrayNoExplode(style)); - switch (style) { - case "label": - return `.${joinedValues}`; - case "matrix": - return `;${name}=${joinedValues}`; - case "simple": - return joinedValues; - default: - return `${name}=${joinedValues}`; - } - } - - const separator = separatorArrayExplode(style); - const joinedValues = value - .map((v) => { - if (style === "label" || style === "simple") { - return allowReserved ? v : encodeURIComponent(v as string); - } - - return serializePrimitiveParam({ - allowReserved, - name, - value: v as string, - }); - }) - .join(separator); - return style === "label" || style === "matrix" - ? separator + joinedValues - : joinedValues; + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case "label": + return `.${joinedValues}`; + case "matrix": + return `;${name}=${joinedValues}`; + case "simple": + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === "label" || style === "simple") { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === "label" || style === "matrix" + ? separator + joinedValues + : joinedValues; }; export const serializePrimitiveParam = ({ - allowReserved, - name, - value, + allowReserved, + name, + value, }: SerializePrimitiveParam) => { - if (value === undefined || value === null) { - return ""; - } + if (value === undefined || value === null) { + return ""; + } - if (typeof value === "object") { - throw new Error( - "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.", - ); - } + if (typeof value === "object") { + throw new Error( + "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.", + ); + } - return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; }; export const serializeObjectParam = ({ - allowReserved, - explode, - name, - style, - value, - valueOnly, + allowReserved, + explode, + name, + style, + value, + valueOnly, }: SerializeOptions & { - value: Record | Date; - valueOnly?: boolean; + value: Record | Date; + valueOnly?: boolean; }) => { - if (value instanceof Date) { - return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; - } - - if (style !== "deepObject" && !explode) { - let values: string[] = []; - Object.entries(value).forEach(([key, v]) => { - values = [ - ...values, - key, - allowReserved ? (v as string) : encodeURIComponent(v as string), - ]; - }); - const joinedValues = values.join(","); - switch (style) { - case "form": - return `${name}=${joinedValues}`; - case "label": - return `.${joinedValues}`; - case "matrix": - return `;${name}=${joinedValues}`; - default: - return joinedValues; - } - } - - const separator = separatorObjectExplode(style); - const joinedValues = Object.entries(value) - .map(([key, v]) => - serializePrimitiveParam({ - allowReserved, - name: style === "deepObject" ? `${name}[${key}]` : key, - value: v as string, - }), - ) - .join(separator); - return style === "label" || style === "matrix" - ? separator + joinedValues - : joinedValues; + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== "deepObject" && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [ + ...values, + key, + allowReserved ? (v as string) : encodeURIComponent(v as string), + ]; + }); + const joinedValues = values.join(","); + switch (style) { + case "form": + return `${name}=${joinedValues}`; + case "label": + return `.${joinedValues}`; + case "matrix": + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === "deepObject" ? `${name}[${key}]` : key, + value: v as string, + }), + ) + .join(separator); + return style === "label" || style === "matrix" + ? separator + joinedValues + : joinedValues; }; diff --git a/packages/insight/src/client/core/types.ts b/packages/insight/src/client/core/types.ts index 41322e707cb..e5ee754b86e 100644 --- a/packages/insight/src/client/core/types.ts +++ b/packages/insight/src/client/core/types.ts @@ -1,98 +1,98 @@ import type { Auth, AuthToken } from "./auth.js"; import type { - BodySerializer, - QuerySerializer, - QuerySerializerOptions, + BodySerializer, + QuerySerializer, + QuerySerializerOptions, } from "./bodySerializer.js"; export interface Client< - RequestFn = never, - Config = unknown, - MethodFn = never, - BuildUrlFn = never, + RequestFn = never, + Config = unknown, + MethodFn = never, + BuildUrlFn = never, > { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn; - connect: MethodFn; - delete: MethodFn; - get: MethodFn; - getConfig: () => Config; - head: MethodFn; - options: MethodFn; - patch: MethodFn; - post: MethodFn; - put: MethodFn; - request: RequestFn; - setConfig: (config: Config) => Config; - trace: MethodFn; + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + connect: MethodFn; + delete: MethodFn; + get: MethodFn; + getConfig: () => Config; + head: MethodFn; + options: MethodFn; + patch: MethodFn; + post: MethodFn; + put: MethodFn; + request: RequestFn; + setConfig: (config: Config) => Config; + trace: MethodFn; } export interface Config { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null; - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: - | RequestInit["headers"] - | Record< - string, - | string - | number - | boolean - | (string | number | boolean)[] - | null - | undefined - | unknown - >; - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: - | "CONNECT" - | "DELETE" - | "GET" - | "HEAD" - | "OPTIONS" - | "PATCH" - | "POST" - | "PUT" - | "TRACE"; - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions; - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise; - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise; + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit["headers"] + | Record< + string, + | string + | number + | boolean + | (string | number | boolean)[] + | null + | undefined + | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: + | "CONNECT" + | "DELETE" + | "GET" + | "HEAD" + | "OPTIONS" + | "PATCH" + | "POST" + | "PUT" + | "TRACE"; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g. converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; } diff --git a/packages/insight/src/client/sdk.gen.ts b/packages/insight/src/client/sdk.gen.ts index e5314509d50..b3561d7bc26 100644 --- a/packages/insight/src/client/sdk.gen.ts +++ b/packages/insight/src/client/sdk.gen.ts @@ -1,283 +1,291 @@ // This file is auto-generated by @hey-api/openapi-ts import type { - Client, - Options as ClientOptions, - TDataShape, + Client, + Options as ClientOptions, + TDataShape, } from "./client/index.js"; import { client as _heyApiClient } from "./client.gen.js"; import type { - DeleteV1WebhooksByWebhookIdData, - DeleteV1WebhooksByWebhookIdErrors, - DeleteV1WebhooksByWebhookIdResponses, - GetV1BlocksData, - GetV1BlocksErrors, - GetV1BlocksResponses, - GetV1ContractsAbiByContractAddressData, - GetV1ContractsAbiByContractAddressErrors, - GetV1ContractsAbiByContractAddressResponses, - GetV1ContractsMetadataByContractAddressData, - GetV1ContractsMetadataByContractAddressErrors, - GetV1ContractsMetadataByContractAddressResponses, - GetV1EventsByContractAddressBySignatureData, - GetV1EventsByContractAddressBySignatureErrors, - GetV1EventsByContractAddressBySignatureResponses, - GetV1EventsByContractAddressData, - GetV1EventsByContractAddressErrors, - GetV1EventsByContractAddressResponses, - GetV1EventsData, - GetV1EventsErrors, - GetV1EventsResponses, - GetV1NftsBalanceByOwnerAddressData, - GetV1NftsBalanceByOwnerAddressErrors, - GetV1NftsBalanceByOwnerAddressResponses, - GetV1NftsByContractAddressByTokenIdData, - GetV1NftsByContractAddressByTokenIdErrors, - GetV1NftsByContractAddressByTokenIdResponses, - GetV1NftsByContractAddressData, - GetV1NftsByContractAddressErrors, - GetV1NftsByContractAddressResponses, - GetV1NftsCollectionsByContractAddressData, - GetV1NftsCollectionsByContractAddressErrors, - GetV1NftsCollectionsByContractAddressResponses, - GetV1NftsData, - GetV1NftsErrors, - GetV1NftsMetadataRefreshByContractAddressByTokenIdData, - GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors, - GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses, - GetV1NftsMetadataRefreshByContractAddressData, - GetV1NftsMetadataRefreshByContractAddressErrors, - GetV1NftsMetadataRefreshByContractAddressResponses, - GetV1NftsOwnersByContractAddressByTokenIdData, - GetV1NftsOwnersByContractAddressByTokenIdErrors, - GetV1NftsOwnersByContractAddressByTokenIdResponses, - GetV1NftsOwnersByContractAddressData, - GetV1NftsOwnersByContractAddressErrors, - GetV1NftsOwnersByContractAddressResponses, - GetV1NftsResponses, - GetV1NftsTransfersByContractAddressByTokenIdData, - GetV1NftsTransfersByContractAddressByTokenIdErrors, - GetV1NftsTransfersByContractAddressByTokenIdResponses, - GetV1NftsTransfersByContractAddressData, - GetV1NftsTransfersByContractAddressErrors, - GetV1NftsTransfersByContractAddressResponses, - GetV1NftsTransfersData, - GetV1NftsTransfersErrors, - GetV1NftsTransfersResponses, - GetV1NftsTransfersTransactionByTransactionHashData, - GetV1NftsTransfersTransactionByTransactionHashErrors, - GetV1NftsTransfersTransactionByTransactionHashResponses, - GetV1ResolveByInputData, - GetV1ResolveByInputErrors, - GetV1ResolveByInputResponses, - GetV1TokensData, - GetV1TokensErc20ByOwnerAddressData, - GetV1TokensErc20ByOwnerAddressErrors, - GetV1TokensErc20ByOwnerAddressResponses, - GetV1TokensErc721ByOwnerAddressData, - GetV1TokensErc721ByOwnerAddressErrors, - GetV1TokensErc721ByOwnerAddressResponses, - GetV1TokensErc1155ByOwnerAddressData, - GetV1TokensErc1155ByOwnerAddressErrors, - GetV1TokensErc1155ByOwnerAddressResponses, - GetV1TokensErrors, - GetV1TokensLookupData, - GetV1TokensLookupErrors, - GetV1TokensLookupResponses, - GetV1TokensOwnersData, - GetV1TokensOwnersErrors, - GetV1TokensOwnersResponses, - GetV1TokensPriceData, - GetV1TokensPriceErrors, - GetV1TokensPriceResponses, - GetV1TokensPriceSupportedData, - GetV1TokensPriceSupportedErrors, - GetV1TokensPriceSupportedResponses, - GetV1TokensResponses, - GetV1TokensTransfersByContractAddressData, - GetV1TokensTransfersByContractAddressErrors, - GetV1TokensTransfersByContractAddressResponses, - GetV1TokensTransfersData, - GetV1TokensTransfersErrors, - GetV1TokensTransfersResponses, - GetV1TokensTransfersTransactionByTransactionHashData, - GetV1TokensTransfersTransactionByTransactionHashErrors, - GetV1TokensTransfersTransactionByTransactionHashResponses, - GetV1TransactionsByContractAddressBySignatureData, - GetV1TransactionsByContractAddressBySignatureErrors, - GetV1TransactionsByContractAddressBySignatureResponses, - GetV1TransactionsByContractAddressData, - GetV1TransactionsByContractAddressErrors, - GetV1TransactionsByContractAddressResponses, - GetV1TransactionsData, - GetV1TransactionsErrors, - GetV1TransactionsResponses, - GetV1WalletsByWalletAddressTransactionsData, - GetV1WalletsByWalletAddressTransactionsErrors, - GetV1WalletsByWalletAddressTransactionsResponses, - GetV1WebhooksData, - GetV1WebhooksErrors, - GetV1WebhooksResponses, - PatchV1WebhooksByWebhookIdData, - PatchV1WebhooksByWebhookIdErrors, - PatchV1WebhooksByWebhookIdResponses, - PostV1DecodeByContractAddressData, - PostV1DecodeByContractAddressErrors, - PostV1DecodeByContractAddressResponses, - PostV1WebhooksData, - PostV1WebhooksErrors, - PostV1WebhooksResponses, - PostV1WebhooksTestData, - PostV1WebhooksTestErrors, - PostV1WebhooksTestResponses, + DeleteV1WebhooksByWebhookIdData, + DeleteV1WebhooksByWebhookIdErrors, + DeleteV1WebhooksByWebhookIdResponses, + GetV1BlocksData, + GetV1BlocksErrors, + GetV1BlocksResponses, + GetV1ContractsAbiByContractAddressData, + GetV1ContractsAbiByContractAddressErrors, + GetV1ContractsAbiByContractAddressResponses, + GetV1ContractsMetadataByContractAddressData, + GetV1ContractsMetadataByContractAddressErrors, + GetV1ContractsMetadataByContractAddressResponses, + GetV1EventsByContractAddressBySignatureData, + GetV1EventsByContractAddressBySignatureErrors, + GetV1EventsByContractAddressBySignatureResponses, + GetV1EventsByContractAddressData, + GetV1EventsByContractAddressErrors, + GetV1EventsByContractAddressResponses, + GetV1EventsData, + GetV1EventsErrors, + GetV1EventsResponses, + GetV1NftsBalanceByOwnerAddressData, + GetV1NftsBalanceByOwnerAddressErrors, + GetV1NftsBalanceByOwnerAddressResponses, + GetV1NftsByContractAddressByTokenIdData, + GetV1NftsByContractAddressByTokenIdErrors, + GetV1NftsByContractAddressByTokenIdResponses, + GetV1NftsByContractAddressData, + GetV1NftsByContractAddressErrors, + GetV1NftsByContractAddressResponses, + GetV1NftsCollectionsByContractAddressData, + GetV1NftsCollectionsByContractAddressErrors, + GetV1NftsCollectionsByContractAddressResponses, + GetV1NftsData, + GetV1NftsErrors, + GetV1NftsMetadataRefreshByContractAddressByTokenIdData, + GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors, + GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses, + GetV1NftsMetadataRefreshByContractAddressData, + GetV1NftsMetadataRefreshByContractAddressErrors, + GetV1NftsMetadataRefreshByContractAddressResponses, + GetV1NftsOwnersByContractAddressByTokenIdData, + GetV1NftsOwnersByContractAddressByTokenIdErrors, + GetV1NftsOwnersByContractAddressByTokenIdResponses, + GetV1NftsOwnersByContractAddressData, + GetV1NftsOwnersByContractAddressErrors, + GetV1NftsOwnersByContractAddressResponses, + GetV1NftsResponses, + GetV1NftsTransfersByContractAddressByTokenIdData, + GetV1NftsTransfersByContractAddressByTokenIdErrors, + GetV1NftsTransfersByContractAddressByTokenIdResponses, + GetV1NftsTransfersByContractAddressData, + GetV1NftsTransfersByContractAddressErrors, + GetV1NftsTransfersByContractAddressResponses, + GetV1NftsTransfersData, + GetV1NftsTransfersErrors, + GetV1NftsTransfersResponses, + GetV1NftsTransfersTransactionByTransactionHashData, + GetV1NftsTransfersTransactionByTransactionHashErrors, + GetV1NftsTransfersTransactionByTransactionHashResponses, + GetV1ResolveByInputData, + GetV1ResolveByInputErrors, + GetV1ResolveByInputResponses, + GetV1TokensData, + GetV1TokensErc20ByOwnerAddressData, + GetV1TokensErc20ByOwnerAddressErrors, + GetV1TokensErc20ByOwnerAddressResponses, + GetV1TokensErc721ByOwnerAddressData, + GetV1TokensErc721ByOwnerAddressErrors, + GetV1TokensErc721ByOwnerAddressResponses, + GetV1TokensErc1155ByOwnerAddressData, + GetV1TokensErc1155ByOwnerAddressErrors, + GetV1TokensErc1155ByOwnerAddressResponses, + GetV1TokensErrors, + GetV1TokensLookupData, + GetV1TokensLookupErrors, + GetV1TokensLookupResponses, + GetV1TokensOwnersData, + GetV1TokensOwnersErrors, + GetV1TokensOwnersResponses, + GetV1TokensPriceData, + GetV1TokensPriceErrors, + GetV1TokensPriceResponses, + GetV1TokensPriceSupportedData, + GetV1TokensPriceSupportedErrors, + GetV1TokensPriceSupportedResponses, + GetV1TokensResponses, + GetV1TokensTransfersByContractAddressData, + GetV1TokensTransfersByContractAddressErrors, + GetV1TokensTransfersByContractAddressResponses, + GetV1TokensTransfersData, + GetV1TokensTransfersErrors, + GetV1TokensTransfersResponses, + GetV1TokensTransfersTransactionByTransactionHashData, + GetV1TokensTransfersTransactionByTransactionHashErrors, + GetV1TokensTransfersTransactionByTransactionHashResponses, + GetV1TransactionsByContractAddressBySignatureData, + GetV1TransactionsByContractAddressBySignatureErrors, + GetV1TransactionsByContractAddressBySignatureResponses, + GetV1TransactionsByContractAddressData, + GetV1TransactionsByContractAddressErrors, + GetV1TransactionsByContractAddressResponses, + GetV1TransactionsData, + GetV1TransactionsErrors, + GetV1TransactionsResponses, + GetV1WalletsByWalletAddressTransactionsData, + GetV1WalletsByWalletAddressTransactionsErrors, + GetV1WalletsByWalletAddressTransactionsResponses, + GetV1WebhooksData, + GetV1WebhooksErrors, + GetV1WebhooksResponses, + PatchV1WebhooksByWebhookIdData, + PatchV1WebhooksByWebhookIdErrors, + PatchV1WebhooksByWebhookIdResponses, + PostServiceWebhooksFiltersValidateData, + PostServiceWebhooksFiltersValidateErrors, + PostServiceWebhooksFiltersValidateResponses, + PostV1DecodeByContractAddressData, + PostV1DecodeByContractAddressErrors, + PostV1DecodeByContractAddressResponses, + PostV1WebhooksData, + PostV1WebhooksErrors, + PostV1WebhooksResponses, + PostV1WebhooksTestData, + PostV1WebhooksTestErrors, + PostV1WebhooksTestResponses, } from "./types.gen.js"; export type Options< - TData extends TDataShape = TDataShape, - ThrowOnError extends boolean = boolean, + 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; + /** + * 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 + * @deprecated */ export const getV1Webhooks = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1WebhooksResponses, - GetV1WebhooksErrors, - ThrowOnError - >({ - security: [ - { - name: "x-secret-key", - type: "apiKey", - }, - ], - url: "/v1/webhooks", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1WebhooksResponses, + GetV1WebhooksErrors, + ThrowOnError + >({ + security: [ + { + name: "x-secret-key", + type: "apiKey", + }, + ], + url: "/v1/webhooks", + ...options, + }); }; /** * Create webhook - * Create a new webhook. In order to receive decoded data, specify a partial ABI in the filters. + * Deprecated - Insight webhooks will remain active for a while, but new ones cannot be created. A general thirdweb webhook solution will be available instead. Create a new webhook. In order to receive decoded data, specify a partial ABI in the filters. + * @deprecated */ export const postV1Webhooks = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).post< - PostV1WebhooksResponses, - PostV1WebhooksErrors, - ThrowOnError - >({ - security: [ - { - name: "x-secret-key", - type: "apiKey", - }, - ], - url: "/v1/webhooks", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }); + return (options?.client ?? _heyApiClient).post< + PostV1WebhooksResponses, + PostV1WebhooksErrors, + ThrowOnError + >({ + security: [ + { + name: "x-secret-key", + type: "apiKey", + }, + ], + url: "/v1/webhooks", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); }; /** * Delete webhook * Delete a webhook. This action cannot be undone. + * @deprecated */ export const deleteV1WebhooksByWebhookId = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).delete< - DeleteV1WebhooksByWebhookIdResponses, - DeleteV1WebhooksByWebhookIdErrors, - ThrowOnError - >({ - security: [ - { - name: "x-secret-key", - type: "apiKey", - }, - ], - url: "/v1/webhooks/{webhook_id}", - ...options, - }); + return (options.client ?? _heyApiClient).delete< + DeleteV1WebhooksByWebhookIdResponses, + DeleteV1WebhooksByWebhookIdErrors, + ThrowOnError + >({ + security: [ + { + name: "x-secret-key", + type: "apiKey", + }, + ], + url: "/v1/webhooks/{webhook_id}", + ...options, + }); }; /** * Update webhook * Update a webhook. + * @deprecated */ export const patchV1WebhooksByWebhookId = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).patch< - PatchV1WebhooksByWebhookIdResponses, - PatchV1WebhooksByWebhookIdErrors, - ThrowOnError - >({ - security: [ - { - name: "x-secret-key", - type: "apiKey", - }, - ], - url: "/v1/webhooks/{webhook_id}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); + return (options.client ?? _heyApiClient).patch< + PatchV1WebhooksByWebhookIdResponses, + PatchV1WebhooksByWebhookIdErrors, + ThrowOnError + >({ + security: [ + { + name: "x-secret-key", + type: "apiKey", + }, + ], + url: "/v1/webhooks/{webhook_id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); }; /** * 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. + * @deprecated */ export const postV1WebhooksTest = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).post< - PostV1WebhooksTestResponses, - PostV1WebhooksTestErrors, - ThrowOnError - >({ - security: [ - { - name: "x-secret-key", - type: "apiKey", - }, - ], - url: "/v1/webhooks/test", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }); + return (options?.client ?? _heyApiClient).post< + PostV1WebhooksTestResponses, + PostV1WebhooksTestErrors, + ThrowOnError + >({ + security: [ + { + name: "x-secret-key", + type: "apiKey", + }, + ], + url: "/v1/webhooks/test", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); }; /** @@ -285,22 +293,22 @@ export const postV1WebhooksTest = ( * Get events */ export const getV1Events = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1EventsResponses, - GetV1EventsErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/events", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1EventsResponses, + GetV1EventsErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/events", + ...options, + }); }; /** @@ -308,24 +316,24 @@ export const getV1Events = ( * Get contract events */ export const getV1EventsByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1EventsByContractAddressResponses, - GetV1EventsByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/events/{contractAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1EventsByContractAddressResponses, + GetV1EventsByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/events/{contractAddress}", + ...options, + }); }; /** @@ -333,24 +341,24 @@ export const getV1EventsByContractAddress = < * Get specific contract events */ export const getV1EventsByContractAddressBySignature = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1EventsByContractAddressBySignatureResponses, - GetV1EventsByContractAddressBySignatureErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/events/{contractAddress}/{signature}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1EventsByContractAddressBySignatureResponses, + GetV1EventsByContractAddressBySignatureErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/events/{contractAddress}/{signature}", + ...options, + }); }; /** @@ -358,22 +366,22 @@ export const getV1EventsByContractAddressBySignature = < * Get transactions */ export const getV1Transactions = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1TransactionsResponses, - GetV1TransactionsErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/transactions", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1TransactionsResponses, + GetV1TransactionsErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/transactions", + ...options, + }); }; /** @@ -381,24 +389,24 @@ export const getV1Transactions = ( * Get contract transactions */ export const getV1TransactionsByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TransactionsByContractAddressResponses, - GetV1TransactionsByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/transactions/{contractAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TransactionsByContractAddressResponses, + GetV1TransactionsByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/transactions/{contractAddress}", + ...options, + }); }; /** @@ -406,27 +414,27 @@ export const getV1TransactionsByContractAddress = < * Get specific contract transactions */ export const getV1TransactionsByContractAddressBySignature = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options< - GetV1TransactionsByContractAddressBySignatureData, - ThrowOnError - >, + options: Options< + GetV1TransactionsByContractAddressBySignatureData, + ThrowOnError + >, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TransactionsByContractAddressBySignatureResponses, - GetV1TransactionsByContractAddressBySignatureErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/transactions/{contractAddress}/{signature}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TransactionsByContractAddressBySignatureResponses, + GetV1TransactionsByContractAddressBySignatureErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/transactions/{contractAddress}/{signature}", + ...options, + }); }; /** @@ -434,22 +442,22 @@ export const getV1TransactionsByContractAddressBySignature = < * Get token owners for specific contract */ export const getV1TokensOwners = ( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensOwnersResponses, - GetV1TokensOwnersErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/owners", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensOwnersResponses, + GetV1TokensOwnersErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/owners", + ...options, + }); }; /** @@ -457,27 +465,27 @@ export const getV1TokensOwners = ( * Get token transfers by transaction */ export const getV1TokensTransfersTransactionByTransactionHash = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options< - GetV1TokensTransfersTransactionByTransactionHashData, - ThrowOnError - >, + options: Options< + GetV1TokensTransfersTransactionByTransactionHashData, + ThrowOnError + >, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensTransfersTransactionByTransactionHashResponses, - GetV1TokensTransfersTransactionByTransactionHashErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/transfers/transaction/{transaction_hash}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensTransfersTransactionByTransactionHashResponses, + GetV1TokensTransfersTransactionByTransactionHashErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/transfers/transaction/{transaction_hash}", + ...options, + }); }; /** @@ -485,24 +493,24 @@ export const getV1TokensTransfersTransactionByTransactionHash = < * Get token transfers by contract */ export const getV1TokensTransfersByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensTransfersByContractAddressResponses, - GetV1TokensTransfersByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/transfers/{contract_address}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensTransfersByContractAddressResponses, + GetV1TokensTransfersByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/transfers/{contract_address}", + ...options, + }); }; /** @@ -510,22 +518,22 @@ export const getV1TokensTransfersByContractAddress = < * Get token transfers */ export const getV1TokensTransfers = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1TokensTransfersResponses, - GetV1TokensTransfersErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/transfers", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1TokensTransfersResponses, + GetV1TokensTransfersErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/transfers", + ...options, + }); }; /** @@ -534,24 +542,24 @@ export const getV1TokensTransfers = ( * @deprecated */ export const getV1TokensErc20ByOwnerAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensErc20ByOwnerAddressResponses, - GetV1TokensErc20ByOwnerAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/erc20/{ownerAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensErc20ByOwnerAddressResponses, + GetV1TokensErc20ByOwnerAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/erc20/{ownerAddress}", + ...options, + }); }; /** @@ -559,22 +567,22 @@ export const getV1TokensErc20ByOwnerAddress = < * Query tokens */ export const getV1Tokens = ( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensResponses, - GetV1TokensErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensResponses, + GetV1TokensErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens", + ...options, + }); }; /** @@ -583,24 +591,24 @@ export const getV1Tokens = ( * @deprecated */ export const getV1TokensErc721ByOwnerAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensErc721ByOwnerAddressResponses, - GetV1TokensErc721ByOwnerAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/erc721/{ownerAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensErc721ByOwnerAddressResponses, + GetV1TokensErc721ByOwnerAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/erc721/{ownerAddress}", + ...options, + }); }; /** @@ -609,24 +617,24 @@ export const getV1TokensErc721ByOwnerAddress = < * @deprecated */ export const getV1TokensErc1155ByOwnerAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensErc1155ByOwnerAddressResponses, - GetV1TokensErc1155ByOwnerAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/erc1155/{ownerAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensErc1155ByOwnerAddressResponses, + GetV1TokensErc1155ByOwnerAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/erc1155/{ownerAddress}", + ...options, + }); }; /** @@ -634,22 +642,22 @@ export const getV1TokensErc1155ByOwnerAddress = < * Get supported tokens for price data */ export const getV1TokensPriceSupported = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1TokensPriceSupportedResponses, - GetV1TokensPriceSupportedErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/price/supported", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1TokensPriceSupportedResponses, + GetV1TokensPriceSupportedErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/price/supported", + ...options, + }); }; /** @@ -657,22 +665,22 @@ export const getV1TokensPriceSupported = ( * Get price in USD for given token(s) */ export const getV1TokensPrice = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1TokensPriceResponses, - GetV1TokensPriceErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/price", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1TokensPriceResponses, + GetV1TokensPriceErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/price", + ...options, + }); }; /** @@ -680,22 +688,22 @@ export const getV1TokensPrice = ( * Look up a fungible token by symbol */ export const getV1TokensLookup = ( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1TokensLookupResponses, - GetV1TokensLookupErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/tokens/lookup", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1TokensLookupResponses, + GetV1TokensLookupErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/tokens/lookup", + ...options, + }); }; /** @@ -703,22 +711,22 @@ export const getV1TokensLookup = ( * Resolve */ export const getV1ResolveByInput = ( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1ResolveByInputResponses, - GetV1ResolveByInputErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/resolve/{input}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1ResolveByInputResponses, + GetV1ResolveByInputErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/resolve/{input}", + ...options, + }); }; /** @@ -726,22 +734,22 @@ export const getV1ResolveByInput = ( * Get blocks */ export const getV1Blocks = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1BlocksResponses, - GetV1BlocksErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/blocks", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1BlocksResponses, + GetV1BlocksErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/blocks", + ...options, + }); }; /** @@ -749,24 +757,24 @@ export const getV1Blocks = ( * Get contract ABI​ */ export const getV1ContractsAbiByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1ContractsAbiByContractAddressResponses, - GetV1ContractsAbiByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/contracts/abi/{contractAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1ContractsAbiByContractAddressResponses, + GetV1ContractsAbiByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/contracts/abi/{contractAddress}", + ...options, + }); }; /** @@ -774,24 +782,24 @@ export const getV1ContractsAbiByContractAddress = < * Get contract metadata​ */ export const getV1ContractsMetadataByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1ContractsMetadataByContractAddressResponses, - GetV1ContractsMetadataByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/contracts/metadata/{contractAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1ContractsMetadataByContractAddressResponses, + GetV1ContractsMetadataByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/contracts/metadata/{contractAddress}", + ...options, + }); }; /** @@ -799,28 +807,28 @@ export const getV1ContractsMetadataByContractAddress = < * Decode logs and transactions​ */ export const postV1DecodeByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).post< - PostV1DecodeByContractAddressResponses, - PostV1DecodeByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/decode/{contractAddress}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); + return (options.client ?? _heyApiClient).post< + PostV1DecodeByContractAddressResponses, + PostV1DecodeByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/decode/{contractAddress}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); }; /** @@ -828,24 +836,24 @@ export const postV1DecodeByContractAddress = < * Get NFT balances for a given address */ export const getV1NftsBalanceByOwnerAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsBalanceByOwnerAddressResponses, - GetV1NftsBalanceByOwnerAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/balance/{ownerAddress}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsBalanceByOwnerAddressResponses, + GetV1NftsBalanceByOwnerAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/balance/{ownerAddress}", + ...options, + }); }; /** @@ -853,24 +861,24 @@ export const getV1NftsBalanceByOwnerAddress = < * Retrieve metadata about a collection */ export const getV1NftsCollectionsByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsCollectionsByContractAddressResponses, - GetV1NftsCollectionsByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/collections/{contract_address}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsCollectionsByContractAddressResponses, + GetV1NftsCollectionsByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/collections/{contract_address}", + ...options, + }); }; /** @@ -878,22 +886,22 @@ export const getV1NftsCollectionsByContractAddress = < * Get NFTs */ export const getV1Nfts = ( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsResponses, - GetV1NftsErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsResponses, + GetV1NftsErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts", + ...options, + }); }; /** @@ -901,24 +909,24 @@ export const getV1Nfts = ( * Get NFT owners by contract */ export const getV1NftsOwnersByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsOwnersByContractAddressResponses, - GetV1NftsOwnersByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/owners/{contract_address}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsOwnersByContractAddressResponses, + GetV1NftsOwnersByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/owners/{contract_address}", + ...options, + }); }; /** @@ -926,24 +934,24 @@ export const getV1NftsOwnersByContractAddress = < * Get NFT owners by token */ export const getV1NftsOwnersByContractAddressByTokenId = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsOwnersByContractAddressByTokenIdResponses, - GetV1NftsOwnersByContractAddressByTokenIdErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/owners/{contract_address}/{token_id}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsOwnersByContractAddressByTokenIdResponses, + GetV1NftsOwnersByContractAddressByTokenIdErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/owners/{contract_address}/{token_id}", + ...options, + }); }; /** @@ -951,22 +959,22 @@ export const getV1NftsOwnersByContractAddressByTokenId = < * Get NFT transfers */ export const getV1NftsTransfers = ( - options?: Options, + options?: Options, ) => { - return (options?.client ?? _heyApiClient).get< - GetV1NftsTransfersResponses, - GetV1NftsTransfersErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/transfers", - ...options, - }); + return (options?.client ?? _heyApiClient).get< + GetV1NftsTransfersResponses, + GetV1NftsTransfersErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers", + ...options, + }); }; /** @@ -974,27 +982,27 @@ export const getV1NftsTransfers = ( * Get NFT transfers by transaction */ export const getV1NftsTransfersTransactionByTransactionHash = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options< - GetV1NftsTransfersTransactionByTransactionHashData, - ThrowOnError - >, + options: Options< + GetV1NftsTransfersTransactionByTransactionHashData, + ThrowOnError + >, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsTransfersTransactionByTransactionHashResponses, - GetV1NftsTransfersTransactionByTransactionHashErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/transfers/transaction/{transaction_hash}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersTransactionByTransactionHashResponses, + GetV1NftsTransfersTransactionByTransactionHashErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers/transaction/{transaction_hash}", + ...options, + }); }; /** @@ -1002,24 +1010,24 @@ export const getV1NftsTransfersTransactionByTransactionHash = < * Get NFT transfers by contract */ export const getV1NftsTransfersByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsTransfersByContractAddressResponses, - GetV1NftsTransfersByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/transfers/{contract_address}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersByContractAddressResponses, + GetV1NftsTransfersByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers/{contract_address}", + ...options, + }); }; /** @@ -1027,24 +1035,24 @@ export const getV1NftsTransfersByContractAddress = < * Get NFTs by contract */ export const getV1NftsByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsByContractAddressResponses, - GetV1NftsByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/{contract_address}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsByContractAddressResponses, + GetV1NftsByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/{contract_address}", + ...options, + }); }; /** @@ -1052,27 +1060,27 @@ export const getV1NftsByContractAddress = < * Get NFT transfers by token */ export const getV1NftsTransfersByContractAddressByTokenId = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options< - GetV1NftsTransfersByContractAddressByTokenIdData, - ThrowOnError - >, + options: Options< + GetV1NftsTransfersByContractAddressByTokenIdData, + ThrowOnError + >, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsTransfersByContractAddressByTokenIdResponses, - GetV1NftsTransfersByContractAddressByTokenIdErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/transfers/{contract_address}/{token_id}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsTransfersByContractAddressByTokenIdResponses, + GetV1NftsTransfersByContractAddressByTokenIdErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/transfers/{contract_address}/{token_id}", + ...options, + }); }; /** @@ -1080,24 +1088,24 @@ export const getV1NftsTransfersByContractAddressByTokenId = < * Get NFT by token ID */ export const getV1NftsByContractAddressByTokenId = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsByContractAddressByTokenIdResponses, - GetV1NftsByContractAddressByTokenIdErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/{contract_address}/{token_id}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsByContractAddressByTokenIdResponses, + GetV1NftsByContractAddressByTokenIdErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/{contract_address}/{token_id}", + ...options, + }); }; /** @@ -1105,24 +1113,24 @@ export const getV1NftsByContractAddressByTokenId = < * Force refresh collection metadata for the specified contract (across multiple chains if provided) */ export const getV1NftsMetadataRefreshByContractAddress = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options, + options: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsMetadataRefreshByContractAddressResponses, - GetV1NftsMetadataRefreshByContractAddressErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/metadata/refresh/{contract_address}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsMetadataRefreshByContractAddressResponses, + GetV1NftsMetadataRefreshByContractAddressErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/metadata/refresh/{contract_address}", + ...options, + }); }; /** @@ -1130,27 +1138,27 @@ export const getV1NftsMetadataRefreshByContractAddress = < * Force refresh token metadata for the specified contract and token ID (across multiple chains if provided) */ export const getV1NftsMetadataRefreshByContractAddressByTokenId = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, >( - options: Options< - GetV1NftsMetadataRefreshByContractAddressByTokenIdData, - ThrowOnError - >, + options: Options< + GetV1NftsMetadataRefreshByContractAddressByTokenIdData, + ThrowOnError + >, ) => { - return (options.client ?? _heyApiClient).get< - GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses, - GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}", - ...options, - }); + return (options.client ?? _heyApiClient).get< + GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses, + GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}", + ...options, + }); }; /** @@ -1158,22 +1166,51 @@ export const getV1NftsMetadataRefreshByContractAddressByTokenId = < * Get incoming and outgoing transactions for a wallet */ export const getV1WalletsByWalletAddressTransactions = < - ThrowOnError extends boolean = false, + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1WalletsByWalletAddressTransactionsResponses, + GetV1WalletsByWalletAddressTransactionsErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/v1/wallets/{wallet_address}/transactions", + ...options, + }); +}; + +/** + * Validate webhook filters + * Webhook filters are complex and unique to Insight. Since webhooks are not created through this service anymore, this functionality to validate them is now exposed through this endpoint. + */ +export const postServiceWebhooksFiltersValidate = < + ThrowOnError extends boolean = false, >( - options: Options, + options?: Options, ) => { - return (options.client ?? _heyApiClient).get< - GetV1WalletsByWalletAddressTransactionsResponses, - GetV1WalletsByWalletAddressTransactionsErrors, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - ], - url: "/v1/wallets/{wallet_address}/transactions", - ...options, - }); + return (options?.client ?? _heyApiClient).post< + PostServiceWebhooksFiltersValidateResponses, + PostServiceWebhooksFiltersValidateErrors, + ThrowOnError + >({ + security: [ + { + name: "x-client-id", + type: "apiKey", + }, + ], + url: "/service/webhooks/filters/validate", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }); }; diff --git a/packages/insight/src/client/types.gen.ts b/packages/insight/src/client/types.gen.ts index 95ab16c808c..f8ce53dbd76 100644 --- a/packages/insight/src/client/types.gen.ts +++ b/packages/insight/src/client/types.gen.ts @@ -1,5481 +1,5715 @@ // 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"; + 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; - }; + /** + * 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; - name: string | null; - webhook_url: string; - webhook_secret: string; - filters: - | string - | number - | boolean - | unknown - | { - [key: string]: unknown; - } - | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + id: string; + team_id: string; + project_id: string; + name: string | null; + webhook_url: string; + webhook_secret: string; + filters: + | string + | number + | boolean + | unknown + | { + [key: string]: 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]; + 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?: { - [key: string]: string | number; - }; - }>; - }; - "v1.transactions"?: { - chain_ids?: Array; - from_addresses?: Array; - to_addresses?: Array; - signatures?: Array<{ - sig_hash: string; - abi?: string; - params?: { - [key: string]: string | number; - }; - }>; - }; - }; - name?: string; - }; - path?: never; - query?: never; - url: "/v1/webhooks"; + body?: { + webhook_url: string; + filters: { + "v1.events"?: { + chain_ids?: Array; + addresses: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: { + [key: string]: string | number; + }; + }>; + }; + "v1.transactions"?: { + chain_ids?: Array; + from_addresses?: Array; + to_addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: { + [key: string]: string | number; + }; + }>; + }; + }; + name?: string; + }; + path?: never; + query?: never; + url: "/v1/webhooks"; }; export type PostV1WebhooksErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Forbidden - */ - 403: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Forbidden + */ + 403: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type PostV1WebhooksError = - PostV1WebhooksErrors[keyof PostV1WebhooksErrors]; + PostV1WebhooksErrors[keyof PostV1WebhooksErrors]; export type PostV1WebhooksResponses = { - /** - * Successful response - */ - 200: { - data: { - id: string; - team_id: string; - project_id: string; - name: string | null; - webhook_url: string; - webhook_secret: string; - filters: - | string - | number - | boolean - | unknown - | { - [key: string]: unknown; - } - | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }; - }; + /** + * Successful response + */ + 200: { + data: { + id: string; + team_id: string; + project_id: string; + name: string | null; + webhook_url: string; + webhook_secret: string; + filters: + | string + | number + | boolean + | unknown + | { + [key: string]: 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]; + PostV1WebhooksResponses[keyof PostV1WebhooksResponses]; export type DeleteV1WebhooksByWebhookIdData = { - body?: never; - path: { - webhook_id: string; - }; - query?: never; - url: "/v1/webhooks/{webhook_id}"; + 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; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Webhook not found + */ + 404: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type DeleteV1WebhooksByWebhookIdError = - DeleteV1WebhooksByWebhookIdErrors[keyof DeleteV1WebhooksByWebhookIdErrors]; + DeleteV1WebhooksByWebhookIdErrors[keyof DeleteV1WebhooksByWebhookIdErrors]; export type DeleteV1WebhooksByWebhookIdResponses = { - /** - * Successful response - */ - 200: { - data: { - id: string; - team_id: string; - project_id: string; - name: string | null; - webhook_url: string; - webhook_secret: string; - filters: - | string - | number - | boolean - | unknown - | { - [key: string]: unknown; - } - | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }; - }; + /** + * Successful response + */ + 200: { + data: { + id: string; + team_id: string; + project_id: string; + name: string | null; + webhook_url: string; + webhook_secret: string; + filters: + | string + | number + | boolean + | unknown + | { + [key: string]: 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]; + 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?: { - [key: string]: string | number; - }; - }>; - }; - "v1.transactions"?: { - chain_ids?: Array; - from_addresses?: Array; - to_addresses?: Array; - signatures?: Array<{ - sig_hash: string; - abi?: string; - params?: { - [key: string]: string | number; - }; - }>; - }; - }; - name?: string; - disabled?: boolean; - }; - path: { - webhook_id: string; - }; - query?: never; - url: "/v1/webhooks/{webhook_id}"; + body?: { + webhook_url?: string; + filters?: { + "v1.events"?: { + chain_ids?: Array; + addresses: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: { + [key: string]: string | number; + }; + }>; + }; + "v1.transactions"?: { + chain_ids?: Array; + from_addresses?: Array; + to_addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: { + [key: string]: string | number; + }; + }>; + }; + }; + name?: string; + 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; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Webhook not found + */ + 404: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type PatchV1WebhooksByWebhookIdError = - PatchV1WebhooksByWebhookIdErrors[keyof PatchV1WebhooksByWebhookIdErrors]; + PatchV1WebhooksByWebhookIdErrors[keyof PatchV1WebhooksByWebhookIdErrors]; export type PatchV1WebhooksByWebhookIdResponses = { - /** - * Successful response - */ - 200: { - data: { - id: string; - team_id: string; - project_id: string; - name: string | null; - webhook_url: string; - webhook_secret: string; - filters: - | string - | number - | boolean - | unknown - | { - [key: string]: unknown; - } - | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }; - }; + /** + * Successful response + */ + 200: { + data: { + id: string; + team_id: string; + project_id: string; + name: string | null; + webhook_url: string; + webhook_secret: string; + filters: + | string + | number + | boolean + | unknown + | { + [key: string]: 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]; + PatchV1WebhooksByWebhookIdResponses[keyof PatchV1WebhooksByWebhookIdResponses]; export type PostV1WebhooksTestData = { - body?: { - webhook_url: string; - type?: "event" | "transaction"; - }; - path?: never; - query?: never; - url: "/v1/webhooks/test"; + 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; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Rate limit exceeded + */ + 429: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type PostV1WebhooksTestError = - PostV1WebhooksTestErrors[keyof PostV1WebhooksTestErrors]; + PostV1WebhooksTestErrors[keyof PostV1WebhooksTestErrors]; export type PostV1WebhooksTestResponses = { - /** - * Test event sent successfully - */ - 200: { - success: boolean; - }; + /** + * Test event sent successfully + */ + 200: { + success: boolean; + }; }; export type PostV1WebhooksTestResponse = - PostV1WebhooksTestResponses[keyof PostV1WebhooksTestResponses]; + PostV1WebhooksTestResponses[keyof PostV1WebhooksTestResponses]; export type GetV1EventsData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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; - /** - * address (hex or ENS) - * Filter by address - */ - filter_address?: string; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - }; - url: "/v1/events"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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; + /** + * address (hex or ENS) + * Filter by address + */ + filter_address?: string; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/events"; }; export type GetV1EventsErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * 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: string; - block_number: number; - block_hash: string; - block_timestamp: number; - 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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + 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]; + GetV1EventsResponses[keyof GetV1EventsResponses]; export type GetV1EventsByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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 (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/events/{contractAddress}"; }; export type GetV1EventsByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1EventsByContractAddressError = - GetV1EventsByContractAddressErrors[keyof GetV1EventsByContractAddressErrors]; + GetV1EventsByContractAddressErrors[keyof GetV1EventsByContractAddressErrors]; export type GetV1EventsByContractAddressResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - 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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + 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]; + GetV1EventsByContractAddressResponses[keyof GetV1EventsByContractAddressResponses]; export type GetV1EventsByContractAddressBySignatureData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - signature: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + signature: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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 (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/events/{contractAddress}/{signature}"; }; export type GetV1EventsByContractAddressBySignatureErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1EventsByContractAddressBySignatureError = - GetV1EventsByContractAddressBySignatureErrors[keyof GetV1EventsByContractAddressBySignatureErrors]; + GetV1EventsByContractAddressBySignatureErrors[keyof GetV1EventsByContractAddressBySignatureErrors]; export type GetV1EventsByContractAddressBySignatureResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - 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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + 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]; + GetV1EventsByContractAddressBySignatureResponses[keyof GetV1EventsByContractAddressBySignatureResponses]; export type GetV1TransactionsData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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; - /** - * address (hex or ENS) - * 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; - /** - * address (hex or ENS) - * Filter by to address - */ - filter_to_address?: string; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - }; - url: "/v1/transactions"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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; + /** + * address (hex or ENS) + * 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; + /** + * address (hex or ENS) + * Filter by to address + */ + filter_to_address?: string; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/transactions"; }; export type GetV1TransactionsErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1TransactionsError = - GetV1TransactionsErrors[keyof GetV1TransactionsErrors]; + GetV1TransactionsErrors[keyof GetV1TransactionsErrors]; export type GetV1TransactionsResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: string; - gas_price: string; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: string; - max_priority_fee_per_gas: string; - transaction_type: number; - r: string; - s: string; - v: string; - access_list_json?: string; - authorization_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: string; - blob_gas_used?: number; - blob_gas_price?: string; - logs_bloom?: string; - status?: number; - decoded?: { - name: string; - signature: string; - inputs?: { - [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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: string; + gas_price: string; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; + transaction_type: number; + r: string; + s: string; + v: string; + access_list_json?: string; + authorization_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: string; + blob_gas_used?: number; + blob_gas_price?: string; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: { + [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 GetV1TransactionsResponse = - GetV1TransactionsResponses[keyof GetV1TransactionsResponses]; + GetV1TransactionsResponses[keyof GetV1TransactionsResponses]; export type GetV1TransactionsByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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; - /** - * address (hex or ENS) - * 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}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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; + /** + * address (hex or ENS) + * 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 (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/transactions/{contractAddress}"; }; export type GetV1TransactionsByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1TransactionsByContractAddressError = - GetV1TransactionsByContractAddressErrors[keyof GetV1TransactionsByContractAddressErrors]; + GetV1TransactionsByContractAddressErrors[keyof GetV1TransactionsByContractAddressErrors]; export type GetV1TransactionsByContractAddressResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: string; - gas_price: string; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: string; - max_priority_fee_per_gas: string; - transaction_type: number; - r: string; - s: string; - v: string; - access_list_json?: string; - authorization_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: string; - blob_gas_used?: number; - blob_gas_price?: string; - 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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: string; + gas_price: string; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; + transaction_type: number; + r: string; + s: string; + v: string; + access_list_json?: string; + authorization_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: string; + blob_gas_used?: number; + blob_gas_price?: string; + 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]; + GetV1TransactionsByContractAddressResponses[keyof GetV1TransactionsByContractAddressResponses]; export type GetV1TransactionsByContractAddressBySignatureData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - signature: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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; - /** - * address (hex or ENS) - * 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}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + signature: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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; + /** + * address (hex or ENS) + * 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 (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/transactions/{contractAddress}/{signature}"; }; export type GetV1TransactionsByContractAddressBySignatureErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1TransactionsByContractAddressBySignatureError = - GetV1TransactionsByContractAddressBySignatureErrors[keyof GetV1TransactionsByContractAddressBySignatureErrors]; + GetV1TransactionsByContractAddressBySignatureErrors[keyof GetV1TransactionsByContractAddressBySignatureErrors]; export type GetV1TransactionsByContractAddressBySignatureResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: string; - gas_price: string; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: string; - max_priority_fee_per_gas: string; - transaction_type: number; - r: string; - s: string; - v: string; - access_list_json?: string; - authorization_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: string; - blob_gas_used?: number; - blob_gas_price?: string; - logs_bloom?: string; - status?: number; - decoded?: { - name: string; - signature: string; - inputs?: { - [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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: string; + gas_price: string; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; + transaction_type: number; + r: string; + s: string; + v: string; + access_list_json?: string; + authorization_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: string; + blob_gas_used?: number; + blob_gas_price?: string; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: { + [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 GetV1TransactionsByContractAddressBySignatureResponse = - GetV1TransactionsByContractAddressBySignatureResponses[keyof GetV1TransactionsByContractAddressBySignatureResponses]; + GetV1TransactionsByContractAddressBySignatureResponses[keyof GetV1TransactionsByContractAddressBySignatureResponses]; export type GetV1TokensOwnersData = { - body?: never; - path?: never; - query: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * address (hex or ENS) - */ - contract_address: string; - }; - url: "/v1/tokens/owners"; + body?: never; + path?: never; + query: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * address (hex or ENS) + */ + contract_address: string; + }; + url: "/v1/tokens/owners"; }; export type GetV1TokensOwnersErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1TokensOwnersError = - GetV1TokensOwnersErrors[keyof GetV1TokensOwnersErrors]; + GetV1TokensOwnersErrors[keyof GetV1TokensOwnersErrors]; export type GetV1TokensOwnersResponses = { - /** - * Success - */ - 200: { - data: Array<{ - chain_id: string; - /** - * address (hex or ENS) - */ - token_address: string; - /** - * address (hex or ENS) - */ - owner_address: string; - balance: string; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + chain_id: string; + /** + * address (hex or ENS) + */ + token_address: string; + /** + * address (hex or ENS) + */ + owner_address: string; + balance: string; + }>; + }; }; export type GetV1TokensOwnersResponse = - GetV1TokensOwnersResponses[keyof GetV1TokensOwnersResponses]; + GetV1TokensOwnersResponses[keyof GetV1TokensOwnersResponses]; export type GetV1TokensTransfersTransactionByTransactionHashData = { - body?: never; - path: { - transaction_hash: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * The types of tokens to include in the response. Can be an empty array to include all types - */ - token_types?: Array<"erc1155" | "erc721" | "erc20">; - }; - url: "/v1/tokens/transfers/transaction/{transaction_hash}"; + body?: never; + path: { + transaction_hash: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include owner addresses in the NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * The types of tokens to include in the response. Can be an empty array to include all types + */ + token_types?: Array<"erc1155" | "erc721" | "erc20">; + }; + 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; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * 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; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensTransfersTransactionByTransactionHashError = - GetV1TokensTransfersTransactionByTransactionHashErrors[keyof GetV1TokensTransfersTransactionByTransactionHashErrors]; + 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; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * 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; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensTransfersTransactionByTransactionHashResponse = - GetV1TokensTransfersTransactionByTransactionHashResponses[keyof GetV1TokensTransfersTransactionByTransactionHashResponses]; + GetV1TokensTransfersTransactionByTransactionHashResponses[keyof GetV1TokensTransfersTransactionByTransactionHashResponses]; export type GetV1TokensTransfersByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - }; - url: "/v1/tokens/transfers/{contract_address}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include owner addresses in the NFT metadata (only if 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; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * 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; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensTransfersByContractAddressError = - GetV1TokensTransfersByContractAddressErrors[keyof GetV1TokensTransfersByContractAddressErrors]; + 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; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * 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; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensTransfersByContractAddressResponse = - GetV1TokensTransfersByContractAddressResponses[keyof GetV1TokensTransfersByContractAddressResponses]; + GetV1TokensTransfersByContractAddressResponses[keyof GetV1TokensTransfersByContractAddressResponses]; export type GetV1TokensTransfersData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * Filter by block number greater than or equal to - */ - block_number_from?: number | string; - /** - * Filter by block number less than or equal to - */ - block_number_to?: number | string; - /** - * Filter by block timestamp greater than or equal to - */ - block_timestamp_from?: number; - /** - * Filter by block timestamp less than or equal to - */ - block_timestamp_to?: number; - /** - * address (hex or ENS) - */ - owner_address?: string; - /** - * Filter by contract address. Can be an array of addresses or a single address. If not provided, all contracts will be included - */ - contract_address?: Array; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - /** - * Only include transfers of a certain type - */ - transfer_type?: "mint" | "transfer" | "burn"; - /** - * The types of tokens to include in the response. Can be an empty array to include all types - */ - token_types?: Array<"erc1155" | "erc721" | "erc20">; - }; - url: "/v1/tokens/transfers"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include owner addresses in the NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * Filter by block number greater than or equal to + */ + block_number_from?: number | string; + /** + * Filter by block number less than or equal to + */ + block_number_to?: number | string; + /** + * Filter by block timestamp greater than or equal to + */ + block_timestamp_from?: number; + /** + * Filter by block timestamp less than or equal to + */ + block_timestamp_to?: number; + /** + * address (hex or ENS) + */ + owner_address?: string; + /** + * Filter by contract address. Can be an array of addresses or a single address. If not provided, all contracts will be included + */ + contract_address?: Array; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + /** + * Only include transfers of a certain type + */ + transfer_type?: "mint" | "transfer" | "burn"; + /** + * The types of tokens to include in the response. Can be an empty array to include all types + */ + token_types?: Array<"erc1155" | "erc721" | "erc20">; + }; + 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; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * 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; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensTransfersError = - GetV1TokensTransfersErrors[keyof GetV1TokensTransfersErrors]; + 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; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * 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; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensTransfersResponse = - GetV1TokensTransfersResponses[keyof GetV1TokensTransfersResponses]; + GetV1TokensTransfersResponses[keyof GetV1TokensTransfersResponses]; export type GetV1TokensErc20ByOwnerAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - ownerAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - /** - * Whether to include spam tokens - */ - include_spam?: "true" | "false"; - }; - url: "/v1/tokens/erc20/{ownerAddress}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + ownerAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "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; + /** + * 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; - /** - * address (hex or ENS) - */ - token_address: string; - balance: string; - name?: string; - symbol?: string; - decimals?: number; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + token_address: string; + balance: string; + name?: string; + symbol?: string; + decimals?: number; + }>; + }; }; export type GetV1TokensErc20ByOwnerAddressResponse = - GetV1TokensErc20ByOwnerAddressResponses[keyof GetV1TokensErc20ByOwnerAddressResponses]; + GetV1TokensErc20ByOwnerAddressResponses[keyof GetV1TokensErc20ByOwnerAddressResponses]; export type GetV1TokensData = { - body?: never; - path?: never; - query: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - /** - * Whether to include spam tokens - */ - include_spam?: "true" | "false"; - /** - * address (hex or ENS) - */ - owner_address: string; - /** - * Whether to include native tokens - */ - include_native?: "true" | "false"; - }; - url: "/v1/tokens"; + body?: never; + path?: never; + query: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + /** + * Whether to include spam tokens + */ + include_spam?: "true" | "false"; + /** + * Address(es) to filter by. You can specify multiple addresses using repeated query parameters, e.g., ?address=0x123&address=0x456 + */ + owner_address: Array; + /** + * Whether to include native tokens + */ + include_native?: "true" | "false"; + /** + * Address(es) to filter by. You can specify multiple addresses using repeated query parameters, e.g., ?address=0x123&address=0x456 + */ + token_address?: Array; + /** + * Field to sort by + */ + sort_by?: "balance" | "token_address" | "token_price" | "usd_value"; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + /** + * Whether to include tokens that don't have price data (only applies when metadata=true) + */ + include_without_price?: "true" | "false"; + }; + url: "/v1/tokens"; }; export type GetV1TokensErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; }; export type GetV1TokensResponses = { - /** - * Successful response - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - /** - * address (hex or ENS) - */ - token_address: string; - balance: string; - name?: string; - symbol?: string; - decimals?: number; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + token_address: string; + balance: string; + name?: string; + symbol?: string; + decimals?: number; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensResponse = - GetV1TokensResponses[keyof GetV1TokensResponses]; + GetV1TokensResponses[keyof GetV1TokensResponses]; export type GetV1TokensErc721ByOwnerAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - ownerAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/tokens/erc721/{ownerAddress}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + ownerAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/tokens/erc721/{ownerAddress}"; }; export type GetV1TokensErc721ByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * 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; - /** - * address (hex or ENS) - */ - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; }; export type GetV1TokensErc721ByOwnerAddressResponse = - GetV1TokensErc721ByOwnerAddressResponses[keyof GetV1TokensErc721ByOwnerAddressResponses]; + GetV1TokensErc721ByOwnerAddressResponses[keyof GetV1TokensErc721ByOwnerAddressResponses]; export type GetV1TokensErc1155ByOwnerAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - ownerAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/tokens/erc1155/{ownerAddress}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + ownerAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/tokens/erc1155/{ownerAddress}"; }; export type GetV1TokensErc1155ByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * 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; - /** - * address (hex or ENS) - */ - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; }; export type GetV1TokensErc1155ByOwnerAddressResponse = - GetV1TokensErc1155ByOwnerAddressResponses[keyof GetV1TokensErc1155ByOwnerAddressResponses]; + GetV1TokensErc1155ByOwnerAddressResponses[keyof GetV1TokensErc1155ByOwnerAddressResponses]; export type GetV1TokensPriceSupportedData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/tokens/price/supported"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/tokens/price/supported"; }; export type GetV1TokensPriceSupportedErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * 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 (hex or ENS) - */ - address: string; - symbol?: string; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + address: string; + symbol?: string; + }>; + }; }; export type GetV1TokensPriceSupportedResponse = - GetV1TokensPriceSupportedResponses[keyof GetV1TokensPriceSupportedResponses]; + GetV1TokensPriceSupportedResponses[keyof GetV1TokensPriceSupportedResponses]; export type GetV1TokensPriceData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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; - /** - * Whether to include historical token prices - */ - include_historical_prices?: "true" | "false"; - /** - * Whether to include the number of holders - */ - include_holders?: "true" | "false"; - }; - url: "/v1/tokens/price"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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; + /** + * Whether to include historical token prices + */ + include_historical_prices?: "true" | "false"; + /** + * Whether to include the number of holders + */ + include_holders?: "true" | "false"; + }; + url: "/v1/tokens/price"; }; export type GetV1TokensPriceErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * 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 (hex or ENS) - */ - address: string; - symbol?: string; - /** - * Precise price in USD - */ - price_usd: number; - /** - * Price in USD cents - */ - price_usd_cents: number; - /** - * Percent change in price over the last 24 hours - */ - percent_change_24h: number; - /** - * Volume in USD over the last 24 hours - */ - volume_24h_usd: number; - /** - * Percent change in volume over the last 24 hours - */ - volume_change_24h: number; - /** - * Market cap in USD - */ - market_cap_usd: number; - historical_prices?: Array<{ - /** - * Date of price - */ - date: string; - /** - * Price in USD - */ - price_usd: number; - /** - * Price in USD cents - */ - price_usd_cents: number; - }>; - /** - * Number of holders - */ - holders?: number; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + address: string; + symbol?: string; + /** + * Precise price in USD + */ + price_usd: number; + /** + * Price in USD cents + */ + price_usd_cents: number; + /** + * Percent change in price over the last 24 hours + */ + percent_change_24h: number; + /** + * Volume in USD over the last 24 hours + */ + volume_24h_usd: number; + /** + * Percent change in volume over the last 24 hours + */ + volume_change_24h: number; + /** + * Market cap in USD + */ + market_cap_usd: number; + historical_prices?: Array<{ + /** + * Date of price + */ + date: string; + /** + * Price in USD + */ + price_usd: number; + /** + * Price in USD cents + */ + price_usd_cents: number; + }>; + /** + * Number of holders + */ + holders?: number; + }>; + }; }; export type GetV1TokensPriceResponse = - GetV1TokensPriceResponses[keyof GetV1TokensPriceResponses]; + 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; - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/tokens/lookup"; + 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; + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/tokens/lookup"; }; export type GetV1TokensLookupErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * 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; - /** - * address (hex or ENS) - */ - token_address: string; - name?: string; - symbol?: string; - decimals?: number; - price_data?: { - /** - * The price of the token in USD - */ - price_usd?: number; - /** - * The volume of the token in USD - */ - volume_24h_usd?: number; - /** - * The market cap of the token in USD - */ - market_cap_usd?: number; - /** - * The circulating supply of the token - */ - circulating_supply?: number; - /** - * The total supply of the token - */ - total_supply?: number; - /** - * The percentage change of the token in the last 24 hours - */ - percent_change_24h?: number; - /** - * The timestamp of the latest price update - */ - price_timestamp?: string; - }; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + token_address: string; + name?: string; + symbol?: string; + decimals?: number; + price_data?: { + /** + * The price of the token in USD + */ + price_usd?: number; + /** + * The value of the token balance in USD + */ + usd_value?: number; + /** + * The volume of the token in USD + */ + volume_24h_usd?: number; + /** + * The market cap of the token in USD + */ + market_cap_usd?: number; + /** + * The circulating supply of the token + */ + circulating_supply?: number; + /** + * The total supply of the token + */ + total_supply?: number; + /** + * The percentage change of the token in the last 24 hours + */ + percent_change_24h?: number; + /** + * The timestamp of the latest price update + */ + price_timestamp?: string; + }; + }>; + }; }; export type GetV1TokensLookupResponse = - GetV1TokensLookupResponses[keyof GetV1TokensLookupResponses]; + GetV1TokensLookupResponses[keyof GetV1TokensLookupResponses]; export type GetV1ResolveByInputData = { - body?: never; - path: { - /** - * hash - * Can be a block number, transaction or block hash, address, event signature or function selector - */ - input: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/resolve/{input}"; + body?: never; + path: { + /** + * hash + * Can be a block number, transaction or block hash, address, event signature or function selector + */ + input: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/resolve/{input}"; }; export type GetV1ResolveByInputErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1ResolveByInputError = - GetV1ResolveByInputErrors[keyof GetV1ResolveByInputErrors]; + 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: string; - block_number: number; - block_hash: string; - block_timestamp: number; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: string; - gas_price: string; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: string; - max_priority_fee_per_gas: string; - transaction_type: number; - r: string; - s: string; - v: string; - access_list_json?: string; - authorization_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: string; - blob_gas_used?: number; - blob_gas_price?: string; - logs_bloom?: string; - status?: number; - }>; - events?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - transaction_hash: string; - transaction_index: number; - log_index: number; - address: string; - data: string; - topics: Array; - }>; - /** - * address (hex or ENS) - */ - address?: string; - 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; - }; - }; + /** + * 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: string; + block_number: number; + block_hash: string; + block_timestamp: number; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: string; + gas_price: string; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; + transaction_type: number; + r: string; + s: string; + v: string; + access_list_json?: string; + authorization_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: string; + blob_gas_used?: number; + blob_gas_price?: string; + logs_bloom?: string; + status?: number; + }>; + events?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + }>; + /** + * address (hex or ENS) + */ + address?: string; + 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]; + GetV1ResolveByInputResponses[keyof GetV1ResolveByInputResponses]; export type GetV1BlocksData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: unknown; - /** - * Filter by hash - */ - filter_hash?: string; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - }; - url: "/v1/blocks"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: unknown; + /** + * Filter by hash + */ + filter_hash?: string; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/blocks"; }; export type GetV1BlocksErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * 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; - }; - }; + /** + * 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]; + GetV1BlocksResponses[keyof GetV1BlocksResponses]; export type GetV1ContractsAbiByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/contracts/abi/{contractAddress}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/contracts/abi/{contractAddress}"; }; export type GetV1ContractsAbiByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1ContractsAbiByContractAddressError = - GetV1ContractsAbiByContractAddressErrors[keyof GetV1ContractsAbiByContractAddressErrors]; + GetV1ContractsAbiByContractAddressErrors[keyof GetV1ContractsAbiByContractAddressErrors]; export type GetV1ContractsAbiByContractAddressResponses = { - /** - * Success - */ - 200: { - [key: string]: unknown; - }; + /** + * Success + */ + 200: { + [key: string]: unknown; + }; }; export type GetV1ContractsAbiByContractAddressResponse = - GetV1ContractsAbiByContractAddressResponses[keyof GetV1ContractsAbiByContractAddressResponses]; + GetV1ContractsAbiByContractAddressResponses[keyof GetV1ContractsAbiByContractAddressResponses]; export type GetV1ContractsMetadataByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/contracts/metadata/{contractAddress}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/contracts/metadata/{contractAddress}"; }; export type GetV1ContractsMetadataByContractAddressErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1ContractsMetadataByContractAddressError = - GetV1ContractsMetadataByContractAddressErrors[keyof GetV1ContractsMetadataByContractAddressErrors]; + GetV1ContractsMetadataByContractAddressErrors[keyof GetV1ContractsMetadataByContractAddressErrors]; export type GetV1ContractsMetadataByContractAddressResponses = { - /** - * Success - */ - 200: { - [key: string]: unknown; - }; + /** + * Success + */ + 200: { + [key: string]: unknown; + }; }; export type GetV1ContractsMetadataByContractAddressResponse = - GetV1ContractsMetadataByContractAddressResponses[keyof GetV1ContractsMetadataByContractAddressResponses]; + GetV1ContractsMetadataByContractAddressResponses[keyof GetV1ContractsMetadataByContractAddressResponses]; export type PostV1DecodeByContractAddressData = { - body?: { - transactions?: Array<{ - data: string; - }>; - logs?: Array<{ - data?: string; - topics: Array; - }>; - }; - path: { - /** - * address (hex or ENS) - */ - contractAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/decode/{contractAddress}"; + body?: { + transactions?: Array<{ + data: string; + }>; + logs?: Array<{ + data?: string; + topics: Array; + }>; + }; + path: { + /** + * address (hex or ENS) + */ + contractAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/decode/{contractAddress}"; }; export type PostV1DecodeByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type PostV1DecodeByContractAddressError = - PostV1DecodeByContractAddressErrors[keyof PostV1DecodeByContractAddressErrors]; + 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; - }>; - }; - }; + /** + * 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]; + PostV1DecodeByContractAddressResponses[keyof PostV1DecodeByContractAddressResponses]; export type GetV1NftsBalanceByOwnerAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - ownerAddress: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - /** - * The types of NFTs to include in the response - */ - token_types?: Array<"erc1155" | "erc721">; - }; - url: "/v1/nfts/balance/{ownerAddress}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + ownerAddress: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + /** + * The types of NFTs to include in the response + */ + token_types?: Array<"erc1155" | "erc721">; + }; + url: "/v1/nfts/balance/{ownerAddress}"; }; export type GetV1NftsBalanceByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + /** + * 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; - /** - * address (hex or ENS) - */ - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + /** + * address (hex or ENS) + */ + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; }; export type GetV1NftsBalanceByOwnerAddressResponse = - GetV1NftsBalanceByOwnerAddressResponses[keyof GetV1NftsBalanceByOwnerAddressResponses]; + GetV1NftsBalanceByOwnerAddressResponses[keyof GetV1NftsBalanceByOwnerAddressResponses]; export type GetV1NftsCollectionsByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * Whether to include stats for the collection - */ - include_stats?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/nfts/collections/{contract_address}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * Whether to include stats for the collection + */ + include_stats?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/nfts/collections/{contract_address}"; }; export type GetV1NftsCollectionsByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsCollectionsByContractAddressError = - GetV1NftsCollectionsByContractAddressErrors[keyof GetV1NftsCollectionsByContractAddressErrors]; + 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; - }; - }>; - }; + /** + * 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]; + GetV1NftsCollectionsByContractAddressResponses[keyof GetV1NftsCollectionsByContractAddressResponses]; export type GetV1NftsData = { - body?: never; - path?: never; - query: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - /** - * address (hex or ENS) - */ - owner_address: string; - }; - url: "/v1/nfts"; + body?: never; + path?: never; + query: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + /** + * Address(es) to filter by. You can specify multiple addresses using repeated query parameters, e.g., ?address=0x123&address=0x456 + */ + owner_address: Array; + /** + * Address(es) to filter by. You can specify multiple addresses using repeated query parameters, e.g., ?address=0x123&address=0x456 + */ + contract_address?: Array; + }; + url: "/v1/nfts"; }; export type GetV1NftsErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - chain_id: number; - contract_address: string; - token_id: string; - token_type: string; - balance?: string; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + chain_id: number; + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + token_type: string; + balance: string; + owner_addresses?: 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; }; export type GetV1NftsResponse = GetV1NftsResponses[keyof GetV1NftsResponses]; export type GetV1NftsOwnersByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Control if the result is an array of addresses only or an array of objects containing the address and balance - */ - include_balances?: "true" | "false"; - }; - url: "/v1/nfts/owners/{contract_address}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Control if the result is an array of addresses only or an array of objects containing the address and balance + */ + include_balances?: "true" | "false"; + }; + url: "/v1/nfts/owners/{contract_address}"; }; export type GetV1NftsOwnersByContractAddressErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsOwnersByContractAddressError = - GetV1NftsOwnersByContractAddressErrors[keyof GetV1NftsOwnersByContractAddressErrors]; + GetV1NftsOwnersByContractAddressErrors[keyof GetV1NftsOwnersByContractAddressErrors]; export type GetV1NftsOwnersByContractAddressResponses = { - /** - * Success - */ - 200: Array< - | { - chain_id: string; - token_address: string; - owner_address: string; - token_id: string; - balance: string; - } - | { - chain_id: string; - owner_addresses: Array; - } - >; + /** + * Success + */ + 200: Array< + | { + chain_id: string; + token_address: string; + owner_address: string; + token_id: string; + balance: string; + } + | { + chain_id: string; + owner_addresses: Array; + } + >; }; export type GetV1NftsOwnersByContractAddressResponse = - GetV1NftsOwnersByContractAddressResponses[keyof GetV1NftsOwnersByContractAddressResponses]; + GetV1NftsOwnersByContractAddressResponses[keyof GetV1NftsOwnersByContractAddressResponses]; export type GetV1NftsOwnersByContractAddressByTokenIdData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - token_id: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Control if the result is an array of addresses only or an array of objects containing the address and balance - */ - include_balances?: "true" | "false"; - }; - url: "/v1/nfts/owners/{contract_address}/{token_id}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Control if the result is an array of addresses only or an array of objects containing the address and balance + */ + include_balances?: "true" | "false"; + }; + url: "/v1/nfts/owners/{contract_address}/{token_id}"; }; export type GetV1NftsOwnersByContractAddressByTokenIdErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsOwnersByContractAddressByTokenIdError = - GetV1NftsOwnersByContractAddressByTokenIdErrors[keyof GetV1NftsOwnersByContractAddressByTokenIdErrors]; + GetV1NftsOwnersByContractAddressByTokenIdErrors[keyof GetV1NftsOwnersByContractAddressByTokenIdErrors]; export type GetV1NftsOwnersByContractAddressByTokenIdResponses = { - /** - * Success - */ - 200: Array< - | { - chain_id: string; - token_address: string; - owner_address: string; - token_id: string; - balance: string; - } - | { - chain_id: string; - owner_addresses: Array; - } - >; + /** + * Success + */ + 200: Array< + | { + chain_id: string; + token_address: string; + owner_address: string; + token_id: string; + balance: string; + } + | { + chain_id: string; + owner_addresses: Array; + } + >; }; export type GetV1NftsOwnersByContractAddressByTokenIdResponse = - GetV1NftsOwnersByContractAddressByTokenIdResponses[keyof GetV1NftsOwnersByContractAddressByTokenIdResponses]; + GetV1NftsOwnersByContractAddressByTokenIdResponses[keyof GetV1NftsOwnersByContractAddressByTokenIdResponses]; export type GetV1NftsTransfersData = { - body?: never; - path?: never; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * Filter by block number greater than or equal to - */ - block_number_from?: number | string; - /** - * Filter by block number less than or equal to - */ - block_number_to?: number | string; - /** - * Filter by block timestamp greater than or equal to - */ - block_timestamp_from?: number; - /** - * Filter by block timestamp less than or equal to - */ - block_timestamp_to?: number; - /** - * address (hex or ENS) - */ - owner_address?: string; - /** - * Filter by contract address. Can be an array of addresses or a single address. If not provided, all contracts will be included - */ - contract_address?: Array; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - /** - * Only include transfers of a certain type - */ - transfer_type?: "mint" | "transfer" | "burn" | "sale"; - /** - * Whether to include sale details for NFT transfers - */ - sales?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/nfts/transfers"; + body?: never; + path?: never; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include owner addresses in the NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * Filter by block number greater than or equal to + */ + block_number_from?: number | string; + /** + * Filter by block number less than or equal to + */ + block_number_to?: number | string; + /** + * Filter by block timestamp greater than or equal to + */ + block_timestamp_from?: number; + /** + * Filter by block timestamp less than or equal to + */ + block_timestamp_to?: number; + /** + * address (hex or ENS) + */ + owner_address?: string; + /** + * Filter by contract address. Can be an array of addresses or a single address. If not provided, all contracts will be included + */ + contract_address?: Array; + /** + * Sort order (asc or desc) + */ + sort_order?: "asc" | "desc"; + /** + * Only include transfers of a certain type + */ + transfer_type?: "mint" | "transfer" | "burn" | "sale"; + /** + * Whether to include sale details for NFT transfers + */ + sales?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/nfts/transfers"; }; export type GetV1NftsTransfersErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsTransfersError = - GetV1NftsTransfersErrors[keyof GetV1NftsTransfersErrors]; + 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: "erc721" | "erc1155"; - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - payment: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + /** + * 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: "erc721" | "erc1155"; + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + payment: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; }; export type GetV1NftsTransfersResponse = - GetV1NftsTransfersResponses[keyof GetV1NftsTransfersResponses]; + GetV1NftsTransfersResponses[keyof GetV1NftsTransfersResponses]; export type GetV1NftsTransfersTransactionByTransactionHashData = { - body?: never; - path: { - transaction_hash: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * The types of tokens to include in the response. Can be an empty array to include all types - */ - token_types?: Array<"erc1155" | "erc721" | "erc20">; - }; - url: "/v1/nfts/transfers/transaction/{transaction_hash}"; + body?: never; + path: { + transaction_hash: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include owner addresses in the NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * The types of tokens to include in the response. Can be an empty array to include all types + */ + token_types?: Array<"erc1155" | "erc721" | "erc20">; + }; + url: "/v1/nfts/transfers/transaction/{transaction_hash}"; }; export type GetV1NftsTransfersTransactionByTransactionHashErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsTransfersTransactionByTransactionHashError = - GetV1NftsTransfersTransactionByTransactionHashErrors[keyof GetV1NftsTransfersTransactionByTransactionHashErrors]; + 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: "erc721" | "erc1155"; - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - payment: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + /** + * 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: "erc721" | "erc1155"; + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + payment: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; }; export type GetV1NftsTransfersTransactionByTransactionHashResponse = - GetV1NftsTransfersTransactionByTransactionHashResponses[keyof GetV1NftsTransfersTransactionByTransactionHashResponses]; + GetV1NftsTransfersTransactionByTransactionHashResponses[keyof GetV1NftsTransfersTransactionByTransactionHashResponses]; export type GetV1NftsTransfersByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - }; - url: "/v1/nfts/transfers/{contract_address}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include metadata for the tokens + */ + metadata?: "true" | "false"; + /** + * Whether to include owner addresses in the NFT metadata (only if 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; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsTransfersByContractAddressError = - GetV1NftsTransfersByContractAddressErrors[keyof GetV1NftsTransfersByContractAddressErrors]; + 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: "erc721" | "erc1155"; - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - payment: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + /** + * 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: "erc721" | "erc1155"; + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + payment: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; }; export type GetV1NftsTransfersByContractAddressResponse = - GetV1NftsTransfersByContractAddressResponses[keyof GetV1NftsTransfersByContractAddressResponses]; + GetV1NftsTransfersByContractAddressResponses[keyof GetV1NftsTransfersByContractAddressResponses]; export type GetV1NftsByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/nfts/{contract_address}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + page?: number | null; + /** + * Whether to include owner addresses in the NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/nfts/{contract_address}"; }; export type GetV1NftsByContractAddressErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsByContractAddressError = - GetV1NftsByContractAddressErrors[keyof GetV1NftsByContractAddressErrors]; + 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - chain_id: number; - contract_address: string; - token_id: string; - token_type: string; - balance?: string; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + chain_id: number; + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + token_type: string; + balance: string; + owner_addresses?: 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; }; export type GetV1NftsByContractAddressResponse = - GetV1NftsByContractAddressResponses[keyof GetV1NftsByContractAddressResponses]; + GetV1NftsByContractAddressResponses[keyof GetV1NftsByContractAddressResponses]; export type GetV1NftsTransfersByContractAddressByTokenIdData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - token_id: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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 NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/nfts/transfers/{contract_address}/{token_id}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * The number of items to return + */ + limit?: number; + /** + * Page number (0-indexed) + */ + 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 NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/nfts/transfers/{contract_address}/{token_id}"; }; export type GetV1NftsTransfersByContractAddressByTokenIdErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsTransfersByContractAddressByTokenIdError = - GetV1NftsTransfersByContractAddressByTokenIdErrors[keyof GetV1NftsTransfersByContractAddressByTokenIdErrors]; + 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: "erc721" | "erc1155"; - 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - payment: Array<{ - /** - * address (hex or ENS) - */ - token_address: string; - token_id: string; - amount: string; - token_type: string; - /** - * address (hex or ENS) - */ - from_address?: string; - /** - * address (hex or ENS) - */ - to_address?: string; - }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + /** + * 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: "erc721" | "erc1155"; + 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + payment: Array<{ + /** + * address (hex or ENS) + */ + token_address: string; + token_id: string; + amount: string; + token_type: string; + /** + * address (hex or ENS) + */ + from_address?: string; + /** + * address (hex or ENS) + */ + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; + }>; + }; }; export type GetV1NftsTransfersByContractAddressByTokenIdResponse = - GetV1NftsTransfersByContractAddressByTokenIdResponses[keyof GetV1NftsTransfersByContractAddressByTokenIdResponses]; + GetV1NftsTransfersByContractAddressByTokenIdResponses[keyof GetV1NftsTransfersByContractAddressByTokenIdResponses]; export type GetV1NftsByContractAddressByTokenIdData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - token_id: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * Whether to include owner addresses in the NFT metadata (only if metadata is requested) - */ - include_owners?: "true" | "false"; - /** - * Whether to resolve metadata IPFS or Arweave links - */ - resolve_metadata_links?: "true" | "false"; - }; - url: "/v1/nfts/{contract_address}/{token_id}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * Whether to include owner addresses in the NFT metadata (only if metadata is requested) + */ + include_owners?: "true" | "false"; + /** + * Whether to resolve metadata IPFS or Arweave links + */ + resolve_metadata_links?: "true" | "false"; + }; + url: "/v1/nfts/{contract_address}/{token_id}"; }; export type GetV1NftsByContractAddressByTokenIdErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsByContractAddressByTokenIdError = - GetV1NftsByContractAddressByTokenIdErrors[keyof GetV1NftsByContractAddressByTokenIdErrors]; + 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?: { - [key: string]: unknown; - } & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | { - [key: string]: unknown; - }; - properties?: { - [key: string]: unknown; - }; - }; - 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 (hex or ENS) - */ - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - chain_id: number; - contract_address: string; - token_id: string; - token_type: string; - balance?: string; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + chain_id: number; + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + token_type: string; + balance: string; + owner_addresses?: 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?: { + [key: string]: unknown; + } & { + attributes?: + | Array<{ + trait_type: string; + value: string | number; + display_type?: string; + }> + | { + [key: string]: unknown; + }; + properties?: { + [key: string]: unknown; + }; + }; + 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 (hex or ENS) + */ + address: string; + name?: string; + symbol?: string; + type?: "erc721" | "erc1155"; + }; + }>; + }; }; export type GetV1NftsByContractAddressByTokenIdResponse = - GetV1NftsByContractAddressByTokenIdResponses[keyof GetV1NftsByContractAddressByTokenIdResponses]; + GetV1NftsByContractAddressByTokenIdResponses[keyof GetV1NftsByContractAddressByTokenIdResponses]; export type GetV1NftsMetadataRefreshByContractAddressData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/nfts/metadata/refresh/{contract_address}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/nfts/metadata/refresh/{contract_address}"; }; export type GetV1NftsMetadataRefreshByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsMetadataRefreshByContractAddressError = - GetV1NftsMetadataRefreshByContractAddressErrors[keyof GetV1NftsMetadataRefreshByContractAddressErrors]; + GetV1NftsMetadataRefreshByContractAddressErrors[keyof GetV1NftsMetadataRefreshByContractAddressErrors]; export type GetV1NftsMetadataRefreshByContractAddressResponses = { - /** - * Success - */ - 200: { - data: { - success: boolean; - message: string; - }; - }; + /** + * Success + */ + 200: { + data: { + success: boolean; + message: string; + }; + }; }; export type GetV1NftsMetadataRefreshByContractAddressResponse = - GetV1NftsMetadataRefreshByContractAddressResponses[keyof GetV1NftsMetadataRefreshByContractAddressResponses]; + GetV1NftsMetadataRefreshByContractAddressResponses[keyof GetV1NftsMetadataRefreshByContractAddressResponses]; export type GetV1NftsMetadataRefreshByContractAddressByTokenIdData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - contract_address: string; - token_id: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - }; - url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + contract_address: string; + token_id: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + }; + url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}"; }; export type GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1NftsMetadataRefreshByContractAddressByTokenIdError = - GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors]; + GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdErrors]; export type GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses = { - /** - * Success - */ - 200: { - data: { - success: boolean; - message: string; - }; - }; + /** + * Success + */ + 200: { + data: { + success: boolean; + message: string; + }; + }; }; export type GetV1NftsMetadataRefreshByContractAddressByTokenIdResponse = - GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses]; + GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses]; export type GetV1WalletsByWalletAddressTransactionsData = { - body?: never; - path: { - /** - * address (hex or ENS) - */ - wallet_address: string; - }; - query?: { - /** - * Use chain_id instead - * @deprecated - */ - chain?: Array; - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 50. - * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain_id?: Array; - /** - * 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"; - /** - * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number - */ - group_by?: unknown; - /** - * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) - */ - aggregate?: 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"; + body?: never; + path: { + /** + * address (hex or ENS) + */ + wallet_address: string; + }; + query?: { + /** + * Use chain_id instead + * @deprecated + */ + chain?: Array; + /** + * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 55. + * Use repeated query parameters, e.g., `?chain_id=20&chain_id=56`. + * Optional, because a single chain can as well be specified as a subdomain + */ + chain_id?: Array; + /** + * 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"; + /** + * Field(s) to group by. You can specify multiple with repeated query parameters, e.g., ?group_by=chain_id&group_by=block_number + */ + group_by?: unknown; + /** + * Aggregation(s). You can specify multiple with repeated query parameters, e.g., ?aggregate=count()&aggregate=sum(gas_used) + */ + aggregate?: 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 (0-indexed). Maximum value depends on query parameters: 20 for regular queries, 500 when using aggregate or group_by parameters. + */ + page?: number | null; + }; + url: "/v1/wallets/{wallet_address}/transactions"; }; export type GetV1WalletsByWalletAddressTransactionsErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; }; export type GetV1WalletsByWalletAddressTransactionsError = - GetV1WalletsByWalletAddressTransactionsErrors[keyof GetV1WalletsByWalletAddressTransactionsErrors]; + GetV1WalletsByWalletAddressTransactionsErrors[keyof GetV1WalletsByWalletAddressTransactionsErrors]; export type GetV1WalletsByWalletAddressTransactionsResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: string; - block_number: number; - block_hash: string; - block_timestamp: number; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: string; - gas_price: string; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: string; - max_priority_fee_per_gas: string; - transaction_type: number; - r: string; - s: string; - v: string; - access_list_json?: string; - authorization_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: string; - blob_gas_used?: number; - blob_gas_price?: string; - logs_bloom?: string; - status?: number; - decoded?: { - name: string; - signature: string; - inputs?: { - [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; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: string; + block_number: number; + block_hash: string; + block_timestamp: number; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: string; + gas_price: string; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: string; + max_priority_fee_per_gas: string; + transaction_type: number; + r: string; + s: string; + v: string; + access_list_json?: string; + authorization_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: string; + blob_gas_used?: number; + blob_gas_price?: string; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: { + [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 GetV1WalletsByWalletAddressTransactionsResponse = - GetV1WalletsByWalletAddressTransactionsResponses[keyof GetV1WalletsByWalletAddressTransactionsResponses]; + GetV1WalletsByWalletAddressTransactionsResponses[keyof GetV1WalletsByWalletAddressTransactionsResponses]; + +export type PostServiceWebhooksFiltersValidateData = { + body?: { + "v1.events"?: { + chain_ids?: Array; + addresses: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: { + [key: string]: string | number; + }; + }>; + }; + "v1.transactions"?: { + chain_ids?: Array; + from_addresses?: Array; + to_addresses?: Array; + signatures?: Array<{ + sig_hash: string; + abi?: string; + params?: { + [key: string]: string | number; + }; + }>; + }; + }; + path?: never; + query?: never; + url: "/service/webhooks/filters/validate"; +}; + +export type PostServiceWebhooksFiltersValidateErrors = { + /** + * Bad request + */ + 400: { + error: string; + }; + /** + * Forbidden + */ + 403: { + error: string; + }; + /** + * Internal server error + */ + 500: { + error: string; + }; +}; + +export type PostServiceWebhooksFiltersValidateError = + PostServiceWebhooksFiltersValidateErrors[keyof PostServiceWebhooksFiltersValidateErrors]; + +export type PostServiceWebhooksFiltersValidateResponses = { + /** + * Successful response + */ + 200: { + valid: boolean; + error?: string; + details?: Array<{ + code: string; + message: string; + path: Array; + }>; + }; +}; + +export type PostServiceWebhooksFiltersValidateResponse = + PostServiceWebhooksFiltersValidateResponses[keyof PostServiceWebhooksFiltersValidateResponses]; export type ClientOptions = { - baseUrl: "https://{chainId}.insight.thirdweb.com/" | (string & {}); + baseUrl: "https://{chainId}.insight.thirdweb.com/" | (string & {}); }; diff --git a/packages/insight/src/configure.ts b/packages/insight/src/configure.ts index d213fe79cc0..914042e1deb 100644 --- a/packages/insight/src/configure.ts +++ b/packages/insight/src/configure.ts @@ -2,18 +2,18 @@ import type { Config } from "./client/client/index.js"; import { client } from "./client/client.gen.js"; export type InsightClientOptions = { - readonly clientId?: string; - readonly secretKey?: string; + readonly clientId?: string; + readonly secretKey?: string; }; export function configure( - options: InsightClientOptions & { override?: Config }, + options: InsightClientOptions & { override?: Config }, ) { - client.setConfig({ - headers: { - ...(options.clientId && { "x-client-id": options.clientId }), - ...(options.secretKey && { "x-secret-key": options.secretKey }), - }, - ...(options.override ?? {}), - }); + client.setConfig({ + headers: { + ...(options.clientId && { "x-client-id": options.clientId }), + ...(options.secretKey && { "x-secret-key": options.secretKey }), + }, + ...(options.override ?? {}), + }); } diff --git a/packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts b/packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts index a66b62a58dd..9959a7a214b 100644 --- a/packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts +++ b/packages/thirdweb/src/extensions/erc1155/read/getOwnedNFTs.ts @@ -62,6 +62,7 @@ async function getOwnedNFTsFromInsight( chains: [options.contract.chain], client: options.contract.client, ownerAddress: options.address, + contractAddress: options.contract.address, queryOptions: { limit, page, diff --git a/packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts b/packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts index f8b9657c30a..fc1ea0b35a2 100644 --- a/packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts +++ b/packages/thirdweb/src/extensions/erc721/read/getOwnedNFTs.ts @@ -78,6 +78,7 @@ async function getOwnedNFTsFromInsight( chains: [options.contract.chain], client: options.contract.client, ownerAddress: options.owner, + contractAddress: options.contract.address, queryOptions: { limit, page, diff --git a/packages/thirdweb/src/insight/get-nfts.ts b/packages/thirdweb/src/insight/get-nfts.ts index f80ce9ecdab..5384b94bb54 100644 --- a/packages/thirdweb/src/insight/get-nfts.ts +++ b/packages/thirdweb/src/insight/get-nfts.ts @@ -33,6 +33,7 @@ export async function getOwnedNFTs(args: { client: ThirdwebClient; chains: Chain[]; ownerAddress: string; + contractAddress?: string; includeMetadata?: boolean; queryOptions?: Omit; }): Promise<(NFT & { quantityOwned: bigint })[]> { @@ -50,8 +51,7 @@ export async function getOwnedNFTs(args: { import("viem"), ]); - // TODO (insight): add support for contract address filters - const { client, chains, ownerAddress, queryOptions } = args; + const { client, chains, ownerAddress, contractAddress, queryOptions } = args; await assertInsightEnabled(chains); @@ -59,7 +59,8 @@ export async function getOwnedNFTs(args: { chain: chains.map((chain) => chain.id), // metadata: includeMetadata ? "true" : "false", TODO (insight): add support for this limit: 50, - owner_address: ownerAddress, + owner_address: [ownerAddress], + contract_address: contractAddress ? [contractAddress] : undefined, }; const result = await getV1Nfts({ diff --git a/packages/thirdweb/src/insight/get-tokens.ts b/packages/thirdweb/src/insight/get-tokens.ts index 1251f2eb052..14d9c02b2cc 100644 --- a/packages/thirdweb/src/insight/get-tokens.ts +++ b/packages/thirdweb/src/insight/get-tokens.ts @@ -26,6 +26,7 @@ export async function getOwnedTokens(args: { client: ThirdwebClient; chains: Chain[]; ownerAddress: string; + tokenAddress?: string; queryOptions?: Omit< GetV1TokensData["query"], "owner_address" | "chain_id" | "chain" @@ -45,7 +46,7 @@ export async function getOwnedTokens(args: { import("../utils/json.js"), ]); - const { client, chains, ownerAddress, queryOptions } = args; + const { client, chains, ownerAddress, tokenAddress, queryOptions } = args; await assertInsightEnabled(chains); @@ -55,7 +56,8 @@ export async function getOwnedTokens(args: { include_spam: "false", limit: 50, metadata: "true", - owner_address: ownerAddress, + owner_address: [ownerAddress], + token_address: tokenAddress ? [tokenAddress] : undefined, }; const result = await getV1Tokens({