From 4f9bb1942b7a87cb80619bad405849b67689c159 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 13:26:45 +0000 Subject: [PATCH] feat(api): api update --- .gitignore | 2 +- .stats.yml | 2 +- api.md | 3 - scripts/build | 2 +- src/core.ts | 10 +- src/error.ts | 2 +- src/index.ts | 301 ++++++++++++++------- src/resources/bitcoin/bitcoin.ts | 13 +- src/resources/bitcoin/index.ts | 2 +- src/resources/bitcoin/transaction.ts | 9 +- src/resources/evm/evm.ts | 133 ++++++--- src/resources/evm/index.ts | 82 +++--- src/resources/evm/json-rpc.ts | 5 +- src/resources/evm/post-transaction-bulk.ts | 9 +- src/resources/evm/post-transaction.ts | 11 +- src/resources/evm/transaction-bulk.ts | 9 +- src/resources/evm/transaction-raw.ts | 5 +- src/resources/evm/transaction.ts | 11 +- src/resources/evm/user-operation.ts | 5 +- src/resources/index.ts | 152 ++++++----- src/resources/site.ts | 17 +- src/resources/solana/address.ts | 5 +- src/resources/solana/index.ts | 67 +++-- src/resources/solana/message.ts | 5 +- src/resources/solana/solana.ts | 240 ++++++++++------ src/resources/starknet/index.ts | 9 +- src/resources/starknet/starknet.ts | 23 +- src/resources/starknet/transaction.ts | 9 +- src/resources/stellar/index.ts | 8 +- src/resources/stellar/stellar.ts | 21 +- src/resources/stellar/transaction.ts | 9 +- src/resources/token-bulk.ts | 9 +- src/resources/token.ts | 13 +- tsconfig.deno.json | 11 +- tsconfig.json | 3 +- 35 files changed, 736 insertions(+), 481 deletions(-) diff --git a/.gitignore b/.gitignore index 3eed6ddf..d98d51a8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ yarn-error.log codegen.log Brewfile.lock.json dist -/deno +dist-deno /*.tgz .idea/ diff --git a/.stats.yml b/.stats.yml index 8ffb1844..b74b3b45 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-46d8eab626e61bba9c77116adbcfcbc34a35b2742976789e9f3643f399386f2c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-68190ea619cfe126cdb1d0d08d55d0701e87c1cb45aaaf714807e2fc0bdde5e6.yml diff --git a/api.md b/api.md index 89df0ffa..0932968d 100644 --- a/api.md +++ b/api.md @@ -103,8 +103,6 @@ Types: - DelegatedAssetDetailsSchema - FungibleMintAccountDetailsSchema - InstructionErrorDetails -- NativeSolDetailsSchema -- NativeSolDiffSchema - NativeSolOwnershipDiffSchema - NonFungibleMintAccountDetailsSchema - PdaAccountSchema @@ -115,7 +113,6 @@ Types: - SplNonFungibleTokenDetailsSchema - SplNonFungibleTokenDiffSchema - SplTokenOwnershipDiffSchema -- StakedSolAssetDetailsSchema - StakedSolWithdrawAuthorityDiffSchema - SuccessfulSimulationResultSchema - SystemAccountDetailsSchema diff --git a/scripts/build b/scripts/build index 44e3c050..736a6557 100755 --- a/scripts/build +++ b/scripts/build @@ -50,7 +50,7 @@ node scripts/utils/postprocess-files.cjs (cd dist && node -e 'require("@blockaid/client")') (cd dist && node -e 'import("@blockaid/client")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] +if [ -e ./scripts/build-deno ] then ./scripts/build-deno fi diff --git a/src/core.ts b/src/core.ts index 3bdcb54c..950c2397 100644 --- a/src/core.ts +++ b/src/core.ts @@ -396,7 +396,7 @@ export abstract class APIClient { error: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { return APIError.generate(status, error, message, headers); } @@ -668,9 +668,9 @@ export abstract class AbstractPage implements AsyncIterable { return await this.#client.requestAPIList(this.constructor as any, nextOptions); } - async *iterPages() { + async *iterPages(): AsyncGenerator { // eslint-disable-next-line @typescript-eslint/no-this-alias - let page: AbstractPage = this; + let page: this = this; yield page; while (page.hasNextPage()) { page = await page.getNextPage(); @@ -678,7 +678,7 @@ export abstract class AbstractPage implements AsyncIterable { } } - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { for await (const page of this.iterPages()) { for (const item of page.getPaginatedItems()) { yield item; @@ -721,7 +721,7 @@ export class PagePromise< * console.log(item) * } */ - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { const page = await this; for await (const item of page) { yield item; diff --git a/src/error.ts b/src/error.ts index 354059a9..847a3022 100644 --- a/src/error.ts +++ b/src/error.ts @@ -47,7 +47,7 @@ export class APIError extends BlockaidError { errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { if (!status) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } diff --git a/src/index.ts b/src/index.ts index bef0cca5..181339bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,99 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Errors from './error'; -import * as Uploads from './uploads'; import { type Agent } from './_shims/index'; import * as Core from './core'; +import * as Errors from './error'; +import * as Uploads from './uploads'; import * as API from './resources/index'; +import { + Site, + SiteReportParams, + SiteReportResponse, + SiteScanHitResponse, + SiteScanMissResponse, + SiteScanParams, + SiteScanResponse, +} from './resources/site'; +import { + Token, + TokenReportParams, + TokenReportResponse, + TokenScanParams, + TokenScanResponse, +} from './resources/token'; +import { TokenBulk, TokenBulkScanParams, TokenBulkScanResponse } from './resources/token-bulk'; +import { Bitcoin } from './resources/bitcoin/bitcoin'; +import { + AddressAssetExposure, + AssetDiff, + Erc1155Diff, + Erc1155Exposure, + Erc1155TokenDetails, + Erc20Diff, + Erc20Exposure, + Erc20TokenDetails, + Erc721Diff, + Erc721Exposure, + Erc721TokenDetails, + Evm, + Metadata, + NativeAssetDetails, + NativeDiff, + NonercTokenDetails, + TokenScanSupportedChain, + TransactionScanFeature, + TransactionScanResponse, + TransactionScanSupportedChain, + TransactionSimulation, + TransactionSimulationError, + TransactionValidation, + TransactionValidationError, + UsdDiff, +} from './resources/evm/evm'; +import { + APIErrorDetails, + AccountSummarySchema, + AddressScanRequestSchema, + AddressScanResponseSchema, + AssetTransferDetailsSchema, + CnftDetailsSchema, + CnftDiffSchema, + CnftMintAccountDetailsSchema, + CombinedValidationResult, + DelegatedAssetDetailsSchema, + FungibleMintAccountDetailsSchema, + InstructionErrorDetails, + NativeSolOwnershipDiffSchema, + NonFungibleMintAccountDetailsSchema, + PdaAccountSchema, + ProgramAccountDetailsSchema, + ResponseSchema, + Solana, + SplFungibleTokenDetailsSchema, + SplFungibleTokenDiffSchema, + SplNonFungibleTokenDetailsSchema, + SplNonFungibleTokenDiffSchema, + SplTokenOwnershipDiffSchema, + StakedSolWithdrawAuthorityDiffSchema, + SuccessfulSimulationResultSchema, + SystemAccountDetailsSchema, + TokenAccountDetailsSchema, + TotalUsdDiffSchema, + TransactionErrorDetails, + TxScanRequestSchema, + ValidationFeature, +} from './resources/solana/solana'; +import { + Starknet, + StarknetErc1155Diff, + StarknetErc20Diff, + StarknetErc721Diff, +} from './resources/starknet/starknet'; +import { + Stellar, + StellarAssetContractDetailsSchema, + StellarAssetTransferDetailsSchema, +} from './resources/stellar/stellar'; const environments = { production: 'https://api.blockaid.io', @@ -235,7 +324,7 @@ export class Blockaid extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export const { +export { BlockaidError, APIError, APIConnectionError, @@ -249,103 +338,123 @@ export const { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} = Errors; +} from './error'; export import toFile = Uploads.toFile; export import fileFromPath = Uploads.fileFromPath; -export namespace Blockaid { - export import RequestOptions = Core.RequestOptions; - - export import Evm = API.Evm; - export import AddressAssetExposure = API.AddressAssetExposure; - export import AssetDiff = API.AssetDiff; - export import Erc1155Diff = API.Erc1155Diff; - export import Erc1155Exposure = API.Erc1155Exposure; - export import Erc1155TokenDetails = API.Erc1155TokenDetails; - export import Erc20Diff = API.Erc20Diff; - export import Erc20Exposure = API.Erc20Exposure; - export import Erc20TokenDetails = API.Erc20TokenDetails; - export import Erc721Diff = API.Erc721Diff; - export import Erc721Exposure = API.Erc721Exposure; - export import Erc721TokenDetails = API.Erc721TokenDetails; - export import Metadata = API.Metadata; - export import NativeAssetDetails = API.NativeAssetDetails; - export import NativeDiff = API.NativeDiff; - export import NonercTokenDetails = API.NonercTokenDetails; - export import TokenScanSupportedChain = API.TokenScanSupportedChain; - export import TransactionScanFeature = API.TransactionScanFeature; - export import TransactionScanResponse = API.TransactionScanResponse; - export import TransactionScanSupportedChain = API.TransactionScanSupportedChain; - export import TransactionSimulation = API.TransactionSimulation; - export import TransactionSimulationError = API.TransactionSimulationError; - export import TransactionValidation = API.TransactionValidation; - export import TransactionValidationError = API.TransactionValidationError; - export import UsdDiff = API.UsdDiff; - - export import Solana = API.Solana; - export import AccountSummarySchema = API.AccountSummarySchema; - export import AddressScanRequestSchema = API.AddressScanRequestSchema; - export import AddressScanResponseSchema = API.AddressScanResponseSchema; - export import APIErrorDetails = API.APIErrorDetails; - export import AssetTransferDetailsSchema = API.AssetTransferDetailsSchema; - export import CnftDetailsSchema = API.CnftDetailsSchema; - export import CnftDiffSchema = API.CnftDiffSchema; - export import CnftMintAccountDetailsSchema = API.CnftMintAccountDetailsSchema; - export import CombinedValidationResult = API.CombinedValidationResult; - export import DelegatedAssetDetailsSchema = API.DelegatedAssetDetailsSchema; - export import FungibleMintAccountDetailsSchema = API.FungibleMintAccountDetailsSchema; - export import InstructionErrorDetails = API.InstructionErrorDetails; - export import NativeSolDetailsSchema = API.NativeSolDetailsSchema; - export import NativeSolDiffSchema = API.NativeSolDiffSchema; - export import NativeSolOwnershipDiffSchema = API.NativeSolOwnershipDiffSchema; - export import NonFungibleMintAccountDetailsSchema = API.NonFungibleMintAccountDetailsSchema; - export import PdaAccountSchema = API.PdaAccountSchema; - export import ProgramAccountDetailsSchema = API.ProgramAccountDetailsSchema; - export import ResponseSchema = API.ResponseSchema; - export import SplFungibleTokenDetailsSchema = API.SplFungibleTokenDetailsSchema; - export import SplFungibleTokenDiffSchema = API.SplFungibleTokenDiffSchema; - export import SplNonFungibleTokenDetailsSchema = API.SplNonFungibleTokenDetailsSchema; - export import SplNonFungibleTokenDiffSchema = API.SplNonFungibleTokenDiffSchema; - export import SplTokenOwnershipDiffSchema = API.SplTokenOwnershipDiffSchema; - export import StakedSolAssetDetailsSchema = API.StakedSolAssetDetailsSchema; - export import StakedSolWithdrawAuthorityDiffSchema = API.StakedSolWithdrawAuthorityDiffSchema; - export import SuccessfulSimulationResultSchema = API.SuccessfulSimulationResultSchema; - export import SystemAccountDetailsSchema = API.SystemAccountDetailsSchema; - export import TokenAccountDetailsSchema = API.TokenAccountDetailsSchema; - export import TotalUsdDiffSchema = API.TotalUsdDiffSchema; - export import TransactionErrorDetails = API.TransactionErrorDetails; - export import TxScanRequestSchema = API.TxScanRequestSchema; - export import ValidationFeature = API.ValidationFeature; - - export import Stellar = API.Stellar; - export import StellarAssetContractDetailsSchema = API.StellarAssetContractDetailsSchema; - export import StellarAssetTransferDetailsSchema = API.StellarAssetTransferDetailsSchema; - - export import Bitcoin = API.Bitcoin; - - export import Starknet = API.Starknet; - export import StarknetErc1155Diff = API.StarknetErc1155Diff; - export import StarknetErc20Diff = API.StarknetErc20Diff; - export import StarknetErc721Diff = API.StarknetErc721Diff; - - export import Site = API.Site; - export import SiteScanHitResponse = API.SiteScanHitResponse; - export import SiteScanMissResponse = API.SiteScanMissResponse; - export import SiteReportResponse = API.SiteReportResponse; - export import SiteScanResponse = API.SiteScanResponse; - export import SiteReportParams = API.SiteReportParams; - export import SiteScanParams = API.SiteScanParams; - - export import Token = API.Token; - export import TokenReportResponse = API.TokenReportResponse; - export import TokenScanResponse = API.TokenScanResponse; - export import TokenReportParams = API.TokenReportParams; - export import TokenScanParams = API.TokenScanParams; - - export import TokenBulk = API.TokenBulk; - export import TokenBulkScanResponse = API.TokenBulkScanResponse; - export import TokenBulkScanParams = API.TokenBulkScanParams; +Blockaid.Evm = Evm; +Blockaid.Solana = Solana; +Blockaid.Stellar = Stellar; +Blockaid.Bitcoin = Bitcoin; +Blockaid.Starknet = Starknet; +Blockaid.Site = Site; +Blockaid.Token = Token; +Blockaid.TokenBulk = TokenBulk; + +export declare namespace Blockaid { + export type RequestOptions = Core.RequestOptions; + + export { + Evm as Evm, + type AddressAssetExposure as AddressAssetExposure, + type AssetDiff as AssetDiff, + type Erc1155Diff as Erc1155Diff, + type Erc1155Exposure as Erc1155Exposure, + type Erc1155TokenDetails as Erc1155TokenDetails, + type Erc20Diff as Erc20Diff, + type Erc20Exposure as Erc20Exposure, + type Erc20TokenDetails as Erc20TokenDetails, + type Erc721Diff as Erc721Diff, + type Erc721Exposure as Erc721Exposure, + type Erc721TokenDetails as Erc721TokenDetails, + type Metadata as Metadata, + type NativeAssetDetails as NativeAssetDetails, + type NativeDiff as NativeDiff, + type NonercTokenDetails as NonercTokenDetails, + type TokenScanSupportedChain as TokenScanSupportedChain, + type TransactionScanFeature as TransactionScanFeature, + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanSupportedChain as TransactionScanSupportedChain, + type TransactionSimulation as TransactionSimulation, + type TransactionSimulationError as TransactionSimulationError, + type TransactionValidation as TransactionValidation, + type TransactionValidationError as TransactionValidationError, + type UsdDiff as UsdDiff, + }; + + export { + Solana as Solana, + type AccountSummarySchema as AccountSummarySchema, + type AddressScanRequestSchema as AddressScanRequestSchema, + type AddressScanResponseSchema as AddressScanResponseSchema, + type APIErrorDetails as APIErrorDetails, + type AssetTransferDetailsSchema as AssetTransferDetailsSchema, + type CnftDetailsSchema as CnftDetailsSchema, + type CnftDiffSchema as CnftDiffSchema, + type CnftMintAccountDetailsSchema as CnftMintAccountDetailsSchema, + type CombinedValidationResult as CombinedValidationResult, + type DelegatedAssetDetailsSchema as DelegatedAssetDetailsSchema, + type FungibleMintAccountDetailsSchema as FungibleMintAccountDetailsSchema, + type InstructionErrorDetails as InstructionErrorDetails, + type NativeSolOwnershipDiffSchema as NativeSolOwnershipDiffSchema, + type NonFungibleMintAccountDetailsSchema as NonFungibleMintAccountDetailsSchema, + type PdaAccountSchema as PdaAccountSchema, + type ProgramAccountDetailsSchema as ProgramAccountDetailsSchema, + type ResponseSchema as ResponseSchema, + type SplFungibleTokenDetailsSchema as SplFungibleTokenDetailsSchema, + type SplFungibleTokenDiffSchema as SplFungibleTokenDiffSchema, + type SplNonFungibleTokenDetailsSchema as SplNonFungibleTokenDetailsSchema, + type SplNonFungibleTokenDiffSchema as SplNonFungibleTokenDiffSchema, + type SplTokenOwnershipDiffSchema as SplTokenOwnershipDiffSchema, + type StakedSolWithdrawAuthorityDiffSchema as StakedSolWithdrawAuthorityDiffSchema, + type SuccessfulSimulationResultSchema as SuccessfulSimulationResultSchema, + type SystemAccountDetailsSchema as SystemAccountDetailsSchema, + type TokenAccountDetailsSchema as TokenAccountDetailsSchema, + type TotalUsdDiffSchema as TotalUsdDiffSchema, + type TransactionErrorDetails as TransactionErrorDetails, + type TxScanRequestSchema as TxScanRequestSchema, + type ValidationFeature as ValidationFeature, + }; + + export { + Stellar as Stellar, + type StellarAssetContractDetailsSchema as StellarAssetContractDetailsSchema, + type StellarAssetTransferDetailsSchema as StellarAssetTransferDetailsSchema, + }; + + export { Bitcoin as Bitcoin }; + + export { + Starknet as Starknet, + type StarknetErc1155Diff as StarknetErc1155Diff, + type StarknetErc20Diff as StarknetErc20Diff, + type StarknetErc721Diff as StarknetErc721Diff, + }; + + export { + Site as Site, + type SiteScanHitResponse as SiteScanHitResponse, + type SiteScanMissResponse as SiteScanMissResponse, + type SiteReportResponse as SiteReportResponse, + type SiteScanResponse as SiteScanResponse, + type SiteReportParams as SiteReportParams, + type SiteScanParams as SiteScanParams, + }; + + export { + Token as Token, + type TokenReportResponse as TokenReportResponse, + type TokenScanResponse as TokenScanResponse, + type TokenReportParams as TokenReportParams, + type TokenScanParams as TokenScanParams, + }; + + export { + TokenBulk as TokenBulk, + type TokenBulkScanResponse as TokenBulkScanResponse, + type TokenBulkScanParams as TokenBulkScanParams, + }; } export default Blockaid; diff --git a/src/resources/bitcoin/bitcoin.ts b/src/resources/bitcoin/bitcoin.ts index 7c3680f8..e6ba4f57 100644 --- a/src/resources/bitcoin/bitcoin.ts +++ b/src/resources/bitcoin/bitcoin.ts @@ -2,13 +2,18 @@ import { APIResource } from '../../resource'; import * as TransactionAPI from './transaction'; +import { Transaction, TransactionScanParams, TransactionScanResponse } from './transaction'; export class Bitcoin extends APIResource { transaction: TransactionAPI.Transaction = new TransactionAPI.Transaction(this._client); } -export namespace Bitcoin { - export import Transaction = TransactionAPI.Transaction; - export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +Bitcoin.Transaction = Transaction; + +export declare namespace Bitcoin { + export { + Transaction as Transaction, + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/bitcoin/index.ts b/src/resources/bitcoin/index.ts index a11d87dd..5692cbb7 100644 --- a/src/resources/bitcoin/index.ts +++ b/src/resources/bitcoin/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bitcoin } from './bitcoin'; -export { TransactionScanResponse, TransactionScanParams, Transaction } from './transaction'; +export { Transaction, type TransactionScanResponse, type TransactionScanParams } from './transaction'; diff --git a/src/resources/bitcoin/transaction.ts b/src/resources/bitcoin/transaction.ts index 236edba6..3988851a 100644 --- a/src/resources/bitcoin/transaction.ts +++ b/src/resources/bitcoin/transaction.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TransactionAPI from './transaction'; export class Transaction extends APIResource { /** @@ -475,7 +474,9 @@ export namespace TransactionScanParams { } } -export namespace Transaction { - export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +export declare namespace Transaction { + export { + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index 5b38a6e8..dbfadf5e 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -3,12 +3,33 @@ import { APIResource } from '../../resource'; import * as EvmAPI from './evm'; import * as JsonRpcAPI from './json-rpc'; +import { JsonRpc, JsonRpcScanParams } from './json-rpc'; import * as PostTransactionAPI from './post-transaction'; +import { + PostTransaction, + PostTransactionReportParams, + PostTransactionReportResponse, + PostTransactionScanParams, +} from './post-transaction'; import * as PostTransactionBulkAPI from './post-transaction-bulk'; +import { + PostTransactionBulk, + PostTransactionBulkScanParams, + PostTransactionBulkScanResponse, +} from './post-transaction-bulk'; import * as TransactionAPI from './transaction'; +import { + Transaction, + TransactionReportParams, + TransactionReportResponse, + TransactionScanParams, +} from './transaction'; import * as TransactionBulkAPI from './transaction-bulk'; +import { TransactionBulk, TransactionBulkScanParams, TransactionBulkScanResponse } from './transaction-bulk'; import * as TransactionRawAPI from './transaction-raw'; +import { TransactionRaw, TransactionRawScanParams } from './transaction-raw'; import * as UserOperationAPI from './user-operation'; +import { UserOperation, UserOperationScanParams } from './user-operation'; export class Evm extends APIResource { jsonRpc: JsonRpcAPI.JsonRpc = new JsonRpcAPI.JsonRpc(this._client); @@ -907,49 +928,71 @@ export interface UsdDiff { total: string; } -export namespace Evm { - export import AddressAssetExposure = EvmAPI.AddressAssetExposure; - export import AssetDiff = EvmAPI.AssetDiff; - export import Erc1155Diff = EvmAPI.Erc1155Diff; - export import Erc1155Exposure = EvmAPI.Erc1155Exposure; - export import Erc1155TokenDetails = EvmAPI.Erc1155TokenDetails; - export import Erc20Diff = EvmAPI.Erc20Diff; - export import Erc20Exposure = EvmAPI.Erc20Exposure; - export import Erc20TokenDetails = EvmAPI.Erc20TokenDetails; - export import Erc721Diff = EvmAPI.Erc721Diff; - export import Erc721Exposure = EvmAPI.Erc721Exposure; - export import Erc721TokenDetails = EvmAPI.Erc721TokenDetails; - export import Metadata = EvmAPI.Metadata; - export import NativeAssetDetails = EvmAPI.NativeAssetDetails; - export import NativeDiff = EvmAPI.NativeDiff; - export import NonercTokenDetails = EvmAPI.NonercTokenDetails; - export import TokenScanSupportedChain = EvmAPI.TokenScanSupportedChain; - export import TransactionScanFeature = EvmAPI.TransactionScanFeature; - export import TransactionScanResponse = EvmAPI.TransactionScanResponse; - export import TransactionScanSupportedChain = EvmAPI.TransactionScanSupportedChain; - export import TransactionSimulation = EvmAPI.TransactionSimulation; - export import TransactionSimulationError = EvmAPI.TransactionSimulationError; - export import TransactionValidation = EvmAPI.TransactionValidation; - export import TransactionValidationError = EvmAPI.TransactionValidationError; - export import UsdDiff = EvmAPI.UsdDiff; - export import JsonRpc = JsonRpcAPI.JsonRpc; - export import JsonRpcScanParams = JsonRpcAPI.JsonRpcScanParams; - export import Transaction = TransactionAPI.Transaction; - export import TransactionReportResponse = TransactionAPI.TransactionReportResponse; - export import TransactionReportParams = TransactionAPI.TransactionReportParams; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; - export import TransactionBulk = TransactionBulkAPI.TransactionBulk; - export import TransactionBulkScanResponse = TransactionBulkAPI.TransactionBulkScanResponse; - export import TransactionBulkScanParams = TransactionBulkAPI.TransactionBulkScanParams; - export import TransactionRaw = TransactionRawAPI.TransactionRaw; - export import TransactionRawScanParams = TransactionRawAPI.TransactionRawScanParams; - export import UserOperation = UserOperationAPI.UserOperation; - export import UserOperationScanParams = UserOperationAPI.UserOperationScanParams; - export import PostTransaction = PostTransactionAPI.PostTransaction; - export import PostTransactionReportResponse = PostTransactionAPI.PostTransactionReportResponse; - export import PostTransactionReportParams = PostTransactionAPI.PostTransactionReportParams; - export import PostTransactionScanParams = PostTransactionAPI.PostTransactionScanParams; - export import PostTransactionBulk = PostTransactionBulkAPI.PostTransactionBulk; - export import PostTransactionBulkScanResponse = PostTransactionBulkAPI.PostTransactionBulkScanResponse; - export import PostTransactionBulkScanParams = PostTransactionBulkAPI.PostTransactionBulkScanParams; +Evm.JsonRpc = JsonRpc; +Evm.Transaction = Transaction; +Evm.TransactionBulk = TransactionBulk; +Evm.TransactionRaw = TransactionRaw; +Evm.UserOperation = UserOperation; +Evm.PostTransaction = PostTransaction; +Evm.PostTransactionBulk = PostTransactionBulk; + +export declare namespace Evm { + export { + type AddressAssetExposure as AddressAssetExposure, + type AssetDiff as AssetDiff, + type Erc1155Diff as Erc1155Diff, + type Erc1155Exposure as Erc1155Exposure, + type Erc1155TokenDetails as Erc1155TokenDetails, + type Erc20Diff as Erc20Diff, + type Erc20Exposure as Erc20Exposure, + type Erc20TokenDetails as Erc20TokenDetails, + type Erc721Diff as Erc721Diff, + type Erc721Exposure as Erc721Exposure, + type Erc721TokenDetails as Erc721TokenDetails, + type Metadata as Metadata, + type NativeAssetDetails as NativeAssetDetails, + type NativeDiff as NativeDiff, + type NonercTokenDetails as NonercTokenDetails, + type TokenScanSupportedChain as TokenScanSupportedChain, + type TransactionScanFeature as TransactionScanFeature, + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanSupportedChain as TransactionScanSupportedChain, + type TransactionSimulation as TransactionSimulation, + type TransactionSimulationError as TransactionSimulationError, + type TransactionValidation as TransactionValidation, + type TransactionValidationError as TransactionValidationError, + type UsdDiff as UsdDiff, + }; + + export { JsonRpc as JsonRpc, type JsonRpcScanParams as JsonRpcScanParams }; + + export { + Transaction as Transaction, + type TransactionReportResponse as TransactionReportResponse, + type TransactionReportParams as TransactionReportParams, + type TransactionScanParams as TransactionScanParams, + }; + + export { + TransactionBulk as TransactionBulk, + type TransactionBulkScanResponse as TransactionBulkScanResponse, + type TransactionBulkScanParams as TransactionBulkScanParams, + }; + + export { TransactionRaw as TransactionRaw, type TransactionRawScanParams as TransactionRawScanParams }; + + export { UserOperation as UserOperation, type UserOperationScanParams as UserOperationScanParams }; + + export { + PostTransaction as PostTransaction, + type PostTransactionReportResponse as PostTransactionReportResponse, + type PostTransactionReportParams as PostTransactionReportParams, + type PostTransactionScanParams as PostTransactionScanParams, + }; + + export { + PostTransactionBulk as PostTransactionBulk, + type PostTransactionBulkScanResponse as PostTransactionBulkScanResponse, + type PostTransactionBulkScanParams as PostTransactionBulkScanParams, + }; } diff --git a/src/resources/evm/index.ts b/src/resources/evm/index.ts index 05f86cff..ec6847af 100644 --- a/src/resources/evm/index.ts +++ b/src/resources/evm/index.ts @@ -1,50 +1,54 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AddressAssetExposure, - AssetDiff, - Erc1155Diff, - Erc1155Exposure, - Erc1155TokenDetails, - Erc20Diff, - Erc20Exposure, - Erc20TokenDetails, - Erc721Diff, - Erc721Exposure, - Erc721TokenDetails, - Metadata, - NativeAssetDetails, - NativeDiff, - NonercTokenDetails, - TokenScanSupportedChain, - TransactionScanFeature, - TransactionScanResponse, - TransactionScanSupportedChain, - TransactionSimulation, - TransactionSimulationError, - TransactionValidation, - TransactionValidationError, - UsdDiff, Evm, + type AddressAssetExposure, + type AssetDiff, + type Erc1155Diff, + type Erc1155Exposure, + type Erc1155TokenDetails, + type Erc20Diff, + type Erc20Exposure, + type Erc20TokenDetails, + type Erc721Diff, + type Erc721Exposure, + type Erc721TokenDetails, + type Metadata, + type NativeAssetDetails, + type NativeDiff, + type NonercTokenDetails, + type TokenScanSupportedChain, + type TransactionScanFeature, + type TransactionScanResponse, + type TransactionScanSupportedChain, + type TransactionSimulation, + type TransactionSimulationError, + type TransactionValidation, + type TransactionValidationError, + type UsdDiff, } from './evm'; -export { JsonRpcScanParams, JsonRpc } from './json-rpc'; +export { JsonRpc, type JsonRpcScanParams } from './json-rpc'; export { - PostTransactionBulkScanResponse, - PostTransactionBulkScanParams, - PostTransactionBulk, -} from './post-transaction-bulk'; -export { - PostTransactionReportResponse, - PostTransactionReportParams, - PostTransactionScanParams, PostTransaction, + type PostTransactionReportResponse, + type PostTransactionReportParams, + type PostTransactionScanParams, } from './post-transaction'; -export { TransactionBulkScanResponse, TransactionBulkScanParams, TransactionBulk } from './transaction-bulk'; -export { TransactionRawScanParams, TransactionRaw } from './transaction-raw'; export { - TransactionReportResponse, - TransactionReportParams, - TransactionScanParams, + PostTransactionBulk, + type PostTransactionBulkScanResponse, + type PostTransactionBulkScanParams, +} from './post-transaction-bulk'; +export { Transaction, + type TransactionReportResponse, + type TransactionReportParams, + type TransactionScanParams, } from './transaction'; -export { UserOperationScanParams, UserOperation } from './user-operation'; +export { + TransactionBulk, + type TransactionBulkScanResponse, + type TransactionBulkScanParams, +} from './transaction-bulk'; +export { TransactionRaw, type TransactionRawScanParams } from './transaction-raw'; +export { UserOperation, type UserOperationScanParams } from './user-operation'; diff --git a/src/resources/evm/json-rpc.ts b/src/resources/evm/json-rpc.ts index 7bbd207c..f6baad49 100644 --- a/src/resources/evm/json-rpc.ts +++ b/src/resources/evm/json-rpc.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as JsonRpcAPI from './json-rpc'; import * as EvmAPI from './evm'; export class JsonRpc extends APIResource { @@ -70,6 +69,6 @@ export namespace JsonRpcScanParams { } } -export namespace JsonRpc { - export import JsonRpcScanParams = JsonRpcAPI.JsonRpcScanParams; +export declare namespace JsonRpc { + export { type JsonRpcScanParams as JsonRpcScanParams }; } diff --git a/src/resources/evm/post-transaction-bulk.ts b/src/resources/evm/post-transaction-bulk.ts index 7cefedc0..64c0031f 100644 --- a/src/resources/evm/post-transaction-bulk.ts +++ b/src/resources/evm/post-transaction-bulk.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as PostTransactionBulkAPI from './post-transaction-bulk'; import * as EvmAPI from './evm'; export class PostTransactionBulk extends APIResource { @@ -49,7 +48,9 @@ export interface PostTransactionBulkScanParams { options?: Array<'validation' | 'simulation' | 'gas_estimation' | 'events'>; } -export namespace PostTransactionBulk { - export import PostTransactionBulkScanResponse = PostTransactionBulkAPI.PostTransactionBulkScanResponse; - export import PostTransactionBulkScanParams = PostTransactionBulkAPI.PostTransactionBulkScanParams; +export declare namespace PostTransactionBulk { + export { + type PostTransactionBulkScanResponse as PostTransactionBulkScanResponse, + type PostTransactionBulkScanParams as PostTransactionBulkScanParams, + }; } diff --git a/src/resources/evm/post-transaction.ts b/src/resources/evm/post-transaction.ts index 23a37371..622f0fb3 100644 --- a/src/resources/evm/post-transaction.ts +++ b/src/resources/evm/post-transaction.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as PostTransactionAPI from './post-transaction'; import * as EvmAPI from './evm'; export class PostTransaction extends APIResource { @@ -109,8 +108,10 @@ export namespace PostTransactionScanParams { } } -export namespace PostTransaction { - export import PostTransactionReportResponse = PostTransactionAPI.PostTransactionReportResponse; - export import PostTransactionReportParams = PostTransactionAPI.PostTransactionReportParams; - export import PostTransactionScanParams = PostTransactionAPI.PostTransactionScanParams; +export declare namespace PostTransaction { + export { + type PostTransactionReportResponse as PostTransactionReportResponse, + type PostTransactionReportParams as PostTransactionReportParams, + type PostTransactionScanParams as PostTransactionScanParams, + }; } diff --git a/src/resources/evm/transaction-bulk.ts b/src/resources/evm/transaction-bulk.ts index c45a78c6..58ca7f97 100644 --- a/src/resources/evm/transaction-bulk.ts +++ b/src/resources/evm/transaction-bulk.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TransactionBulkAPI from './transaction-bulk'; import * as EvmAPI from './evm'; export class TransactionBulk extends APIResource { @@ -85,7 +84,9 @@ export namespace TransactionBulkScanParams { } } -export namespace TransactionBulk { - export import TransactionBulkScanResponse = TransactionBulkAPI.TransactionBulkScanResponse; - export import TransactionBulkScanParams = TransactionBulkAPI.TransactionBulkScanParams; +export declare namespace TransactionBulk { + export { + type TransactionBulkScanResponse as TransactionBulkScanResponse, + type TransactionBulkScanParams as TransactionBulkScanParams, + }; } diff --git a/src/resources/evm/transaction-raw.ts b/src/resources/evm/transaction-raw.ts index 12a7ab50..231f2b85 100644 --- a/src/resources/evm/transaction-raw.ts +++ b/src/resources/evm/transaction-raw.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TransactionRawAPI from './transaction-raw'; import * as EvmAPI from './evm'; export class TransactionRaw extends APIResource { @@ -54,6 +53,6 @@ export interface TransactionRawScanParams { options?: Array<'validation' | 'simulation' | 'gas_estimation' | 'events'>; } -export namespace TransactionRaw { - export import TransactionRawScanParams = TransactionRawAPI.TransactionRawScanParams; +export declare namespace TransactionRaw { + export { type TransactionRawScanParams as TransactionRawScanParams }; } diff --git a/src/resources/evm/transaction.ts b/src/resources/evm/transaction.ts index f0cf0237..e9842fe7 100644 --- a/src/resources/evm/transaction.ts +++ b/src/resources/evm/transaction.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TransactionAPI from './transaction'; import * as EvmAPI from './evm'; export class Transaction extends APIResource { @@ -204,8 +203,10 @@ export namespace TransactionScanParams { } } -export namespace Transaction { - export import TransactionReportResponse = TransactionAPI.TransactionReportResponse; - export import TransactionReportParams = TransactionAPI.TransactionReportParams; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +export declare namespace Transaction { + export { + type TransactionReportResponse as TransactionReportResponse, + type TransactionReportParams as TransactionReportParams, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/evm/user-operation.ts b/src/resources/evm/user-operation.ts index 8da06b47..3efcdfcf 100644 --- a/src/resources/evm/user-operation.ts +++ b/src/resources/evm/user-operation.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as UserOperationAPI from './user-operation'; import * as EvmAPI from './evm'; export class UserOperation extends APIResource { @@ -132,6 +131,6 @@ export namespace UserOperationScanParams { } } -export namespace UserOperation { - export import UserOperationScanParams = UserOperationAPI.UserOperationScanParams; +export declare namespace UserOperation { + export { type UserOperationScanParams as UserOperationScanParams }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index a82a85d0..99dd7fd2 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -1,83 +1,91 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { Bitcoin } from './bitcoin/bitcoin'; export { - AccountSummarySchema, - AddressScanRequestSchema, - AddressScanResponseSchema, - APIErrorDetails, - AssetTransferDetailsSchema, - CnftDetailsSchema, - CnftDiffSchema, - CnftMintAccountDetailsSchema, - CombinedValidationResult, - DelegatedAssetDetailsSchema, - FungibleMintAccountDetailsSchema, - InstructionErrorDetails, - NativeSolDetailsSchema, - NativeSolDiffSchema, - NativeSolOwnershipDiffSchema, - NonFungibleMintAccountDetailsSchema, - PdaAccountSchema, - ProgramAccountDetailsSchema, - ResponseSchema, - SplFungibleTokenDetailsSchema, - SplFungibleTokenDiffSchema, - SplNonFungibleTokenDetailsSchema, - SplNonFungibleTokenDiffSchema, - SplTokenOwnershipDiffSchema, - StakedSolAssetDetailsSchema, - StakedSolWithdrawAuthorityDiffSchema, - SuccessfulSimulationResultSchema, - SystemAccountDetailsSchema, - TokenAccountDetailsSchema, - TotalUsdDiffSchema, - TransactionErrorDetails, - TxScanRequestSchema, - ValidationFeature, - Solana, -} from './solana/solana'; -export { - AddressAssetExposure, - AssetDiff, - Erc1155Diff, - Erc1155Exposure, - Erc1155TokenDetails, - Erc20Diff, - Erc20Exposure, - Erc20TokenDetails, - Erc721Diff, - Erc721Exposure, - Erc721TokenDetails, - Metadata, - NativeAssetDetails, - NativeDiff, - NonercTokenDetails, - TokenScanSupportedChain, - TransactionScanFeature, - TransactionScanResponse, - TransactionScanSupportedChain, - TransactionSimulation, - TransactionSimulationError, - TransactionValidation, - TransactionValidationError, - UsdDiff, Evm, + type AddressAssetExposure, + type AssetDiff, + type Erc1155Diff, + type Erc1155Exposure, + type Erc1155TokenDetails, + type Erc20Diff, + type Erc20Exposure, + type Erc20TokenDetails, + type Erc721Diff, + type Erc721Exposure, + type Erc721TokenDetails, + type Metadata, + type NativeAssetDetails, + type NativeDiff, + type NonercTokenDetails, + type TokenScanSupportedChain, + type TransactionScanFeature, + type TransactionScanResponse, + type TransactionScanSupportedChain, + type TransactionSimulation, + type TransactionSimulationError, + type TransactionValidation, + type TransactionValidationError, + type UsdDiff, } from './evm/evm'; -export { Bitcoin } from './bitcoin/bitcoin'; export { - SiteScanHitResponse, - SiteScanMissResponse, - SiteReportResponse, - SiteScanResponse, - SiteReportParams, - SiteScanParams, Site, + type SiteScanHitResponse, + type SiteScanMissResponse, + type SiteReportResponse, + type SiteScanResponse, + type SiteReportParams, + type SiteScanParams, } from './site'; -export { StarknetErc1155Diff, StarknetErc20Diff, StarknetErc721Diff, Starknet } from './starknet/starknet'; export { - StellarAssetContractDetailsSchema, - StellarAssetTransferDetailsSchema, + Solana, + type AccountSummarySchema, + type AddressScanRequestSchema, + type AddressScanResponseSchema, + type APIErrorDetails, + type AssetTransferDetailsSchema, + type CnftDetailsSchema, + type CnftDiffSchema, + type CnftMintAccountDetailsSchema, + type CombinedValidationResult, + type DelegatedAssetDetailsSchema, + type FungibleMintAccountDetailsSchema, + type InstructionErrorDetails, + type NativeSolOwnershipDiffSchema, + type NonFungibleMintAccountDetailsSchema, + type PdaAccountSchema, + type ProgramAccountDetailsSchema, + type ResponseSchema, + type SplFungibleTokenDetailsSchema, + type SplFungibleTokenDiffSchema, + type SplNonFungibleTokenDetailsSchema, + type SplNonFungibleTokenDiffSchema, + type SplTokenOwnershipDiffSchema, + type StakedSolWithdrawAuthorityDiffSchema, + type SuccessfulSimulationResultSchema, + type SystemAccountDetailsSchema, + type TokenAccountDetailsSchema, + type TotalUsdDiffSchema, + type TransactionErrorDetails, + type TxScanRequestSchema, + type ValidationFeature, +} from './solana/solana'; +export { + Starknet, + type StarknetErc1155Diff, + type StarknetErc20Diff, + type StarknetErc721Diff, +} from './starknet/starknet'; +export { Stellar, + type StellarAssetContractDetailsSchema, + type StellarAssetTransferDetailsSchema, } from './stellar/stellar'; -export { TokenBulkScanResponse, TokenBulkScanParams, TokenBulk } from './token-bulk'; -export { TokenReportResponse, TokenScanResponse, TokenReportParams, TokenScanParams, Token } from './token'; +export { + Token, + type TokenReportResponse, + type TokenScanResponse, + type TokenReportParams, + type TokenScanParams, +} from './token'; +export { TokenBulk, type TokenBulkScanResponse, type TokenBulkScanParams } from './token-bulk'; diff --git a/src/resources/site.ts b/src/resources/site.ts index 5c7e8347..d072df31 100644 --- a/src/resources/site.ts +++ b/src/resources/site.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as SiteAPI from './site'; export class Site extends APIResource { /** @@ -156,11 +155,13 @@ export namespace SiteScanParams { } } -export namespace Site { - export import SiteScanHitResponse = SiteAPI.SiteScanHitResponse; - export import SiteScanMissResponse = SiteAPI.SiteScanMissResponse; - export import SiteReportResponse = SiteAPI.SiteReportResponse; - export import SiteScanResponse = SiteAPI.SiteScanResponse; - export import SiteReportParams = SiteAPI.SiteReportParams; - export import SiteScanParams = SiteAPI.SiteScanParams; +export declare namespace Site { + export { + type SiteScanHitResponse as SiteScanHitResponse, + type SiteScanMissResponse as SiteScanMissResponse, + type SiteReportResponse as SiteReportResponse, + type SiteScanResponse as SiteScanResponse, + type SiteReportParams as SiteReportParams, + type SiteScanParams as SiteScanParams, + }; } diff --git a/src/resources/solana/address.ts b/src/resources/solana/address.ts index 4861d5a3..4eaa545f 100644 --- a/src/resources/solana/address.ts +++ b/src/resources/solana/address.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as AddressAPI from './address'; import * as SolanaAPI from './solana'; export class Address extends APIResource { @@ -42,6 +41,6 @@ export namespace AddressScanParams { } } -export namespace Address { - export import AddressScanParams = AddressAPI.AddressScanParams; +export declare namespace Address { + export { type AddressScanParams as AddressScanParams }; } diff --git a/src/resources/solana/index.ts b/src/resources/solana/index.ts index 21812c88..34d17466 100644 --- a/src/resources/solana/index.ts +++ b/src/resources/solana/index.ts @@ -1,40 +1,37 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { Address, type AddressScanParams } from './address'; +export { Message, type MessageScanParams } from './message'; export { - AccountSummarySchema, - AddressScanRequestSchema, - AddressScanResponseSchema, - APIErrorDetails, - AssetTransferDetailsSchema, - CnftDetailsSchema, - CnftDiffSchema, - CnftMintAccountDetailsSchema, - CombinedValidationResult, - DelegatedAssetDetailsSchema, - FungibleMintAccountDetailsSchema, - InstructionErrorDetails, - NativeSolDetailsSchema, - NativeSolDiffSchema, - NativeSolOwnershipDiffSchema, - NonFungibleMintAccountDetailsSchema, - PdaAccountSchema, - ProgramAccountDetailsSchema, - ResponseSchema, - SplFungibleTokenDetailsSchema, - SplFungibleTokenDiffSchema, - SplNonFungibleTokenDetailsSchema, - SplNonFungibleTokenDiffSchema, - SplTokenOwnershipDiffSchema, - StakedSolAssetDetailsSchema, - StakedSolWithdrawAuthorityDiffSchema, - SuccessfulSimulationResultSchema, - SystemAccountDetailsSchema, - TokenAccountDetailsSchema, - TotalUsdDiffSchema, - TransactionErrorDetails, - TxScanRequestSchema, - ValidationFeature, Solana, + type AccountSummarySchema, + type AddressScanRequestSchema, + type AddressScanResponseSchema, + type APIErrorDetails, + type AssetTransferDetailsSchema, + type CnftDetailsSchema, + type CnftDiffSchema, + type CnftMintAccountDetailsSchema, + type CombinedValidationResult, + type DelegatedAssetDetailsSchema, + type FungibleMintAccountDetailsSchema, + type InstructionErrorDetails, + type NativeSolOwnershipDiffSchema, + type NonFungibleMintAccountDetailsSchema, + type PdaAccountSchema, + type ProgramAccountDetailsSchema, + type ResponseSchema, + type SplFungibleTokenDetailsSchema, + type SplFungibleTokenDiffSchema, + type SplNonFungibleTokenDetailsSchema, + type SplNonFungibleTokenDiffSchema, + type SplTokenOwnershipDiffSchema, + type StakedSolWithdrawAuthorityDiffSchema, + type SuccessfulSimulationResultSchema, + type SystemAccountDetailsSchema, + type TokenAccountDetailsSchema, + type TotalUsdDiffSchema, + type TransactionErrorDetails, + type TxScanRequestSchema, + type ValidationFeature, } from './solana'; -export { AddressScanParams, Address } from './address'; -export { MessageScanParams, Message } from './message'; diff --git a/src/resources/solana/message.ts b/src/resources/solana/message.ts index 6175a69e..a3ee9610 100644 --- a/src/resources/solana/message.ts +++ b/src/resources/solana/message.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as MessageAPI from './message'; import * as SolanaAPI from './solana'; export class Message extends APIResource { @@ -54,6 +53,6 @@ export namespace MessageScanParams { } } -export namespace Message { - export import MessageScanParams = MessageAPI.MessageScanParams; +export declare namespace Message { + export { type MessageScanParams as MessageScanParams }; } diff --git a/src/resources/solana/solana.ts b/src/resources/solana/solana.ts index 191a5a9f..4530f483 100644 --- a/src/resources/solana/solana.ts +++ b/src/resources/solana/solana.ts @@ -3,7 +3,9 @@ import { APIResource } from '../../resource'; import * as SolanaAPI from './solana'; import * as AddressAPI from './address'; +import { Address, AddressScanParams } from './address'; import * as MessageAPI from './message'; +import { Message, MessageScanParams } from './message'; export class Solana extends APIResource { message: MessageAPI.Message = new MessageAPI.Message(this._client); @@ -20,7 +22,10 @@ export interface AccountSummarySchema { * Assets diff of the requested account address */ account_assets_diff?: Array< - NativeSolDiffSchema | SplFungibleTokenDiffSchema | SplNonFungibleTokenDiffSchema | CnftDiffSchema + | AccountSummarySchema.NativeDiffSchema + | SplFungibleTokenDiffSchema + | SplNonFungibleTokenDiffSchema + | CnftDiffSchema >; /** @@ -36,6 +41,40 @@ export interface AccountSummarySchema { >; } +export namespace AccountSummarySchema { + export interface NativeDiffSchema { + asset: NativeDiffSchema.Asset; + + /** + * Type of the asset involved in the transfer + */ + asset_type: string; + + /** + * Incoming transfers of the asset + */ + in?: SolanaAPI.AssetTransferDetailsSchema | null; + + out?: SolanaAPI.AssetTransferDetailsSchema | null; + } + + export namespace NativeDiffSchema { + export interface Asset { + decimals?: number; + + /** + * Logo of the native currency + */ + logo?: string | null; + + /** + * Type of the asset (`"NativeToken"`) + */ + type?: string; + } + } +} + export interface AddressScanRequestSchema { /** * Encoded public key @@ -322,38 +361,8 @@ export interface InstructionErrorDetails { type?: string; } -export interface NativeSolDetailsSchema { - decimals?: number; - - /** - * Logo of Sol - */ - logo?: string | null; - - /** - * Type of the asset (`"SOL"`) - */ - type?: string; -} - -export interface NativeSolDiffSchema { - asset: NativeSolDetailsSchema; - - /** - * Type of the asset involved in the transfer - */ - asset_type: string; - - /** - * Incoming transfers of the asset - */ - in?: AssetTransferDetailsSchema | null; - - out?: AssetTransferDetailsSchema | null; -} - export interface NativeSolOwnershipDiffSchema { - asset: NativeSolDetailsSchema; + asset: NativeSolOwnershipDiffSchema.Asset; /** * Type of the asset involved in the transfer @@ -381,6 +390,22 @@ export interface NativeSolOwnershipDiffSchema { pre_owner?: string | null; } +export namespace NativeSolOwnershipDiffSchema { + export interface Asset { + decimals?: number; + + /** + * Logo of the native currency + */ + logo?: string | null; + + /** + * Type of the asset (`"NativeToken"`) + */ + type?: string; + } +} + export interface NonFungibleMintAccountDetailsSchema { /** * Encoded public key of the account @@ -590,20 +615,6 @@ export interface SplTokenOwnershipDiffSchema { pre_owner?: string | null; } -export interface StakedSolAssetDetailsSchema { - decimals?: number; - - /** - * Logo of Sol - */ - logo?: string | null; - - /** - * Type of the asset (`"STAKED_SOL"`) - */ - type?: string; -} - export interface StakedSolWithdrawAuthorityDiffSchema { /** * Type of the asset involved in the transfer @@ -615,7 +626,7 @@ export interface StakedSolWithdrawAuthorityDiffSchema { */ post_owner: string; - asset?: StakedSolAssetDetailsSchema; + asset?: StakedSolWithdrawAuthorityDiffSchema.Asset; /** * Incoming transfers of the asset @@ -633,6 +644,22 @@ export interface StakedSolWithdrawAuthorityDiffSchema { pre_owner?: string | null; } +export namespace StakedSolWithdrawAuthorityDiffSchema { + export interface Asset { + decimals?: number; + + /** + * Logo of the native currency + */ + logo?: string | null; + + /** + * Type of the asset (`"STAKED_NATIVE"`) + */ + type?: string; + } +} + export interface SuccessfulSimulationResultSchema { /** * Summary of the requested account address @@ -657,7 +684,12 @@ export interface SuccessfulSimulationResultSchema { */ assets_diff: Record< string, - Array + Array< + | SuccessfulSimulationResultSchema.NativeDiffSchema + | SplFungibleTokenDiffSchema + | SplNonFungibleTokenDiffSchema + | CnftDiffSchema + > >; /** @@ -674,6 +706,40 @@ export interface SuccessfulSimulationResultSchema { delegations: Record>; } +export namespace SuccessfulSimulationResultSchema { + export interface NativeDiffSchema { + asset: NativeDiffSchema.Asset; + + /** + * Type of the asset involved in the transfer + */ + asset_type: string; + + /** + * Incoming transfers of the asset + */ + in?: SolanaAPI.AssetTransferDetailsSchema | null; + + out?: SolanaAPI.AssetTransferDetailsSchema | null; + } + + export namespace NativeDiffSchema { + export interface Asset { + decimals?: number; + + /** + * Logo of the native currency + */ + logo?: string | null; + + /** + * Type of the asset (`"NativeToken"`) + */ + type?: string; + } + } +} + export interface SystemAccountDetailsSchema { /** * Encoded public key of the account @@ -825,42 +891,44 @@ export interface ValidationFeature { address?: string | null; } -export namespace Solana { - export import AccountSummarySchema = SolanaAPI.AccountSummarySchema; - export import AddressScanRequestSchema = SolanaAPI.AddressScanRequestSchema; - export import AddressScanResponseSchema = SolanaAPI.AddressScanResponseSchema; - export import APIErrorDetails = SolanaAPI.APIErrorDetails; - export import AssetTransferDetailsSchema = SolanaAPI.AssetTransferDetailsSchema; - export import CnftDetailsSchema = SolanaAPI.CnftDetailsSchema; - export import CnftDiffSchema = SolanaAPI.CnftDiffSchema; - export import CnftMintAccountDetailsSchema = SolanaAPI.CnftMintAccountDetailsSchema; - export import CombinedValidationResult = SolanaAPI.CombinedValidationResult; - export import DelegatedAssetDetailsSchema = SolanaAPI.DelegatedAssetDetailsSchema; - export import FungibleMintAccountDetailsSchema = SolanaAPI.FungibleMintAccountDetailsSchema; - export import InstructionErrorDetails = SolanaAPI.InstructionErrorDetails; - export import NativeSolDetailsSchema = SolanaAPI.NativeSolDetailsSchema; - export import NativeSolDiffSchema = SolanaAPI.NativeSolDiffSchema; - export import NativeSolOwnershipDiffSchema = SolanaAPI.NativeSolOwnershipDiffSchema; - export import NonFungibleMintAccountDetailsSchema = SolanaAPI.NonFungibleMintAccountDetailsSchema; - export import PdaAccountSchema = SolanaAPI.PdaAccountSchema; - export import ProgramAccountDetailsSchema = SolanaAPI.ProgramAccountDetailsSchema; - export import ResponseSchema = SolanaAPI.ResponseSchema; - export import SplFungibleTokenDetailsSchema = SolanaAPI.SplFungibleTokenDetailsSchema; - export import SplFungibleTokenDiffSchema = SolanaAPI.SplFungibleTokenDiffSchema; - export import SplNonFungibleTokenDetailsSchema = SolanaAPI.SplNonFungibleTokenDetailsSchema; - export import SplNonFungibleTokenDiffSchema = SolanaAPI.SplNonFungibleTokenDiffSchema; - export import SplTokenOwnershipDiffSchema = SolanaAPI.SplTokenOwnershipDiffSchema; - export import StakedSolAssetDetailsSchema = SolanaAPI.StakedSolAssetDetailsSchema; - export import StakedSolWithdrawAuthorityDiffSchema = SolanaAPI.StakedSolWithdrawAuthorityDiffSchema; - export import SuccessfulSimulationResultSchema = SolanaAPI.SuccessfulSimulationResultSchema; - export import SystemAccountDetailsSchema = SolanaAPI.SystemAccountDetailsSchema; - export import TokenAccountDetailsSchema = SolanaAPI.TokenAccountDetailsSchema; - export import TotalUsdDiffSchema = SolanaAPI.TotalUsdDiffSchema; - export import TransactionErrorDetails = SolanaAPI.TransactionErrorDetails; - export import TxScanRequestSchema = SolanaAPI.TxScanRequestSchema; - export import ValidationFeature = SolanaAPI.ValidationFeature; - export import Message = MessageAPI.Message; - export import MessageScanParams = MessageAPI.MessageScanParams; - export import Address = AddressAPI.Address; - export import AddressScanParams = AddressAPI.AddressScanParams; +Solana.Message = Message; +Solana.Address = Address; + +export declare namespace Solana { + export { + type AccountSummarySchema as AccountSummarySchema, + type AddressScanRequestSchema as AddressScanRequestSchema, + type AddressScanResponseSchema as AddressScanResponseSchema, + type APIErrorDetails as APIErrorDetails, + type AssetTransferDetailsSchema as AssetTransferDetailsSchema, + type CnftDetailsSchema as CnftDetailsSchema, + type CnftDiffSchema as CnftDiffSchema, + type CnftMintAccountDetailsSchema as CnftMintAccountDetailsSchema, + type CombinedValidationResult as CombinedValidationResult, + type DelegatedAssetDetailsSchema as DelegatedAssetDetailsSchema, + type FungibleMintAccountDetailsSchema as FungibleMintAccountDetailsSchema, + type InstructionErrorDetails as InstructionErrorDetails, + type NativeSolOwnershipDiffSchema as NativeSolOwnershipDiffSchema, + type NonFungibleMintAccountDetailsSchema as NonFungibleMintAccountDetailsSchema, + type PdaAccountSchema as PdaAccountSchema, + type ProgramAccountDetailsSchema as ProgramAccountDetailsSchema, + type ResponseSchema as ResponseSchema, + type SplFungibleTokenDetailsSchema as SplFungibleTokenDetailsSchema, + type SplFungibleTokenDiffSchema as SplFungibleTokenDiffSchema, + type SplNonFungibleTokenDetailsSchema as SplNonFungibleTokenDetailsSchema, + type SplNonFungibleTokenDiffSchema as SplNonFungibleTokenDiffSchema, + type SplTokenOwnershipDiffSchema as SplTokenOwnershipDiffSchema, + type StakedSolWithdrawAuthorityDiffSchema as StakedSolWithdrawAuthorityDiffSchema, + type SuccessfulSimulationResultSchema as SuccessfulSimulationResultSchema, + type SystemAccountDetailsSchema as SystemAccountDetailsSchema, + type TokenAccountDetailsSchema as TokenAccountDetailsSchema, + type TotalUsdDiffSchema as TotalUsdDiffSchema, + type TransactionErrorDetails as TransactionErrorDetails, + type TxScanRequestSchema as TxScanRequestSchema, + type ValidationFeature as ValidationFeature, + }; + + export { Message as Message, type MessageScanParams as MessageScanParams }; + + export { Address as Address, type AddressScanParams as AddressScanParams }; } diff --git a/src/resources/starknet/index.ts b/src/resources/starknet/index.ts index 3a1a7074..40596a5a 100644 --- a/src/resources/starknet/index.ts +++ b/src/resources/starknet/index.ts @@ -1,4 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { StarknetErc1155Diff, StarknetErc20Diff, StarknetErc721Diff, Starknet } from './starknet'; -export { TransactionScanResponse, TransactionScanParams, Transaction } from './transaction'; +export { + Starknet, + type StarknetErc1155Diff, + type StarknetErc20Diff, + type StarknetErc721Diff, +} from './starknet'; +export { Transaction, type TransactionScanResponse, type TransactionScanParams } from './transaction'; diff --git a/src/resources/starknet/starknet.ts b/src/resources/starknet/starknet.ts index 3a5d01a5..a3a33651 100644 --- a/src/resources/starknet/starknet.ts +++ b/src/resources/starknet/starknet.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as StarknetAPI from './starknet'; import * as TransactionAPI from './transaction'; +import { Transaction, TransactionScanParams, TransactionScanResponse } from './transaction'; export class Starknet extends APIResource { transaction: TransactionAPI.Transaction = new TransactionAPI.Transaction(this._client); @@ -69,11 +69,18 @@ export interface StarknetErc721Diff { summary?: string | null; } -export namespace Starknet { - export import StarknetErc1155Diff = StarknetAPI.StarknetErc1155Diff; - export import StarknetErc20Diff = StarknetAPI.StarknetErc20Diff; - export import StarknetErc721Diff = StarknetAPI.StarknetErc721Diff; - export import Transaction = TransactionAPI.Transaction; - export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +Starknet.Transaction = Transaction; + +export declare namespace Starknet { + export { + type StarknetErc1155Diff as StarknetErc1155Diff, + type StarknetErc20Diff as StarknetErc20Diff, + type StarknetErc721Diff as StarknetErc721Diff, + }; + + export { + Transaction as Transaction, + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/starknet/transaction.ts b/src/resources/starknet/transaction.ts index 036b1945..324744c1 100644 --- a/src/resources/starknet/transaction.ts +++ b/src/resources/starknet/transaction.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TransactionAPI from './transaction'; import * as StarknetAPI from './starknet'; export class Transaction extends APIResource { @@ -1028,7 +1027,9 @@ export namespace TransactionScanParams { } } -export namespace Transaction { - export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +export declare namespace Transaction { + export { + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/stellar/index.ts b/src/resources/stellar/index.ts index 89e99239..80722a0c 100644 --- a/src/resources/stellar/index.ts +++ b/src/resources/stellar/index.ts @@ -1,4 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { StellarAssetContractDetailsSchema, StellarAssetTransferDetailsSchema, Stellar } from './stellar'; -export { TransactionScanResponse, TransactionScanParams, Transaction } from './transaction'; +export { + Stellar, + type StellarAssetContractDetailsSchema, + type StellarAssetTransferDetailsSchema, +} from './stellar'; +export { Transaction, type TransactionScanResponse, type TransactionScanParams } from './transaction'; diff --git a/src/resources/stellar/stellar.ts b/src/resources/stellar/stellar.ts index bc8965ee..497d7ee5 100644 --- a/src/resources/stellar/stellar.ts +++ b/src/resources/stellar/stellar.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as StellarAPI from './stellar'; import * as TransactionAPI from './transaction'; +import { Transaction, TransactionScanParams, TransactionScanResponse } from './transaction'; export class Stellar extends APIResource { transaction: TransactionAPI.Transaction = new TransactionAPI.Transaction(this._client); @@ -52,10 +52,17 @@ export interface StellarAssetTransferDetailsSchema { summary?: string | null; } -export namespace Stellar { - export import StellarAssetContractDetailsSchema = StellarAPI.StellarAssetContractDetailsSchema; - export import StellarAssetTransferDetailsSchema = StellarAPI.StellarAssetTransferDetailsSchema; - export import Transaction = TransactionAPI.Transaction; - export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +Stellar.Transaction = Transaction; + +export declare namespace Stellar { + export { + type StellarAssetContractDetailsSchema as StellarAssetContractDetailsSchema, + type StellarAssetTransferDetailsSchema as StellarAssetTransferDetailsSchema, + }; + + export { + Transaction as Transaction, + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/stellar/transaction.ts b/src/resources/stellar/transaction.ts index 7c9e914a..5ed2ba1a 100644 --- a/src/resources/stellar/transaction.ts +++ b/src/resources/stellar/transaction.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TransactionAPI from './transaction'; import * as StellarAPI from './stellar'; export class Transaction extends APIResource { @@ -808,7 +807,9 @@ export namespace TransactionScanParams { } } -export namespace Transaction { - export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; - export import TransactionScanParams = TransactionAPI.TransactionScanParams; +export declare namespace Transaction { + export { + type TransactionScanResponse as TransactionScanResponse, + type TransactionScanParams as TransactionScanParams, + }; } diff --git a/src/resources/token-bulk.ts b/src/resources/token-bulk.ts index 90f01bef..0b33b1ac 100644 --- a/src/resources/token-bulk.ts +++ b/src/resources/token-bulk.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as TokenBulkAPI from './token-bulk'; import * as EvmAPI from './evm/evm'; export class TokenBulk extends APIResource { @@ -472,7 +471,9 @@ export namespace TokenBulkScanParams { } } -export namespace TokenBulk { - export import TokenBulkScanResponse = TokenBulkAPI.TokenBulkScanResponse; - export import TokenBulkScanParams = TokenBulkAPI.TokenBulkScanParams; +export declare namespace TokenBulk { + export { + type TokenBulkScanResponse as TokenBulkScanResponse, + type TokenBulkScanParams as TokenBulkScanParams, + }; } diff --git a/src/resources/token.ts b/src/resources/token.ts index c1711ad5..f3de04c8 100644 --- a/src/resources/token.ts +++ b/src/resources/token.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as TokenAPI from './token'; import * as EvmAPI from './evm/evm'; export class Token extends APIResource { @@ -523,9 +522,11 @@ export namespace TokenScanParams { } } -export namespace Token { - export import TokenReportResponse = TokenAPI.TokenReportResponse; - export import TokenScanResponse = TokenAPI.TokenScanResponse; - export import TokenReportParams = TokenAPI.TokenReportParams; - export import TokenScanParams = TokenAPI.TokenScanParams; +export declare namespace Token { + export { + type TokenReportResponse as TokenReportResponse, + type TokenScanResponse as TokenScanResponse, + type TokenReportParams as TokenReportParams, + type TokenScanParams as TokenScanParams, + }; } diff --git a/tsconfig.deno.json b/tsconfig.deno.json index 6a5302ce..849e070d 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -1,19 +1,14 @@ { "extends": "./tsconfig.json", - "include": ["deno"], + "include": ["dist-deno"], "exclude": [], "compilerOptions": { - "rootDir": "./deno", + "rootDir": "./dist-deno", "lib": ["es2020", "DOM"], - "paths": { - "@blockaid/client/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "@blockaid/client/*": ["deno/*"], - "@blockaid/client": ["deno/index.ts"], - }, "noEmit": true, "declaration": true, "declarationMap": true, - "outDir": "deno", + "outDir": "dist-deno", "pretty": true, "sourceMap": true } diff --git a/tsconfig.json b/tsconfig.json index 6737b3b4..c30756fb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "paths": { "@blockaid/client/_shims/auto/*": ["src/_shims/auto/*-node"], "@blockaid/client/*": ["src/*"], - "@blockaid/client": ["src/index.ts"], + "@blockaid/client": ["src/index.ts"] }, "noEmit": true, @@ -32,6 +32,7 @@ "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, + "isolatedModules": false, "skipLibCheck": true }