import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Transaction extends APIResource { /** * Get a risk recommendation with plain-language reasons for a Hedera transaction. * * @example * ```ts * const response = await client.hedera.transaction.scan({ * account_address: '0.0.9352077', * chain: 'mainnet', * metadata: { type: 'wallet', url: 'https://example.com' }, * transaction: * 'KmEKXQoVCgwIjvztygYQn6yo3QISBRiawrcDEgIYBhiAwtcvIgIIeDIVSEJBUiB0cmFuc2ZlciBleGFtcGxlciAKHgoNCgUYjee6BBD/p9a5BwoNCgUYha/rARCAqNa5BxIA', * options: ['simulation'], * }); * ``` */ scan(body: TransactionScanParams, options?: RequestOptions): APIPromise; } /** * Transaction scan response schema. */ export interface TransactionScanResponse { /** * Simulation result; Only present if simulation option is included in the request */ simulation?: TransactionScanResponse.HederaSimulationResponse | TransactionScanResponse.HederaSimulationErrorSchema | null; /** * Validation result; Only present if validation option is included in the request */ validation?: TransactionScanResponse.HederaValidationResult | TransactionScanResponse.HederaValidationErrorSchema | null; } export declare namespace TransactionScanResponse { interface HederaSimulationResponse { /** * Summary of the actions and asset transfers that were made by the requested * account address */ account_summary: HederaSimulationResponse.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?: { [key: string]: Array; }; /** * Mapping between the address of an account to the exposure of the assets during * the transaction */ exposures?: { [key: string]: Array; }; transaction_actions?: Array<'native_wrap' | 'native_transfer' | 'token_transfer' | 'swap' | 'mint' | 'stake' | 'approval' | 'proxy_upgrade' | 'ownership_change' | 'set_code_account' | (string & {})> | null; } namespace HederaSimulationResponse { /** * Summary of the actions and asset transfers that were made by the requested * account address */ interface AccountSummary { /** * Exposures made by the requested account address */ account_exposures: 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; /** * Total USD exposure for each of the spender addresses during the transaction */ total_usd_exposure?: { [key: string]: number; }; } namespace AccountSummary { interface AccountExposure { asset: AccountExposure.HederaNativeAssetDetailsSchema | AccountExposure.HederaTokenDetailsSchema | AccountExposure.HederaNFTDetailsSchema; /** * Mapping between the spender address and the exposure of the asset */ spenders?: { [key: string]: AccountExposure.Spenders; }; } namespace AccountExposure { interface HederaNativeAssetDetailsSchema { /** * Type of the asset (`NATIVE`) */ type?: 'NATIVE'; } interface HederaTokenDetailsSchema { /** * The token ID */ id: string; /** * Decimals of the asset */ decimals: number; /** * The token description */ description: string; /** * The token name */ name: string; /** * The token's symbol */ symbol: string; /** * URL of the asset's logo */ logo_url?: string | null; /** * Type of the asset (`TOKEN`) */ type?: 'TOKEN'; } interface HederaNFTDetailsSchema { /** * The NFT ID */ id: string; /** * The NFT's description */ description: string; /** * NFT's display name */ name: string; /** * The NFT's collection ID (token ID) */ nft_type: string; /** * URL of the NFT's image */ logo_url?: string | null; /** * Type of the asset (`NFT`) */ type?: 'NFT'; } interface Spenders { exposure: Array; /** * Summarized description of the exposure */ summary?: string | null; } namespace Spenders { interface Exposure { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } } /** * Total USD diff for the requested account address */ interface TotalUsdDiff { /** * Total incoming USD transfers */ in: number; /** * Total outgoing USD transfers */ out: number; /** * Total USD transfers */ total?: number; } interface HederaAccountNativeAssetTransferDiffDetailsSchema { asset: HederaAccountNativeAssetTransferDiffDetailsSchema.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: HederaAccountNativeAssetTransferDiffDetailsSchema.In | null; /** * Details of the outgoing transfer */ out?: HederaAccountNativeAssetTransferDiffDetailsSchema.Out | null; } namespace HederaAccountNativeAssetTransferDiffDetailsSchema { interface Asset { /** * Type of the asset (`NATIVE`) */ type?: 'NATIVE'; } /** * Details of the incoming transfer */ interface In { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } /** * Details of the outgoing transfer */ interface Out { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } interface HederaAccountTokenTransferDiffDetailsSchema { asset: HederaAccountTokenTransferDiffDetailsSchema.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: HederaAccountTokenTransferDiffDetailsSchema.In | null; /** * Details of the outgoing transfer */ out?: HederaAccountTokenTransferDiffDetailsSchema.Out | null; } namespace HederaAccountTokenTransferDiffDetailsSchema { interface Asset { /** * The token ID */ id: string; /** * Decimals of the asset */ decimals: number; /** * The token description */ description: string; /** * The token name */ name: string; /** * The token's symbol */ symbol: string; /** * URL of the asset's logo */ logo_url?: string | null; /** * Type of the asset (`TOKEN`) */ type?: 'TOKEN'; } /** * Details of the incoming transfer */ interface In { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } /** * Details of the outgoing transfer */ interface Out { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } interface NFTDetailsSchemaErc721DiffSchema { asset: NFTDetailsSchemaErc721DiffSchema.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: NFTDetailsSchemaErc721DiffSchema.In | null; /** * Details of the outgoing transfer */ out?: NFTDetailsSchemaErc721DiffSchema.Out | null; } namespace NFTDetailsSchemaErc721DiffSchema { interface Asset { /** * The NFT ID */ id: string; /** * The NFT's description */ description: string; /** * NFT's display name */ name: string; /** * The NFT's collection ID (token ID) */ nft_type: string; /** * URL of the NFT's image */ logo_url?: string | null; /** * Type of the asset (`NFT`) */ type?: 'NFT'; } /** * Details of the incoming transfer */ interface In { /** * Token ID of the transfer */ token_id: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } /** * Details of the outgoing transfer */ interface Out { /** * Token ID of the transfer */ token_id: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } } interface AddressDetail { /** * Encoded public key of the account */ account_address: string; /** * Description of the account */ description?: string | null; } interface HederaAccountNativeAssetTransferDiffDetailsSchema { asset: HederaAccountNativeAssetTransferDiffDetailsSchema.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: HederaAccountNativeAssetTransferDiffDetailsSchema.In | null; /** * Details of the outgoing transfer */ out?: HederaAccountNativeAssetTransferDiffDetailsSchema.Out | null; } namespace HederaAccountNativeAssetTransferDiffDetailsSchema { interface Asset { /** * Type of the asset (`NATIVE`) */ type?: 'NATIVE'; } /** * Details of the incoming transfer */ interface In { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } /** * Details of the outgoing transfer */ interface Out { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } interface HederaAccountTokenTransferDiffDetailsSchema { asset: HederaAccountTokenTransferDiffDetailsSchema.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: HederaAccountTokenTransferDiffDetailsSchema.In | null; /** * Details of the outgoing transfer */ out?: HederaAccountTokenTransferDiffDetailsSchema.Out | null; } namespace HederaAccountTokenTransferDiffDetailsSchema { interface Asset { /** * The token ID */ id: string; /** * Decimals of the asset */ decimals: number; /** * The token description */ description: string; /** * The token name */ name: string; /** * The token's symbol */ symbol: string; /** * URL of the asset's logo */ logo_url?: string | null; /** * Type of the asset (`TOKEN`) */ type?: 'TOKEN'; } /** * Details of the incoming transfer */ interface In { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } /** * Details of the outgoing transfer */ interface Out { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } interface NFTDetailsSchemaErc721DiffSchema { asset: NFTDetailsSchemaErc721DiffSchema.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: NFTDetailsSchemaErc721DiffSchema.In | null; /** * Details of the outgoing transfer */ out?: NFTDetailsSchemaErc721DiffSchema.Out | null; } namespace NFTDetailsSchemaErc721DiffSchema { interface Asset { /** * The NFT ID */ id: string; /** * The NFT's description */ description: string; /** * NFT's display name */ name: string; /** * The NFT's collection ID (token ID) */ nft_type: string; /** * URL of the NFT's image */ logo_url?: string | null; /** * Type of the asset (`NFT`) */ type?: 'NFT'; } /** * Details of the incoming transfer */ interface In { /** * Token ID of the transfer */ token_id: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } /** * Details of the outgoing transfer */ interface Out { /** * Token ID of the transfer */ token_id: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } interface Exposure { asset: Exposure.HederaNativeAssetDetailsSchema | Exposure.HederaTokenDetailsSchema | Exposure.HederaNFTDetailsSchema; /** * Mapping between the spender address and the exposure of the asset */ spenders?: { [key: string]: Exposure.Spenders; }; } namespace Exposure { interface HederaNativeAssetDetailsSchema { /** * Type of the asset (`NATIVE`) */ type?: 'NATIVE'; } interface HederaTokenDetailsSchema { /** * The token ID */ id: string; /** * Decimals of the asset */ decimals: number; /** * The token description */ description: string; /** * The token name */ name: string; /** * The token's symbol */ symbol: string; /** * URL of the asset's logo */ logo_url?: string | null; /** * Type of the asset (`TOKEN`) */ type?: 'TOKEN'; } interface HederaNFTDetailsSchema { /** * The NFT ID */ id: string; /** * The NFT's description */ description: string; /** * NFT's display name */ name: string; /** * The NFT's collection ID (token ID) */ nft_type: string; /** * URL of the NFT's image */ logo_url?: string | null; /** * Type of the asset (`NFT`) */ type?: 'NFT'; } interface Spenders { exposure: Array; /** * Summarized description of the exposure */ summary?: string | null; } namespace Spenders { interface Exposure { /** * Raw value of the transfer */ raw_value: number; /** * Value of the transfer */ value: string; /** * Summarized description of the transfer */ summary?: string | null; /** * USD price of the asset */ usd_price?: number | null; } } } } interface HederaSimulationErrorSchema { /** * Error message */ error: string; status: 'Error'; /** * Error details if the simulation failed. */ error_details?: HederaSimulationErrorSchema.HederaGenericErrorDetails | HederaSimulationErrorSchema.HederaUnsupportedTransactionTypeErrorDetails; } namespace HederaSimulationErrorSchema { interface HederaGenericErrorDetails { category: string; /** * The error code */ code: string; } interface HederaUnsupportedTransactionTypeErrorDetails { category: 'INVALID_INPUT'; code: 'UNSUPPORTED_TRANSACTION_TYPE'; /** * The unsupported transaction type */ transaction_type: string; } } interface HederaValidationResult { /** * A textual classification that can be presented to the user explaining the * reason. */ classification: string; /** * A textual description about the validation result */ description: string; 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' | 'Error'; status: 'Success'; } namespace HederaValidationResult { interface Feature { /** * Address the feature relates to. */ address: string | null; /** * Textual description of the feature. */ description: string; /** * The ID of the feature associated with this transaction. */ feature_id: string; /** * The security classification of the feature (Benign, Warning, Malicious or Info). */ type: 'Benign' | 'Warning' | 'Malicious' | 'Info'; } } interface HederaValidationErrorSchema { /** * Error message */ error: string; status: 'Error'; } } export interface TransactionScanParams { /** * The address to relate the transaction to. Account address determines in which * perspective the transaction is simulated and validated. */ account_address: unknown; /** * The chain the transaction runs on. */ chain: 'mainnet'; /** * Additional information regarding the wallet involved in the transaction. */ metadata: TransactionScanParams.HederaWalletRequestMetadata | TransactionScanParams.HederaInAppRequestMetadata; transaction: string; /** * Select which component will be included in the response. * * - `simulation` - Include the results of the transaction simulation in your * response. * - `validation` - Include a security validation of the transaction in your * response. */ options?: Array<'validation' | 'simulation'>; [k: string]: unknown; } export declare namespace TransactionScanParams { interface HederaWalletRequestMetadata { /** * Metadata for wallet requests */ type: 'wallet'; /** * URL of the dApp the transaction originated from. */ url: string; /** * Account information associated with the request */ account?: HederaWalletRequestMetadata.Account; /** * Connection metadata including user agent and IP information */ connection?: HederaWalletRequestMetadata.Connection; } namespace HederaWalletRequestMetadata { /** * Account information associated with the request */ interface Account { /** * Unique identifier for the account. */ account_id: string; /** * Timestamp when the account was created. */ account_creation_timestamp?: string; /** * Age of the user in years */ user_age?: number; /** * ISO country code of the user's location. */ user_country_code?: string; } /** * Connection metadata including user agent and IP information */ interface Connection { /** * IP address of the customer making the request. */ ip_address: string; /** * User agent string from the client's browser or application. */ user_agent?: string; } } interface HederaInAppRequestMetadata { /** * Account information associated with the request */ account?: HederaInAppRequestMetadata.Account; /** * Connection metadata including user agent and IP information */ connection?: HederaInAppRequestMetadata.Connection; /** * Metadata for in-app requests */ type?: 'in_app'; } namespace HederaInAppRequestMetadata { /** * Account information associated with the request */ interface Account { /** * Unique identifier for the account. */ account_id: string; /** * Timestamp when the account was created. */ account_creation_timestamp?: string; /** * Age of the user in years */ user_age?: number; /** * ISO country code of the user's location. */ user_country_code?: string; } /** * Connection metadata including user agent and IP information */ interface Connection { /** * IP address of the customer making the request. */ ip_address: string; /** * User agent string from the client's browser or application. */ user_agent?: string; } } } export declare namespace Transaction { export { type TransactionScanResponse as TransactionScanResponse, type TransactionScanParams as TransactionScanParams, }; } //# sourceMappingURL=transaction.d.ts.map