import type { Address, Chain, Hex, TypedDataDefinition } from 'viem'; import type { NonEvmAddress } from '../../chains/non-evm.js'; type SupportedChain = number; type CrossChainSettlementLayer = 'ACROSS' | 'ECO' | 'RELAY' | 'OFT' | 'NEAR' | 'RHINO' | 'CCTP'; type SupportedTokenSymbol = 'ETH' | 'WETH' | 'USDC' | 'USDT' | 'USDT0'; type SupportedToken = SupportedTokenSymbol | Address; type AccountType = 'GENERIC' | 'ERC7579' | 'EOA'; declare const INTENT_STATUS_PENDING = "PENDING"; declare const INTENT_STATUS_FAILED = "FAILED"; declare const INTENT_STATUS_COMPLETED = "COMPLETED"; /** * High-level intent status. * * - `PENDING` – the intent has been accepted and is being processed * - `COMPLETED` – all operations finished successfully * - `FAILED` – the intent failed (inspect `operations` for details) */ type IntentStatus = typeof INTENT_STATUS_PENDING | typeof INTENT_STATUS_COMPLETED | typeof INTENT_STATUS_FAILED; type MappedChainTokenAccessList = { chainTokens?: { [chainId in SupportedChain]?: SupportedToken[]; }; chainTokenAmounts?: { [chainId in SupportedChain]?: Partial>; }; }; type UnmappedChainTokenAccessList = { chainIds?: SupportedChain[]; tokens?: SupportedToken[]; }; type AccountAccessList = MappedChainTokenAccessList | UnmappedChainTokenAccessList; /** Per-operation status. */ type OperationStatus = 'PENDING' | 'COMPLETED' | 'FAILED'; /** * Why an operation failed. Only meaningful when `status` is `FAILED`. * * - `EXPIRED` – the operation deadline passed without completion * - `REVERTED` – the on-chain transaction reverted * - `RELAYER_FAILURE` – the relayer could not submit the transaction */ type FailureReason = 'EXPIRED' | 'REVERTED' | 'RELAYER_FAILURE'; /** * One operation per chain involved in the intent. * * The orchestrator returns `items[]` per chain for future extensibility; * the SDK flattens to one entry per chain for simpler DX. */ type ChainOperation = { /** Chain ID this operation belongs to. */ chain: number; status: 'PENDING'; } | { chain: number; status: 'COMPLETED'; /** Transaction hash of the confirmed on-chain transaction. */ txHash: Hex; /** UNIX epoch seconds when the on-chain transaction was confirmed. */ timestamp: number; } | { chain: number; status: 'FAILED'; /** Why the operation failed. */ failureReason: FailureReason; }; interface Execution { to: Address; value: bigint; data: Hex; } type SettlementLayer = 'SAME_CHAIN' | 'INTENT_EXECUTOR' | CrossChainSettlementLayer; type SettlementLayerFilter = { include: CrossChainSettlementLayer[]; } | { exclude: CrossChainSettlementLayer[]; }; declare const SIG_MODE_EMISSARY = 0; declare const SIG_MODE_ERC1271 = 1; declare const SIG_MODE_EMISSARY_ERC1271 = 2; declare const SIG_MODE_ERC1271_EMISSARY = 3; declare const SIG_MODE_EMISSARY_EXECUTION = 4; declare const SIG_MODE_EMISSARY_EXECUTION_ERC1271 = 5; declare const SIG_MODE_ERC1271_EMISSARY_EXECUTION = 6; type SignatureMode = typeof SIG_MODE_EMISSARY | typeof SIG_MODE_ERC1271 | typeof SIG_MODE_EMISSARY_ERC1271 | typeof SIG_MODE_ERC1271_EMISSARY | typeof SIG_MODE_EMISSARY_EXECUTION | typeof SIG_MODE_EMISSARY_EXECUTION_ERC1271 | typeof SIG_MODE_ERC1271_EMISSARY_EXECUTION; type AuxiliaryFunds = { [chainId: number]: Record; }; interface IntentOptions { appFees?: AppFeeRate; protocolFees?: ProtocolFeeRate; /** * Absolute unix timestamp (seconds) overriding the on-chain fill deadline. * Same-chain (tokenless) route only; ignored elsewhere. Bounds (`now + 120s` * .. `now + 86400s`) are enforced by the orchestrator. */ customDeadline?: number; sponsorSettings?: SponsorSettings; settlementLayers?: SettlementLayerFilter; signatureMode?: SignatureMode; auxiliaryFunds?: AuxiliaryFunds; } interface AppFeeRate { feeBps: number; } /** * Rate for the Rhinestone protocol fee — a clone of the app fee that always * accrues to Rhinestone regardless of the caller's API key, collected alongside * the app fee in one batched transfer, and (unlike the app fee) sponsorable via * `SponsorSettings.protocolFees`. */ interface ProtocolFeeRate { feeBps: number; } /** An integrator's accrued app-fee balance, as USD totals. */ interface AppFeeBalances { /** Collected (accrued) app fees available to withdraw, valued in USD at collection. */ withdrawableUsd: number; /** Value reserved by an in-flight withdrawal; `0` until withdrawals are enabled. */ pendingUsd: number; } interface SponsorSettings { gas: boolean; bridgeFees: boolean; swapFees: boolean; protocolFees?: boolean; } interface PortfolioToken { symbol: string; chains: { chain: number; address: Address; decimals: number; amount: bigint; }[]; } type Portfolio = PortfolioToken[]; interface IntentInput { account: Account; destinationChainId: number; destinationExecutions: Execution[]; destinationGasUnits?: bigint; tokenRequests: { tokenAddress: Address | NonEvmAddress; amount?: bigint; }[]; recipient?: Account; accountAccessList?: AccountAccessList; options: IntentOptions; preClaimExecutions?: Record; } interface UsdAmount { usd: number; } type Price = { usd: number; } | null; interface CostTokenEntry { chainId: number; tokenAddress: Address; symbol: string | null; decimals: number | null; price: Price; amount: bigint; } interface FeeBreakdown { gas: UsdAmount; bridge: UsdAmount; swap: UsdAmount; app: UsdAmount; protocol: UsdAmount; } interface Fees { total: UsdAmount; breakdown: FeeBreakdown; } interface Cost { input: CostTokenEntry[]; output: CostTokenEntry[]; fees: Fees; } interface EstimatedFillTime { seconds: number; } interface SignData { origin: TypedDataDefinition[]; destination: TypedDataDefinition; targetExecution?: TypedDataDefinition; } type BridgeFill = { type: 'OFT'; destinationChainId: number; } | { type: 'RELAY'; destinationChainId: number; requestId: string; } | { type: 'NEAR'; destinationChainId: number; depositAddress: Address; } | { type: 'RHINO'; destinationChainId: number; commitmentId: string; } | { type: 'CCTP'; destinationChainId: number; sourceDomainId: number; destinationDomainId: number; }; interface Quote { intentId: string; expiresAt: number; estimatedFillTime: EstimatedFillTime; settlementLayer: SettlementLayer; signData: SignData; cost: Cost; tokenRequirements?: TokenRequirements; bridgeFill?: BridgeFill; } interface QuoteResponse { traceId: string; routes: Quote[]; } type OriginSignature = Hex | { notarizedClaimSig: Hex; preClaimSig: Hex; }; interface SignedAuthorization { chainId: string; address: Address; nonce: number; yParity: number; r: Hex; s: Hex; } interface IntentSubmitRequest { intentId: string; signatures: { origin: OriginSignature[]; destination: Hex; targetExecution?: Hex; }; authorizations?: { sponsor?: SignedAuthorization[]; recipient?: SignedAuthorization[]; }; } /** * Internal augmentation of the submit request. Not part of the blanc public * schema, but the orchestrator still reads `options.dryRun` from the raw body. * Used by the SDK's `simulate` flag — never surfaced to consumers. */ interface IntentSubmitRequestInternal extends IntentSubmitRequest { options?: { dryRun?: boolean; }; } interface IntentSubmitResponse { traceId: string; intentId: string; } type AccountContext = { accountType: 'smartAccount'; isDeployed: boolean; isERC7579: boolean; erc7579AccountType: string; erc7579AccountVersion: string; } | { accountType: 'EOA'; }; interface Account { address: Address | NonEvmAddress; /** * Account type — required for EVM accounts. Omitted for non-EVM * recipients (Solana / Tron) where smart-account semantics don't apply * and the orchestrator schema requires it unset. */ accountType?: AccountType; /** * Per-chain account-setup operations — required for EVM accounts. * Omitted for non-EVM recipients for the same reason as `accountType`. */ setupOps?: Pick[]; delegations?: Delegations; /** Per-chain SSX mock signatures keyed by decimal chainId string. */ mockSignatures?: Record<`${number}`, Hex>; } type AccountWithContext = Omit & { accountContext: { [chainId: number]: AccountContext; }; requiredDelegations?: Delegations; }; interface Delegation { contract: Address; } type Delegations = Record; interface WrapRequired { type: 'wrap'; amount: bigint; } interface ApprovalRequired { type: 'approval'; amount: bigint; spender: Address; } type TokenRequirements = { [chainId: number]: { [tokenAddress: Address]: ApprovalRequired | WrapRequired; }; }; interface TokenConfig { symbol: string; address: Address; decimals: number; } export type TokenPrices = { [key in SupportedTokenSymbol]?: number; }; export type GasPrices = Partial>; export type OPNetworkParams = Partial> | { estimatedCalldataSize: number; }; interface SplitIntentsInput { chain: Chain; tokens: Record; settlementLayers?: SettlementLayerFilter; } interface SplitIntentsResult { traceId: string; intents: Record[]; } /** * Full intent status as returned by the orchestrator (blanc API version). * * One operation per chain involved in the intent. The SDK flattens the * orchestrator's per-chain `items[]` to a single entry per chain. */ interface IntentOpStatus { /** OpenTelemetry trace ID for correlating this orchestrator response. */ traceId: string; /** High-level intent status. */ status: IntentStatus; /** The smart-account address that owns this intent. */ accountAddress: Address; /** Per-chain operation status. One entry per chain. */ operations: ChainOperation[]; } export type { Account, AccountType, AccountWithContext, AppFeeRate, ProtocolFeeRate, AuxiliaryFunds, AppFeeBalances, TokenConfig, SupportedChain, SettlementLayer, SettlementLayerFilter, SignatureMode, IntentInput, BridgeFill, Quote, QuoteResponse, Cost, CostTokenEntry, FeeBreakdown, Fees, Price, UsdAmount, EstimatedFillTime, SignData, IntentSubmitRequest, IntentSubmitRequestInternal, IntentSubmitResponse, IntentOpStatus, IntentOptions, SponsorSettings, SignedAuthorization, SplitIntentsInput, SplitIntentsResult, Portfolio, PortfolioToken, Execution, AccountAccessList, MappedChainTokenAccessList, UnmappedChainTokenAccessList, OriginSignature, TokenRequirements, WrapRequired, ApprovalRequired, TypedDataDefinition, OperationStatus, FailureReason, ChainOperation, IntentStatus, }; export { INTENT_STATUS_PENDING, INTENT_STATUS_FAILED, INTENT_STATUS_COMPLETED, SIG_MODE_EMISSARY, SIG_MODE_ERC1271, SIG_MODE_EMISSARY_ERC1271, SIG_MODE_ERC1271_EMISSARY, SIG_MODE_EMISSARY_EXECUTION, SIG_MODE_EMISSARY_EXECUTION_ERC1271, SIG_MODE_ERC1271_EMISSARY_EXECUTION, }; //# sourceMappingURL=public.d.ts.map