@gearbox-protocol/sdk 12.6.6 → 12.6.7
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.
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(chains_exports);
|
|
|
32
32
|
var import_viem = require("viem");
|
|
33
33
|
var import_chains = require("viem/chains");
|
|
34
34
|
var import_v4 = require("zod/v4");
|
|
35
|
-
var
|
|
35
|
+
var import_mappers = require("../utils/mappers.js");
|
|
36
36
|
const SUPPORTED_NETWORKS = [
|
|
37
37
|
"Mainnet",
|
|
38
38
|
"Arbitrum",
|
|
@@ -162,16 +162,13 @@ const chains = {
|
|
|
162
162
|
"sonic-rpc"
|
|
163
163
|
),
|
|
164
164
|
MegaETH: (0, import_viem.defineChain)({
|
|
165
|
-
...import_chains.
|
|
165
|
+
...import_chains.megaeth,
|
|
166
166
|
network: "MegaETH",
|
|
167
|
-
defaultMarketConfigurators: {
|
|
168
|
-
"0x59Db4A2241BFe5Ba9023d47A012a6c7A039139A6": "Chaos Labs"
|
|
169
|
-
},
|
|
167
|
+
defaultMarketConfigurators: {},
|
|
170
168
|
isPublic: false,
|
|
171
|
-
// TODO: has no block explorer API
|
|
172
169
|
wellKnownToken: {
|
|
173
|
-
address: "
|
|
174
|
-
symbol: "
|
|
170
|
+
address: "0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7",
|
|
171
|
+
symbol: "USDm"
|
|
175
172
|
}
|
|
176
173
|
}),
|
|
177
174
|
// NOTE: Monad chain configs should be updated once the public mainnet is available
|
|
@@ -311,8 +308,8 @@ const chains = {
|
|
|
311
308
|
},
|
|
312
309
|
isPublic: true,
|
|
313
310
|
wellKnownToken: {
|
|
314
|
-
address: "
|
|
315
|
-
symbol: "
|
|
311
|
+
address: "0x5d72a9d9a9510cd8cbdba12ac62593a58930a948",
|
|
312
|
+
symbol: "aPlaUSDT0"
|
|
316
313
|
},
|
|
317
314
|
contracts: {
|
|
318
315
|
multicall3: {
|
|
@@ -389,7 +386,7 @@ function isPublicNetwork(networkOrChainId) {
|
|
|
389
386
|
function getCuratorName(marketConfigurator, network) {
|
|
390
387
|
const chainz = network ? [chains[network]] : Object.values(chains);
|
|
391
388
|
for (const c of chainz) {
|
|
392
|
-
for (const [a, curator] of
|
|
389
|
+
for (const [a, curator] of import_mappers.TypedObjectUtils.entries({
|
|
393
390
|
...c.defaultMarketConfigurators,
|
|
394
391
|
...c.testMarketConfigurators
|
|
395
392
|
})) {
|
|
@@ -403,7 +400,7 @@ function getCuratorName(marketConfigurator, network) {
|
|
|
403
400
|
function findCuratorMarketConfigurator(curator, network) {
|
|
404
401
|
const { defaultMarketConfigurators, testMarketConfigurators } = chains[network];
|
|
405
402
|
const all = { ...defaultMarketConfigurators, ...testMarketConfigurators };
|
|
406
|
-
for (const [a, c] of
|
|
403
|
+
for (const [a, c] of import_mappers.TypedObjectUtils.entries(all)) {
|
|
407
404
|
if (c === curator) {
|
|
408
405
|
return a;
|
|
409
406
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
hemi,
|
|
10
10
|
lisk,
|
|
11
11
|
mainnet,
|
|
12
|
-
|
|
12
|
+
megaeth,
|
|
13
13
|
monad,
|
|
14
14
|
optimism,
|
|
15
15
|
plasma,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
worldchain
|
|
18
18
|
} from "viem/chains";
|
|
19
19
|
import { z } from "zod/v4";
|
|
20
|
-
import { TypedObjectUtils } from "../utils/
|
|
20
|
+
import { TypedObjectUtils } from "../utils/mappers.js";
|
|
21
21
|
const SUPPORTED_NETWORKS = [
|
|
22
22
|
"Mainnet",
|
|
23
23
|
"Arbitrum",
|
|
@@ -147,16 +147,13 @@ const chains = {
|
|
|
147
147
|
"sonic-rpc"
|
|
148
148
|
),
|
|
149
149
|
MegaETH: defineChain({
|
|
150
|
-
...
|
|
150
|
+
...megaeth,
|
|
151
151
|
network: "MegaETH",
|
|
152
|
-
defaultMarketConfigurators: {
|
|
153
|
-
"0x59Db4A2241BFe5Ba9023d47A012a6c7A039139A6": "Chaos Labs"
|
|
154
|
-
},
|
|
152
|
+
defaultMarketConfigurators: {},
|
|
155
153
|
isPublic: false,
|
|
156
|
-
// TODO: has no block explorer API
|
|
157
154
|
wellKnownToken: {
|
|
158
|
-
address: "
|
|
159
|
-
symbol: "
|
|
155
|
+
address: "0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7",
|
|
156
|
+
symbol: "USDm"
|
|
160
157
|
}
|
|
161
158
|
}),
|
|
162
159
|
// NOTE: Monad chain configs should be updated once the public mainnet is available
|
|
@@ -296,8 +293,8 @@ const chains = {
|
|
|
296
293
|
},
|
|
297
294
|
isPublic: true,
|
|
298
295
|
wellKnownToken: {
|
|
299
|
-
address: "
|
|
300
|
-
symbol: "
|
|
296
|
+
address: "0x5d72a9d9a9510cd8cbdba12ac62593a58930a948",
|
|
297
|
+
symbol: "aPlaUSDT0"
|
|
301
298
|
},
|
|
302
299
|
contracts: {
|
|
303
300
|
multicall3: {
|
|
@@ -123,8 +123,8 @@ export declare class CreditAccountData_Legacy {
|
|
|
123
123
|
constructor(payload: CreditAccountDataPayload);
|
|
124
124
|
static sortBalances(balances: Record<Address, bigint>, prices: Record<Address, bigint>, tokens: Record<Address, TokenData>): Array<[Address, bigint]>;
|
|
125
125
|
static sortAssets<T extends Asset>(balances: Array<T>, prices: Record<Address, bigint>, tokens: Record<Address, TokenData>): T[];
|
|
126
|
-
static assetComparator<T extends Asset>(t1: T, t2: T, prices1: Record<Address, bigint> | undefined, prices2: Record<Address, bigint> | undefined, tokens1: Record<Address, TokenData> | undefined, tokens2: Record<Address, TokenData> | undefined): 1 |
|
|
127
|
-
static tokensAbcComparator(t1?: TokenData, t2?: TokenData): 1 |
|
|
126
|
+
static assetComparator<T extends Asset>(t1: T, t2: T, prices1: Record<Address, bigint> | undefined, prices2: Record<Address, bigint> | undefined, tokens1: Record<Address, TokenData> | undefined, tokens2: Record<Address, TokenData> | undefined): 1 | 0 | -1;
|
|
127
|
+
static tokensAbcComparator(t1?: TokenData, t2?: TokenData): 1 | 0 | -1;
|
|
128
128
|
static amountAbcComparator(t1: bigint, t2: bigint): 1 | -1;
|
|
129
129
|
isForbidden(token: Address): boolean;
|
|
130
130
|
isQuoted(token: Address): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/sdk",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.7",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/sdk/index.js",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"zod": "^4.3.6"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@biomejs/biome": "^2.3.
|
|
70
|
-
"@commitlint/cli": "^20.
|
|
71
|
-
"@commitlint/config-conventional": "^20.
|
|
72
|
-
"@gearbox-protocol/biome-config": "^1.0.
|
|
69
|
+
"@biomejs/biome": "^2.3.14",
|
|
70
|
+
"@commitlint/cli": "^20.4.1",
|
|
71
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
72
|
+
"@gearbox-protocol/biome-config": "^1.0.20",
|
|
73
73
|
"@types/cross-spawn": "^6.0.6",
|
|
74
|
-
"axios": "^1.13.
|
|
74
|
+
"axios": "^1.13.5",
|
|
75
75
|
"cross-spawn": "^7.0.6",
|
|
76
76
|
"husky": "^9.1.7",
|
|
77
77
|
"lint-staged": "^16.2.7",
|