From 7065da159dd8ee88dfd03ed1e86d4aaf0eab7c6e Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Fri, 30 May 2025 13:06:45 +1200 Subject: [PATCH] Update token price APIs to query from insight directly --- .changeset/fuzzy-walls-allow.md | 5 + .changeset/petite-falcons-ring.md | 5 + packages/engine/CHANGELOG.md | 2 +- packages/insight/src/client/sdk.gen.ts | 505 +- packages/insight/src/client/types.gen.ts | 8117 +++++++++-------- packages/thirdweb/src/insight/get-nfts.ts | 2 +- .../src/pay/convert/cryptoToFiat.test.ts | 22 +- .../thirdweb/src/pay/convert/cryptoToFiat.ts | 45 +- .../src/pay/convert/fiatToCrypto.test.ts | 22 +- .../thirdweb/src/pay/convert/fiatToCrypto.ts | 44 +- .../thirdweb/src/pay/utils/definitions.ts | 6 - 11 files changed, 4411 insertions(+), 4364 deletions(-) create mode 100644 .changeset/fuzzy-walls-allow.md create mode 100644 .changeset/petite-falcons-ring.md diff --git a/.changeset/fuzzy-walls-allow.md b/.changeset/fuzzy-walls-allow.md new file mode 100644 index 00000000000..2691efc656c --- /dev/null +++ b/.changeset/fuzzy-walls-allow.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Update token price APIs to query from insight diff --git a/.changeset/petite-falcons-ring.md b/.changeset/petite-falcons-ring.md new file mode 100644 index 00000000000..64654a3a67c --- /dev/null +++ b/.changeset/petite-falcons-ring.md @@ -0,0 +1,5 @@ +--- +"@thirdweb-dev/insight": patch +--- + +Update to latest openAPI spec diff --git a/packages/engine/CHANGELOG.md b/packages/engine/CHANGELOG.md index 4dd75824b99..32e88155af4 100644 --- a/packages/engine/CHANGELOG.md +++ b/packages/engine/CHANGELOG.md @@ -1,4 +1,4 @@ -# @thirdweb-dev/insight +# @thirdweb-dev/engine ## 3.0.3 diff --git a/packages/insight/src/client/sdk.gen.ts b/packages/insight/src/client/sdk.gen.ts index eeb90077478..3c73002784c 100644 --- a/packages/insight/src/client/sdk.gen.ts +++ b/packages/insight/src/client/sdk.gen.ts @@ -69,6 +69,7 @@ import type { GetV1ResolveByInputData, GetV1ResolveByInputError, GetV1ResolveByInputResponse, + GetV1TokensData, GetV1TokensErc20ByOwnerAddressData, GetV1TokensErc20ByOwnerAddressResponse, GetV1TokensErc721ByOwnerAddressData, @@ -77,10 +78,14 @@ import type { GetV1TokensErc1155ByOwnerAddressResponse, GetV1TokensLookupData, GetV1TokensLookupResponse, + GetV1TokensOwnersData, + GetV1TokensOwnersError, + GetV1TokensOwnersResponse, GetV1TokensPriceData, GetV1TokensPriceResponse, GetV1TokensPriceSupportedData, GetV1TokensPriceSupportedResponse, + GetV1TokensResponse, GetV1TokensTransfersByContractAddressData, GetV1TokensTransfersByContractAddressError, GetV1TokensTransfersByContractAddressResponse, @@ -111,12 +116,6 @@ import type { PostV1DecodeByContractAddressData, PostV1DecodeByContractAddressError, PostV1DecodeByContractAddressResponse, - PostV1WebhooksByWebhookIdResendOtpData, - PostV1WebhooksByWebhookIdResendOtpError, - PostV1WebhooksByWebhookIdResendOtpResponse, - PostV1WebhooksByWebhookIdVerifyData, - PostV1WebhooksByWebhookIdVerifyError, - PostV1WebhooksByWebhookIdVerifyResponse, PostV1WebhooksData, PostV1WebhooksError, PostV1WebhooksResponse, @@ -156,16 +155,7 @@ export const getV1Webhooks = ( >({ security: [ { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-secret-key", type: "apiKey", }, ], @@ -176,7 +166,7 @@ export const getV1Webhooks = ( /** * Create webhook - * Create a new webhook. The webhook will start out as suspended and an OTP code will be sent to the webhook URL. This OTP code must be verified using the Verify Webhook endpoint within 15 minutes. + * Create a new webhook. In order to receive decoded data, specify a partial ABI in the filters. */ export const postV1Webhooks = ( options?: Options, @@ -188,16 +178,7 @@ export const postV1Webhooks = ( >({ security: [ { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-secret-key", type: "apiKey", }, ], @@ -226,16 +207,7 @@ export const deleteV1WebhooksByWebhookId = < >({ security: [ { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-secret-key", type: "apiKey", }, ], @@ -246,7 +218,7 @@ export const deleteV1WebhooksByWebhookId = < /** * Update webhook - * Update a webhook. If the URL is updated, it needs to verified again the same way as when creating a webhook. + * Update a webhook. */ export const patchV1WebhooksByWebhookId = < ThrowOnError extends boolean = false, @@ -260,16 +232,7 @@ export const patchV1WebhooksByWebhookId = < >({ security: [ { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-secret-key", type: "apiKey", }, ], @@ -282,74 +245,6 @@ export const patchV1WebhooksByWebhookId = < }); }; -/** - * Verify webhook - * Verify a webhook using a OTP code that was sent to the webhook URL. The webhook will be activated after verification. - */ -export const postV1WebhooksByWebhookIdVerify = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => { - return (options.client ?? _heyApiClient).post< - PostV1WebhooksByWebhookIdVerifyResponse, - PostV1WebhooksByWebhookIdVerifyError, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, - ], - url: "/v1/webhooks/{webhook_id}/verify", - ...options, - }); -}; - -/** - * Resend OTP code - * Resend a OTP code to the webhook URL. This will invalidate the old OTP and will again expire after 15 minutes. - */ -export const postV1WebhooksByWebhookIdResendOtp = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => { - return (options.client ?? _heyApiClient).post< - PostV1WebhooksByWebhookIdResendOtpResponse, - PostV1WebhooksByWebhookIdResendOtpError, - ThrowOnError - >({ - security: [ - { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, - ], - url: "/v1/webhooks/{webhook_id}/resend-otp", - ...options, - }); -}; - /** * Test webhook * Test your webhook URL. This will send a test event to the webhook URL signed with an example secret 'test123'. NB! The payload does not necessarily match your webhook filters. You can however use it to test signature verification and payload format handling. @@ -364,16 +259,7 @@ export const postV1WebhooksTest = ( >({ security: [ { - name: "x-client-id", - type: "apiKey", - }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-secret-key", type: "apiKey", }, ], @@ -403,15 +289,6 @@ export const getV1Events = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/events", ...options, @@ -437,15 +314,6 @@ export const getV1EventsByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/events/{contractAddress}", ...options, @@ -471,15 +339,6 @@ export const getV1EventsByContractAddressBySignature = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/events/{contractAddress}/{signature}", ...options, @@ -503,15 +362,6 @@ export const getV1Transactions = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/transactions", ...options, @@ -537,15 +387,6 @@ export const getV1TransactionsByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/transactions/{contractAddress}", ...options, @@ -574,17 +415,31 @@ export const getV1TransactionsByContractAddressBySignature = < name: "x-client-id", type: "apiKey", }, + ], + url: "/v1/transactions/{contractAddress}/{signature}", + ...options, + }); +}; + +/** + * Get token owners by contract + * Get token owners for specific contract + */ +export const getV1TokensOwners = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensOwnersResponse, + GetV1TokensOwnersError, + ThrowOnError + >({ + security: [ { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-client-id", type: "apiKey", }, ], - url: "/v1/transactions/{contractAddress}/{signature}", + url: "/v1/tokens/owners", ...options, }); }; @@ -611,15 +466,6 @@ export const getV1TokensTransfersTransactionByTransactionHash = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/transfers/transaction/{transaction_hash}", ...options, @@ -645,15 +491,6 @@ export const getV1TokensTransfersByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/transfers/{contract_address}", ...options, @@ -661,13 +498,13 @@ export const getV1TokensTransfersByContractAddress = < }; /** - * Get token transfers by wallet address - * Get token transfers by wallet address + * Get token transfers + * Get token transfers */ export const getV1TokensTransfers = ( - options: Options, + options?: Options, ) => { - return (options.client ?? _heyApiClient).get< + return (options?.client ?? _heyApiClient).get< GetV1TokensTransfersResponse, GetV1TokensTransfersError, ThrowOnError @@ -677,15 +514,6 @@ export const getV1TokensTransfers = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/transfers", ...options, @@ -693,8 +521,9 @@ export const getV1TokensTransfers = ( }; /** + * @deprecated * Get ERC-20 balances by address - * Get ERC-20 balances for a given address + * Get ERC-20 balances for a given address. [BEING DEPRECATED IN FAVOR OF /tokens] */ export const getV1TokensErc20ByOwnerAddress = < ThrowOnError extends boolean = false, @@ -711,17 +540,31 @@ export const getV1TokensErc20ByOwnerAddress = < name: "x-client-id", type: "apiKey", }, + ], + url: "/v1/tokens/erc20/{ownerAddress}", + ...options, + }); +}; + +/** + * Get tokens + * Query tokens + */ +export const getV1Tokens = ( + options: Options, +) => { + return (options.client ?? _heyApiClient).get< + GetV1TokensResponse, + unknown, + ThrowOnError + >({ + security: [ { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", + name: "x-client-id", type: "apiKey", }, ], - url: "/v1/tokens/erc20/{ownerAddress}", + url: "/v1/tokens", ...options, }); }; @@ -746,15 +589,6 @@ export const getV1TokensErc721ByOwnerAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/erc721/{ownerAddress}", ...options, @@ -781,15 +615,6 @@ export const getV1TokensErc1155ByOwnerAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/erc1155/{ownerAddress}", ...options, @@ -813,15 +638,6 @@ export const getV1TokensPriceSupported = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/price/supported", ...options, @@ -845,15 +661,6 @@ export const getV1TokensPrice = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/price", ...options, @@ -877,15 +684,6 @@ export const getV1TokensLookup = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/tokens/lookup", ...options, @@ -909,15 +707,6 @@ export const getV1ResolveByInput = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/resolve/{input}", ...options, @@ -941,15 +730,6 @@ export const getV1Blocks = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/blocks", ...options, @@ -975,15 +755,6 @@ export const getV1ContractsAbiByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/contracts/abi/{contractAddress}", ...options, @@ -1009,15 +780,6 @@ export const getV1ContractsMetadataByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/contracts/metadata/{contractAddress}", ...options, @@ -1043,15 +805,6 @@ export const postV1DecodeByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/decode/{contractAddress}", ...options, @@ -1081,15 +834,6 @@ export const getV1NftsBalanceByOwnerAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/balance/{ownerAddress}", ...options, @@ -1115,15 +859,6 @@ export const getV1NftsCollectionsByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/collections/{contract_address}", ...options, @@ -1131,8 +866,8 @@ export const getV1NftsCollectionsByContractAddress = < }; /** - * Get NFTs by owner - * Get NFTs by owner + * Get NFTs + * Get NFTs */ export const getV1Nfts = ( options: Options, @@ -1147,15 +882,6 @@ export const getV1Nfts = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts", ...options, @@ -1181,15 +907,6 @@ export const getV1NftsOwnersByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/owners/{contract_address}", ...options, @@ -1215,15 +932,6 @@ export const getV1NftsOwnersByContractAddressByTokenId = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/owners/{contract_address}/{token_id}", ...options, @@ -1231,13 +939,13 @@ export const getV1NftsOwnersByContractAddressByTokenId = < }; /** - * Get NFT transfers by owner - * Get NFT transfers by owner + * Get NFT transfers + * Get NFT transfers */ export const getV1NftsTransfers = ( - options: Options, + options?: Options, ) => { - return (options.client ?? _heyApiClient).get< + return (options?.client ?? _heyApiClient).get< GetV1NftsTransfersResponse, GetV1NftsTransfersError, ThrowOnError @@ -1247,15 +955,6 @@ export const getV1NftsTransfers = ( name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/transfers", ...options, @@ -1284,15 +983,6 @@ export const getV1NftsTransfersTransactionByTransactionHash = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/transfers/transaction/{transaction_hash}", ...options, @@ -1318,15 +1008,6 @@ export const getV1NftsTransfersByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/transfers/{contract_address}", ...options, @@ -1352,15 +1033,6 @@ export const getV1NftsByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/{contract_address}", ...options, @@ -1389,15 +1061,6 @@ export const getV1NftsTransfersByContractAddressByTokenId = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/transfers/{contract_address}/{token_id}", ...options, @@ -1423,15 +1086,6 @@ export const getV1NftsByContractAddressByTokenId = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/{contract_address}/{token_id}", ...options, @@ -1457,15 +1111,6 @@ export const getV1NftsMetadataRefreshByContractAddress = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/metadata/refresh/{contract_address}", ...options, @@ -1494,15 +1139,6 @@ export const getV1NftsMetadataRefreshByContractAddressByTokenId = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}", ...options, @@ -1528,15 +1164,6 @@ export const getV1WalletsByWalletAddressTransactions = < name: "x-client-id", type: "apiKey", }, - { - scheme: "bearer", - type: "http", - }, - { - in: "query", - name: "clientId", - type: "apiKey", - }, ], url: "/v1/wallets/{wallet_address}/transactions", ...options, diff --git a/packages/insight/src/client/types.gen.ts b/packages/insight/src/client/types.gen.ts index 3de4df45396..4f159bf880d 100644 --- a/packages/insight/src/client/types.gen.ts +++ b/packages/insight/src/client/types.gen.ts @@ -1,4319 +1,4742 @@ // 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; - webhook_url: string; - webhook_secret: string; - filters: string | number | boolean | unknown | {} | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }>; - }; + /** + * 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]; +export type GetV1WebhooksResponse = GetV1WebhooksResponses[keyof GetV1WebhooksResponses]; export type PostV1WebhooksData = { - body?: { - webhook_url: string; - filters: { - "v1.events"?: { - chain_ids?: Array; - addresses?: Array; - signatures?: Array<{ - sig_hash: string; - abi?: string; - params?: {}; - }>; - }; - "v1.transactions"?: { - chain_ids?: Array; - from_addresses?: Array; - to_addresses?: Array; - signatures?: Array<{ - sig_hash: string; - abi?: string; - params?: Array; - }>; - }; + 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"; + path?: never; + query?: never; + url: '/v1/webhooks'; }; export type PostV1WebhooksErrors = { - /** - * Bad request - */ - 400: { - 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]; +export type PostV1WebhooksError = PostV1WebhooksErrors[keyof PostV1WebhooksErrors]; export type PostV1WebhooksResponses = { - /** - * Successful response - */ - 200: { - data: { - id: string; - team_id: string; - project_id: string; - webhook_url: string; - webhook_secret: string; - filters: string | number | boolean | unknown | {} | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }; - }; + /** + * 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]; +export type PostV1WebhooksResponse = 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]; +export type DeleteV1WebhooksByWebhookIdError = DeleteV1WebhooksByWebhookIdErrors[keyof DeleteV1WebhooksByWebhookIdErrors]; export type DeleteV1WebhooksByWebhookIdResponses = { - /** - * Successful response - */ - 200: { - data: { - id: string; - team_id: string; - project_id: string; - webhook_url: string; - webhook_secret: string; - filters: string | number | boolean | unknown | {} | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }; - }; + /** + * 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]; +export type DeleteV1WebhooksByWebhookIdResponse = DeleteV1WebhooksByWebhookIdResponses[keyof DeleteV1WebhooksByWebhookIdResponses]; export type PatchV1WebhooksByWebhookIdData = { - body?: { - webhook_url?: string; - filters?: { - "v1.events"?: { - chain_ids?: Array; - addresses?: Array; - signatures?: Array<{ - sig_hash: string; - abi?: string; - params?: {}; - }>; - }; - "v1.transactions"?: { - chain_ids?: Array; - from_addresses?: Array; - to_addresses?: Array; - signatures?: Array<{ - sig_hash: string; - abi?: string; - params?: Array; - }>; - }; - }; - disabled?: boolean; - }; - path: { - webhook_id: string; - }; - query?: never; - url: "/v1/webhooks/{webhook_id}"; + 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]; +export type PatchV1WebhooksByWebhookIdError = PatchV1WebhooksByWebhookIdErrors[keyof PatchV1WebhooksByWebhookIdErrors]; export type PatchV1WebhooksByWebhookIdResponses = { - /** - * Successful response - */ - 200: { - data: { - id: string; - team_id: string; - project_id: string; - webhook_url: string; - webhook_secret: string; - filters: string | number | boolean | unknown | {} | Array; - suspended_at: string | null; - suspended_reason: string | null; - disabled: boolean; - created_at: string; - updated_at: string | null; - }; - }; -}; - -export type PatchV1WebhooksByWebhookIdResponse = - PatchV1WebhooksByWebhookIdResponses[keyof PatchV1WebhooksByWebhookIdResponses]; - -export type PostV1WebhooksByWebhookIdVerifyData = { - body?: never; - path: { - webhook_id: string; - }; - query: { - otp: string; - }; - url: "/v1/webhooks/{webhook_id}/verify"; -}; - -export type PostV1WebhooksByWebhookIdVerifyErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Webhook not found - */ - 404: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; -}; - -export type PostV1WebhooksByWebhookIdVerifyError = - PostV1WebhooksByWebhookIdVerifyErrors[keyof PostV1WebhooksByWebhookIdVerifyErrors]; - -export type PostV1WebhooksByWebhookIdVerifyResponses = { - /** - * Successful response - */ - 200: { - success: boolean; - }; -}; - -export type PostV1WebhooksByWebhookIdVerifyResponse = - PostV1WebhooksByWebhookIdVerifyResponses[keyof PostV1WebhooksByWebhookIdVerifyResponses]; - -export type PostV1WebhooksByWebhookIdResendOtpData = { - body?: never; - path: { - webhook_id: string; - }; - query?: never; - url: "/v1/webhooks/{webhook_id}/resend-otp"; -}; - -export type PostV1WebhooksByWebhookIdResendOtpErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Webhook not found - */ - 404: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; -}; - -export type PostV1WebhooksByWebhookIdResendOtpError = - PostV1WebhooksByWebhookIdResendOtpErrors[keyof PostV1WebhooksByWebhookIdResendOtpErrors]; - -export type PostV1WebhooksByWebhookIdResendOtpResponses = { - /** - * OTP code resent successfully - */ - 200: { - success: boolean; - }; + /** + * 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 PostV1WebhooksByWebhookIdResendOtpResponse = - PostV1WebhooksByWebhookIdResendOtpResponses[keyof PostV1WebhooksByWebhookIdResendOtpResponses]; +export type PatchV1WebhooksByWebhookIdResponse = 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; - }; -}; - -export type PostV1WebhooksTestError = - PostV1WebhooksTestErrors[keyof PostV1WebhooksTestErrors]; - -export type PostV1WebhooksTestResponses = { - /** - * Test event sent successfully - */ - 200: { - success: boolean; - }; -}; - -export type PostV1WebhooksTestResponse = - PostV1WebhooksTestResponses[keyof PostV1WebhooksTestResponses]; - -export type GetV1EventsData = { - body?: never; - path?: never; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_transaction_hash?: string; /** - * Filter by log index + * Bad request */ - 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; + 400: { + error: string; + }; /** - * Filter by topic 2 + * Rate limit exceeded */ - filter_topic_2?: string; + 429: { + error: string; + }; /** - * Filter by topic 3 + * Internal server error */ - filter_topic_3?: string; + 500: { + error: string; + }; +}; + +export type PostV1WebhooksTestError = PostV1WebhooksTestErrors[keyof PostV1WebhooksTestErrors]; + +export type PostV1WebhooksTestResponses = { /** - * Filter by topic 0 + * Test event sent successfully */ - filter_topic_0?: string; + 200: { + success: boolean; + }; +}; + +export type PostV1WebhooksTestResponse = 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; + /** + * Filter by address + */ + filter_address?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: '/v1/events'; +}; + +export type GetV1EventsErrors = { /** - * Filter by address + * Bad request */ - filter_address?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/events"; -}; - -export type GetV1EventsErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; export type GetV1EventsError = GetV1EventsErrors[keyof GetV1EventsErrors]; export type GetV1EventsResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - transaction_hash: string; - transaction_index: number; - log_index: number; - address: string; - data: string; - topics: Array; - decoded?: { - name: string; - signature: string; - indexed_params: { - [key: string]: unknown; - }; - non_indexed_params: { - [key: string]: unknown; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + decoded?: { + name: string; + signature: string; + indexed_params: { + [key: string]: unknown; + }; + non_indexed_params: { + [key: string]: unknown; + }; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; }; - }; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + }; }; -export type GetV1EventsResponse = - GetV1EventsResponses[keyof GetV1EventsResponses]; +export type GetV1EventsResponse = GetV1EventsResponses[keyof GetV1EventsResponses]; export type GetV1EventsByContractAddressData = { - body?: never; - path: { - contractAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_transaction_hash?: string; - /** - * Filter by log index - */ - filter_log_index?: number | null; - /** - * Filter by log index greater than or equal to - */ - filter_log_index_gte?: number | null; - /** - * Filter by log index greater than - */ - filter_log_index_gt?: number | null; - /** - * Filter by log index less than or equal to - */ - filter_log_index_lte?: number | null; - /** - * Filter by log index less than - */ - filter_log_index_lt?: number | null; - /** - * Filter by topic 1 - */ - filter_topic_1?: string; - /** - * Filter by topic 2 - */ - filter_topic_2?: string; - /** - * Filter by topic 3 - */ - filter_topic_3?: string; + body?: never; + path: { + 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}'; +}; + +export type GetV1EventsByContractAddressErrors = { /** - * Filter by topic 0 + * Bad request */ - filter_topic_0?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/events/{contractAddress}"; -}; - -export type GetV1EventsByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1EventsByContractAddressError = - GetV1EventsByContractAddressErrors[keyof GetV1EventsByContractAddressErrors]; +export type GetV1EventsByContractAddressError = GetV1EventsByContractAddressErrors[keyof GetV1EventsByContractAddressErrors]; export type GetV1EventsByContractAddressResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - transaction_hash: string; - transaction_index: number; - log_index: number; - address: string; - data: string; - topics: Array; - decoded?: { - name: string; - signature: string; - indexed_params: { - [key: string]: unknown; - }; - non_indexed_params: { - [key: string]: unknown; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + decoded?: { + name: string; + signature: string; + indexed_params: { + [key: string]: unknown; + }; + non_indexed_params: { + [key: string]: unknown; + }; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; }; - }; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + }; }; -export type GetV1EventsByContractAddressResponse = - GetV1EventsByContractAddressResponses[keyof GetV1EventsByContractAddressResponses]; +export type GetV1EventsByContractAddressResponse = GetV1EventsByContractAddressResponses[keyof GetV1EventsByContractAddressResponses]; export type GetV1EventsByContractAddressBySignatureData = { - body?: never; - path: { - contractAddress: string; - signature: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_transaction_hash?: string; - /** - * Filter by log index - */ - filter_log_index?: number | null; - /** - * Filter by log index greater than or equal to - */ - filter_log_index_gte?: number | null; - /** - * Filter by log index greater than - */ - filter_log_index_gt?: number | null; - /** - * Filter by log index less than or equal to - */ - filter_log_index_lte?: number | null; - /** - * Filter by log index less than - */ - filter_log_index_lt?: number | null; - /** - * Filter by topic 1 - */ - filter_topic_1?: string; - /** - * Filter by topic 2 - */ - filter_topic_2?: string; + body?: never; + path: { + 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}'; +}; + +export type GetV1EventsByContractAddressBySignatureErrors = { /** - * Filter by topic 3 + * Bad request */ - filter_topic_3?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/events/{contractAddress}/{signature}"; -}; - -export type GetV1EventsByContractAddressBySignatureErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1EventsByContractAddressBySignatureError = - GetV1EventsByContractAddressBySignatureErrors[keyof GetV1EventsByContractAddressBySignatureErrors]; +export type GetV1EventsByContractAddressBySignatureError = GetV1EventsByContractAddressBySignatureErrors[keyof GetV1EventsByContractAddressBySignatureErrors]; export type GetV1EventsByContractAddressBySignatureResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - transaction_hash: string; - transaction_index: number; - log_index: number; - address: string; - data: string; - topics: Array; - decoded?: { - name: string; - signature: string; - indexed_params: { - [key: string]: unknown; - }; - non_indexed_params: { - [key: string]: unknown; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + decoded?: { + name: string; + signature: string; + indexed_params: { + [key: string]: unknown; + }; + non_indexed_params: { + [key: string]: unknown; + }; + }; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; }; - }; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + }; }; -export type GetV1EventsByContractAddressBySignatureResponse = - GetV1EventsByContractAddressBySignatureResponses[keyof GetV1EventsByContractAddressBySignatureResponses]; +export type GetV1EventsByContractAddressBySignatureResponse = GetV1EventsByContractAddressBySignatureResponses[keyof GetV1EventsByContractAddressBySignatureResponses]; export type GetV1TransactionsData = { - body?: never; - path?: never; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_hash?: string; - /** - * Filter by from address - */ - filter_from_address?: string; - /** - * Filter by value - */ - filter_value?: number | null; - /** - * Filter by value greater than or equal to - */ - filter_value_gte?: number | null; - /** - * Filter by value greater than - */ - filter_value_gt?: number | null; - /** - * Filter by value less than or equal to - */ - filter_value_lte?: number | null; - /** - * Filter by value less than - */ - filter_value_lt?: number | null; - /** - * Filter by gas price - */ - filter_gas_price?: number | null; - /** - * Filter by gas price greater than or equal to - */ - filter_gas_price_gte?: number | null; - /** - * Filter by gas price greater than - */ - filter_gas_price_gt?: number | null; - /** - * Filter by gas price less than or equal to - */ - filter_gas_price_lte?: number | null; - /** - * Filter by gas price less than - */ - filter_gas_price_lt?: number | null; - /** - * Filter by gas - */ - filter_gas?: number | null; - /** - * Filter by gas greater than or equal to - */ - filter_gas_gte?: number | null; - /** - * Filter by gas greater than - */ - filter_gas_gt?: number | null; - /** - * Filter by gas less than or equal to - */ - filter_gas_lte?: number | null; - /** - * Filter by gas less than - */ - filter_gas_lt?: number | null; - /** - * Filter by function selector - */ - filter_function_selector?: string; + 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; + /** + * Filter by from address + */ + filter_from_address?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * Filter by function selector + */ + filter_function_selector?: string; + /** + * Filter by to address + */ + filter_to_address?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: '/v1/transactions'; +}; + +export type GetV1TransactionsErrors = { /** - * Filter by to address + * Bad request */ - filter_to_address?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/transactions"; -}; - -export type GetV1TransactionsErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1TransactionsError = - GetV1TransactionsErrors[keyof GetV1TransactionsErrors]; +export type GetV1TransactionsError = GetV1TransactionsErrors[keyof GetV1TransactionsErrors]; export type GetV1TransactionsResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: number; - gas_price: number; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; - transaction_type: number; - r: number; - s: number; - v: number; - access_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: number; - blob_gas_used?: number; - blob_gas_price?: number; - logs_bloom?: string; - status?: number; - decoded?: { - name: string; - signature: string; - inputs?: {}; - }; - /** - * @deprecated - */ - decodedData?: { - name: string; - signature: string; - inputs?: {}; - }; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: { + [key: string]: unknown; + }; + }; + /** + * @deprecated + */ + decodedData?: { + 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]; +export type GetV1TransactionsResponse = GetV1TransactionsResponses[keyof GetV1TransactionsResponses]; export type GetV1TransactionsByContractAddressData = { - body?: never; - path: { - contractAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_hash?: string; - /** - * Filter by from address - */ - filter_from_address?: string; - /** - * Filter by value - */ - filter_value?: number | null; - /** - * Filter by value greater than or equal to - */ - filter_value_gte?: number | null; - /** - * Filter by value greater than - */ - filter_value_gt?: number | null; - /** - * Filter by value less than or equal to - */ - filter_value_lte?: number | null; - /** - * Filter by value less than - */ - filter_value_lt?: number | null; - /** - * Filter by gas price - */ - filter_gas_price?: number | null; - /** - * Filter by gas price greater than or equal to - */ - filter_gas_price_gte?: number | null; - /** - * Filter by gas price greater than - */ - filter_gas_price_gt?: number | null; - /** - * Filter by gas price less than or equal to - */ - filter_gas_price_lte?: number | null; - /** - * Filter by gas price less than - */ - filter_gas_price_lt?: number | null; - /** - * Filter by gas - */ - filter_gas?: number | null; - /** - * Filter by gas greater than or equal to - */ - filter_gas_gte?: number | null; - /** - * Filter by gas greater than - */ - filter_gas_gt?: number | null; - /** - * Filter by gas less than or equal to - */ - filter_gas_lte?: number | null; - /** - * Filter by gas less than - */ - filter_gas_lt?: number | null; + body?: never; + path: { + 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; + /** + * Filter by from address + */ + filter_from_address?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * Filter by function selector + */ + filter_function_selector?: string; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: '/v1/transactions/{contractAddress}'; +}; + +export type GetV1TransactionsByContractAddressErrors = { /** - * Filter by function selector + * Bad request */ - filter_function_selector?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/transactions/{contractAddress}"; -}; - -export type GetV1TransactionsByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1TransactionsByContractAddressError = - GetV1TransactionsByContractAddressErrors[keyof GetV1TransactionsByContractAddressErrors]; +export type GetV1TransactionsByContractAddressError = GetV1TransactionsByContractAddressErrors[keyof GetV1TransactionsByContractAddressErrors]; export type GetV1TransactionsByContractAddressResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: number; - gas_price: number; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; - transaction_type: number; - r: number; - s: number; - v: number; - access_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: number; - blob_gas_used?: number; - blob_gas_price?: number; - logs_bloom?: string; - status?: number; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + }>; + aggregations?: unknown; + meta: { + chain_ids: Array; + address?: string; + signature?: string; + page: number; + limit_per_chain: number; + total_items: number; + total_pages: number; + }; + }; }; -export type GetV1TransactionsByContractAddressResponse = - GetV1TransactionsByContractAddressResponses[keyof GetV1TransactionsByContractAddressResponses]; +export type GetV1TransactionsByContractAddressResponse = GetV1TransactionsByContractAddressResponses[keyof GetV1TransactionsByContractAddressResponses]; export type GetV1TransactionsByContractAddressBySignatureData = { - body?: never; - path: { - contractAddress: string; - signature: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_hash?: string; - /** - * Filter by from address - */ - filter_from_address?: string; - /** - * Filter by value - */ - filter_value?: number | null; - /** - * Filter by value greater than or equal to - */ - filter_value_gte?: number | null; - /** - * Filter by value greater than - */ - filter_value_gt?: number | null; - /** - * Filter by value less than or equal to - */ - filter_value_lte?: number | null; - /** - * Filter by value less than - */ - filter_value_lt?: number | null; - /** - * Filter by gas price - */ - filter_gas_price?: number | null; - /** - * Filter by gas price greater than or equal to - */ - filter_gas_price_gte?: number | null; - /** - * Filter by gas price greater than - */ - filter_gas_price_gt?: number | null; - /** - * Filter by gas price less than or equal to - */ - filter_gas_price_lte?: number | null; - /** - * Filter by gas price less than - */ - filter_gas_price_lt?: number | null; - /** - * Filter by gas - */ - filter_gas?: number | null; - /** - * Filter by gas greater than or equal to - */ - filter_gas_gte?: number | null; - /** - * Filter by gas greater than - */ - filter_gas_gt?: number | null; - /** - * Filter by gas less than or equal to - */ - filter_gas_lte?: number | null; + body?: never; + path: { + 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; + /** + * Filter by from address + */ + filter_from_address?: string; + /** + * Filter by value + */ + filter_value?: number | null; + /** + * Filter by value greater than or equal to + */ + filter_value_gte?: number | null; + /** + * Filter by value greater than + */ + filter_value_gt?: number | null; + /** + * Filter by value less than or equal to + */ + filter_value_lte?: number | null; + /** + * Filter by value less than + */ + filter_value_lt?: number | null; + /** + * Filter by gas price + */ + filter_gas_price?: number | null; + /** + * Filter by gas price greater than or equal to + */ + filter_gas_price_gte?: number | null; + /** + * Filter by gas price greater than + */ + filter_gas_price_gt?: number | null; + /** + * Filter by gas price less than or equal to + */ + filter_gas_price_lte?: number | null; + /** + * Filter by gas price less than + */ + filter_gas_price_lt?: number | null; + /** + * Filter by gas + */ + filter_gas?: number | null; + /** + * Filter by gas greater than or equal to + */ + filter_gas_gte?: number | null; + /** + * Filter by gas greater than + */ + filter_gas_gt?: number | null; + /** + * Filter by gas less than or equal to + */ + filter_gas_lte?: number | null; + /** + * Filter by gas less than + */ + filter_gas_lt?: number | null; + /** + * The number of items to return + */ + limit?: number; + page?: number | null; + }; + url: '/v1/transactions/{contractAddress}/{signature}'; +}; + +export type GetV1TransactionsByContractAddressBySignatureErrors = { /** - * Filter by gas less than + * Bad request */ - filter_gas_lt?: number | null; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/transactions/{contractAddress}/{signature}"; -}; - -export type GetV1TransactionsByContractAddressBySignatureErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1TransactionsByContractAddressBySignatureError = - GetV1TransactionsByContractAddressBySignatureErrors[keyof GetV1TransactionsByContractAddressBySignatureErrors]; +export type GetV1TransactionsByContractAddressBySignatureError = GetV1TransactionsByContractAddressBySignatureErrors[keyof GetV1TransactionsByContractAddressBySignatureErrors]; export type GetV1TransactionsByContractAddressBySignatureResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: number; - gas_price: number; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; - transaction_type: number; - r: number; - s: number; - v: number; - access_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: number; - blob_gas_used?: number; - blob_gas_price?: number; - logs_bloom?: string; - status?: number; - decoded?: { - name: string; - signature: string; - inputs?: {}; - }; - /** - * @deprecated - */ - decodedData?: { - name: string; - signature: string; - inputs?: {}; - }; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: { + [key: string]: unknown; + }; + }; + /** + * @deprecated + */ + decodedData?: { + 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]; +export type GetV1TransactionsByContractAddressBySignatureResponse = GetV1TransactionsByContractAddressBySignatureResponses[keyof GetV1TransactionsByContractAddressBySignatureResponses]; -export type GetV1TokensTransfersTransactionByTransactionHashData = { - body?: never; - path: { - transaction_hash: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; +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; + contract_address: string; + }; + url: '/v1/tokens/owners'; +}; + +export type GetV1TokensOwnersErrors = { /** - * The number of items to return + * Bad request */ - limit?: number; - page?: number | null; + 400: { + error: string; + }; /** - * Whether to include metadata for the tokens + * Not found */ - metadata?: "true" | "false"; + 404: unknown; /** - * Whether to include sale details for NFT transfers + * Internal server error */ - sales?: "true" | "false"; + 500: { + error: string; + }; +}; + +export type GetV1TokensOwnersError = GetV1TokensOwnersErrors[keyof GetV1TokensOwnersErrors]; + +export type GetV1TokensOwnersResponses = { /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Success */ - include_owners?: "true" | "false"; - }; - url: "/v1/tokens/transfers/transaction/{transaction_hash}"; + 200: { + data: Array<{ + chain_id: string; + token_address: string; + owner_address: string; + balance: string; + }>; + }; +}; + +export type GetV1TokensOwnersResponse = 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 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'; + /** + * 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; - }; - }>; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: 'mint' | 'sale' | 'transfer'; + token_type: 'erc20'; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; }; -export type GetV1TokensTransfersTransactionByTransactionHashError = - GetV1TokensTransfersTransactionByTransactionHashErrors[keyof GetV1TokensTransfersTransactionByTransactionHashErrors]; +export type GetV1TokensTransfersTransactionByTransactionHashError = GetV1TokensTransfersTransactionByTransactionHashErrors[keyof GetV1TokensTransfersTransactionByTransactionHashErrors]; export type GetV1TokensTransfersTransactionByTransactionHashResponses = { - /** - * Success - */ - 200: { - data: Array<{ - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: "erc20"; - amount: string; - chain_id: number; - token_metadata?: { - name?: string; - symbol?: string; - decimals?: number; - }; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: 'mint' | 'sale' | 'transfer'; + token_type: 'erc20'; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; }; -export type GetV1TokensTransfersTransactionByTransactionHashResponse = - GetV1TokensTransfersTransactionByTransactionHashResponses[keyof GetV1TokensTransfersTransactionByTransactionHashResponses]; +export type GetV1TokensTransfersTransactionByTransactionHashResponse = GetV1TokensTransfersTransactionByTransactionHashResponses[keyof GetV1TokensTransfersTransactionByTransactionHashResponses]; export type GetV1TokensTransfersByContractAddressData = { - body?: never; - path: { - contract_address: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include sale details for NFT transfers - */ - sales?: "true" | "false"; - /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) - */ - include_owners?: "true" | "false"; - }; - url: "/v1/tokens/transfers/{contract_address}"; + body?: never; + path: { + 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 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/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; - }; - }>; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: 'mint' | 'sale' | 'transfer'; + token_type: 'erc20'; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; }; -export type GetV1TokensTransfersByContractAddressError = - GetV1TokensTransfersByContractAddressErrors[keyof GetV1TokensTransfersByContractAddressErrors]; +export type GetV1TokensTransfersByContractAddressError = GetV1TokensTransfersByContractAddressErrors[keyof GetV1TokensTransfersByContractAddressErrors]; export type GetV1TokensTransfersByContractAddressResponses = { - /** - * Success - */ - 200: { - data: Array<{ - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: "erc20"; - amount: string; - chain_id: number; - token_metadata?: { - name?: string; - symbol?: string; - decimals?: number; - }; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: 'mint' | 'sale' | 'transfer'; + token_type: 'erc20'; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; }; -export type GetV1TokensTransfersByContractAddressResponse = - GetV1TokensTransfersByContractAddressResponses[keyof GetV1TokensTransfersByContractAddressResponses]; +export type GetV1TokensTransfersByContractAddressResponse = GetV1TokensTransfersByContractAddressResponses[keyof GetV1TokensTransfersByContractAddressResponses]; export type GetV1TokensTransfersData = { - body?: never; - path?: never; - query: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; - /** - * Whether to include sale details for NFT transfers - */ - sales?: "true" | "false"; - /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) - */ - include_owners?: "true" | "false"; - owner_address: string; - }; - url: "/v1/tokens/transfers"; + 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 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'; + /** + * 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; + /** + * The types of tokens to include in the response. Can be an empty array to include all types + */ + token_types?: Array<'erc1155' | 'erc721' | 'erc20'>; + owner_address?: string; + }; + url: '/v1/tokens/transfers'; }; export type GetV1TokensTransfersErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - data: Array<{ - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: "erc20"; - amount: string; - chain_id: number; - token_metadata?: { - name?: string; - symbol?: string; - decimals?: number; - }; - }>; - }; + /** + * Not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: 'mint' | 'sale' | 'transfer'; + token_type: 'erc20'; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; }; -export type GetV1TokensTransfersError = - GetV1TokensTransfersErrors[keyof GetV1TokensTransfersErrors]; +export type GetV1TokensTransfersError = GetV1TokensTransfersErrors[keyof GetV1TokensTransfersErrors]; export type GetV1TokensTransfersResponses = { - /** - * Success - */ - 200: { - data: Array<{ - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: "erc20"; - amount: string; - chain_id: number; - token_metadata?: { - name?: string; - symbol?: string; - decimals?: number; - }; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + block_number: string; + block_hash?: string; + block_timestamp: string; + transaction_hash: string; + from_address: string; + to_address: string; + log_index: number; + contract_address: string; + transfer_type: 'mint' | 'sale' | 'transfer'; + token_type: 'erc20'; + amount: string; + chain_id: number; + token_metadata?: { + name?: string; + symbol?: string; + decimals?: number; + }; + }>; + }; }; -export type GetV1TokensTransfersResponse = - GetV1TokensTransfersResponses[keyof GetV1TokensTransfersResponses]; +export type GetV1TokensTransfersResponse = GetV1TokensTransfersResponses[keyof GetV1TokensTransfersResponses]; export type GetV1TokensErc20ByOwnerAddressData = { - body?: never; - path: { - ownerAddress: string; - }; - query?: { + body?: never; + path: { + 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}'; +}; + +export type GetV1TokensErc20ByOwnerAddressErrors = { /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Bad request */ - chain?: Array | (number | null) | unknown; + 400: unknown; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; + 500: unknown; +}; + +export type GetV1TokensErc20ByOwnerAddressResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + balance: string; + name?: string; + symbol?: string; + decimals?: number; + }>; + }; +}; + +export type GetV1TokensErc20ByOwnerAddressResponse = GetV1TokensErc20ByOwnerAddressResponses[keyof GetV1TokensErc20ByOwnerAddressResponses]; + +export type 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'; + owner_address: string; + /** + * Whether to include native tokens + */ + include_native?: 'true' | 'false'; + }; + url: '/v1/tokens'; +}; + +export type GetV1TokensErrors = { /** - * Whether to include metadata for the tokens + * Bad request */ - metadata?: "true" | "false"; + 400: unknown; /** - * Whether to include spam tokens + * Internal server error */ - include_spam?: "true" | "false"; - }; - url: "/v1/tokens/erc20/{ownerAddress}"; -}; - -export type GetV1TokensErc20ByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + 500: unknown; }; -export type GetV1TokensErc20ByOwnerAddressResponses = { - /** - * Successful response - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - token_address: string; - balance: string; - name?: string; - symbol?: string; - decimals?: number; - }>; - }; +export type GetV1TokensResponses = { + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + balance: string; + name?: string; + symbol?: string; + decimals?: number; + }>; + }; }; -export type GetV1TokensErc20ByOwnerAddressResponse = - GetV1TokensErc20ByOwnerAddressResponses[keyof GetV1TokensErc20ByOwnerAddressResponses]; +export type GetV1TokensResponse = GetV1TokensResponses[keyof GetV1TokensResponses]; export type GetV1TokensErc721ByOwnerAddressData = { - body?: never; - path: { - ownerAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; + body?: never; + path: { + 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}'; +}; + +export type GetV1TokensErc721ByOwnerAddressErrors = { /** - * The number of items to return + * Bad request */ - limit?: number; - page?: number | null; + 400: unknown; /** - * Whether to include metadata for the tokens + * Internal server error */ - metadata?: "true" | "false"; - }; - url: "/v1/tokens/erc721/{ownerAddress}"; -}; - -export type GetV1TokensErc721ByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + 500: unknown; }; export type GetV1TokensErc721ByOwnerAddressResponses = { - /** - * Successful response - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - token_address: string; - token_id: string; - balance: string; - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + token_id: string; + balance: string; + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: { + [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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }>; + }; }; -export type GetV1TokensErc721ByOwnerAddressResponse = - GetV1TokensErc721ByOwnerAddressResponses[keyof GetV1TokensErc721ByOwnerAddressResponses]; +export type GetV1TokensErc721ByOwnerAddressResponse = GetV1TokensErc721ByOwnerAddressResponses[keyof GetV1TokensErc721ByOwnerAddressResponses]; export type GetV1TokensErc1155ByOwnerAddressData = { - body?: never; - path: { - ownerAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; + body?: never; + path: { + 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}'; +}; + +export type GetV1TokensErc1155ByOwnerAddressErrors = { /** - * The number of items to return + * Bad request */ - limit?: number; - page?: number | null; + 400: unknown; /** - * Whether to include metadata for the tokens + * Internal server error */ - metadata?: "true" | "false"; - }; - url: "/v1/tokens/erc1155/{ownerAddress}"; -}; - -export type GetV1TokensErc1155ByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + 500: unknown; }; export type GetV1TokensErc1155ByOwnerAddressResponses = { - /** - * Successful response - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - token_address: string; - token_id: string; - balance: string; - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + token_id: string; + balance: string; + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: { + [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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }>; + }; }; -export type GetV1TokensErc1155ByOwnerAddressResponse = - GetV1TokensErc1155ByOwnerAddressResponses[keyof GetV1TokensErc1155ByOwnerAddressResponses]; +export type GetV1TokensErc1155ByOwnerAddressResponse = GetV1TokensErc1155ByOwnerAddressResponses[keyof GetV1TokensErc1155ByOwnerAddressResponses]; export type GetV1TokensPriceSupportedData = { - body?: never; - path?: never; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/tokens/price/supported"; + 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'; }; 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: string; - symbol?: string; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + symbol?: string; + }>; + }; }; -export type GetV1TokensPriceSupportedResponse = - GetV1TokensPriceSupportedResponses[keyof GetV1TokensPriceSupportedResponses]; +export type GetV1TokensPriceSupportedResponse = GetV1TokensPriceSupportedResponses[keyof GetV1TokensPriceSupportedResponses]; export type GetV1TokensPriceData = { - body?: never; - path?: never; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The address of the token to get the price for - */ - address?: Array | string; + 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'; +}; + +export type GetV1TokensPriceErrors = { /** - * The symbol of the token to get the price for + * Bad request */ - symbol?: Array | (string | null) | unknown; + 400: unknown; /** - * Timestamp in seconds or milliseconds + * Internal server error */ - timestamp?: number; - }; - url: "/v1/tokens/price"; -}; - -export type GetV1TokensPriceErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + 500: unknown; }; export type GetV1TokensPriceResponses = { - /** - * Successful response - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - symbol?: string; - /** - * Precise price in USD - */ - price_usd: number; - /** - * Price in USD cents - */ - price_usd_cents: number; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + address: string; + symbol?: string; + /** + * Precise price in USD + */ + price_usd: number; + /** + * Price in USD cents + */ + price_usd_cents: number; + /** + * 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]; +export type GetV1TokensPriceResponse = GetV1TokensPriceResponses[keyof GetV1TokensPriceResponses]; export type GetV1TokensLookupData = { - body?: never; - path?: never; - query: { + 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'; +}; + +export type GetV1TokensLookupErrors = { /** - * 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`. + * Bad request */ - symbol: Array | string; + 400: unknown; /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Internal server error */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/tokens/lookup"; -}; - -export type GetV1TokensLookupErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + 500: unknown; }; export type GetV1TokensLookupResponses = { - /** - * Successful response - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - token_address: string; - name?: string; - symbol?: string; - decimals?: number; - }>; - }; + /** + * Successful response + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + name?: string; + symbol?: string; + decimals?: number; + }>; + }; }; -export type GetV1TokensLookupResponse = - GetV1TokensLookupResponses[keyof GetV1TokensLookupResponses]; +export type GetV1TokensLookupResponse = GetV1TokensLookupResponses[keyof GetV1TokensLookupResponses]; export type GetV1ResolveByInputData = { - body?: never; - path: { + body?: never; + path: { + /** + * 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}'; +}; + +export type GetV1ResolveByInputErrors = { /** - * Can be a block number, transaction or block hash, address, event signature or function selector + * Bad request */ - input: string; - }; - query?: { + 400: { + error: string; + }; /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Internal server error */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/resolve/{input}"; -}; - -export type GetV1ResolveByInputErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1ResolveByInputError = - GetV1ResolveByInputErrors[keyof GetV1ResolveByInputErrors]; +export type GetV1ResolveByInputError = GetV1ResolveByInputErrors[keyof GetV1ResolveByInputErrors]; export type GetV1ResolveByInputResponses = { - /** - * Successful response - */ - 200: { - data?: { - blocks?: Array<{ - chain_id: number; - block_number: number; - block_hash: string; - parent_hash: string; - block_timestamp: number; - nonce: string; - sha3_uncles: string; - mix_hash: string; - miner: string; - state_root: string; - transactions_root: string; - receipts_root: string; - logs_bloom: string; - size: number; - extra_data: string; - difficulty: string; - total_difficulty: string; - transaction_count: number; - gas_limit: number; - gas_used: number; - withdrawals_root: string; - base_fee_per_gas: number; - }>; - transactions?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: number; - gas_price: number; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; - transaction_type: number; - r: number; - s: number; - v: number; - access_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: number; - blob_gas_used?: number; - blob_gas_price?: number; - logs_bloom?: string; - status?: number; - }>; - events?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - transaction_hash: string; - transaction_index: number; - log_index: number; - address: string; - data: string; - topics: Array; - }>; - type: - | "block" - | "transaction" - | "event_signature" - | "function_signature" - | "address" - | "contract" - | "unknown"; - }; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + /** + * Successful response + */ + 200: { + data?: { + blocks?: Array<{ + chain_id: number; + block_number: number; + block_hash: string; + parent_hash: string; + block_timestamp: number; + nonce: string; + sha3_uncles: string; + mix_hash: string; + miner: string; + state_root: string; + transactions_root: string; + receipts_root: string; + logs_bloom: string; + size: number; + extra_data: string; + difficulty: string; + total_difficulty: string; + transaction_count: number; + gas_limit: number; + gas_used: number; + withdrawals_root: string; + base_fee_per_gas: number; + }>; + transactions?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + }>; + events?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + transaction_hash: string; + transaction_index: number; + log_index: number; + address: string; + data: string; + topics: Array; + }>; + 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]; +export type GetV1ResolveByInputResponse = GetV1ResolveByInputResponses[keyof GetV1ResolveByInputResponses]; export type GetV1BlocksData = { - body?: never; - path?: never; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; + 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'; +}; + +export type GetV1BlocksErrors = { /** - * Filter by hash + * Bad request */ - filter_hash?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/blocks"; -}; - -export type GetV1BlocksErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 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]; +export type GetV1BlocksResponse = GetV1BlocksResponses[keyof GetV1BlocksResponses]; export type GetV1ContractsAbiByContractAddressData = { - body?: never; - path: { - contractAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/contracts/abi/{contractAddress}"; + body?: never; + path: { + 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}'; }; 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]; +export type GetV1ContractsAbiByContractAddressError = GetV1ContractsAbiByContractAddressErrors[keyof GetV1ContractsAbiByContractAddressErrors]; export type GetV1ContractsAbiByContractAddressResponses = { - /** - * Success - */ - 200: { - [key: string]: unknown; - }; + /** + * Success + */ + 200: { + [key: string]: unknown; + }; }; -export type GetV1ContractsAbiByContractAddressResponse = - GetV1ContractsAbiByContractAddressResponses[keyof GetV1ContractsAbiByContractAddressResponses]; +export type GetV1ContractsAbiByContractAddressResponse = GetV1ContractsAbiByContractAddressResponses[keyof GetV1ContractsAbiByContractAddressResponses]; export type GetV1ContractsMetadataByContractAddressData = { - body?: never; - path: { - contractAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/contracts/metadata/{contractAddress}"; + body?: never; + path: { + 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}'; }; 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]; +export type GetV1ContractsMetadataByContractAddressError = GetV1ContractsMetadataByContractAddressErrors[keyof GetV1ContractsMetadataByContractAddressErrors]; export type GetV1ContractsMetadataByContractAddressResponses = { - /** - * Success - */ - 200: { - [key: string]: unknown; - }; + /** + * Success + */ + 200: { + [key: string]: unknown; + }; }; -export type GetV1ContractsMetadataByContractAddressResponse = - GetV1ContractsMetadataByContractAddressResponses[keyof GetV1ContractsMetadataByContractAddressResponses]; +export type GetV1ContractsMetadataByContractAddressResponse = GetV1ContractsMetadataByContractAddressResponses[keyof GetV1ContractsMetadataByContractAddressResponses]; export type PostV1DecodeByContractAddressData = { - body?: { - transactions?: Array<{ - data: string; - }>; - logs?: Array<{ - data?: string; - topics: Array; - }>; - }; - path: { - contractAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/decode/{contractAddress}"; + body?: { + transactions?: Array<{ + data: string; + }>; + logs?: Array<{ + data?: string; + topics: Array; + }>; + }; + path: { + 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}'; }; 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]; +export type PostV1DecodeByContractAddressError = PostV1DecodeByContractAddressErrors[keyof PostV1DecodeByContractAddressErrors]; export type PostV1DecodeByContractAddressResponses = { - /** - * Success - */ - 200: { - data?: { - transactions?: Array<{ - data: string; - function_name?: string; - args?: Array; - }>; - logs?: Array<{ - data?: string; - topics: Array; - event_name?: string; - args?: Array; - }>; - }; - }; + /** + * Success + */ + 200: { + data?: { + transactions?: Array<{ + data: string; + function_name?: string; + args?: Array; + }>; + logs?: Array<{ + data?: string; + topics: Array; + event_name?: string; + args?: Array; + }>; + }; + }; }; -export type PostV1DecodeByContractAddressResponse = - PostV1DecodeByContractAddressResponses[keyof PostV1DecodeByContractAddressResponses]; +export type PostV1DecodeByContractAddressResponse = PostV1DecodeByContractAddressResponses[keyof PostV1DecodeByContractAddressResponses]; export type GetV1NftsBalanceByOwnerAddressData = { - body?: never; - path: { - ownerAddress: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; + body?: never; + path: { + 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}'; +}; + +export type GetV1NftsBalanceByOwnerAddressErrors = { /** - * Whether to include metadata for the tokens + * Bad request */ - metadata?: "true" | "false"; + 400: unknown; /** - * The types of NFTs to include in the response. Can be an empty array to include all types + * Internal server error */ - token_types?: Array<"erc1155" | "erc721">; - }; - url: "/v1/nfts/balance/{ownerAddress}"; -}; - -export type GetV1NftsBalanceByOwnerAddressErrors = { - /** - * Bad request - */ - 400: unknown; - /** - * Internal server error - */ - 500: unknown; + 500: unknown; }; export type GetV1NftsBalanceByOwnerAddressResponses = { - /** - * Success - */ - 200: { - data: Array<{ - /** - * The chain ID of a relevant entry - */ - chain_id: number; - token_address: string; - token_id: string; - balance: string; - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + /** + * The chain ID of a relevant entry + */ + chain_id: number; + token_address: string; + token_id: string; + balance: string; + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses?: Array; + extra_metadata?: { + [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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }>; + }; }; -export type GetV1NftsBalanceByOwnerAddressResponse = - GetV1NftsBalanceByOwnerAddressResponses[keyof GetV1NftsBalanceByOwnerAddressResponses]; +export type GetV1NftsBalanceByOwnerAddressResponse = GetV1NftsBalanceByOwnerAddressResponses[keyof GetV1NftsBalanceByOwnerAddressResponses]; export type GetV1NftsCollectionsByContractAddressData = { - body?: never; - path: { - contract_address: string; - }; - query?: { + body?: never; + path: { + 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}'; +}; + +export type GetV1NftsCollectionsByContractAddressErrors = { /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Bad request */ - chain?: Array | (number | null) | unknown; + 400: { + error: string; + }; /** - * Whether to include stats for the collection + * Internal server error */ - include_stats?: "true" | "false"; - }; - url: "/v1/nfts/collections/{contract_address}"; -}; - -export type GetV1NftsCollectionsByContractAddressErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsCollectionsByContractAddressError = - GetV1NftsCollectionsByContractAddressErrors[keyof GetV1NftsCollectionsByContractAddressErrors]; +export type GetV1NftsCollectionsByContractAddressError = GetV1NftsCollectionsByContractAddressErrors[keyof GetV1NftsCollectionsByContractAddressErrors]; export type GetV1NftsCollectionsByContractAddressResponses = { - /** - * Success - */ - 200: { - data: Array<{ - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - stats?: { - owner_count: number; - token_count: number; - mint_count: number; - total_quantity: number; - }; - }>; - }; + /** + * Success + */ + 200: { + data: Array<{ + name?: string; + description?: string; + image_url?: string; + banner_image_url?: string; + featured_image_url?: string; + external_link?: string; + stats?: { + owner_count: number; + token_count: number; + mint_count: number; + total_quantity: number; + }; + }>; + }; }; -export type GetV1NftsCollectionsByContractAddressResponse = - GetV1NftsCollectionsByContractAddressResponses[keyof GetV1NftsCollectionsByContractAddressResponses]; +export type GetV1NftsCollectionsByContractAddressResponse = GetV1NftsCollectionsByContractAddressResponses[keyof GetV1NftsCollectionsByContractAddressResponses]; export type GetV1NftsData = { - body?: never; - path?: never; - query: { + 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'; + owner_address: string; + }; + url: '/v1/nfts'; +}; + +export type GetV1NftsErrors = { /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Not found */ - chain?: Array | (number | null) | unknown; + 404: unknown; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - owner_address: string; - }; - url: "/v1/nfts"; -}; - -export type GetV1NftsErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; export type GetV1NftsError = GetV1NftsErrors[keyof GetV1NftsErrors]; export type GetV1NftsResponses = { - /** - * Success - */ - 200: { - data: Array<{ - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - chain_id: number; - contract_address: string; - token_id: string; - token_type: string; - balance?: string; - }>; - }; + /** + * 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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + chain_id: number; + contract_address: string; + token_id: string; + token_type: string; + balance?: string; + }>; + }; }; export type GetV1NftsResponse = GetV1NftsResponses[keyof GetV1NftsResponses]; export type GetV1NftsOwnersByContractAddressData = { - body?: never; - path: { - contract_address: string; - }; - query?: { + body?: never; + path: { + 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}'; +}; + +export type GetV1NftsOwnersByContractAddressErrors = { /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Not found */ - chain?: Array | (number | null) | unknown; + 404: unknown; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/nfts/owners/{contract_address}"; -}; - -export type GetV1NftsOwnersByContractAddressErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsOwnersByContractAddressError = - GetV1NftsOwnersByContractAddressErrors[keyof GetV1NftsOwnersByContractAddressErrors]; +export type GetV1NftsOwnersByContractAddressError = GetV1NftsOwnersByContractAddressErrors[keyof GetV1NftsOwnersByContractAddressErrors]; export type GetV1NftsOwnersByContractAddressResponses = { - /** - * Success - */ - 200: Array<{ - 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]; +export type GetV1NftsOwnersByContractAddressResponse = GetV1NftsOwnersByContractAddressResponses[keyof GetV1NftsOwnersByContractAddressResponses]; export type GetV1NftsOwnersByContractAddressByTokenIdData = { - body?: never; - path: { - contract_address: string; - token_id: string; - }; - query?: { + body?: never; + path: { + 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}'; +}; + +export type GetV1NftsOwnersByContractAddressByTokenIdErrors = { /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Not found */ - chain?: Array | (number | null) | unknown; + 404: unknown; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/nfts/owners/{contract_address}/{token_id}"; -}; - -export type GetV1NftsOwnersByContractAddressByTokenIdErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsOwnersByContractAddressByTokenIdError = - GetV1NftsOwnersByContractAddressByTokenIdErrors[keyof GetV1NftsOwnersByContractAddressByTokenIdErrors]; +export type GetV1NftsOwnersByContractAddressByTokenIdError = GetV1NftsOwnersByContractAddressByTokenIdErrors[keyof GetV1NftsOwnersByContractAddressByTokenIdErrors]; export type GetV1NftsOwnersByContractAddressByTokenIdResponses = { - /** - * Success - */ - 200: Array<{ - 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]; +export type GetV1NftsOwnersByContractAddressByTokenIdResponse = GetV1NftsOwnersByContractAddressByTokenIdResponses[keyof GetV1NftsOwnersByContractAddressByTokenIdResponses]; export type GetV1NftsTransfersData = { - body?: never; - path?: never; - query: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; + 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 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'; + /** + * 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; + /** + * The types of tokens to include in the response. Can be an empty array to include all types + */ + token_types?: Array<'erc1155' | 'erc721' | 'erc20'>; + owner_address?: string; + }; + url: '/v1/nfts/transfers'; +}; + +export type GetV1NftsTransfersErrors = { /** - * Whether to include sale details for NFT transfers + * Not found */ - sales?: "true" | "false"; + 404: unknown; /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Internal server error */ - include_owners?: "true" | "false"; - owner_address: string; - }; - url: "/v1/nfts/transfers"; -}; - -export type GetV1NftsTransfersErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsTransfersError = - GetV1NftsTransfersErrors[keyof GetV1NftsTransfersErrors]; +export type GetV1NftsTransfersError = GetV1NftsTransfersErrors[keyof GetV1NftsTransfersErrors]; export type GetV1NftsTransfersResponses = { - /** - * Success - */ - 200: { - data: Array<{ - token_id: string; - chain_id: number; - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: string; - amount: string; - nft_metadata?: { - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; - }>; - payment: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; + /** + * 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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + }; }; -export type GetV1NftsTransfersResponse = - GetV1NftsTransfersResponses[keyof GetV1NftsTransfersResponses]; +export type GetV1NftsTransfersResponse = GetV1NftsTransfersResponses[keyof GetV1NftsTransfersResponses]; export type GetV1NftsTransfersTransactionByTransactionHashData = { - body?: never; - path: { - transaction_hash: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; + 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 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'; + /** + * 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 = { /** - * Whether to include sale details for NFT transfers + * Not found */ - sales?: "true" | "false"; + 404: unknown; /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Internal server error */ - include_owners?: "true" | "false"; - }; - url: "/v1/nfts/transfers/transaction/{transaction_hash}"; -}; - -export type GetV1NftsTransfersTransactionByTransactionHashErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsTransfersTransactionByTransactionHashError = - GetV1NftsTransfersTransactionByTransactionHashErrors[keyof GetV1NftsTransfersTransactionByTransactionHashErrors]; +export type GetV1NftsTransfersTransactionByTransactionHashError = GetV1NftsTransfersTransactionByTransactionHashErrors[keyof GetV1NftsTransfersTransactionByTransactionHashErrors]; export type GetV1NftsTransfersTransactionByTransactionHashResponses = { - /** - * Success - */ - 200: { - data: Array<{ - token_id: string; - chain_id: number; - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: string; - amount: string; - nft_metadata?: { - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; - }>; - payment: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; + /** + * 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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + }; }; -export type GetV1NftsTransfersTransactionByTransactionHashResponse = - GetV1NftsTransfersTransactionByTransactionHashResponses[keyof GetV1NftsTransfersTransactionByTransactionHashResponses]; +export type GetV1NftsTransfersTransactionByTransactionHashResponse = GetV1NftsTransfersTransactionByTransactionHashResponses[keyof GetV1NftsTransfersTransactionByTransactionHashResponses]; export type GetV1NftsTransfersByContractAddressData = { - body?: never; - path: { - contract_address: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; + body?: never; + path: { + 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 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}'; +}; + +export type GetV1NftsTransfersByContractAddressErrors = { /** - * Whether to include sale details for NFT transfers + * Not found */ - sales?: "true" | "false"; + 404: unknown; /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Internal server error */ - include_owners?: "true" | "false"; - }; - url: "/v1/nfts/transfers/{contract_address}"; -}; - -export type GetV1NftsTransfersByContractAddressErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsTransfersByContractAddressError = - GetV1NftsTransfersByContractAddressErrors[keyof GetV1NftsTransfersByContractAddressErrors]; +export type GetV1NftsTransfersByContractAddressError = GetV1NftsTransfersByContractAddressErrors[keyof GetV1NftsTransfersByContractAddressErrors]; export type GetV1NftsTransfersByContractAddressResponses = { - /** - * Success - */ - 200: { - data: Array<{ - token_id: string; - chain_id: number; - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: string; - amount: string; - nft_metadata?: { - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; - }>; - payment: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; + /** + * 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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + }; }; -export type GetV1NftsTransfersByContractAddressResponse = - GetV1NftsTransfersByContractAddressResponses[keyof GetV1NftsTransfersByContractAddressResponses]; +export type GetV1NftsTransfersByContractAddressResponse = GetV1NftsTransfersByContractAddressResponses[keyof GetV1NftsTransfersByContractAddressResponses]; export type GetV1NftsByContractAddressData = { - body?: never; - path: { - contract_address: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; + body?: never; + path: { + 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}'; +}; + +export type GetV1NftsByContractAddressErrors = { /** - * The number of items to return + * Not found */ - limit?: number; - page?: number | null; + 404: unknown; /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Internal server error */ - include_owners?: "true" | "false"; - }; - url: "/v1/nfts/{contract_address}"; + 500: { + error: string; + }; }; -export type GetV1NftsByContractAddressErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; +export type GetV1NftsByContractAddressError = GetV1NftsByContractAddressErrors[keyof GetV1NftsByContractAddressErrors]; + +export type GetV1NftsByContractAddressResponses = { + /** + * Success + */ + 200: { + data: Array<{ + name?: string; + description?: string; + image_url?: string; + video_url?: string; + animation_url?: string; + background_color?: string; + external_url?: string; + status?: string; + metadata_url?: string; + owner_addresses: Array; + extra_metadata?: { + [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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + chain_id: number; + contract_address: string; + token_id: string; + token_type: string; + balance?: string; + }>; + }; }; -export type GetV1NftsByContractAddressError = - GetV1NftsByContractAddressErrors[keyof GetV1NftsByContractAddressErrors]; +export type GetV1NftsByContractAddressResponse = GetV1NftsByContractAddressResponses[keyof GetV1NftsByContractAddressResponses]; -export type GetV1NftsByContractAddressResponses = { - /** - * Success - */ - 200: { - data: Array<{ - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - chain_id: number; - contract_address: string; - token_id: string; - token_type: string; - balance?: string; - }>; - }; +export type GetV1NftsTransfersByContractAddressByTokenIdData = { + body?: never; + path: { + 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}'; }; -export type GetV1NftsByContractAddressResponse = - GetV1NftsByContractAddressResponses[keyof GetV1NftsByContractAddressResponses]; - -export type GetV1NftsTransfersByContractAddressByTokenIdData = { - body?: never; - path: { - contract_address: string; - token_id: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * The number of items to return - */ - limit?: number; - page?: number | null; - /** - * Whether to include metadata for the tokens - */ - metadata?: "true" | "false"; +export type GetV1NftsTransfersByContractAddressByTokenIdErrors = { /** - * Whether to include sale details for NFT transfers + * Not found */ - sales?: "true" | "false"; + 404: unknown; /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Internal server error */ - include_owners?: "true" | "false"; - }; - url: "/v1/nfts/transfers/{contract_address}/{token_id}"; -}; - -export type GetV1NftsTransfersByContractAddressByTokenIdErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsTransfersByContractAddressByTokenIdError = - GetV1NftsTransfersByContractAddressByTokenIdErrors[keyof GetV1NftsTransfersByContractAddressByTokenIdErrors]; +export type GetV1NftsTransfersByContractAddressByTokenIdError = GetV1NftsTransfersByContractAddressByTokenIdErrors[keyof GetV1NftsTransfersByContractAddressByTokenIdErrors]; export type GetV1NftsTransfersByContractAddressByTokenIdResponses = { - /** - * Success - */ - 200: { - data: Array<{ - token_id: string; - chain_id: number; - block_number: string; - block_hash?: string; - block_timestamp: string; - transaction_hash: string; - from_address: string; - to_address: string; - log_index: number; - contract_address: string; - transfer_type: "mint" | "sale" | "transfer"; - token_type: string; - amount: string; - nft_metadata?: { - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses?: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - }; - nft_sale?: { - transaction_hash: string; - items_sold: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; - }>; - payment: Array<{ - token_address: string; - token_id: string; - amount: string; - token_type: string; - from_address?: string; - to_address?: string; + /** + * 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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + }; + nft_sale?: { + transaction_hash: string; + items_sold: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + payment: Array<{ + token_address: string; + token_id: string; + amount: string; + token_type: string; + from_address?: string; + to_address?: string; + }>; + marketplace_address: string; + marketplace_name: string; + }; }>; - marketplace_address: string; - marketplace_name: string; - }; - }>; - }; + }; }; -export type GetV1NftsTransfersByContractAddressByTokenIdResponse = - GetV1NftsTransfersByContractAddressByTokenIdResponses[keyof GetV1NftsTransfersByContractAddressByTokenIdResponses]; +export type GetV1NftsTransfersByContractAddressByTokenIdResponse = GetV1NftsTransfersByContractAddressByTokenIdResponses[keyof GetV1NftsTransfersByContractAddressByTokenIdResponses]; export type GetV1NftsByContractAddressByTokenIdData = { - body?: never; - path: { - contract_address: string; - token_id: string; - }; - query?: { + body?: never; + path: { + 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}'; +}; + +export type GetV1NftsByContractAddressByTokenIdErrors = { /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain + * Not found */ - chain?: Array | (number | null) | unknown; + 404: unknown; /** - * Whether to include owner addresses in the response (only if NFT metadata is requested) + * Internal server error */ - include_owners?: "true" | "false"; - }; - url: "/v1/nfts/{contract_address}/{token_id}"; -}; - -export type GetV1NftsByContractAddressByTokenIdErrors = { - /** - * Not found - */ - 404: unknown; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1NftsByContractAddressByTokenIdError = - GetV1NftsByContractAddressByTokenIdErrors[keyof GetV1NftsByContractAddressByTokenIdErrors]; +export type GetV1NftsByContractAddressByTokenIdError = GetV1NftsByContractAddressByTokenIdErrors[keyof GetV1NftsByContractAddressByTokenIdErrors]; export type GetV1NftsByContractAddressByTokenIdResponses = { - /** - * Success - */ - 200: { - data: Array<{ - name?: string; - description?: string; - image_url?: string; - video_url?: string; - animation_url?: string; - background_color?: string; - external_url?: string; - status?: string; - metadata_url?: string; - owner_addresses: Array; - extra_metadata?: {} & { - attributes?: - | Array<{ - trait_type: string; - value: string | number; - display_type?: string; - }> - | {}; - properties?: {}; - }; - collection?: { - name?: string; - description?: string; - image_url?: string; - banner_image_url?: string; - featured_image_url?: string; - external_link?: string; - }; - contract?: { - /** - * The chain ID of a relevant entry - */ - chain_id: number; - address: string; - name?: string; - symbol?: string; - type?: "erc721" | "erc1155"; - }; - chain_id: number; - contract_address: string; - token_id: string; - token_type: string; - balance?: string; - }>; - }; + /** + * 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: string; + name?: string; + symbol?: string; + type?: 'erc721' | 'erc1155'; + }; + chain_id: number; + contract_address: string; + token_id: string; + token_type: string; + balance?: string; + }>; + }; }; -export type GetV1NftsByContractAddressByTokenIdResponse = - GetV1NftsByContractAddressByTokenIdResponses[keyof GetV1NftsByContractAddressByTokenIdResponses]; +export type GetV1NftsByContractAddressByTokenIdResponse = GetV1NftsByContractAddressByTokenIdResponses[keyof GetV1NftsByContractAddressByTokenIdResponses]; export type GetV1NftsMetadataRefreshByContractAddressData = { - body?: never; - path: { - contract_address: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/nfts/metadata/refresh/{contract_address}"; + body?: never; + path: { + 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}'; }; 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]; +export type GetV1NftsMetadataRefreshByContractAddressError = 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]; +export type GetV1NftsMetadataRefreshByContractAddressResponse = GetV1NftsMetadataRefreshByContractAddressResponses[keyof GetV1NftsMetadataRefreshByContractAddressResponses]; export type GetV1NftsMetadataRefreshByContractAddressByTokenIdData = { - body?: never; - path: { - contract_address: string; - token_id: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - }; - url: "/v1/nfts/metadata/refresh/{contract_address}/{token_id}"; + body?: never; + path: { + 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}'; }; 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]; +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdError = 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]; +export type GetV1NftsMetadataRefreshByContractAddressByTokenIdResponse = GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses[keyof GetV1NftsMetadataRefreshByContractAddressByTokenIdResponses]; export type GetV1WalletsByWalletAddressTransactionsData = { - body?: never; - path: { - wallet_address: string; - }; - query?: { - /** - * The chain ID(s) to request the data for. You can specify multiple chain IDs, up to a maximum of 5. - * Use repeated query parameters, e.g., `?chain=20&chain=56`. - * Optional, because a single chain can as well be specified as a subdomain - */ - chain?: Array | (number | null) | unknown; - /** - * Filter by block number - */ - filter_block_number?: number | null; - /** - * Filter by block number greater than or equal to - */ - filter_block_number_gte?: number | null; - /** - * Filter by block number greater than - */ - filter_block_number_gt?: number | null; - /** - * Filter by block number less than or equal to - */ - filter_block_number_lte?: number | null; - /** - * Filter by block number less than - */ - filter_block_number_lt?: number | null; - /** - * Filter by block hash - */ - filter_block_hash?: string; - /** - * Filter by block timestamp - */ - filter_block_timestamp?: number | null; - /** - * Filter by block timestamp greater than or equal to - */ - filter_block_timestamp_gte?: number | null; - /** - * Filter by block timestamp greater than - */ - filter_block_timestamp_gt?: number | null; - /** - * Filter by block timestamp less than or equal to - */ - filter_block_timestamp_lte?: number | null; - /** - * Filter by block timestamp less than - */ - filter_block_timestamp_lt?: number | null; - /** - * Field to sort results by - */ - sort_by?: "block_number" | string; - /** - * Sort order (asc or desc) - */ - sort_order?: "asc" | "desc"; - group_by?: Array | (string | null) | unknown; - aggregate?: Array | (string | null) | unknown; - /** - * Filter by transaction index - */ - filter_transaction_index?: number | null; - /** - * Filter by transaction index greater than or equal to - */ - filter_transaction_index_gte?: number | null; - /** - * Filter by transaction index greater than - */ - filter_transaction_index_gt?: number | null; - /** - * Filter by transaction index less than or equal to - */ - filter_transaction_index_lte?: number | null; - /** - * Filter by transaction index less than - */ - filter_transaction_index_lt?: number | null; - /** - * Enable ABI decoding of the transactions/events data - */ - decode?: boolean | null; - /** - * Filter by transaction hash - */ - filter_hash?: string; - /** - * Filter by value - */ - filter_value?: number | null; - /** - * Filter by value greater than or equal to - */ - filter_value_gte?: number | null; - /** - * Filter by value greater than - */ - filter_value_gt?: number | null; - /** - * Filter by value less than or equal to - */ - filter_value_lte?: number | null; - /** - * Filter by value less than - */ - filter_value_lt?: number | null; - /** - * Filter by gas price - */ - filter_gas_price?: number | null; - /** - * Filter by gas price greater than or equal to - */ - filter_gas_price_gte?: number | null; - /** - * Filter by gas price greater than - */ - filter_gas_price_gt?: number | null; - /** - * Filter by gas price less than or equal to - */ - filter_gas_price_lte?: number | null; - /** - * Filter by gas price less than - */ - filter_gas_price_lt?: number | null; - /** - * Filter by gas - */ - filter_gas?: number | null; - /** - * Filter by gas greater than or equal to - */ - filter_gas_gte?: number | null; - /** - * Filter by gas greater than - */ - filter_gas_gt?: number | null; - /** - * Filter by gas less than or equal to - */ - filter_gas_lte?: number | null; - /** - * Filter by gas less than - */ - filter_gas_lt?: number | null; + body?: never; + path: { + 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'; +}; + +export type GetV1WalletsByWalletAddressTransactionsErrors = { /** - * Filter by function selector + * Bad request */ - filter_function_selector?: string; + 400: { + error: string; + }; /** - * The number of items to return + * Internal server error */ - limit?: number; - page?: number | null; - }; - url: "/v1/wallets/{wallet_address}/transactions"; -}; - -export type GetV1WalletsByWalletAddressTransactionsErrors = { - /** - * Bad request - */ - 400: { - error: string; - }; - /** - * Internal server error - */ - 500: { - error: string; - }; + 500: { + error: string; + }; }; -export type GetV1WalletsByWalletAddressTransactionsError = - GetV1WalletsByWalletAddressTransactionsErrors[keyof GetV1WalletsByWalletAddressTransactionsErrors]; +export type GetV1WalletsByWalletAddressTransactionsError = GetV1WalletsByWalletAddressTransactionsErrors[keyof GetV1WalletsByWalletAddressTransactionsErrors]; export type GetV1WalletsByWalletAddressTransactionsResponses = { - /** - * Successful response - */ - 200: { - data?: Array<{ - chain_id: number; - block_number: string; - block_hash: string; - block_timestamp: string; - hash: string; - nonce: number; - transaction_index: number; - from_address: string; - to_address: string; - value: number; - gas_price: number; - gas: number; - function_selector: string; - data: string; - max_fee_per_gas: number; - max_priority_fee_per_gas: number; - transaction_type: number; - r: number; - s: number; - v: number; - access_list_json?: string; - contract_address?: string; - gas_used?: number; - cumulative_gas_used?: number; - effective_gas_price?: number; - blob_gas_used?: number; - blob_gas_price?: number; - logs_bloom?: string; - status?: number; - decoded?: { - name: string; - signature: string; - inputs?: {}; - }; - /** - * @deprecated - */ - decodedData?: { - name: string; - signature: string; - inputs?: {}; - }; - }>; - aggregations?: unknown; - meta: { - chain_ids: Array; - address?: string; - signature?: string; - page: number; - limit_per_chain: number; - total_items: number; - total_pages: number; - }; - }; + /** + * Successful response + */ + 200: { + data?: Array<{ + chain_id: number; + block_number: string; + block_hash: string; + block_timestamp: string; + hash: string; + nonce: number; + transaction_index: number; + from_address: string; + to_address: string; + value: number; + gas_price: number; + gas: number; + function_selector: string; + data: string; + max_fee_per_gas: number; + max_priority_fee_per_gas: number; + transaction_type: number; + r: number; + s: number; + v: number; + access_list_json?: string; + contract_address?: string; + gas_used?: number; + cumulative_gas_used?: number; + effective_gas_price?: number; + blob_gas_used?: number; + blob_gas_price?: number; + logs_bloom?: string; + status?: number; + decoded?: { + name: string; + signature: string; + inputs?: { + [key: string]: unknown; + }; + }; + /** + * @deprecated + */ + decodedData?: { + 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]; +export type GetV1WalletsByWalletAddressTransactionsResponse = GetV1WalletsByWalletAddressTransactionsResponses[keyof GetV1WalletsByWalletAddressTransactionsResponses]; export type ClientOptions = { - baseUrl: "https://{chainId}.insight.thirdweb.com/" | (string & {}); -}; + baseUrl: 'https://{chainId}.insight.thirdweb.com/' | (string & {}); +}; \ No newline at end of file diff --git a/packages/thirdweb/src/insight/get-nfts.ts b/packages/thirdweb/src/insight/get-nfts.ts index 16ac8094a39..9902c99664c 100644 --- a/packages/thirdweb/src/insight/get-nfts.ts +++ b/packages/thirdweb/src/insight/get-nfts.ts @@ -213,7 +213,7 @@ export async function getNFT(args: { const defaultQueryOptions: GetV1NftsByContractAddressByTokenIdData["query"] = { - chain: chain.id, + chain_id: [chain.id], include_owners: includeOwners === true ? ("true" as const) : ("false" as const), }; diff --git a/packages/thirdweb/src/pay/convert/cryptoToFiat.test.ts b/packages/thirdweb/src/pay/convert/cryptoToFiat.test.ts index f04faf23ebc..645784ae433 100644 --- a/packages/thirdweb/src/pay/convert/cryptoToFiat.test.ts +++ b/packages/thirdweb/src/pay/convert/cryptoToFiat.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it, vi } from "vitest"; +import { describe, expect, it } from "vitest"; import { TEST_CLIENT } from "~test/test-clients.js"; import { base } from "../../chains/chain-definitions/base.js"; import { ethereum } from "../../chains/chain-definitions/ethereum.js"; @@ -92,24 +92,4 @@ describe.runIf(process.env.TW_SECRET_KEY)("Pay: crypto-to-fiat", () => { `Error: ${ZERO_ADDRESS} on chainId: ${base.id} is not a valid contract address.`, ); }); - it("should throw if response is not OK", async () => { - global.fetch = vi.fn(); - global.fetch = vi.fn().mockResolvedValue({ - ok: false, - status: 400, - statusText: "Bad Request", - }); - await expect( - convertCryptoToFiat({ - chain: base, - fromTokenAddress: NATIVE_TOKEN_ADDRESS, - fromAmount: 1, - to: "USD", - client: TEST_CLIENT, - }), - ).rejects.toThrowError( - `Failed to fetch USD value for token (${NATIVE_TOKEN_ADDRESS}) on chainId: ${base.id}`, - ); - vi.restoreAllMocks(); - }); }); diff --git a/packages/thirdweb/src/pay/convert/cryptoToFiat.ts b/packages/thirdweb/src/pay/convert/cryptoToFiat.ts index 092e1f75805..c6c07660af3 100644 --- a/packages/thirdweb/src/pay/convert/cryptoToFiat.ts +++ b/packages/thirdweb/src/pay/convert/cryptoToFiat.ts @@ -1,3 +1,4 @@ +import { getV1TokensPrice } from "@thirdweb-dev/insight"; import type { Address } from "abitype"; import type { Chain } from "../../chains/types.js"; import type { ThirdwebClient } from "../../client/client.js"; @@ -5,8 +6,10 @@ import { NATIVE_TOKEN_ADDRESS } from "../../constants/addresses.js"; import { getBytecode } from "../../contract/actions/get-bytecode.js"; import { getContract } from "../../contract/contract.js"; import { isAddress } from "../../utils/address.js"; +import { getThirdwebDomains } from "../../utils/domains.js"; import { getClientFetch } from "../../utils/fetch.js"; -import { getPayConvertCryptoToFiatEndpoint } from "../utils/definitions.js"; +import { stringify } from "../../utils/json.js"; +import { withCache } from "../../utils/promise/withCache.js"; import type { SupportedFiatCurrency } from "./type.js"; /** @@ -92,21 +95,35 @@ export async function convertCryptoToFiat( ); } } - const params = { - fromTokenAddress, - to, - chainId: String(chain.id), - fromAmount: String(fromAmount), - }; - const queryString = new URLSearchParams(params).toString(); - const url = `${getPayConvertCryptoToFiatEndpoint()}?${queryString}`; - const response = await getClientFetch(client)(url); - if (!response.ok) { + + const result = await withCache( + () => + getV1TokensPrice({ + baseUrl: `https://${getThirdwebDomains().insight}`, + fetch: getClientFetch(client), + query: { + address: fromTokenAddress, + chain_id: [chain.id], + }, + }), + { + cacheKey: `convert-fiat-to-crypto-${to}-${chain.id}`, + cacheTime: 1000 * 60, // 1 minute cache + }, + ); + + if (result.error) { throw new Error( - `Failed to fetch ${to} value for token (${fromTokenAddress}) on chainId: ${chain.id}`, + `Failed to fetch ${to} value for token (${fromTokenAddress}) on chainId: ${chain.id} - ${result.response.status} ${result.response.statusText} - ${result.error ? stringify(result.error) : "Unknown error"}`, ); } - const data: { result: number } = await response.json(); - return data; + const firstResult = result.data?.data[0]; + + if (!firstResult) { + throw new Error( + `Failed to fetch ${to} value for token (${fromTokenAddress}) on chainId: ${chain.id}`, + ); + } + return { result: firstResult.price_usd * fromAmount }; } diff --git a/packages/thirdweb/src/pay/convert/fiatToCrypto.test.ts b/packages/thirdweb/src/pay/convert/fiatToCrypto.test.ts index 1db42013418..59fdfc264a1 100644 --- a/packages/thirdweb/src/pay/convert/fiatToCrypto.test.ts +++ b/packages/thirdweb/src/pay/convert/fiatToCrypto.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it, vi } from "vitest"; +import { describe, expect, it } from "vitest"; import { TEST_CLIENT } from "~test/test-clients.js"; import { base } from "../../chains/chain-definitions/base.js"; import { ethereum } from "../../chains/chain-definitions/ethereum.js"; @@ -95,24 +95,4 @@ describe.runIf(process.env.TW_SECRET_KEY)("Pay: fiatToCrypto", () => { `Error: ${ZERO_ADDRESS} on chainId: ${base.id} is not a valid contract address.`, ); }); - it("should throw if response is not OK", async () => { - global.fetch = vi.fn(); - global.fetch = vi.fn().mockResolvedValue({ - ok: false, - status: 400, - statusText: "Bad Request", - }); - await expect( - convertFiatToCrypto({ - chain: ethereum, - to: NATIVE_TOKEN_ADDRESS, - fromAmount: 1, - from: "USD", - client: TEST_CLIENT, - }), - ).rejects.toThrowError( - `Failed to convert USD value to token (${NATIVE_TOKEN_ADDRESS}) on chainId: 1`, - ); - vi.restoreAllMocks(); - }); }); diff --git a/packages/thirdweb/src/pay/convert/fiatToCrypto.ts b/packages/thirdweb/src/pay/convert/fiatToCrypto.ts index 580c81e87bc..58ba8944ee0 100644 --- a/packages/thirdweb/src/pay/convert/fiatToCrypto.ts +++ b/packages/thirdweb/src/pay/convert/fiatToCrypto.ts @@ -1,3 +1,4 @@ +import { getV1TokensPrice } from "@thirdweb-dev/insight"; import type { Address } from "abitype"; import type { Chain } from "../../chains/types.js"; import type { ThirdwebClient } from "../../client/client.js"; @@ -5,8 +6,10 @@ import { NATIVE_TOKEN_ADDRESS } from "../../constants/addresses.js"; import { getBytecode } from "../../contract/actions/get-bytecode.js"; import { getContract } from "../../contract/contract.js"; import { isAddress } from "../../utils/address.js"; +import { getThirdwebDomains } from "../../utils/domains.js"; import { getClientFetch } from "../../utils/fetch.js"; -import { getPayConvertFiatToCryptoEndpoint } from "../utils/definitions.js"; +import { stringify } from "../../utils/json.js"; +import { withCache } from "../../utils/promise/withCache.js"; import type { SupportedFiatCurrency } from "./type.js"; /** @@ -91,21 +94,34 @@ export async function convertFiatToCrypto( ); } } - const params = { - from, - to, - chainId: String(chain.id), - fromAmount: String(fromAmount), - }; - const queryString = new URLSearchParams(params).toString(); - const url = `${getPayConvertFiatToCryptoEndpoint()}?${queryString}`; - const response = await getClientFetch(client)(url); - if (!response.ok) { + const result = await withCache( + () => + getV1TokensPrice({ + baseUrl: `https://${getThirdwebDomains().insight}`, + fetch: getClientFetch(client), + query: { + address: to, + chain_id: [chain.id], + }, + }), + { + cacheKey: `convert-fiat-to-crypto-${to}-${chain.id}`, + cacheTime: 1000 * 60, // 1 minute cache + }, + ); + + if (result.error) { throw new Error( - `Failed to convert ${from} value to token (${to}) on chainId: ${chain.id}`, + `Failed to fetch ${from} value for token (${to}) on chainId: ${chain.id} - ${result.response.status} ${result.response.statusText} - ${result.error ? stringify(result.error) : "Unknown error"}`, ); } - const data: { result: number } = await response.json(); - return data; + const firstResult = result.data?.data[0]; + + if (!firstResult || firstResult.price_usd === 0) { + throw new Error( + `Failed to fetch ${from} value for token (${to}) on chainId: ${chain.id}`, + ); + } + return { result: fromAmount / firstResult.price_usd }; } diff --git a/packages/thirdweb/src/pay/utils/definitions.ts b/packages/thirdweb/src/pay/utils/definitions.ts index b8731428c28..1d1dd00e2d9 100644 --- a/packages/thirdweb/src/pay/utils/definitions.ts +++ b/packages/thirdweb/src/pay/utils/definitions.ts @@ -28,9 +28,3 @@ export const getPayBuyWithCryptoHistoryEndpoint = () => */ export const getPayBuyHistoryEndpoint = () => `${getPayBaseUrl()}/wallet/history/v1`; - -export const getPayConvertFiatToCryptoEndpoint = () => - `${getPayBaseUrl()}/convert/fiat-to-crypto/v1`; - -export const getPayConvertCryptoToFiatEndpoint = () => - `${getPayBaseUrl()}/convert/crypto-to-fiat/v1`;