import { APIResource } from "../../core/resource.js"; import * as SuiAPI from "./sui.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class PostTransaction extends APIResource { /** * Scan a transaction that was already executed on chain, returns validation with * features indicating address poisoning entities and malicious operators. * * @example * ```ts * const response = await client.sui.postTransaction.scan({ * chain: 'mainnet', * data: { * tx_hash: '7h7BZFAq5PfxqJEVqrm5g6oUZNkHGEip57vXsQRVgjmp', * }, * metadata: { non_dapp: true, domain: 'valid.com' }, * options: ['simulation'], * }); * ``` */ scan(body: PostTransactionScanParams, options?: RequestOptions): APIPromise; } export interface PostTransactionScanResponse { account_address: string; /** * Simulation result; Only present if simulation option is included in the request */ simulation?: PostTransactionScanResponse.SuiPostTransactionSimulationResult | PostTransactionScanResponse.SuiSimulationErrorSchema | null; /** * Validation result; Only present if validation option is included in the request */ validation?: PostTransactionScanResponse.SuiValidationResult | PostTransactionScanResponse.SuiValidationErrorSchema | null; } export declare namespace PostTransactionScanResponse { interface SuiPostTransactionSimulationResult { /** * Summary of the actions and asset transfers that were made by the requested * account address */ account_summary: SuiPostTransactionSimulationResult.AccountSummary; params: SuiPostTransactionSimulationResult.Params; 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; }; } namespace SuiPostTransactionSimulationResult { /** * Summary of the actions and asset transfers that were made by the requested * account address */ interface AccountSummary { /** * Total USD diff for the requested account address */ total_usd_diff: AccountSummary.TotalUsdDiff; /** * Assets diffs of the requested account address */ account_assets_diffs?: Array; } namespace AccountSummary { /** * 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 SuiNativeAssetDiff { asset: SuiAPI.SuiNativeAssetDetailsSchema; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: SuiAPI.SuiAssetTransferDetailsSchema | null; /** * Details of the outgoing transfer */ out?: SuiAPI.SuiAssetTransferDetailsSchema | null; } interface SuiNFTAssetDiff { asset: SuiAPI.SuiNFTDetailsSchema; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: SuiAPI.SuiNFTDiffSchema | null; /** * Details of the outgoing transfer */ out?: SuiAPI.SuiNFTDiffSchema | null; } interface SuiCoinsAssetDiff { asset: SuiCoinsAssetDiff.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: SuiAPI.SuiAssetTransferDetailsSchema | null; /** * Details of the outgoing transfer */ out?: SuiAPI.SuiAssetTransferDetailsSchema | null; } namespace SuiCoinsAssetDiff { interface Asset { /** * Token's package address */ address: string; /** * Token's decimal precision */ decimals: number; /** * Token's name */ name: string; /** * Token's symbol (abbreviation) */ symbol: string; creation_timestamp?: string | null; /** * Address of the token's deployer */ deployer?: string | null; /** * URL of the token's logo */ logo_url?: string | null; scam?: boolean | null; total_supply?: number | null; /** * Type of the asset (`Coin`) */ type?: 'fungible'; verified?: boolean | null; } } } interface Params { block_tag: string; chain: string; from: string; value: string; [k: string]: unknown; } interface AddressDetail { /** * Encoded public key of the account */ account_address: string; /** * Description of the account */ description?: string | null; } interface SuiNativeAssetDiff { asset: SuiAPI.SuiNativeAssetDetailsSchema; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: SuiAPI.SuiAssetTransferDetailsSchema | null; /** * Details of the outgoing transfer */ out?: SuiAPI.SuiAssetTransferDetailsSchema | null; } interface SuiNFTAssetDiff { asset: SuiAPI.SuiNFTDetailsSchema; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: SuiAPI.SuiNFTDiffSchema | null; /** * Details of the outgoing transfer */ out?: SuiAPI.SuiNFTDiffSchema | null; } interface SuiCoinsAssetDiff { asset: SuiCoinsAssetDiff.Asset; /** * The type of the assets in this diff */ asset_type: string; /** * Details of the incoming transfer */ in?: SuiAPI.SuiAssetTransferDetailsSchema | null; /** * Details of the outgoing transfer */ out?: SuiAPI.SuiAssetTransferDetailsSchema | null; } namespace SuiCoinsAssetDiff { interface Asset { /** * Token's package address */ address: string; /** * Token's decimal precision */ decimals: number; /** * Token's name */ name: string; /** * Token's symbol (abbreviation) */ symbol: string; creation_timestamp?: string | null; /** * Address of the token's deployer */ deployer?: string | null; /** * URL of the token's logo */ logo_url?: string | null; scam?: boolean | null; total_supply?: number | null; /** * Type of the asset (`Coin`) */ type?: 'fungible'; verified?: boolean | null; } } } interface SuiSimulationErrorSchema { /** * Error message */ error: string; status: 'Error'; } interface SuiValidationResult { /** * 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 SuiValidationResult { interface Feature { /** * Address the feature refers to */ address: string; /** * Textual description */ description: string; feature_id: string; /** * Feature Classification */ type: 'Benign' | 'Warning' | 'Malicious' | 'Info'; } } interface SuiValidationErrorSchema { /** * Error message */ error: string; status: 'Error'; } } export interface PostTransactionScanParams { chain: 'mainnet'; data: PostTransactionScanParams.Data; metadata: PostTransactionScanParams.Metadata; /** * List of options to include 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'>; } export declare namespace PostTransactionScanParams { interface Data { tx_hash: string; } interface Metadata { /** * cross reference transaction against the domain. */ domain?: string | null; /** * whether the transaction is initiated by a dapp. Default is false. */ non_dapp?: boolean | null; } } export declare namespace PostTransaction { export { type PostTransactionScanResponse as PostTransactionScanResponse, type PostTransactionScanParams as PostTransactionScanParams, }; } //# sourceMappingURL=post-transaction.d.ts.map