@gearbox-protocol/sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/creditManager.d.ts +5 -0
- package/lib/core/creditManager.js +5 -0
- package/lib/pathfinder/path.js +5 -5
- package/lib/payload/creditManager.d.ts +5 -0
- package/lib/strategies/creditFacade.js +1 -1
- package/lib/types/contracts/interfaces/ICreditConfigurator.sol/ICreditConfigurator.d.ts +271 -20
- package/lib/types/contracts/interfaces/ICreditConfigurator.sol/ICreditConfiguratorEvents.d.ts +8 -19
- package/lib/types/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExtended.d.ts +9 -9
- package/lib/types/contracts/interfaces/ICreditManagerV2.sol/ICreditManagerV2.d.ts +52 -116
- package/lib/types/contracts/interfaces/IDataCompressor.sol/IDataCompressor.d.ts +26 -1
- package/lib/types/contracts/interfaces/IDegenNFT.sol/IDegenNFT.d.ts +10 -10
- package/lib/types/contracts/interfaces/V1/ICreditFilter.d.ts +3 -3
- package/lib/types/contracts/interfaces/adapters/convex/IConvexV1BoosterAdapter.d.ts +1 -9
- package/lib/types/contracts/pathfinder/index.d.ts +0 -1
- package/lib/types/contracts/pathfinder/interfaces/IClosePathResolver.d.ts +125 -0
- package/lib/types/contracts/pathfinder/{ISwapper.js → interfaces/IClosePathResolver.js} +0 -0
- package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/IDepositor.d.ts +159 -0
- package/lib/types/contracts/pathfinder/interfaces/{ISwapPathFinder.js → IDepositor.sol/IDepositor.js} +0 -0
- package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/IDepositorOptions.d.ts +165 -0
- package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/IDepositorOptions.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/index.d.ts +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/index.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IGasPricer.d.ts +44 -0
- package/lib/types/contracts/pathfinder/interfaces/IGasPricer.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorker.d.ts +113 -0
- package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorker.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorkerOptions.d.ts +119 -0
- package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorkerOptions.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/index.d.ts +2 -0
- package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/index.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IPathFinder.d.ts +210 -0
- package/lib/types/contracts/pathfinder/interfaces/IPathFinder.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IPathResolver.d.ts +131 -0
- package/lib/types/contracts/pathfinder/interfaces/IPathResolver.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/{ISwapPathFinder.d.ts → ISwapAggregator.d.ts} +98 -14
- package/lib/types/contracts/pathfinder/interfaces/ISwapAggregator.js +2 -0
- package/lib/types/contracts/pathfinder/{ISwapper.d.ts → interfaces/ISwapper.d.ts} +1 -1
- package/lib/types/contracts/pathfinder/interfaces/ISwapper.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawer.d.ts +144 -0
- package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawer.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawerOptions.d.ts +160 -0
- package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawerOptions.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/index.d.ts +2 -0
- package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/index.js +2 -0
- package/lib/types/contracts/pathfinder/interfaces/index.d.ts +12 -1
- package/lib/types/factories/contracts/interfaces/ICreditConfigurator.sol/ICreditConfiguratorEvents__factory.js +1 -14
- package/lib/types/factories/contracts/interfaces/ICreditConfigurator.sol/ICreditConfiguratorExceptions__factory.js +2 -17
- package/lib/types/factories/contracts/interfaces/ICreditConfigurator.sol/ICreditConfigurator__factory.js +240 -31
- package/lib/types/factories/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExceptions__factory.js +7 -2
- package/lib/types/factories/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExtended__factory.js +1 -1
- package/lib/types/factories/contracts/interfaces/ICreditFacade.sol/ICreditFacade__factory.js +7 -2
- package/lib/types/factories/contracts/interfaces/ICreditManagerV2.sol/ICreditManagerV2Exceptions__factory.js +2 -2
- package/lib/types/factories/contracts/interfaces/ICreditManagerV2.sol/ICreditManagerV2__factory.js +41 -84
- package/lib/types/factories/contracts/interfaces/IDataCompressor.sol/IDataCompressor__factory.d.ts +14 -14
- package/lib/types/factories/contracts/interfaces/IDataCompressor.sol/IDataCompressor__factory.js +74 -0
- package/lib/types/factories/contracts/interfaces/IDegenNFT.sol/IDegenNFT__factory.js +4 -4
- package/lib/types/factories/contracts/interfaces/V1/ICreditFilter__factory.js +1 -1
- package/lib/types/factories/contracts/interfaces/adapters/convex/IConvexV1BoosterAdapter__factory.js +0 -13
- package/lib/types/factories/contracts/pathfinder/index.d.ts +0 -1
- package/lib/types/factories/contracts/pathfinder/index.js +1 -3
- package/lib/types/factories/contracts/pathfinder/interfaces/IClosePathResolver__factory.d.ts +57 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IClosePathResolver__factory.js +264 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/IDepositorOptions__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/IDepositorOptions__factory.js +717 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/IDepositor__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/IDepositor__factory.js +702 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/index.d.ts +2 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/index.js +10 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IGasPricer__factory.d.ts +22 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IGasPricer__factory.js +41 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorkerOptions__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorkerOptions__factory.js +252 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorker__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorker__factory.js +247 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/index.d.ts +2 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/index.js +10 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/{ISwapPathFinder__factory.d.ts → IPathFinder__factory.d.ts} +42 -28
- package/lib/types/factories/contracts/pathfinder/interfaces/IPathFinder__factory.js +483 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IPathResolver__factory.d.ts +57 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IPathResolver__factory.js +467 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ISwapAggregator__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/ISwapAggregator__factory.js +782 -0
- package/lib/types/factories/contracts/pathfinder/{ISwapper__factory.d.ts → interfaces/ISwapper__factory.d.ts} +1 -1
- package/lib/types/factories/contracts/pathfinder/{ISwapper__factory.js → interfaces/ISwapper__factory.js} +0 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawerOptions__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawerOptions__factory.js +729 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawer__factory.d.ts +62 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawer__factory.js +692 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/index.d.ts +2 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/index.js +10 -0
- package/lib/types/factories/contracts/pathfinder/interfaces/index.d.ts +9 -1
- package/lib/types/factories/contracts/pathfinder/interfaces/index.js +39 -3
- package/lib/types/factories/contracts/support/MultiCall.sol/Multicall2__factory.d.ts +1 -1
- package/lib/types/factories/contracts/support/MultiCall.sol/Multicall2__factory.js +1 -1
- package/lib/types/index.d.ts +24 -4
- package/lib/types/index.js +24 -4
- package/package.json +2 -2
- package/lib/types/factories/contracts/pathfinder/interfaces/ISwapPathFinder__factory.js +0 -346
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
|
|
2
|
+
import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
|
|
3
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "../../../common";
|
|
5
|
+
export declare type MultiCallStruct = {
|
|
6
|
+
target: string;
|
|
7
|
+
callData: BytesLike;
|
|
8
|
+
};
|
|
9
|
+
export declare type MultiCallStructOutput = [string, string] & {
|
|
10
|
+
target: string;
|
|
11
|
+
callData: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type PathFinderResultStruct = {
|
|
14
|
+
amount: BigNumberish;
|
|
15
|
+
gasUsage: BigNumberish;
|
|
16
|
+
calls: MultiCallStruct[];
|
|
17
|
+
};
|
|
18
|
+
export declare type PathFinderResultStructOutput = [
|
|
19
|
+
BigNumber,
|
|
20
|
+
BigNumber,
|
|
21
|
+
MultiCallStructOutput[]
|
|
22
|
+
] & {
|
|
23
|
+
amount: BigNumber;
|
|
24
|
+
gasUsage: BigNumber;
|
|
25
|
+
calls: MultiCallStructOutput[];
|
|
26
|
+
};
|
|
27
|
+
export declare type PathOptionStruct = {
|
|
28
|
+
target: string;
|
|
29
|
+
option: BigNumberish;
|
|
30
|
+
totalOptions: BigNumberish;
|
|
31
|
+
};
|
|
32
|
+
export declare type PathOptionStructOutput = [string, number, number] & {
|
|
33
|
+
target: string;
|
|
34
|
+
option: number;
|
|
35
|
+
totalOptions: number;
|
|
36
|
+
};
|
|
37
|
+
export declare type BalanceStruct = {
|
|
38
|
+
token: string;
|
|
39
|
+
balance: BigNumberish;
|
|
40
|
+
};
|
|
41
|
+
export declare type BalanceStructOutput = [string, BigNumber] & {
|
|
42
|
+
token: string;
|
|
43
|
+
balance: BigNumber;
|
|
44
|
+
};
|
|
45
|
+
export interface IPathFinderInterface extends utils.Interface {
|
|
46
|
+
functions: {
|
|
47
|
+
"componentAddressById(uint8)": FunctionFragment;
|
|
48
|
+
"findAllSwaps(address,uint256,address,address,address[],uint256)": FunctionFragment;
|
|
49
|
+
"findBestClosePath(address,address[],uint256,(address,uint8,uint8)[],uint256)": FunctionFragment;
|
|
50
|
+
"findOneTokenPath(address,uint256,address,address,address[],uint256)": FunctionFragment;
|
|
51
|
+
"findOpenStrategyPath(address,(address,uint256)[],address,address[],uint256)": FunctionFragment;
|
|
52
|
+
"getGasPriceTokenOutRAY(address)": FunctionFragment;
|
|
53
|
+
"isPathFinderConfigurator(address)": FunctionFragment;
|
|
54
|
+
"tokenTypes(address)": FunctionFragment;
|
|
55
|
+
"version()": FunctionFragment;
|
|
56
|
+
};
|
|
57
|
+
getFunction(nameOrSignatureOrTopic: "componentAddressById" | "findAllSwaps" | "findBestClosePath" | "findOneTokenPath" | "findOpenStrategyPath" | "getGasPriceTokenOutRAY" | "isPathFinderConfigurator" | "tokenTypes" | "version"): FunctionFragment;
|
|
58
|
+
encodeFunctionData(functionFragment: "componentAddressById", values: [BigNumberish]): string;
|
|
59
|
+
encodeFunctionData(functionFragment: "findAllSwaps", values: [string, BigNumberish, string, string, string[], BigNumberish]): string;
|
|
60
|
+
encodeFunctionData(functionFragment: "findBestClosePath", values: [string, string[], BigNumberish, PathOptionStruct[], BigNumberish]): string;
|
|
61
|
+
encodeFunctionData(functionFragment: "findOneTokenPath", values: [string, BigNumberish, string, string, string[], BigNumberish]): string;
|
|
62
|
+
encodeFunctionData(functionFragment: "findOpenStrategyPath", values: [string, BalanceStruct[], string, string[], BigNumberish]): string;
|
|
63
|
+
encodeFunctionData(functionFragment: "getGasPriceTokenOutRAY", values: [string]): string;
|
|
64
|
+
encodeFunctionData(functionFragment: "isPathFinderConfigurator", values: [string]): string;
|
|
65
|
+
encodeFunctionData(functionFragment: "tokenTypes", values: [string]): string;
|
|
66
|
+
encodeFunctionData(functionFragment: "version", values?: undefined): string;
|
|
67
|
+
decodeFunctionResult(functionFragment: "componentAddressById", data: BytesLike): Result;
|
|
68
|
+
decodeFunctionResult(functionFragment: "findAllSwaps", data: BytesLike): Result;
|
|
69
|
+
decodeFunctionResult(functionFragment: "findBestClosePath", data: BytesLike): Result;
|
|
70
|
+
decodeFunctionResult(functionFragment: "findOneTokenPath", data: BytesLike): Result;
|
|
71
|
+
decodeFunctionResult(functionFragment: "findOpenStrategyPath", data: BytesLike): Result;
|
|
72
|
+
decodeFunctionResult(functionFragment: "getGasPriceTokenOutRAY", data: BytesLike): Result;
|
|
73
|
+
decodeFunctionResult(functionFragment: "isPathFinderConfigurator", data: BytesLike): Result;
|
|
74
|
+
decodeFunctionResult(functionFragment: "tokenTypes", data: BytesLike): Result;
|
|
75
|
+
decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
|
|
76
|
+
events: {
|
|
77
|
+
"PathFinderComponentUpdate(uint8,address)": EventFragment;
|
|
78
|
+
"ResolverUpdate(uint8,uint8,uint8)": EventFragment;
|
|
79
|
+
};
|
|
80
|
+
getEvent(nameOrSignatureOrTopic: "PathFinderComponentUpdate"): EventFragment;
|
|
81
|
+
getEvent(nameOrSignatureOrTopic: "ResolverUpdate"): EventFragment;
|
|
82
|
+
}
|
|
83
|
+
export interface PathFinderComponentUpdateEventObject {
|
|
84
|
+
arg0: number;
|
|
85
|
+
arg1: string;
|
|
86
|
+
}
|
|
87
|
+
export declare type PathFinderComponentUpdateEvent = TypedEvent<[
|
|
88
|
+
number,
|
|
89
|
+
string
|
|
90
|
+
], PathFinderComponentUpdateEventObject>;
|
|
91
|
+
export declare type PathFinderComponentUpdateEventFilter = TypedEventFilter<PathFinderComponentUpdateEvent>;
|
|
92
|
+
export interface ResolverUpdateEventObject {
|
|
93
|
+
arg0: number;
|
|
94
|
+
arg1: number;
|
|
95
|
+
arg2: number;
|
|
96
|
+
}
|
|
97
|
+
export declare type ResolverUpdateEvent = TypedEvent<[
|
|
98
|
+
number,
|
|
99
|
+
number,
|
|
100
|
+
number
|
|
101
|
+
], ResolverUpdateEventObject>;
|
|
102
|
+
export declare type ResolverUpdateEventFilter = TypedEventFilter<ResolverUpdateEvent>;
|
|
103
|
+
export interface IPathFinder extends BaseContract {
|
|
104
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
105
|
+
attach(addressOrName: string): this;
|
|
106
|
+
deployed(): Promise<this>;
|
|
107
|
+
interface: IPathFinderInterface;
|
|
108
|
+
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
109
|
+
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
110
|
+
listeners(eventName?: string): Array<Listener>;
|
|
111
|
+
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
|
|
112
|
+
removeAllListeners(eventName?: string): this;
|
|
113
|
+
off: OnEvent<this>;
|
|
114
|
+
on: OnEvent<this>;
|
|
115
|
+
once: OnEvent<this>;
|
|
116
|
+
removeListener: OnEvent<this>;
|
|
117
|
+
functions: {
|
|
118
|
+
componentAddressById(pf: BigNumberish, overrides?: CallOverrides): Promise<[string]>;
|
|
119
|
+
findAllSwaps(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
120
|
+
from?: string | Promise<string>;
|
|
121
|
+
}): Promise<ContractTransaction>;
|
|
122
|
+
findBestClosePath(creditAccount: string, connectors: string[], slippage: BigNumberish, pathOptions: PathOptionStruct[], iterations: BigNumberish, overrides?: Overrides & {
|
|
123
|
+
from?: string | Promise<string>;
|
|
124
|
+
}): Promise<ContractTransaction>;
|
|
125
|
+
findOneTokenPath(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
126
|
+
from?: string | Promise<string>;
|
|
127
|
+
}): Promise<ContractTransaction>;
|
|
128
|
+
findOpenStrategyPath(creditManager: string, balances: BalanceStruct[], target: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
129
|
+
from?: string | Promise<string>;
|
|
130
|
+
}): Promise<ContractTransaction>;
|
|
131
|
+
getGasPriceTokenOutRAY(token: string, overrides?: CallOverrides): Promise<[BigNumber] & {
|
|
132
|
+
gasPrice: BigNumber;
|
|
133
|
+
}>;
|
|
134
|
+
isPathFinderConfigurator(account: string, overrides?: CallOverrides): Promise<[boolean]>;
|
|
135
|
+
tokenTypes(arg0: string, overrides?: CallOverrides): Promise<[number]>;
|
|
136
|
+
version(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
137
|
+
};
|
|
138
|
+
componentAddressById(pf: BigNumberish, overrides?: CallOverrides): Promise<string>;
|
|
139
|
+
findAllSwaps(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
140
|
+
from?: string | Promise<string>;
|
|
141
|
+
}): Promise<ContractTransaction>;
|
|
142
|
+
findBestClosePath(creditAccount: string, connectors: string[], slippage: BigNumberish, pathOptions: PathOptionStruct[], iterations: BigNumberish, overrides?: Overrides & {
|
|
143
|
+
from?: string | Promise<string>;
|
|
144
|
+
}): Promise<ContractTransaction>;
|
|
145
|
+
findOneTokenPath(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
146
|
+
from?: string | Promise<string>;
|
|
147
|
+
}): Promise<ContractTransaction>;
|
|
148
|
+
findOpenStrategyPath(creditManager: string, balances: BalanceStruct[], target: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
149
|
+
from?: string | Promise<string>;
|
|
150
|
+
}): Promise<ContractTransaction>;
|
|
151
|
+
getGasPriceTokenOutRAY(token: string, overrides?: CallOverrides): Promise<BigNumber>;
|
|
152
|
+
isPathFinderConfigurator(account: string, overrides?: CallOverrides): Promise<boolean>;
|
|
153
|
+
tokenTypes(arg0: string, overrides?: CallOverrides): Promise<number>;
|
|
154
|
+
version(overrides?: CallOverrides): Promise<BigNumber>;
|
|
155
|
+
callStatic: {
|
|
156
|
+
componentAddressById(pf: BigNumberish, overrides?: CallOverrides): Promise<string>;
|
|
157
|
+
findAllSwaps(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: CallOverrides): Promise<PathFinderResultStructOutput[]>;
|
|
158
|
+
findBestClosePath(creditAccount: string, connectors: string[], slippage: BigNumberish, pathOptions: PathOptionStruct[], iterations: BigNumberish, overrides?: CallOverrides): Promise<PathFinderResultStructOutput>;
|
|
159
|
+
findOneTokenPath(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: CallOverrides): Promise<PathFinderResultStructOutput>;
|
|
160
|
+
findOpenStrategyPath(creditManager: string, balances: BalanceStruct[], target: string, connectors: string[], slippage: BigNumberish, overrides?: CallOverrides): Promise<[BalanceStructOutput[], PathFinderResultStructOutput]>;
|
|
161
|
+
getGasPriceTokenOutRAY(token: string, overrides?: CallOverrides): Promise<BigNumber>;
|
|
162
|
+
isPathFinderConfigurator(account: string, overrides?: CallOverrides): Promise<boolean>;
|
|
163
|
+
tokenTypes(arg0: string, overrides?: CallOverrides): Promise<number>;
|
|
164
|
+
version(overrides?: CallOverrides): Promise<BigNumber>;
|
|
165
|
+
};
|
|
166
|
+
filters: {
|
|
167
|
+
"PathFinderComponentUpdate(uint8,address)"(arg0?: BigNumberish | null, arg1?: string | null): PathFinderComponentUpdateEventFilter;
|
|
168
|
+
PathFinderComponentUpdate(arg0?: BigNumberish | null, arg1?: string | null): PathFinderComponentUpdateEventFilter;
|
|
169
|
+
"ResolverUpdate(uint8,uint8,uint8)"(arg0?: BigNumberish | null, arg1?: BigNumberish | null, arg2?: BigNumberish | null): ResolverUpdateEventFilter;
|
|
170
|
+
ResolverUpdate(arg0?: BigNumberish | null, arg1?: BigNumberish | null, arg2?: BigNumberish | null): ResolverUpdateEventFilter;
|
|
171
|
+
};
|
|
172
|
+
estimateGas: {
|
|
173
|
+
componentAddressById(pf: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
|
|
174
|
+
findAllSwaps(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
175
|
+
from?: string | Promise<string>;
|
|
176
|
+
}): Promise<BigNumber>;
|
|
177
|
+
findBestClosePath(creditAccount: string, connectors: string[], slippage: BigNumberish, pathOptions: PathOptionStruct[], iterations: BigNumberish, overrides?: Overrides & {
|
|
178
|
+
from?: string | Promise<string>;
|
|
179
|
+
}): Promise<BigNumber>;
|
|
180
|
+
findOneTokenPath(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
181
|
+
from?: string | Promise<string>;
|
|
182
|
+
}): Promise<BigNumber>;
|
|
183
|
+
findOpenStrategyPath(creditManager: string, balances: BalanceStruct[], target: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
184
|
+
from?: string | Promise<string>;
|
|
185
|
+
}): Promise<BigNumber>;
|
|
186
|
+
getGasPriceTokenOutRAY(token: string, overrides?: CallOverrides): Promise<BigNumber>;
|
|
187
|
+
isPathFinderConfigurator(account: string, overrides?: CallOverrides): Promise<BigNumber>;
|
|
188
|
+
tokenTypes(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;
|
|
189
|
+
version(overrides?: CallOverrides): Promise<BigNumber>;
|
|
190
|
+
};
|
|
191
|
+
populateTransaction: {
|
|
192
|
+
componentAddressById(pf: BigNumberish, overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
193
|
+
findAllSwaps(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
194
|
+
from?: string | Promise<string>;
|
|
195
|
+
}): Promise<PopulatedTransaction>;
|
|
196
|
+
findBestClosePath(creditAccount: string, connectors: string[], slippage: BigNumberish, pathOptions: PathOptionStruct[], iterations: BigNumberish, overrides?: Overrides & {
|
|
197
|
+
from?: string | Promise<string>;
|
|
198
|
+
}): Promise<PopulatedTransaction>;
|
|
199
|
+
findOneTokenPath(tokenIn: string, amount: BigNumberish, tokenOut: string, creditAccount: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
200
|
+
from?: string | Promise<string>;
|
|
201
|
+
}): Promise<PopulatedTransaction>;
|
|
202
|
+
findOpenStrategyPath(creditManager: string, balances: BalanceStruct[], target: string, connectors: string[], slippage: BigNumberish, overrides?: Overrides & {
|
|
203
|
+
from?: string | Promise<string>;
|
|
204
|
+
}): Promise<PopulatedTransaction>;
|
|
205
|
+
getGasPriceTokenOutRAY(token: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
206
|
+
isPathFinderConfigurator(account: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
207
|
+
tokenTypes(arg0: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
208
|
+
version(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
|
|
2
|
+
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
|
3
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "../../../common";
|
|
5
|
+
export declare type BalanceStruct = {
|
|
6
|
+
token: string;
|
|
7
|
+
balance: BigNumberish;
|
|
8
|
+
};
|
|
9
|
+
export declare type BalanceStructOutput = [string, BigNumber] & {
|
|
10
|
+
token: string;
|
|
11
|
+
balance: BigNumber;
|
|
12
|
+
};
|
|
13
|
+
export declare type TokenAdaptersStruct = {
|
|
14
|
+
token: string;
|
|
15
|
+
adapters: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare type TokenAdaptersStructOutput = [string, string[]] & {
|
|
18
|
+
token: string;
|
|
19
|
+
adapters: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare type MultiCallStruct = {
|
|
22
|
+
target: string;
|
|
23
|
+
callData: BytesLike;
|
|
24
|
+
};
|
|
25
|
+
export declare type MultiCallStructOutput = [string, string] & {
|
|
26
|
+
target: string;
|
|
27
|
+
callData: string;
|
|
28
|
+
};
|
|
29
|
+
export declare type StrategyPathTaskStruct = {
|
|
30
|
+
creditAccount: string;
|
|
31
|
+
balances: BalanceStruct[];
|
|
32
|
+
target: string;
|
|
33
|
+
connectors: string[];
|
|
34
|
+
adapters: string[];
|
|
35
|
+
slippage: BigNumberish;
|
|
36
|
+
targetType: BigNumberish;
|
|
37
|
+
foundAdapters: TokenAdaptersStruct[];
|
|
38
|
+
gasPriceTargetRAY: BigNumberish;
|
|
39
|
+
gasUsage: BigNumberish;
|
|
40
|
+
initTargetBalance: BigNumberish;
|
|
41
|
+
calls: MultiCallStruct[];
|
|
42
|
+
};
|
|
43
|
+
export declare type StrategyPathTaskStructOutput = [
|
|
44
|
+
string,
|
|
45
|
+
BalanceStructOutput[],
|
|
46
|
+
string,
|
|
47
|
+
string[],
|
|
48
|
+
string[],
|
|
49
|
+
BigNumber,
|
|
50
|
+
number,
|
|
51
|
+
TokenAdaptersStructOutput[],
|
|
52
|
+
BigNumber,
|
|
53
|
+
BigNumber,
|
|
54
|
+
BigNumber,
|
|
55
|
+
MultiCallStructOutput[]
|
|
56
|
+
] & {
|
|
57
|
+
creditAccount: string;
|
|
58
|
+
balances: BalanceStructOutput[];
|
|
59
|
+
target: string;
|
|
60
|
+
connectors: string[];
|
|
61
|
+
adapters: string[];
|
|
62
|
+
slippage: BigNumber;
|
|
63
|
+
targetType: number;
|
|
64
|
+
foundAdapters: TokenAdaptersStructOutput[];
|
|
65
|
+
gasPriceTargetRAY: BigNumber;
|
|
66
|
+
gasUsage: BigNumber;
|
|
67
|
+
initTargetBalance: BigNumber;
|
|
68
|
+
calls: MultiCallStructOutput[];
|
|
69
|
+
};
|
|
70
|
+
export interface IPathResolverInterface extends utils.Interface {
|
|
71
|
+
functions: {
|
|
72
|
+
"findOneTokenPath(uint8,address,uint256,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
|
|
73
|
+
"findOpenStrategyPath((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
|
|
74
|
+
};
|
|
75
|
+
getFunction(nameOrSignatureOrTopic: "findOneTokenPath" | "findOpenStrategyPath"): FunctionFragment;
|
|
76
|
+
encodeFunctionData(functionFragment: "findOneTokenPath", values: [BigNumberish, string, BigNumberish, StrategyPathTaskStruct]): string;
|
|
77
|
+
encodeFunctionData(functionFragment: "findOpenStrategyPath", values: [StrategyPathTaskStruct]): string;
|
|
78
|
+
decodeFunctionResult(functionFragment: "findOneTokenPath", data: BytesLike): Result;
|
|
79
|
+
decodeFunctionResult(functionFragment: "findOpenStrategyPath", data: BytesLike): Result;
|
|
80
|
+
events: {};
|
|
81
|
+
}
|
|
82
|
+
export interface IPathResolver extends BaseContract {
|
|
83
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
84
|
+
attach(addressOrName: string): this;
|
|
85
|
+
deployed(): Promise<this>;
|
|
86
|
+
interface: IPathResolverInterface;
|
|
87
|
+
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
88
|
+
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
89
|
+
listeners(eventName?: string): Array<Listener>;
|
|
90
|
+
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
|
|
91
|
+
removeAllListeners(eventName?: string): this;
|
|
92
|
+
off: OnEvent<this>;
|
|
93
|
+
on: OnEvent<this>;
|
|
94
|
+
once: OnEvent<this>;
|
|
95
|
+
removeListener: OnEvent<this>;
|
|
96
|
+
functions: {
|
|
97
|
+
findOneTokenPath(typeIn: BigNumberish, tokenIn: string, amount: BigNumberish, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
98
|
+
from?: string | Promise<string>;
|
|
99
|
+
}): Promise<ContractTransaction>;
|
|
100
|
+
findOpenStrategyPath(task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
101
|
+
from?: string | Promise<string>;
|
|
102
|
+
}): Promise<ContractTransaction>;
|
|
103
|
+
};
|
|
104
|
+
findOneTokenPath(typeIn: BigNumberish, tokenIn: string, amount: BigNumberish, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
105
|
+
from?: string | Promise<string>;
|
|
106
|
+
}): Promise<ContractTransaction>;
|
|
107
|
+
findOpenStrategyPath(task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
108
|
+
from?: string | Promise<string>;
|
|
109
|
+
}): Promise<ContractTransaction>;
|
|
110
|
+
callStatic: {
|
|
111
|
+
findOneTokenPath(typeIn: BigNumberish, tokenIn: string, amount: BigNumberish, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
|
|
112
|
+
findOpenStrategyPath(task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
|
|
113
|
+
};
|
|
114
|
+
filters: {};
|
|
115
|
+
estimateGas: {
|
|
116
|
+
findOneTokenPath(typeIn: BigNumberish, tokenIn: string, amount: BigNumberish, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
117
|
+
from?: string | Promise<string>;
|
|
118
|
+
}): Promise<BigNumber>;
|
|
119
|
+
findOpenStrategyPath(task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
120
|
+
from?: string | Promise<string>;
|
|
121
|
+
}): Promise<BigNumber>;
|
|
122
|
+
};
|
|
123
|
+
populateTransaction: {
|
|
124
|
+
findOneTokenPath(typeIn: BigNumberish, tokenIn: string, amount: BigNumberish, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
125
|
+
from?: string | Promise<string>;
|
|
126
|
+
}): Promise<PopulatedTransaction>;
|
|
127
|
+
findOpenStrategyPath(task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
128
|
+
from?: string | Promise<string>;
|
|
129
|
+
}): Promise<PopulatedTransaction>;
|
|
130
|
+
};
|
|
131
|
+
}
|
package/lib/types/contracts/pathfinder/interfaces/{ISwapPathFinder.d.ts → ISwapAggregator.d.ts}
RENAMED
|
@@ -56,29 +56,89 @@ export declare type SwapQuoteStructOutput = [
|
|
|
56
56
|
found: boolean;
|
|
57
57
|
gasUsage: BigNumber;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
59
|
+
export declare type BalanceStruct = {
|
|
60
|
+
token: string;
|
|
61
|
+
balance: BigNumberish;
|
|
62
|
+
};
|
|
63
|
+
export declare type BalanceStructOutput = [string, BigNumber] & {
|
|
64
|
+
token: string;
|
|
65
|
+
balance: BigNumber;
|
|
66
|
+
};
|
|
67
|
+
export declare type TokenAdaptersStruct = {
|
|
68
|
+
token: string;
|
|
69
|
+
adapters: string[];
|
|
70
|
+
};
|
|
71
|
+
export declare type TokenAdaptersStructOutput = [string, string[]] & {
|
|
72
|
+
token: string;
|
|
73
|
+
adapters: string[];
|
|
74
|
+
};
|
|
75
|
+
export declare type StrategyPathTaskStruct = {
|
|
76
|
+
creditAccount: string;
|
|
77
|
+
balances: BalanceStruct[];
|
|
78
|
+
target: string;
|
|
79
|
+
connectors: string[];
|
|
80
|
+
adapters: string[];
|
|
81
|
+
slippage: BigNumberish;
|
|
82
|
+
targetType: BigNumberish;
|
|
83
|
+
foundAdapters: TokenAdaptersStruct[];
|
|
84
|
+
gasPriceTargetRAY: BigNumberish;
|
|
85
|
+
gasUsage: BigNumberish;
|
|
86
|
+
initTargetBalance: BigNumberish;
|
|
87
|
+
calls: MultiCallStruct[];
|
|
88
|
+
};
|
|
89
|
+
export declare type StrategyPathTaskStructOutput = [
|
|
90
|
+
string,
|
|
91
|
+
BalanceStructOutput[],
|
|
92
|
+
string,
|
|
93
|
+
string[],
|
|
94
|
+
string[],
|
|
95
|
+
BigNumber,
|
|
96
|
+
number,
|
|
97
|
+
TokenAdaptersStructOutput[],
|
|
98
|
+
BigNumber,
|
|
99
|
+
BigNumber,
|
|
100
|
+
BigNumber,
|
|
101
|
+
MultiCallStructOutput[]
|
|
102
|
+
] & {
|
|
103
|
+
creditAccount: string;
|
|
104
|
+
balances: BalanceStructOutput[];
|
|
105
|
+
target: string;
|
|
106
|
+
connectors: string[];
|
|
107
|
+
adapters: string[];
|
|
108
|
+
slippage: BigNumber;
|
|
109
|
+
targetType: number;
|
|
110
|
+
foundAdapters: TokenAdaptersStructOutput[];
|
|
111
|
+
gasPriceTargetRAY: BigNumber;
|
|
112
|
+
gasUsage: BigNumber;
|
|
113
|
+
initTargetBalance: BigNumber;
|
|
114
|
+
calls: MultiCallStructOutput[];
|
|
115
|
+
};
|
|
116
|
+
export interface ISwapAggregatorInterface extends utils.Interface {
|
|
60
117
|
functions: {
|
|
61
118
|
"findAllSwaps((uint8,address,address,address,address[],uint256,uint256,bool),address[])": FunctionFragment;
|
|
62
119
|
"findBestSwap((uint8,address,address,address,address[],uint256,uint256,bool),address[])": FunctionFragment;
|
|
120
|
+
"findBestSwapOrRevert(address,uint256,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
|
|
63
121
|
"getBestDirectPairSwap((uint8,address,address,address,address[],uint256,uint256,bool),address[],uint256)": FunctionFragment;
|
|
64
|
-
"
|
|
122
|
+
"swapAllNormalTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]),address)": FunctionFragment;
|
|
65
123
|
};
|
|
66
|
-
getFunction(nameOrSignatureOrTopic: "findAllSwaps" | "findBestSwap" | "getBestDirectPairSwap" | "
|
|
124
|
+
getFunction(nameOrSignatureOrTopic: "findAllSwaps" | "findBestSwap" | "findBestSwapOrRevert" | "getBestDirectPairSwap" | "swapAllNormalTokens"): FunctionFragment;
|
|
67
125
|
encodeFunctionData(functionFragment: "findAllSwaps", values: [SwapTaskStruct, string[]]): string;
|
|
68
126
|
encodeFunctionData(functionFragment: "findBestSwap", values: [SwapTaskStruct, string[]]): string;
|
|
127
|
+
encodeFunctionData(functionFragment: "findBestSwapOrRevert", values: [string, BigNumberish, string, StrategyPathTaskStruct]): string;
|
|
69
128
|
encodeFunctionData(functionFragment: "getBestDirectPairSwap", values: [SwapTaskStruct, string[], BigNumberish]): string;
|
|
70
|
-
encodeFunctionData(functionFragment: "
|
|
129
|
+
encodeFunctionData(functionFragment: "swapAllNormalTokens", values: [StrategyPathTaskStruct, string]): string;
|
|
71
130
|
decodeFunctionResult(functionFragment: "findAllSwaps", data: BytesLike): Result;
|
|
72
131
|
decodeFunctionResult(functionFragment: "findBestSwap", data: BytesLike): Result;
|
|
132
|
+
decodeFunctionResult(functionFragment: "findBestSwapOrRevert", data: BytesLike): Result;
|
|
73
133
|
decodeFunctionResult(functionFragment: "getBestDirectPairSwap", data: BytesLike): Result;
|
|
74
|
-
decodeFunctionResult(functionFragment: "
|
|
134
|
+
decodeFunctionResult(functionFragment: "swapAllNormalTokens", data: BytesLike): Result;
|
|
75
135
|
events: {};
|
|
76
136
|
}
|
|
77
|
-
export interface
|
|
137
|
+
export interface ISwapAggregator extends BaseContract {
|
|
78
138
|
connect(signerOrProvider: Signer | Provider | string): this;
|
|
79
139
|
attach(addressOrName: string): this;
|
|
80
140
|
deployed(): Promise<this>;
|
|
81
|
-
interface:
|
|
141
|
+
interface: ISwapAggregatorInterface;
|
|
82
142
|
queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
|
|
83
143
|
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
|
|
84
144
|
listeners(eventName?: string): Array<Listener>;
|
|
@@ -95,12 +155,15 @@ export interface ISwapPathFinder extends BaseContract {
|
|
|
95
155
|
findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
|
|
96
156
|
from?: string | Promise<string>;
|
|
97
157
|
}): Promise<ContractTransaction>;
|
|
158
|
+
findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
159
|
+
from?: string | Promise<string>;
|
|
160
|
+
}): Promise<ContractTransaction>;
|
|
98
161
|
getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
|
|
99
162
|
from?: string | Promise<string>;
|
|
100
163
|
}): Promise<ContractTransaction>;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}>;
|
|
164
|
+
swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
|
|
165
|
+
from?: string | Promise<string>;
|
|
166
|
+
}): Promise<ContractTransaction>;
|
|
104
167
|
};
|
|
105
168
|
findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
|
|
106
169
|
from?: string | Promise<string>;
|
|
@@ -108,15 +171,26 @@ export interface ISwapPathFinder extends BaseContract {
|
|
|
108
171
|
findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
|
|
109
172
|
from?: string | Promise<string>;
|
|
110
173
|
}): Promise<ContractTransaction>;
|
|
174
|
+
findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
175
|
+
from?: string | Promise<string>;
|
|
176
|
+
}): Promise<ContractTransaction>;
|
|
111
177
|
getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
|
|
112
178
|
from?: string | Promise<string>;
|
|
113
179
|
}): Promise<ContractTransaction>;
|
|
114
|
-
|
|
180
|
+
swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
|
|
181
|
+
from?: string | Promise<string>;
|
|
182
|
+
}): Promise<ContractTransaction>;
|
|
115
183
|
callStatic: {
|
|
116
184
|
findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: CallOverrides): Promise<SwapQuoteStructOutput[]>;
|
|
117
185
|
findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
|
|
186
|
+
findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
|
|
187
|
+
BigNumber,
|
|
188
|
+
StrategyPathTaskStructOutput
|
|
189
|
+
] & {
|
|
190
|
+
amountOut: BigNumber;
|
|
191
|
+
}>;
|
|
118
192
|
getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
|
|
119
|
-
|
|
193
|
+
swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
|
|
120
194
|
};
|
|
121
195
|
filters: {};
|
|
122
196
|
estimateGas: {
|
|
@@ -126,10 +200,15 @@ export interface ISwapPathFinder extends BaseContract {
|
|
|
126
200
|
findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
|
|
127
201
|
from?: string | Promise<string>;
|
|
128
202
|
}): Promise<BigNumber>;
|
|
203
|
+
findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
204
|
+
from?: string | Promise<string>;
|
|
205
|
+
}): Promise<BigNumber>;
|
|
129
206
|
getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
|
|
130
207
|
from?: string | Promise<string>;
|
|
131
208
|
}): Promise<BigNumber>;
|
|
132
|
-
|
|
209
|
+
swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
|
|
210
|
+
from?: string | Promise<string>;
|
|
211
|
+
}): Promise<BigNumber>;
|
|
133
212
|
};
|
|
134
213
|
populateTransaction: {
|
|
135
214
|
findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
|
|
@@ -138,9 +217,14 @@ export interface ISwapPathFinder extends BaseContract {
|
|
|
138
217
|
findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
|
|
139
218
|
from?: string | Promise<string>;
|
|
140
219
|
}): Promise<PopulatedTransaction>;
|
|
220
|
+
findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
|
|
221
|
+
from?: string | Promise<string>;
|
|
222
|
+
}): Promise<PopulatedTransaction>;
|
|
141
223
|
getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
|
|
142
224
|
from?: string | Promise<string>;
|
|
143
225
|
}): Promise<PopulatedTransaction>;
|
|
144
|
-
|
|
226
|
+
swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
|
|
227
|
+
from?: string | Promise<string>;
|
|
228
|
+
}): Promise<PopulatedTransaction>;
|
|
145
229
|
};
|
|
146
230
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
|
|
2
2
|
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
|
3
3
|
import type { Listener, Provider } from "@ethersproject/providers";
|
|
4
|
-
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "
|
|
4
|
+
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "../../../common";
|
|
5
5
|
export declare type SwapTaskStruct = {
|
|
6
6
|
swapOperation: BigNumberish;
|
|
7
7
|
creditAccount: string;
|