@gearbox-protocol/sdk 3.0.0-vfour.43 → 3.0.0-vfour.45
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/dist/cjs/dev/index.cjs
CHANGED
|
@@ -61,6 +61,7 @@ function createAnvilClient({
|
|
|
61
61
|
cacheTime: 0
|
|
62
62
|
}
|
|
63
63
|
).extend(viem.publicActions).extend(viem.walletActions).extend((client) => ({
|
|
64
|
+
anvilNodeInfo: () => anvilNodeInfo(client),
|
|
64
65
|
isAnvil: () => isAnvil(client),
|
|
65
66
|
evmMineDetailed: (timestamp) => evmMineDetailed(client, timestamp)
|
|
66
67
|
}));
|
|
@@ -76,6 +77,12 @@ async function isAnvil(client) {
|
|
|
76
77
|
return false;
|
|
77
78
|
}
|
|
78
79
|
}
|
|
80
|
+
async function anvilNodeInfo(client) {
|
|
81
|
+
return client.request({
|
|
82
|
+
method: "anvil_nodeInfo",
|
|
83
|
+
params: []
|
|
84
|
+
});
|
|
85
|
+
}
|
|
79
86
|
async function evmMineDetailed(client, timestamp) {
|
|
80
87
|
try {
|
|
81
88
|
const [block] = await client.request({
|
|
@@ -1512,6 +1519,7 @@ async function setLTs(sdk, cm, newLTs, logger) {
|
|
|
1512
1519
|
});
|
|
1513
1520
|
}
|
|
1514
1521
|
|
|
1522
|
+
exports.anvilNodeInfo = anvilNodeInfo;
|
|
1515
1523
|
exports.calcLiquidatableLTs = calcLiquidatableLTs;
|
|
1516
1524
|
exports.createAnvilClient = createAnvilClient;
|
|
1517
1525
|
exports.evmMineDetailed = evmMineDetailed;
|
package/dist/cjs/dev/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, TestRpcSchema, Hex, Block, Prettify, Client, Transport, Chain, TestActions, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
import { GearboxSDK, CreditAccountData, ILogger, CreditFactory } from '../sdk';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -39,6 +39,7 @@ type AnvilRPCSchema = [
|
|
|
39
39
|
}
|
|
40
40
|
];
|
|
41
41
|
type AnvilActions = {
|
|
42
|
+
anvilNodeInfo: () => Promise<AnvilNodeInfo>;
|
|
42
43
|
isAnvil: () => Promise<boolean>;
|
|
43
44
|
evmMineDetailed: (
|
|
44
45
|
/**
|
|
@@ -60,6 +61,12 @@ declare function createAnvilClient({ chain, transport, }: AnvilClientConfig): An
|
|
|
60
61
|
* @returns
|
|
61
62
|
*/
|
|
62
63
|
declare function isAnvil(client: Client<any, any, any, AnvilRPCSchema, any>): Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* Anvil node info
|
|
66
|
+
* @param client
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
declare function anvilNodeInfo(client: Client<any, any, any, AnvilRPCSchema, any>): Promise<AnvilNodeInfo>;
|
|
63
70
|
/**
|
|
64
71
|
* Safely tries to mine block with given timestamp
|
|
65
72
|
* @param client
|
|
@@ -76,4 +83,4 @@ declare function evmMineDetailed(client: Client<any, any, any, AnvilRPCSchema, a
|
|
|
76
83
|
*/
|
|
77
84
|
declare function setLTs(sdk: GearboxSDK, cm: CreditFactory, newLTs: Record<Address, number>, logger?: ILogger): Promise<void>;
|
|
78
85
|
|
|
79
|
-
export { type AnvilActions, type AnvilClient, type AnvilClientConfig, calcLiquidatableLTs, createAnvilClient, evmMineDetailed, isAnvil, setLTs };
|
|
86
|
+
export { type AnvilActions, type AnvilClient, type AnvilClientConfig, type AnvilNodeInfo, type AnvilRPCSchema, anvilNodeInfo, calcLiquidatableLTs, createAnvilClient, evmMineDetailed, isAnvil, setLTs };
|
package/dist/cjs/sdk/index.cjs
CHANGED
|
@@ -8,7 +8,6 @@ var actions = require('viem/actions');
|
|
|
8
8
|
var evmConnector = require('@redstone-finance/evm-connector');
|
|
9
9
|
var redstoneProtocol = require('redstone-protocol');
|
|
10
10
|
var sdkGov = require('@gearbox-protocol/sdk-gov');
|
|
11
|
-
var aura = require('@gearbox-protocol/sdk-gov/lib/tokens/aura');
|
|
12
11
|
|
|
13
12
|
// src/sdk/accounts/CreditAccountsService.ts
|
|
14
13
|
|
|
@@ -22565,9 +22564,9 @@ var PathOptionFactory = class _PathOptionFactory {
|
|
|
22565
22564
|
([, balance]) => balance.balance > 1
|
|
22566
22565
|
);
|
|
22567
22566
|
const balancerPools = nonZeroBalances.map(([token]) => sdkGov.getTokenSymbol(token)).filter((symbol) => sdkGov.isBalancerLPToken(symbol));
|
|
22568
|
-
const balancerAuraTokens = Object.entries(
|
|
22567
|
+
const balancerAuraTokens = Object.entries(sdkGov.auraTokens).filter(([, data]) => sdkGov.isBalancerLPToken(data.underlying)).map(([token]) => token);
|
|
22569
22568
|
const balancerTokensFromAura = nonZeroBalances.map(([token]) => sdkGov.getTokenSymbol(token)).filter((symbol) => balancerAuraTokens.includes(symbol)).map(
|
|
22570
|
-
(symbol) =>
|
|
22569
|
+
(symbol) => sdkGov.auraTokens[symbol].underlying
|
|
22571
22570
|
);
|
|
22572
22571
|
const balancerSet = /* @__PURE__ */ new Set([...balancerPools, ...balancerTokensFromAura]);
|
|
22573
22572
|
return Array.from(balancerSet.values());
|
package/dist/esm/dev/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, TestRpcSchema, Hex, Block, Prettify, Client, Transport, Chain, TestActions, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
import { GearboxSDK, CreditAccountData, ILogger, CreditFactory } from '../sdk';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -39,6 +39,7 @@ type AnvilRPCSchema = [
|
|
|
39
39
|
}
|
|
40
40
|
];
|
|
41
41
|
type AnvilActions = {
|
|
42
|
+
anvilNodeInfo: () => Promise<AnvilNodeInfo>;
|
|
42
43
|
isAnvil: () => Promise<boolean>;
|
|
43
44
|
evmMineDetailed: (
|
|
44
45
|
/**
|
|
@@ -60,6 +61,12 @@ declare function createAnvilClient({ chain, transport, }: AnvilClientConfig): An
|
|
|
60
61
|
* @returns
|
|
61
62
|
*/
|
|
62
63
|
declare function isAnvil(client: Client<any, any, any, AnvilRPCSchema, any>): Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* Anvil node info
|
|
66
|
+
* @param client
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
declare function anvilNodeInfo(client: Client<any, any, any, AnvilRPCSchema, any>): Promise<AnvilNodeInfo>;
|
|
63
70
|
/**
|
|
64
71
|
* Safely tries to mine block with given timestamp
|
|
65
72
|
* @param client
|
|
@@ -76,4 +83,4 @@ declare function evmMineDetailed(client: Client<any, any, any, AnvilRPCSchema, a
|
|
|
76
83
|
*/
|
|
77
84
|
declare function setLTs(sdk: GearboxSDK, cm: CreditFactory, newLTs: Record<Address, number>, logger?: ILogger): Promise<void>;
|
|
78
85
|
|
|
79
|
-
export { type AnvilActions, type AnvilClient, type AnvilClientConfig, calcLiquidatableLTs, createAnvilClient, evmMineDetailed, isAnvil, setLTs };
|
|
86
|
+
export { type AnvilActions, type AnvilClient, type AnvilClientConfig, type AnvilNodeInfo, type AnvilRPCSchema, anvilNodeInfo, calcLiquidatableLTs, createAnvilClient, evmMineDetailed, isAnvil, setLTs };
|
package/dist/esm/dev/index.mjs
CHANGED
|
@@ -59,6 +59,7 @@ function createAnvilClient({
|
|
|
59
59
|
cacheTime: 0
|
|
60
60
|
}
|
|
61
61
|
).extend(publicActions).extend(walletActions).extend((client) => ({
|
|
62
|
+
anvilNodeInfo: () => anvilNodeInfo(client),
|
|
62
63
|
isAnvil: () => isAnvil(client),
|
|
63
64
|
evmMineDetailed: (timestamp) => evmMineDetailed(client, timestamp)
|
|
64
65
|
}));
|
|
@@ -74,6 +75,12 @@ async function isAnvil(client) {
|
|
|
74
75
|
return false;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
async function anvilNodeInfo(client) {
|
|
79
|
+
return client.request({
|
|
80
|
+
method: "anvil_nodeInfo",
|
|
81
|
+
params: []
|
|
82
|
+
});
|
|
83
|
+
}
|
|
77
84
|
async function evmMineDetailed(client, timestamp) {
|
|
78
85
|
try {
|
|
79
86
|
const [block] = await client.request({
|
|
@@ -1510,4 +1517,4 @@ async function setLTs(sdk, cm, newLTs, logger) {
|
|
|
1510
1517
|
});
|
|
1511
1518
|
}
|
|
1512
1519
|
|
|
1513
|
-
export { calcLiquidatableLTs, createAnvilClient, evmMineDetailed, isAnvil, setLTs };
|
|
1520
|
+
export { anvilNodeInfo, calcLiquidatableLTs, createAnvilClient, evmMineDetailed, isAnvil, setLTs };
|
package/dist/esm/sdk/index.mjs
CHANGED
|
@@ -5,8 +5,7 @@ import { mainnet, arbitrum, optimism, base } from 'viem/chains';
|
|
|
5
5
|
import { simulateContract } from 'viem/actions';
|
|
6
6
|
import { DataServiceWrapper } from '@redstone-finance/evm-connector';
|
|
7
7
|
import { RedstonePayload } from 'redstone-protocol';
|
|
8
|
-
import { getConnectors, decimals, getTokenSymbol, RouterComponent, TokenType, tokenDataByNetwork, contractParams, curveTokens, balancerLpTokens, isCurveLPToken, yearnTokens, convexTokens, isBalancerLPToken } from '@gearbox-protocol/sdk-gov';
|
|
9
|
-
import { auraTokens } from '@gearbox-protocol/sdk-gov/lib/tokens/aura';
|
|
8
|
+
import { getConnectors, decimals, getTokenSymbol, RouterComponent, TokenType, tokenDataByNetwork, contractParams, curveTokens, balancerLpTokens, isCurveLPToken, yearnTokens, convexTokens, isBalancerLPToken, auraTokens } from '@gearbox-protocol/sdk-gov';
|
|
10
9
|
|
|
11
10
|
// src/sdk/accounts/CreditAccountsService.ts
|
|
12
11
|
|