@gearbox-protocol/sdk 3.0.0-next.5 → 3.0.0-next.6
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MultiCall } from "../pathfinder/core";
|
|
2
1
|
import { ChartsCreditManagerPayload, CreditManagerDataPayload, QuotaInfo } from "../payload/creditManager";
|
|
3
2
|
import { LinearModel } from "../payload/pool";
|
|
3
|
+
import { MultiCallStruct } from "../types/IRouter";
|
|
4
4
|
export declare class CreditManagerData {
|
|
5
5
|
readonly address: string;
|
|
6
6
|
readonly underlyingToken: string;
|
|
@@ -31,12 +31,12 @@ export declare class CreditManagerData {
|
|
|
31
31
|
readonly quotas: Array<QuotaInfo>;
|
|
32
32
|
readonly interestModel: LinearModel;
|
|
33
33
|
constructor(payload: CreditManagerDataPayload);
|
|
34
|
-
encodeAddCollateral(accountAddress: string, tokenAddress: string, amount: bigint):
|
|
35
|
-
encodeIncreaseDebt(amount: bigint):
|
|
36
|
-
encodeDecreaseDebt(amount: bigint):
|
|
37
|
-
encodeEnableToken(token: string):
|
|
38
|
-
encodeDisableToken(token: string):
|
|
39
|
-
static withdrawAllAndUnwrap_Convex(address: string, claim: boolean):
|
|
34
|
+
encodeAddCollateral(accountAddress: string, tokenAddress: string, amount: bigint): MultiCallStruct;
|
|
35
|
+
encodeIncreaseDebt(amount: bigint): MultiCallStruct;
|
|
36
|
+
encodeDecreaseDebt(amount: bigint): MultiCallStruct;
|
|
37
|
+
encodeEnableToken(token: string): MultiCallStruct;
|
|
38
|
+
encodeDisableToken(token: string): MultiCallStruct;
|
|
39
|
+
static withdrawAllAndUnwrap_Convex(address: string, claim: boolean): MultiCallStruct;
|
|
40
40
|
get id(): string;
|
|
41
41
|
}
|
|
42
42
|
export declare class ChartsCreditManagerData {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NetworkType, SupportedContract, SupportedToken } from "@gearbox-protocol/sdk-gov";
|
|
2
2
|
import { providers } from "ethers";
|
|
3
|
-
import {
|
|
3
|
+
import { MultiCallStruct } from "../types/IRouter";
|
|
4
4
|
import { CreditAccountData } from "./creditAccount";
|
|
5
5
|
import { CreditManagerData } from "./creditManager";
|
|
6
6
|
export interface Rewards {
|
|
7
7
|
contract: SupportedContract;
|
|
8
8
|
rewards: Partial<Record<SupportedToken, bigint>>;
|
|
9
|
-
calls: Array<
|
|
9
|
+
calls: Array<MultiCallStruct>;
|
|
10
10
|
}
|
|
11
11
|
export interface AdapterWithType {
|
|
12
12
|
contractAddress: string;
|
package/lib/core/trade.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SupportedContract } from "@gearbox-protocol/sdk-gov";
|
|
2
2
|
import { Signer } from "ethers";
|
|
3
|
-
import {
|
|
3
|
+
import { PathFinderResult, SwapOperation } from "../pathfinder/core";
|
|
4
4
|
import { ICreditFacadeV2 } from "../types";
|
|
5
|
+
import { MultiCallStruct, MultiCallStructOutput } from "../types/IRouter";
|
|
5
6
|
import { CreditManagerData } from "./creditManager";
|
|
6
7
|
import { EVMTx } from "./eventOrTx";
|
|
7
8
|
interface Info {
|
|
@@ -46,11 +47,11 @@ export declare class Trade {
|
|
|
46
47
|
toString(): string;
|
|
47
48
|
static getTrades({ from, to, amount, results, creditManager, currentContracts, }: GetTradesProps): Trade[];
|
|
48
49
|
static getOperationName(tokenInAddress: string, tokenOutAddress: string): TradeOperations;
|
|
49
|
-
static getCallInfo(calls: Array<
|
|
50
|
+
static getCallInfo(calls: Array<MultiCallStructOutput>, creditManager: string, currentContracts: Record<SupportedContract, string>): Info[];
|
|
50
51
|
private static getContractSymbol;
|
|
51
52
|
static getTradeId(trade: Trade): string;
|
|
52
53
|
static sortTrades(trades: Array<Trade>, swapStrategy: string): Trade[];
|
|
53
|
-
static executeMulticallPath(creditFacade: string | ICreditFacadeV2, signer: Signer, calls: Array<
|
|
54
|
+
static executeMulticallPath(creditFacade: string | ICreditFacadeV2, signer: Signer, calls: Array<MultiCallStruct>): Promise<import("ethers").ContractTransaction>;
|
|
54
55
|
private static executeOnCreditFacade;
|
|
55
56
|
}
|
|
56
57
|
export {};
|
package/lib/pathfinder/core.d.ts
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
+
import { MultiCallStructOutput } from "../types/IRouter";
|
|
1
2
|
export declare enum SwapOperation {
|
|
2
3
|
EXACT_INPUT = 0,
|
|
3
4
|
EXACT_INPUT_ALL = 1,
|
|
4
5
|
EXACT_OUTPUT = 2
|
|
5
6
|
}
|
|
6
|
-
export interface MultiCall {
|
|
7
|
-
target: string;
|
|
8
|
-
callData: string;
|
|
9
|
-
}
|
|
10
7
|
export interface PathFinderResult {
|
|
11
8
|
amount: bigint;
|
|
12
|
-
calls: Array<
|
|
9
|
+
calls: Array<MultiCallStructOutput>;
|
|
13
10
|
}
|
|
14
11
|
export interface PathFinderOpenStrategyResult {
|
|
15
12
|
balances: Record<string, bigint>;
|
|
16
|
-
calls: Array<
|
|
13
|
+
calls: Array<MultiCallStructOutput>;
|
|
17
14
|
}
|
|
18
15
|
export interface PathFinderCloseResult {
|
|
19
16
|
underlyingBalance: bigint;
|
|
20
|
-
calls: Array<
|
|
17
|
+
calls: Array<MultiCallStructOutput>;
|
|
21
18
|
}
|
|
@@ -3,10 +3,11 @@ import { BigNumberish, providers, Signer } from "ethers";
|
|
|
3
3
|
import { CreditAccountData } from "../core/creditAccount";
|
|
4
4
|
import { CreditManagerData } from "../core/creditManager";
|
|
5
5
|
import { IRouter } from "../types";
|
|
6
|
-
import {
|
|
6
|
+
import { MultiCallStructOutput } from "../types/IRouter";
|
|
7
|
+
import { PathFinderCloseResult, PathFinderOpenStrategyResult, PathFinderResult, SwapOperation } from "./core";
|
|
7
8
|
export interface CloseResult {
|
|
8
9
|
amount: bigint;
|
|
9
|
-
calls: Array<
|
|
10
|
+
calls: Array<MultiCallStructOutput>;
|
|
10
11
|
gasUsage: bigint;
|
|
11
12
|
}
|
|
12
13
|
export declare class PathFinder {
|