From 8f9a8e9d4edc3d812db4df0ee1738660cf8b2efd Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 15:13:58 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 2 +- api.md | 8 +- package.json | 2 +- src/index.ts | 2 - src/resources/index.ts | 2 - src/resources/stellar/index.ts | 10 +- src/resources/stellar/stellar.ts | 468 +---------------- src/resources/stellar/transaction.ts | 759 ++++++++++++++++++++++++++- 8 files changed, 767 insertions(+), 486 deletions(-) diff --git a/.stats.yml b/.stats.yml index 77730241..8ffb1844 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-55118c53a81dd5c570c3bc3138f2a9e569da2b05f570880459c7e20bb43c297c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-46d8eab626e61bba9c77116adbcfcbc34a35b2742976789e9f3643f399386f2c.yml diff --git a/api.md b/api.md index 761d5b32..89df0ffa 100644 --- a/api.md +++ b/api.md @@ -143,14 +143,16 @@ Types: - StellarAssetContractDetailsSchema - StellarAssetTransferDetailsSchema -- StellarTransactionScanRequest -- StellarTransactionScanResponse ## Transaction +Types: + +- TransactionScanResponse + Methods: -- client.stellar.transaction.scan({ ...params }) -> StellarTransactionScanResponse +- client.stellar.transaction.scan({ ...params }) -> TransactionScanResponse # Bitcoin diff --git a/package.json b/package.json index c0e637d8..57e6fd28 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ - "*" + "**/*" ], "private": false, "scripts": { diff --git a/src/index.ts b/src/index.ts index 1ae2bc83..bef0cca5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -321,8 +321,6 @@ export namespace Blockaid { export import Stellar = API.Stellar; export import StellarAssetContractDetailsSchema = API.StellarAssetContractDetailsSchema; export import StellarAssetTransferDetailsSchema = API.StellarAssetTransferDetailsSchema; - export import StellarTransactionScanRequest = API.StellarTransactionScanRequest; - export import StellarTransactionScanResponse = API.StellarTransactionScanResponse; export import Bitcoin = API.Bitcoin; diff --git a/src/resources/index.ts b/src/resources/index.ts index 5cdb58e1..a82a85d0 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -77,8 +77,6 @@ export { StarknetErc1155Diff, StarknetErc20Diff, StarknetErc721Diff, Starknet } export { StellarAssetContractDetailsSchema, StellarAssetTransferDetailsSchema, - StellarTransactionScanRequest, - StellarTransactionScanResponse, Stellar, } from './stellar/stellar'; export { TokenBulkScanResponse, TokenBulkScanParams, TokenBulk } from './token-bulk'; diff --git a/src/resources/stellar/index.ts b/src/resources/stellar/index.ts index cc3e5243..89e99239 100644 --- a/src/resources/stellar/index.ts +++ b/src/resources/stellar/index.ts @@ -1,10 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - StellarAssetContractDetailsSchema, - StellarAssetTransferDetailsSchema, - StellarTransactionScanRequest, - StellarTransactionScanResponse, - Stellar, -} from './stellar'; -export { TransactionScanParams, Transaction } from './transaction'; +export { StellarAssetContractDetailsSchema, StellarAssetTransferDetailsSchema, Stellar } from './stellar'; +export { TransactionScanResponse, TransactionScanParams, Transaction } from './transaction'; diff --git a/src/resources/stellar/stellar.ts b/src/resources/stellar/stellar.ts index f8d8516b..bc8965ee 100644 --- a/src/resources/stellar/stellar.ts +++ b/src/resources/stellar/stellar.ts @@ -36,482 +36,26 @@ export interface StellarAssetTransferDetailsSchema { */ raw_value: number; - /** - * Value of the transfer - */ - value: number; - - /** - * Summarized description of the transfer - */ - summary?: string | null; - /** * USD price of the asset */ - usd_price?: number; -} - -export interface StellarTransactionScanRequest { - account_address: string; + usd_price: string; /** - * A CAIP-2 chain ID or a Stellar network name - */ - chain: 'pubnet' | 'futurenet' | 'testnet'; - - /** - * Metadata - */ - metadata: - | StellarTransactionScanRequest.StellarWalletRequestMetadata - | StellarTransactionScanRequest.StellarInAppRequestMetadata; - - transaction: string; - - /** - * List of options to include in the response - * - * - `simulation`: Include simulation output in the response - * - `validation`: Include security validation of the transaction in the response - */ - options?: Array<'validation' | 'simulation'>; -} - -export namespace StellarTransactionScanRequest { - export interface StellarWalletRequestMetadata { - /** - * Metadata for wallet requests - */ - type: 'wallet'; - - /** - * URL of the dApp originating the transaction - */ - url: string; - } - - export interface StellarInAppRequestMetadata { - /** - * Metadata for in-app requests - */ - type: 'in_app'; - } -} - -export interface StellarTransactionScanResponse { - /** - * Simulation result; Only present if simulation option is included in the request + * Value of the transfer */ - simulation?: - | StellarTransactionScanResponse.StellarSimulationResultSchema - | StellarTransactionScanResponse.StellarSimulationErrorSchema - | null; + value: string; /** - * Validation result; Only present if validation option is included in the request + * Summarized description of the transfer */ - validation?: - | StellarTransactionScanResponse.StellarValidationResultSchema - | StellarTransactionScanResponse.StellarValidationErrorSchema - | null; -} - -export namespace StellarTransactionScanResponse { - export interface StellarSimulationResultSchema { - /** - * Summary of the actions and asset transfers that were made by the requested - * account address - */ - account_summary: StellarSimulationResultSchema.AccountSummary; - - status: 'Success'; - - /** - * Details of addresses involved in the transaction - */ - address_details?: Array; - - /** - * Mapping between the address of an account to the assets diff during the - * transaction - */ - assets_diffs?: Record>; - - /** - * Mapping between the address of an account to the ownership diff of the account - * during the transaction - */ - assets_ownership_diff?: Record>; - - /** - * Mapping between the address of an account to the exposure of the assets during - * the transaction - */ - exposures?: Record>; - } - - export namespace StellarSimulationResultSchema { - /** - * Summary of the actions and asset transfers that were made by the requested - * account address - */ - export interface AccountSummary { - /** - * Exposures made by the requested account address - */ - account_exposures: Array; - - /** - * Account ownerships diff of the requested account address - */ - account_ownerships_diff: Array; - - /** - * Total USD diff for the requested account address - */ - total_usd_diff: AccountSummary.TotalUsdDiff; - - /** - * Assets diffs of the requested account address - */ - assets_diffs?: Array; - - /** - * Total USD exposure for each of the spender addresses during the transaction - */ - total_usd_exposure?: Record; - } - - export namespace AccountSummary { - export interface AccountExposure { - asset: StellarAPI.StellarAssetContractDetailsSchema; - - /** - * Mapping between the address of a Spender to the exposure of the asset during the - * transaction - */ - spenders?: Record; - } - - export namespace AccountExposure { - export interface Spenders { - /** - * Raw value of the exposure - */ - raw_value: number; - - /** - * USD value of the exposure - */ - usd_price: number; - - /** - * Value of the exposure - */ - value: number; - - /** - * Summarized description of the exposure - */ - summary?: string | null; - } - } - - export interface AccountOwnershipsDiff { - /** - * List of public keys that can sign on behalf of the account post-transaction - */ - post_signers: Array; - - /** - * List of public keys that can sign on behalf of the account pre-transaction - */ - pre_signers: Array; - - type: 'SET_OPTIONS'; - } - - /** - * Total USD diff for the requested account address - */ - export interface TotalUsdDiff { - /** - * Total incoming USD transfers - */ - in: number; - - /** - * Total outgoing USD transfers - */ - out: number; - - /** - * Total USD transfers - */ - total?: number; - } - - export interface AssetsDiff { - /** - * Asset involved in the transfer - */ - asset: - | AssetsDiff.StellarLegacyAssetDetailsSchema - | AssetsDiff.StellarNativeAssetDetailsSchema - | StellarAPI.StellarAssetContractDetailsSchema; - - /** - * Incoming transfers of the asset - */ - in?: StellarAPI.StellarAssetTransferDetailsSchema | null; - - /** - * Outgoing transfers of the asset - */ - out?: StellarAPI.StellarAssetTransferDetailsSchema | null; - } - - export namespace AssetsDiff { - export interface StellarLegacyAssetDetailsSchema { - /** - * Asset code - */ - code: string; - - /** - * Asset issuer address - */ - issuer: string; - - /** - * Organization name - */ - org_name: string; - - /** - * Organization URL - */ - org_url: string; - - /** - * Type of the asset (`ASSET`) - */ - type?: 'ASSET'; - } - - export interface StellarNativeAssetDetailsSchema { - /** - * Asset code - */ - code?: 'XLM'; - - /** - * Type of the asset (`NATIVE`) - */ - type?: 'NATIVE'; - } - } - } - - export interface AddressDetail { - /** - * Encoded public key of the account - */ - account_address: string; - - /** - * Description of the account - */ - description?: string | null; - } - - export interface AssetsDiff { - /** - * Asset involved in the transfer - */ - asset: - | AssetsDiff.StellarLegacyAssetDetailsSchema - | AssetsDiff.StellarNativeAssetDetailsSchema - | StellarAPI.StellarAssetContractDetailsSchema; - - /** - * Incoming transfers of the asset - */ - in?: StellarAPI.StellarAssetTransferDetailsSchema | null; - - /** - * Outgoing transfers of the asset - */ - out?: StellarAPI.StellarAssetTransferDetailsSchema | null; - } - - export namespace AssetsDiff { - export interface StellarLegacyAssetDetailsSchema { - /** - * Asset code - */ - code: string; - - /** - * Asset issuer address - */ - issuer: string; - - /** - * Organization name - */ - org_name: string; - - /** - * Organization URL - */ - org_url: string; - - /** - * Type of the asset (`ASSET`) - */ - type?: 'ASSET'; - } - - export interface StellarNativeAssetDetailsSchema { - /** - * Asset code - */ - code?: 'XLM'; - - /** - * Type of the asset (`NATIVE`) - */ - type?: 'NATIVE'; - } - } - - export interface AssetsOwnershipDiff { - /** - * List of public keys that can sign on behalf of the account post-transaction - */ - post_signers: Array; - - /** - * List of public keys that can sign on behalf of the account pre-transaction - */ - pre_signers: Array; - - type: 'SET_OPTIONS'; - } - - export interface Exposure { - asset: StellarAPI.StellarAssetContractDetailsSchema; - - /** - * Mapping between the address of a Spender to the exposure of the asset during the - * transaction - */ - spenders?: Record; - } - - export namespace Exposure { - export interface Spenders { - /** - * Raw value of the exposure - */ - raw_value: number; - - /** - * USD value of the exposure - */ - usd_price: number; - - /** - * Value of the exposure - */ - value: number; - - /** - * Summarized description of the exposure - */ - summary?: string | null; - } - } - } - - export interface StellarSimulationErrorSchema { - /** - * Error message - */ - error: string; - - status: 'Error'; - } - - export interface StellarValidationResultSchema { - /** - * A textual classification that can be presented to the user explaining the - * reason. - */ - classification: string; - - /** - * A textual description about the validation result - */ - description: string; - - /** - * A list of features about this transaction explaining the validation - */ - features: Array; - - /** - * A textual description about the reasons the transaction was flagged with - * result_type - */ - reason: string; - - /** - * Verdict of the validation - */ - result_type: 'Benign' | 'Warning' | 'Malicious'; - - status: 'Success'; - } - - export namespace StellarValidationResultSchema { - export interface Feature { - /** - * Address the feature refers to - */ - address: string; - - /** - * Textual description - */ - description: string; - - feature_id: string; - - /** - * Feature Classification - */ - type: 'Benign' | 'Warning' | 'Malicious' | 'Info'; - } - } - - export interface StellarValidationErrorSchema { - /** - * Error message - */ - error: string; - - status: 'Error'; - } + summary?: string | null; } export namespace Stellar { export import StellarAssetContractDetailsSchema = StellarAPI.StellarAssetContractDetailsSchema; export import StellarAssetTransferDetailsSchema = StellarAPI.StellarAssetTransferDetailsSchema; - export import StellarTransactionScanRequest = StellarAPI.StellarTransactionScanRequest; - export import StellarTransactionScanResponse = StellarAPI.StellarTransactionScanResponse; export import Transaction = TransactionAPI.Transaction; + export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; export import TransactionScanParams = TransactionAPI.TransactionScanParams; } diff --git a/src/resources/stellar/transaction.ts b/src/resources/stellar/transaction.ts index 89def815..7c9e914a 100644 --- a/src/resources/stellar/transaction.ts +++ b/src/resources/stellar/transaction.ts @@ -9,14 +9,757 @@ export class Transaction extends APIResource { /** * Scan Transaction */ - scan( - body: TransactionScanParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + scan(body: TransactionScanParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/v0/stellar/transaction/scan', { body, ...options }); } } +export interface TransactionScanResponse { + /** + * Simulation result; Only present if simulation option is included in the request + */ + simulation?: + | TransactionScanResponse.StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration + | TransactionScanResponse.StellarSimulationErrorSchema + | null; + + /** + * Validation result; Only present if validation option is included in the request + */ + validation?: + | TransactionScanResponse.StellarValidationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchema + | TransactionScanResponse.StellarValidationErrorSchema + | null; +} + +export namespace TransactionScanResponse { + export interface StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration { + /** + * Summary of the actions and asset transfers that were made by the requested + * account address + */ + account_summary: StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration.AccountSummary; + + /** + * Ownership diffs of the account addresses + */ + assets_ownership_diff: Record< + string, + Array + >; + + status: 'Success'; + + /** + * Details of addresses involved in the transaction + */ + address_details?: Array; + + /** + * Mapping between the address of an account to the assets diff during the + * transaction + */ + assets_diffs?: Record< + string, + Array< + | StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration.StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema + | StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration.StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema + | StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration.StellarAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchema + > + >; + + /** + * Mapping between the address of an account to the exposure of the assets during + * the transaction + */ + exposures?: Record< + string, + Array< + | StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration.StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema + | StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration.StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema + > + >; + } + + export namespace StellarSimulationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaUnionAnnotatedAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetDiffAnnotatedAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleContractBackedAssetDiffUnionAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleLegacyAssetExposureAnnotatedAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchemaFieldInfoAnnotationNoneTypeRequiredTrueTitleNativeAssetExposureAccountSetOptionsOwnershipDiffSchemaAddressDetailsBaseSchemaAnnotatedEmptyModelSimulationSchemaConfiguration { + /** + * Summary of the actions and asset transfers that were made by the requested + * account address + */ + export interface AccountSummary { + /** + * Exposures made by the requested account address + */ + account_exposures: Array< + | AccountSummary.StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema + | AccountSummary.StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema + >; + + /** + * Ownership diffs of the requested account address + */ + account_ownerships_diff: Array; + + /** + * Total USD diff for the requested account address + */ + total_usd_diff: AccountSummary.TotalUsdDiff; + + /** + * Assets diffs of the requested account address + */ + account_assets_diffs?: Array< + | AccountSummary.StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema + | AccountSummary.StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema + | AccountSummary.StellarAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchema + >; + + /** + * Total USD exposure for each of the spender addresses during the transaction + */ + total_usd_exposure?: Record; + } + + export namespace AccountSummary { + export interface StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema { + asset: StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema.Asset; + + /** + * Mapping between the spender address and the exposure of the asset + */ + spenders?: Record< + string, + StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema.Spenders + >; + } + + export namespace StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema { + export interface Asset { + /** + * Asset code + */ + code: string; + + /** + * Asset issuer address + */ + issuer: string; + + /** + * Organization name + */ + org_name: string; + + /** + * Organization URL + */ + org_url: string; + + /** + * Type of the asset (`ASSET`) + */ + type?: 'ASSET'; + } + + export interface Spenders { + /** + * Approval value of the ERC20 token + */ + approval: string; + + exposure: Array; + + /** + * Expiration date of the approval + */ + expiration?: string | null; + + /** + * Summarized description of the exposure + */ + summary?: string | null; + } + + export namespace Spenders { + export interface Exposure { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + } + + export interface StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema { + asset: StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema.Asset; + + /** + * Mapping between the spender address and the exposure of the asset + */ + spenders?: Record< + string, + StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema.Spenders + >; + } + + export namespace StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema { + export interface Asset { + /** + * Asset code + */ + code?: 'XLM'; + + /** + * Type of the asset (`NATIVE`) + */ + type?: 'NATIVE'; + } + + export interface Spenders { + /** + * Approval value of the ERC20 token + */ + approval: string; + + exposure: Array; + + /** + * Expiration date of the approval + */ + expiration?: string | null; + + /** + * Summarized description of the exposure + */ + summary?: string | null; + } + + export namespace Spenders { + export interface Exposure { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + } + + export interface AccountOwnershipsDiff { + /** + * List of public keys that can sign on behalf of the account post-transaction + */ + post_signers: Array; + + /** + * List of public keys that can sign on behalf of the account pre-transaction + */ + pre_signers: Array; + + type?: 'SET_OPTIONS'; + } + + /** + * Total USD diff for the requested account address + */ + export interface TotalUsdDiff { + /** + * Total incoming USD transfers + */ + in: number; + + /** + * Total outgoing USD transfers + */ + out: number; + + /** + * Total USD transfers + */ + total?: number; + } + + export interface StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema { + asset: StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: StellarAPI.StellarAssetTransferDetailsSchema | null; + + /** + * Details of the outgoing transfer + */ + out?: StellarAPI.StellarAssetTransferDetailsSchema | null; + } + + export namespace StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema { + export interface Asset { + /** + * Asset code + */ + code: string; + + /** + * Asset issuer address + */ + issuer: string; + + /** + * Organization name + */ + org_name: string; + + /** + * Organization URL + */ + org_url: string; + + /** + * Type of the asset (`ASSET`) + */ + type?: 'ASSET'; + } + } + + export interface StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema { + asset: StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: StellarAPI.StellarAssetTransferDetailsSchema | null; + + /** + * Details of the outgoing transfer + */ + out?: StellarAPI.StellarAssetTransferDetailsSchema | null; + } + + export namespace StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema { + export interface Asset { + /** + * Asset code + */ + code?: 'XLM'; + + /** + * Type of the asset (`NATIVE`) + */ + type?: 'NATIVE'; + } + } + + export interface StellarAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchema { + asset: StellarAPI.StellarAssetContractDetailsSchema; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: StellarAPI.StellarAssetTransferDetailsSchema | null; + + /** + * Details of the outgoing transfer + */ + out?: StellarAPI.StellarAssetTransferDetailsSchema | null; + } + } + + export interface AssetsOwnershipDiff { + /** + * List of public keys that can sign on behalf of the account post-transaction + */ + post_signers: Array; + + /** + * List of public keys that can sign on behalf of the account pre-transaction + */ + pre_signers: Array; + + type?: 'SET_OPTIONS'; + } + + export interface AddressDetail { + /** + * Encoded public key of the account + */ + account_address: unknown; + + /** + * Description of the account + */ + description?: string | null; + } + + export interface StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema { + asset: StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: StellarAPI.StellarAssetTransferDetailsSchema | null; + + /** + * Details of the outgoing transfer + */ + out?: StellarAPI.StellarAssetTransferDetailsSchema | null; + } + + export namespace StellarAccountSingleAssetDiffSchemaTypeLegacyAssetDetailsSchemaAssetTransferDetailsSchema { + export interface Asset { + /** + * Asset code + */ + code: string; + + /** + * Asset issuer address + */ + issuer: string; + + /** + * Organization name + */ + org_name: string; + + /** + * Organization URL + */ + org_url: string; + + /** + * Type of the asset (`ASSET`) + */ + type?: 'ASSET'; + } + } + + export interface StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema { + asset: StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: StellarAPI.StellarAssetTransferDetailsSchema | null; + + /** + * Details of the outgoing transfer + */ + out?: StellarAPI.StellarAssetTransferDetailsSchema | null; + } + + export namespace StellarAccountSingleAssetDiffSchemaTypeNativeAssetDetailsSchemaAssetTransferDetailsSchema { + export interface Asset { + /** + * Asset code + */ + code?: 'XLM'; + + /** + * Type of the asset (`NATIVE`) + */ + type?: 'NATIVE'; + } + } + + export interface StellarAccountSingleAssetDiffSchemaTypeAssetContractDetailsSchemaAssetTransferDetailsSchema { + asset: StellarAPI.StellarAssetContractDetailsSchema; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: StellarAPI.StellarAssetTransferDetailsSchema | null; + + /** + * Details of the outgoing transfer + */ + out?: StellarAPI.StellarAssetTransferDetailsSchema | null; + } + + export interface StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema { + asset: StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema.Asset; + + /** + * Mapping between the spender address and the exposure of the asset + */ + spenders?: Record< + string, + StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema.Spenders + >; + } + + export namespace StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaLegacyAssetDetailsSchemaSingleAssetExposureSchema { + export interface Asset { + /** + * Asset code + */ + code: string; + + /** + * Asset issuer address + */ + issuer: string; + + /** + * Organization name + */ + org_name: string; + + /** + * Organization URL + */ + org_url: string; + + /** + * Type of the asset (`ASSET`) + */ + type?: 'ASSET'; + } + + export interface Spenders { + /** + * Approval value of the ERC20 token + */ + approval: string; + + exposure: Array; + + /** + * Expiration date of the approval + */ + expiration?: string | null; + + /** + * Summarized description of the exposure + */ + summary?: string | null; + } + + export namespace Spenders { + export interface Exposure { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + } + + export interface StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema { + asset: StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema.Asset; + + /** + * Mapping between the spender address and the exposure of the asset + */ + spenders?: Record< + string, + StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema.Spenders + >; + } + + export namespace StellarAddressAssetExposureSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchemaNativeAssetDetailsSchemaSingleAssetExposureSchema { + export interface Asset { + /** + * Asset code + */ + code?: 'XLM'; + + /** + * Type of the asset (`NATIVE`) + */ + type?: 'NATIVE'; + } + + export interface Spenders { + /** + * Approval value of the ERC20 token + */ + approval: string; + + exposure: Array; + + /** + * Expiration date of the approval + */ + expiration?: string | null; + + /** + * Summarized description of the exposure + */ + summary?: string | null; + } + + export namespace Spenders { + export interface Exposure { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + } + } + + export interface StellarSimulationErrorSchema { + /** + * Error message + */ + error: string; + + status: 'Error'; + } + + export interface StellarValidationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchema { + /** + * A textual classification that can be presented to the user explaining the + * reason. + */ + classification: string; + + /** + * A textual description about the validation result + */ + description: string; + + /** + * A list of features about this transaction explaining the validation + */ + features: Array; + + /** + * A textual description about the reasons the transaction was flagged with + * result_type + */ + reason: string; + + /** + * Verdict of the validation + */ + result_type: 'Benign' | 'Warning' | 'Malicious'; + + status: 'Success'; + } + + export namespace StellarValidationResultSchemaTypeAnnotatedUnionMuxedAccountContractAddressSkipValidationPlainSerializerGetPydanticSchema { + export interface Feature { + /** + * Address the feature refers to + */ + address: string; + + /** + * Textual description + */ + description: string; + + feature_id: string; + + /** + * Feature Classification + */ + type: 'Benign' | 'Warning' | 'Malicious' | 'Info'; + } + } + + export interface StellarValidationErrorSchema { + /** + * Error message + */ + error: string; + + status: 'Error'; + } +} + export interface TransactionScanParams { account_address: string; @@ -37,8 +780,9 @@ export interface TransactionScanParams { /** * List of options to include in the response * - * - `simulation`: Include simulation output in the response - * - `validation`: Include security validation of the transaction in the response + * - `Options.validation`: Include Options.validation output in the response + * + * - `Options.simulation`: Include Options.simulation output in the response */ options?: Array<'validation' | 'simulation'>; } @@ -60,10 +804,11 @@ export namespace TransactionScanParams { /** * Metadata for in-app requests */ - type: 'in_app'; + type?: 'in_app'; } } export namespace Transaction { + export import TransactionScanResponse = TransactionAPI.TransactionScanResponse; export import TransactionScanParams = TransactionAPI.TransactionScanParams; }