import { ExternalVariable, Variable } from '../../Fct/plugins/corelibTypes'; import { IconType } from 'react-icons'; export declare const maxValue = "115792089237316195423570985008687907853269984665640564039457584007913129639935"; export type ChainId = '1' | '42161' | '11155111' | '10' | '8453'; export type DefaultProtocols = 'ERC20' | 'ERC721' | 'ERC1155' | 'MATH' | 'TOKEN_MATH' | 'VALIDATOR' | 'TOKEN_VALIDATOR' | 'UNISWAP' | 'AAVE' | 'AaveV3' | 'UTILITY' | 'SUSHISWAP' | 'PARASWAP' | 'YEARN' | 'COMPOUND_V2' | 'COMPOUND_V3' | '1INCH' | 'CURVE' | 'CHAINLINK' | 'UNISWAP_V3' | 'CUSTOM' | 'SECURE_STORAGE' | 'RADIANTV2' | 'KIROBO_MULTICALL' | 'ROCKETPOOL' | 'LIDO' | 'FUNCTIONS' | 'KIROBO_MULTICALL_CSV' | 'MAGIC' | 'GMX' | 'cBridge'; export type Protocol = DefaultProtocols | string; export type Type = 'ACTION' | 'GETTER' | 'VALIDATOR' | 'CALCULATOR' | 'LIBRARY' | 'ORACLE' | 'MODULE' | 'MULTICALL' | 'LIBRARY:VIEWONLY' | 'COMPUTED' | 'VALIDATION' | 'OFFCHAIN_ONLY'; type PluginType = Type; export type FlowType = 'OFFCHAIN_ONLY' | 'ANY' | 'REACT_COMPONENT' | undefined; export interface IFctParam { fctType: string; appType: string; value?: T; } type ParamType = K & T; interface FctParamTypeArgs { fctType: string; appType: string; } export type Risk = { description: string; isDanger: (p: Type | undefined) => boolean; }; export type Options = { value: Type | undefined; category?: string; name?: string; decimals?: number; symbol?: string; logoURI?: string; chainId?: number | string; decimalsList?: string[]; coins?: { address: string; decimals?: string | number; logo?: string; }[]; assetTypeName?: string; implementation?: string; }[]; type MODE = 'INPUT' | 'VARIABLE' | 'ALL'; interface FctParamOptionalArgs { mode?: MODE; destination?: DestinationType; rawValue?: string; description?: string; value?: Type; required?: boolean; innerIndex?: number; risk?: Risk; options?: Options | undefined; messageType?: AppType | FctType; readonly?: boolean; innerType?: string; decimals?: number; hidden?: boolean; key?: string; virtual?: boolean; symbol?: string; isPreview?: boolean; icon?: IconType; } interface FctParamArgs extends FctParamTypeArgs, FctParamOptionalArgs { messageType?: AppType | FctType; } export declare const isVariable: (value: unknown) => boolean; export declare const isOutputVariable: (value: unknown) => boolean; export type IconData = { package: 'react-icons'; name: string; }; export type ParamJSONData = { readonly appType: string; readonly fctType: string; readonly key: string; readonly ioType: 'INPUT' | 'OUTPUT'; uiType?: string; value?: string | Variable; label?: string; destination?: string; description?: string; hidden?: boolean; virtual?: boolean; required?: boolean; risk?: Risk; estimatedValue?: string; _messageType?: string; decimals?: number; nodeId?: string; mode?: MODE; readonly?: boolean; innerType?: string; innerIndex?: number; isMultiParam?: boolean; order?: number; symbol?: string; isPreview?: boolean; icon?: IconData; }; export declare const getOutputVariable: ({ innerIndex, nodeId, pluginType, }: { innerIndex: number; nodeId: string; pluginType?: Type | undefined; }) => { type: "external"; id: number; } | { type: "global"; id: import("../../Fct/plugins/corelibTypes").GlobalVariable; } | { type: "constants"; id: import("../../Fct/plugins/corelibTypes").ConstantType; } | { id: string; type: "computed"; value1: string | Variable; operator1: string; value2: string | Variable; operator2: string; value3: string | Variable; operator3: string; value4: string | Variable; overflowProtection: boolean; } | { id: string; type: "validation"; value1: string | Variable; operator: string; value2: string | Variable; } | { name: "path"; type: "address[]"; value: ExternalVariable[]; } | { readonly type: "output"; readonly id: { readonly innerIndex: number; readonly nodeId: string; }; } | undefined; export declare class FctParam implements IFctParam { value: Type | undefined; mode: MODE; _fctType: ParamType; innerType: string; appType: ParamType; required: boolean; innerIndex: number | undefined; destination: MetadataType | undefined; description: string | undefined; rawValue: string | undefined; options: Options | undefined; nodeId?: string; risk?: Risk; key?: string; estimatedValue?: string | number | boolean | string[] | undefined; _messageType?: AppType | FctType; readonly?: boolean; isMultiParam?: boolean; isPreview?: boolean; symbol?: string; icon?: IconType; subscribe: ({ callback, id, }: { callback: ParamCallback>; id: string; }) => void; unsubscribe: ({ id }: { id: string; }) => void; observers: Map>>; get label(): string | undefined; set label(label: string | undefined); private _label; _isLoading: boolean; get isLoading(): boolean; set isLoading(isLoading: boolean); get hidden(): boolean; set hidden(isHidden: boolean); get virtual(): boolean; set virtual(isVirtual: boolean); private _virtual; private _hidden; get decimals(): number | undefined; set decimals(label: number | undefined); private _uiType; get uiType(): string; set uiType(type: string); private _order; get order(): number | undefined; set order(order: number | undefined); private serializeIcon; getJsonParam({ key, ioType }: { key: string; ioType: 'INPUT' | 'OUTPUT' | 'VALIDATORS'; }): ParamJSONData; private deserializeIcon; setJsonParam(param: ParamJSONData): void; private _decimals; constructor({ fctType, appType, value, mode, required, innerIndex, destination, rawValue, description, options, risk, messageType, readonly, innerType, decimals, hidden, key, virtual, isPreview, icon, }: FctParamArgs); get fctType(): ParamType; get isVariable(): boolean; get isOutputVariable(): boolean; isConnectable: (param: { appType: string; fctType: string; hashed?: boolean; destination?: string; decimals?: number; toPluginType?: PluginType; key?: string; }) => boolean; getOutputVariable: (nodeId: string, pluginType?: PluginType) => Variable | undefined; get encodedValue(): string; set: ({ value }: { value: Type | undefined; }) => void; setString: ({ value }: { value: string | Variable | undefined; }) => void; getString: () => string | Variable | undefined; setQuiet: ({ value }: { value: Type | undefined; }) => void; get: () => any; setEstimated: ({ value }: { value: string | number | boolean | string[] | undefined; }) => void; setEstimatedString: ({ value }: { value: string | undefined; }) => void; getEstimated: () => string | number | boolean | string[] | undefined; isValid: () => { state: boolean; error?: string; }; reset: () => void; updateSubsciptions: () => void; getMessageType(): AppType | FctType | undefined; protected setVariable: ({ value }: { value: Variable; }) => void; protected _setString: ({ value }: { value: string | Variable | undefined; }) => void; } export declare const isConnectable: ({ from, to, }: { from: { appType: string; fctType: string; hashed?: boolean; destination?: unknown; decimals?: number; key?: string; }; to: { appType: string; fctType: string; hashed?: boolean; destination?: unknown; decimals?: number; pluginType?: PluginType; key?: string; }; }) => boolean; type FctValueMetadata = 'wei_amount' | 'eip712_tokenId'; declare class FctAmount extends FctParam implements IFctParam { isValid: () => { state: boolean; error: undefined; } | { state: boolean; error: string; }; } declare class FctAmount128 extends FctParam implements IFctParam { isValid: () => { state: boolean; error: undefined; } | { state: boolean; error: string; }; } export declare class FctInt256 extends FctParam<'integer', 'int256', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); isValid: () => { state: boolean; error: undefined; } | { state: boolean; error: string; }; } export declare class FctValue extends FctAmount<'integer'> { constructor(args: FctParamOptionalArgs); } export declare class FctTimestamp extends FctAmount<'timestamp'> { constructor(args: FctParamOptionalArgs); } export declare class FctDecimals extends FctAmount<'decimals'> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctValue18 extends FctAmount<'integer18'> { constructor(args: FctParamOptionalArgs); } export declare class FctValue27 extends FctAmount<'integer27'> { constructor(args: FctParamOptionalArgs); } export declare class FctBps extends FctAmount<'bps'> { constructor(args: FctParamOptionalArgs); } export declare class FctUinteger32Bps extends FctParam<'bps', 'uint32', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctPercent extends FctParam<'number', 'string', string | Variable, 'percent'> implements IFctParam { constructor(args: FctParamOptionalArgs); isValid: () => { state: boolean; error: undefined; } | { state: boolean; error: string; }; } export declare class FctValue8 extends FctParam<'integer', 'uint8', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctUInt80 extends FctParam<'integer', 'uint80', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctUInt112 extends FctParam<'integer', 'uint112', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctValue16 extends FctParam<'integer', 'uint16', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctValue24 extends FctParam<'integer', 'uint24', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctValue40 extends FctParam<'integer', 'uint40', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctValue128 extends FctParam<'integer', 'uint128', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctValue128_27 extends FctAmount128<'integer27'> { constructor(args: FctParamOptionalArgs); } export declare class FctValue160 extends FctParam<'integer', 'uint160', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } type FctAddressMetadata = 'erc20' | 'erc721' | 'erc1155' | 'uniswap_pool_v2' | 'curve_pool' | 'curve_gauge' | 'curve_voting_escrow' | 'aave_lending_pool_v2' | 'aave_protocol_data_provider_v2' | 'radiant_lending_pool_v2' | 'radiant_protocol_data_provider_v2' | 'ctoken' | 'comptroller' | 'curve_exchange' | 'paraswap_swapper_v5' | 'sushiswap_router' | 'uniswap_router' | 'uniswap_factory' | 'wrapped_ether' | 'yearn_vault' | 'chainlink_datafeed' | 'aave_pool_v3'; export declare class FctAddress extends FctParam<'address', 'address', string | Variable, FctAddressMetadata> implements IFctParam { constructor(args: FctParamOptionalArgs); isValid: () => { state: boolean; error: undefined; } | { state: boolean; error: string; }; } export declare class FctAddressList extends FctParam<'address[]', 'address[]', string[]> implements IFctParam { paramFctType: "address"; paramAppType: "address"; constructor(args: FctParamOptionalArgs); setString: ({ value }: { value: string | Variable | undefined; }) => void; } export declare class FctStringList extends FctParam<'string[]', 'string[]', string[]> implements IFctParam { paramFctType: "string"; paramAppType: "string"; constructor(args: FctParamOptionalArgs); setString: ({ value }: { value: string | Variable | undefined; }) => void; } type FctValueListMetadata = 'amount_list'; export declare class FctValueList extends FctParam<'integer[]', 'uint256[]', string[] | Variable, FctValueListMetadata> implements IFctParam { paramFctType: "uint256"; paramAppType: "integer"; constructor(args: FctParamOptionalArgs); setString: ({ value }: { value: string | Variable | undefined; }) => void; } export declare const getOutputVariableOnChain: ({ index, innerIndex, type, }: { index: number; innerIndex: number; type?: string | undefined; }) => string; export declare class FctValueListN extends FctParam<'integer[]', 'uint256[n]', (string | Variable | undefined)[]> implements IFctParam { constructor(args: FctParamOptionalArgs<(string | Variable | undefined)[]>); setString: ({ value }: { value: string | Variable | undefined; }) => void; get fctType(): "uint256[n]"; } type MethodParam = string | boolean; export type SetMethodParamsArgs = (MethodParam | MethodParam[] | MethodParam[][])[]; export type SetOutputParamsArgs = MethodParam[]; export declare class FctBytes32 extends FctParam<'stringOrBytes32' | 'bytes32' | 'string', 'bytes32', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); getMessageType(): "string" | "bytes32"; } export declare class FctAnyType extends FctParam<'anyType', 'bytes32', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); setValue: (value: any) => void; get: () => string | Variable | undefined; private getParsedValue; isValid: () => { state: boolean; error: string | undefined; }; } export declare class FctBytes32List extends FctParam<'string[]', 'bytes32[]', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctBytes4 extends FctParam<'string', 'bytes4', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctBytes extends FctParam<'stringOrBytes' | 'bytes' | 'string', 'bytes', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); getMessageType(): "string" | "bytes"; } export declare class FctBytesList extends FctParam<'string[]', 'bytes[]', string[] | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctString extends FctParam<'string', 'string', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctTextarea extends FctParam<'textarea', 'string', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctJSON extends FctParam<'JSON', 'string', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctImage extends FctParam<'image', 'string', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export type TradingGraphPropsType = { protocol?: 'uniswapv2'; label?: string; fromToken?: string; toToken?: string; maxPrice?: string; minPrice?: string; fromSymbol?: string; toSymbol?: string; fromDecimals?: number; toDecimals?: number; minDescription?: string; maxDescription?: string; }; export declare class FctTradingGraphProps extends FctParam implements IFctParam { constructor(args: FctParamOptionalArgs); } export type TupleParam = { name: string; type: string; value: string; }; export type TupleArrayParamType = { name: string; type: string; value: string; virtual?: boolean; }[][] | undefined; export declare class FctTupleArray extends FctParam<'csv', 'tuple[]', TupleArrayParamType | Variable> implements IFctParam { tupleInterface: string; tupleType: string; params: Record; constructor(args: FctParamOptionalArgs & { params?: Record; }); setString: ({ value }: { value: string | Variable | undefined; }) => void; getFctParams: () => { type: "output"; id: { nodeId: string; innerIndex: number; index?: number | undefined; }; } | { type: "external"; id: number; } | { type: "global"; id: import("../../Fct/plugins/corelibTypes").GlobalVariable; } | { type: "constants"; id: import("../../Fct/plugins/corelibTypes").ConstantType; } | { id: string; type: "computed"; value1: string | Variable; operator1: string; value2: string | Variable; operator2: string; value3: string | Variable; operator3: string; value4: string | Variable; overflowProtection: boolean; } | { id: string; type: "validation"; value1: string | Variable; operator: string; value2: string | Variable; } | { name: "path"; type: "address[]"; value: ExternalVariable[]; } | { name: string; type: string; value: string; virtual?: boolean | undefined; }[][] | undefined; } export declare class FctBoolean extends FctParam<'boolean', 'bool', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctRadio extends FctParam<'radio', 'bool', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctInteger24 extends FctParam<'integer', 'int24', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctInteger64 extends FctParam<'integer', 'int64', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctInteger32 extends FctParam<'integer', 'int32', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctUinteger64 extends FctParam<'integer', 'uint64', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctUinteger32 extends FctParam<'integer', 'uint32', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctInteger128 extends FctParam<'integer', 'int128', string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctCustom extends FctParam<'string', unknown, string | Variable> implements IFctParam { constructor(args: FctParamOptionalArgs); } export declare class FctCustomArray extends FctParam<'string[]', unknown, string[] | Variable> implements IFctParam { paramAppType: "string"; paramFctType: "unknown"; constructor(args: FctParamOptionalArgs); } export type ParamsSchemas = FctAddress | FctBytes32 | FctBoolean | FctAddressList | FctValue | FctBytes | FctValueList | FctValue8 | FctValue16 | FctValue24 | FctValue40 | FctValue128 | FctValue160 | FctString | FctBytes4 | FctBytes32List | FctInteger128 | FctInteger24 | FctValueListN | FctPercent | FctTimestamp | FctDecimals | FctBps | FctValue18 | FctValue27 | FctInt256 | FctCustom | FctValue128_27 | FctBytesList | FctInteger32 | FctInteger64 | FctUinteger32 | FctUinteger64 | FctUInt80 | FctUInt112 | FctCustomArray | FctTupleArray | FctUinteger32Bps | FctAnyType | FctRadio | FctImage | FctTradingGraphProps | FctJSON | FctStringList | FctTextarea; export type UnknownPluginParamType = string | boolean | number | Variable | string[] | undefined; export type UnknownPluginParamValueType = ({ value: string | Variable | undefined; } & { value: boolean | Variable | undefined; } & { value: string[] | undefined; } & { value: number | Variable | undefined; })['value']; export declare const paramsSchemas: (typeof FctInt256 | typeof FctValue | typeof FctTimestamp | typeof FctDecimals | typeof FctValue18 | typeof FctValue27 | typeof FctBps | typeof FctUinteger32Bps | typeof FctValue8 | typeof FctUInt80 | typeof FctUInt112 | typeof FctValue16 | typeof FctValue24 | typeof FctValue40 | typeof FctValue128 | typeof FctValue160 | typeof FctAddress | typeof FctAddressList | typeof FctStringList | typeof FctValueList | typeof FctValueListN | typeof FctBytes32 | typeof FctAnyType | typeof FctBytes32List | typeof FctBytes4 | typeof FctBytes | typeof FctBytesList | typeof FctString | typeof FctTextarea | typeof FctJSON | typeof FctImage | typeof FctTradingGraphProps | typeof FctTupleArray | typeof FctBoolean | typeof FctRadio | typeof FctInteger24 | typeof FctInteger64 | typeof FctInteger32 | typeof FctUinteger64 | typeof FctUinteger32 | typeof FctInteger128 | typeof FctCustom | typeof FctCustomArray)[]; export declare const fctParamUITypes: readonly ["token", "address", "string", "tokenIndex", "integer", "number", "decimals", "string[]", "integer[]", "address[]", "anyType", "account"]; export type UIType = (typeof fctParamUITypes)[number]; export type FctParamsTypes = ParamsSchemas; export type FctParamsValuesTypes = ParamsSchemas['value']; export type FctParamsConstructors = (typeof paramsSchemas)[number]; export type FctUnknownParam = FctParam; export type FctParamInit = { type: FctParamsConstructors; readonly?: boolean; required?: boolean; }; export type FctParamType = FctParamsTypes | { [key: string]: FctParamType; }; type FctParamSchema = { [key: string]: FctParamType | { [key: string]: FctParamType; }; }; export interface IPluginParamsSchema { input: FctParamSchema & { methodParams: FctParamSchema; }; output: FctParamSchema; } export interface IPluginParams { input: { [key: string]: FctParamType | { [key: string]: FctParamType; }; } & { to?: FctAddress; gasLimit?: FctValue; isOffChainOnly?: FctBoolean; value?: FctValue; } & { methodParams: { [key: string]: FctParamType; }; }; output: { [key: string]: FctParamType | { [key: string]: FctParamType; }; }; } export type IMethodParams = { name: keyof IPluginParams['input']['methodParams']; type: IPluginParams['input']['methodParams'][keyof IPluginParams['input']['methodParams']]['fctType']; value: IPluginParams['input']['methodParams'][keyof IPluginParams['input']['methodParams']]['value']; customType: boolean; hashed?: boolean; isTupleArray?: boolean; tupleType?: string; }[]; export type OmitMethodParams = Omit; /** * Recursion call create perfomance issue here */ export type PluginParamsInput = Partial<{ [Key in keyof Params]: Params[Key] extends FctParamsTypes ? Params[Key]['value'] : Params[Key] extends FctParamSchema ? unknown : unknown; }>; export type PluginParamsNestedInputKeys = { [Key in keyof Params & (string | number)]: Params[Key] extends FctParamSchema ? `${Key}` : `${Key}`; }[keyof Params & (string | number)] & string; export type PluginParamsInputKeys = { [Key in keyof Params & (string | number)]: Params[Key] extends FctParamSchema ? `${Key}.${PluginParamsNestedInputKeys}` : `${Key}`; }[keyof Params & (string | number)] & string; export type PluginParamsOutput = Partial>; export type InputParams = Params['input']; export type OutputParams = Params['output']; export type InputErrors = Map | keyof Params['input']['methodParams'], string>; export type Callback = (value: InputParams | undefined, errors: InputErrors, chainId: ChainId, paramKey?: string) => void; export type ParamCallback = (p: ParamType, isLoading: boolean, chainId: undefined) => void; export type Subscribtion = { callback: Callback; id: string; }; export type RequiredApproval = ({ method: 'approve'; protocol: 'ERC20'; params: { spender: FctParamsValuesTypes; amount: FctParamsValuesTypes; }; } | { method: 'approve'; protocol: 'ERC721'; params: { to: FctParamsValuesTypes; tokenId: FctParamsValuesTypes; }; } | { method: 'setApprovalForAll'; protocol: 'ERC721'; params: { operator: FctParamsValuesTypes; approved: FctParamsValuesTypes; }; } | { method: 'setApprovalForAll'; protocol: 'ERC1155'; params: { operator: FctParamsValuesTypes; approved: FctParamsValuesTypes; }; } | { method: 'approveDelegation'; protocol: 'AAVE' | 'RADIANTV2'; params: { delegatee: FctParamsValuesTypes; amount: FctParamsValuesTypes; }; }) & { to?: string | Variable; from?: string | Variable; }; export type RequiredApprovals = RequiredApproval[]; export type RequiredApprovalInterface = { to: RequiredApprovals[number]['to']; protocol: RequiredApprovals[number]['protocol']; method: RequiredApprovals[number]['method']; params: FctParamsValuesTypes[]; from: RequiredApprovals[number]['from']; }; export type ComputeOperatorType = '+' | '-' | '*' | '/' | '**' | '%' | 'max' | 'min' | '*(10**X)' | '/(10**X)' | 'keccak256' | ''; export type ValidateOperatorType = 'equal' | 'greater than' | 'greater equal than' | 'or' | 'and' | 'and not' | 'not equal' | 'or not'; export type AssetFlow = Promise; toReceive: Array<{ token: string | Variable; amount: string | Variable; }>; }>> | Array<{ address: string; toSpend: Array<{ token: string | Variable; amount: string | Variable; }>; toReceive: Array<{ token: string | Variable; amount: string | Variable; }>; }>; export {};