import { Amount } from '@safeblock/blockchain-utils'; import { default as BigNumber } from 'bignumber.js'; import { default as SdkException } from './sdk-exception'; import { ExchangeQuota, ExecutorCallData, SimulatedRoute } from '../types'; type TMixinList = { [key: string]: { [key: string]: { [key: string]: any; }; }; }; /** Mixins description */ export interface InternalMixinList extends TMixinList { internal: { buildCrossChainTransaction: { nativeAmountFinalized: BigNumber; transferDataEncoded: string; arrivalGasDataEncoded: string; multiCallTransactionRequest: ExecutorCallData; approveTransactionRequest: ExecutorCallData; resetApproveTransactionRequest: ExecutorCallData; outputAmountsCorrected: [Amount, Amount[]]; quotaComputationFinalized: ExchangeQuota; tokenTransferCallDataFinalized: Promise | string; bridgeTransactionCallData: string; bridgeTransactionNativeAmount: string; callOffset: string; }; computeQuotaExecutionGasUsage: { bridgeSwapMessageGasUsage: number; bridgeHollowMessageGasUsage: number; wrapTransactionGasUsage: number; unwrapTransactionGasUsage: number; multiStepExchangeWrapperGasUsage: number; finalMultiplier: number; }; computeOnchainTradeGasUsage: { uniswapV3StepGasUsage: number; uniswapV2StepGasUsage: number; receiveNativeGasUsage: number; routeInitialGasUsage: number; }; fetchRoute: { receivedFinalizedRoute: SimulatedRoute | SdkException; wrapUnwrapVirtualRouteBuilt: SimulatedRoute; }; createSingleChainTransaction: { singleChainQuotaBuilt: ExchangeQuota; tokenTransferCallDataFinalized: Promise | string; }; createSingleChainWrapUnwrapTransaction: { quotaBuilt: ExchangeQuota; }; }; } /** * SDK sub‑system that implements mixins */ export declare class SdkMixins { private mixins; /** * Register a mixin that alters specific logic * * @param location global namespace the mixin belongs to * @param namespace local namespace the mixin belongs to * @param breakpoint mixin name (logical breakpoint) * @param callback function that mutates the value * @returns {string} identifier of the registered mixin */ addMixin(location: Location, namespace: Namespace, breakpoint: Breakpoint, callback: (value: Value) => Value): string; /** * Internal convenience method that returns a mixin applicator * for a given global namespace. * * @internal * * @param {Location} location global namespace * @returns mixin applicator bound to the specified namespace */ getMixinApplicator(location: Location): { /** Apply mixins for the specified logic */ applyMixin: (namespace: Namespace, breakpoint: Breakpoint, value: CombinedMixinsList[Location][Namespace][Breakpoint]) => CombinedMixinsList[Location][Namespace][Breakpoint]; /** Obtain a more specific applicator for a local namespace */ getNamespaceApplicator: (namespace: Namespace) => { /** Apply mixins for the specified logic */ applyMixin: (breakpoint: Breakpoint, value: CombinedMixinsList[Location][Namespace][Breakpoint]) => CombinedMixinsList[Location][Namespace][Breakpoint]; }; }; /** * Remove a mixin by its identifier * * @param {string} identifier mixin identifier returned by `addMixin` */ removeMixin(identifier: string): void; /** * Deep‑copy helper that unlinks objects, * producing copies without shared references. * * @param _value object to copy * @returns cloned object in a new memory space * @private */ private unlink; } export {};