@bgd-labs/toolbox 0.0.4 → 0.0.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.
- package/dist/index.d.mts +3258 -2
- package/dist/index.d.ts +3258 -2
- package/dist/index.js +377 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +394 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,6 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
ChainId: () => ChainId,
|
|
34
|
+
ChainList: () => ChainList,
|
|
33
35
|
EVENT_DB: () => EVENT_DB,
|
|
34
36
|
HALF_RAY: () => HALF_RAY,
|
|
35
37
|
HALF_WAD: () => HALF_WAD,
|
|
@@ -43,6 +45,7 @@ __export(index_exports, {
|
|
|
43
45
|
SelfdestuctCheckState: () => SelfdestuctCheckState,
|
|
44
46
|
WAD: () => WAD,
|
|
45
47
|
WAD_RAY_RATIO: () => WAD_RAY_RATIO,
|
|
48
|
+
alchemySupportedChainIds: () => alchemySupportedChainIds,
|
|
46
49
|
bitmapToIndexes: () => bitmapToIndexes,
|
|
47
50
|
calculateAvailableBorrowsMarketReferenceCurrency: () => calculateAvailableBorrowsMarketReferenceCurrency,
|
|
48
51
|
calculateCompoundedInterest: () => calculateCompoundedInterest,
|
|
@@ -58,17 +61,24 @@ __export(index_exports, {
|
|
|
58
61
|
erc1967_ImplementationSlot: () => erc1967_ImplementationSlot,
|
|
59
62
|
foundry_getStandardJsonInput: () => foundry_getStandardJsonInput,
|
|
60
63
|
foundry_getStorageLayout: () => foundry_getStorageLayout,
|
|
64
|
+
getAlchemyRPC: () => getAlchemyRPC,
|
|
61
65
|
getBits: () => getBits,
|
|
66
|
+
getClient: () => getClient,
|
|
62
67
|
getCurrentDebtBalance: () => getCurrentDebtBalance,
|
|
63
68
|
getCurrentLiquidityBalance: () => getCurrentLiquidityBalance,
|
|
69
|
+
getExplicitRPC: () => getExplicitRPC,
|
|
64
70
|
getExplorer: () => getExplorer,
|
|
65
71
|
getGovernance: () => getGovernance,
|
|
66
72
|
getMarketReferenceCurrencyAndUsdBalance: () => getMarketReferenceCurrencyAndUsdBalance,
|
|
73
|
+
getNetworkEnv: () => getNetworkEnv,
|
|
67
74
|
getNonFinalizedPayloads: () => getNonFinalizedPayloads,
|
|
68
75
|
getNonFinalizedProposals: () => getNonFinalizedProposals,
|
|
69
76
|
getNormalizedDebt: () => getNormalizedDebt,
|
|
70
77
|
getNormalizedIncome: () => getNormalizedIncome,
|
|
71
78
|
getPayloadsController: () => getPayloadsController,
|
|
79
|
+
getPublicRpc: () => getPublicRpc,
|
|
80
|
+
getQuickNodeRpc: () => getQuickNodeRpc,
|
|
81
|
+
getRPCUrl: () => getRPCUrl,
|
|
72
82
|
getSourceCode: () => getSourceCode,
|
|
73
83
|
isPayloadFinal: () => isPayloadFinal,
|
|
74
84
|
isProposalFinal: () => isProposalFinal,
|
|
@@ -76,6 +86,7 @@ __export(index_exports, {
|
|
|
76
86
|
makeProposalExecutableOnTestClient: () => makeProposalExecutableOnTestClient,
|
|
77
87
|
parseEtherscanStyleSourceCode: () => parseEtherscanStyleSourceCode,
|
|
78
88
|
parseLogs: () => parseLogs,
|
|
89
|
+
publicRPCs: () => publicRPCs,
|
|
79
90
|
rayDiv: () => rayDiv,
|
|
80
91
|
rayMul: () => rayMul,
|
|
81
92
|
rayToWad: () => rayToWad,
|
|
@@ -1906,7 +1917,7 @@ var IGovernanceCore_ABI = [
|
|
|
1906
1917
|
}
|
|
1907
1918
|
];
|
|
1908
1919
|
|
|
1909
|
-
// src/aave/governance/
|
|
1920
|
+
// src/aave/governance/payloads-controller.ts
|
|
1910
1921
|
var import_viem2 = require("viem");
|
|
1911
1922
|
|
|
1912
1923
|
// src/math/slot.ts
|
|
@@ -1920,7 +1931,7 @@ function getSolidityStorageSlotUint(mappingSlot, key) {
|
|
|
1920
1931
|
);
|
|
1921
1932
|
}
|
|
1922
1933
|
|
|
1923
|
-
// src/aave/governance/
|
|
1934
|
+
// src/aave/governance/payloads-controller.ts
|
|
1924
1935
|
var import_actions = require("viem/actions");
|
|
1925
1936
|
var PayloadState = /* @__PURE__ */ ((PayloadState2) => {
|
|
1926
1937
|
PayloadState2[PayloadState2["None"] = 0] = "None";
|
|
@@ -3151,6 +3162,357 @@ function diffFoundryStorageLayout(layoutBefore, layoutAfter) {
|
|
|
3151
3162
|
// src/ecosystem/event-db.ts
|
|
3152
3163
|
var EVENT_DB = [];
|
|
3153
3164
|
|
|
3165
|
+
// src/ecosystem/chainIds.ts
|
|
3166
|
+
var import_chains = require("viem/chains");
|
|
3167
|
+
var ChainId = {
|
|
3168
|
+
celo: import_chains.celo.id,
|
|
3169
|
+
mainnet: import_chains.mainnet.id,
|
|
3170
|
+
polygon: import_chains.polygon.id,
|
|
3171
|
+
polygon_amoy: import_chains.polygonAmoy.id,
|
|
3172
|
+
avalanche: import_chains.avalanche.id,
|
|
3173
|
+
avalanche_fuji: import_chains.avalancheFuji.id,
|
|
3174
|
+
arbitrum: import_chains.arbitrum.id,
|
|
3175
|
+
arbitrum_sepolia: import_chains.arbitrumSepolia.id,
|
|
3176
|
+
fantom: import_chains.fantom.id,
|
|
3177
|
+
fantom_testnet: import_chains.fantomTestnet.id,
|
|
3178
|
+
optimism: import_chains.optimism.id,
|
|
3179
|
+
optimism_sepolia: import_chains.optimismSepolia.id,
|
|
3180
|
+
harmony: import_chains.harmonyOne.id,
|
|
3181
|
+
sepolia: import_chains.sepolia.id,
|
|
3182
|
+
scroll: import_chains.scroll.id,
|
|
3183
|
+
scroll_sepolia: import_chains.scrollSepolia.id,
|
|
3184
|
+
sonic: import_chains.sonic.id,
|
|
3185
|
+
mantle: import_chains.mantle.id,
|
|
3186
|
+
metis: import_chains.metis.id,
|
|
3187
|
+
base: import_chains.base.id,
|
|
3188
|
+
base_sepolia: import_chains.baseSepolia.id,
|
|
3189
|
+
bnb: import_chains.bsc.id,
|
|
3190
|
+
gnosis: import_chains.gnosis.id,
|
|
3191
|
+
zkEVM: import_chains.polygonZkEvm.id,
|
|
3192
|
+
zksync: import_chains.zksync.id,
|
|
3193
|
+
linea: import_chains.linea.id
|
|
3194
|
+
};
|
|
3195
|
+
var ChainList = {
|
|
3196
|
+
[ChainId.mainnet]: import_chains.mainnet,
|
|
3197
|
+
[ChainId.polygon]: import_chains.polygon,
|
|
3198
|
+
[ChainId.polygon_amoy]: import_chains.polygonAmoy,
|
|
3199
|
+
[ChainId.avalanche]: import_chains.avalanche,
|
|
3200
|
+
[ChainId.avalanche_fuji]: import_chains.avalancheFuji,
|
|
3201
|
+
[ChainId.arbitrum]: import_chains.arbitrum,
|
|
3202
|
+
[ChainId.arbitrum_sepolia]: import_chains.arbitrumSepolia,
|
|
3203
|
+
[ChainId.fantom]: import_chains.fantom,
|
|
3204
|
+
[ChainId.fantom_testnet]: import_chains.fantomTestnet,
|
|
3205
|
+
[ChainId.optimism]: import_chains.optimism,
|
|
3206
|
+
[ChainId.optimism_sepolia]: import_chains.optimismSepolia,
|
|
3207
|
+
[ChainId.harmony]: import_chains.harmonyOne,
|
|
3208
|
+
[ChainId.sepolia]: import_chains.sepolia,
|
|
3209
|
+
[ChainId.scroll]: import_chains.scroll,
|
|
3210
|
+
[ChainId.scroll_sepolia]: import_chains.scrollSepolia,
|
|
3211
|
+
[ChainId.sonic]: import_chains.sonic,
|
|
3212
|
+
[ChainId.mantle]: import_chains.mantle,
|
|
3213
|
+
[ChainId.metis]: import_chains.metis,
|
|
3214
|
+
[ChainId.base]: import_chains.base,
|
|
3215
|
+
[ChainId.base_sepolia]: import_chains.baseSepolia,
|
|
3216
|
+
[ChainId.bnb]: import_chains.bsc,
|
|
3217
|
+
[ChainId.gnosis]: import_chains.gnosis,
|
|
3218
|
+
[ChainId.zkEVM]: import_chains.polygonZkEvm,
|
|
3219
|
+
[ChainId.celo]: import_chains.celo,
|
|
3220
|
+
[ChainId.zksync]: import_chains.zksync,
|
|
3221
|
+
[ChainId.linea]: import_chains.linea
|
|
3222
|
+
};
|
|
3223
|
+
|
|
3224
|
+
// src/ecosystem/rpcs.ts
|
|
3225
|
+
var import_viem5 = require("viem");
|
|
3226
|
+
|
|
3227
|
+
// src/ecosystem/generated/alechmyNetworkMap.ts
|
|
3228
|
+
var alechmyNetworkMap = {
|
|
3229
|
+
1: "eth-mainnet",
|
|
3230
|
+
10: "opt-mainnet",
|
|
3231
|
+
30: "rootstock-mainnet",
|
|
3232
|
+
31: "rootstock-testnet",
|
|
3233
|
+
56: "bnb-mainnet",
|
|
3234
|
+
97: "bnb-testnet",
|
|
3235
|
+
100: "gnosis-mainnet",
|
|
3236
|
+
130: "unichain-mainnet",
|
|
3237
|
+
137: "polygon-mainnet",
|
|
3238
|
+
146: "sonic-mainnet",
|
|
3239
|
+
204: "opbnb-mainnet",
|
|
3240
|
+
250: "fantom-mainnet",
|
|
3241
|
+
252: "frax-mainnet",
|
|
3242
|
+
300: "zksync-sepolia",
|
|
3243
|
+
324: "zksync-mainnet",
|
|
3244
|
+
360: "shape-mainnet",
|
|
3245
|
+
480: "worldchain-mainnet",
|
|
3246
|
+
545: "flow-testnet",
|
|
3247
|
+
592: "astar-mainnet",
|
|
3248
|
+
747: "flow-mainnet",
|
|
3249
|
+
1088: "metis-mainnet",
|
|
3250
|
+
1101: "polygonzkevm-mainnet",
|
|
3251
|
+
1301: "unichain-sepolia",
|
|
3252
|
+
1328: "sei-testnet",
|
|
3253
|
+
1329: "sei-mainnet",
|
|
3254
|
+
1868: "soneium-mainnet",
|
|
3255
|
+
1946: "soneium-minato",
|
|
3256
|
+
2020: "ronin-mainnet",
|
|
3257
|
+
2021: "ronin-saigon",
|
|
3258
|
+
2442: "polygonzkevm-cardona",
|
|
3259
|
+
2522: "frax-sepolia",
|
|
3260
|
+
2741: "abstract-mainnet",
|
|
3261
|
+
4002: "fantom-testnet",
|
|
3262
|
+
4157: "crossfi-testnet",
|
|
3263
|
+
4158: "crossfi-mainnet",
|
|
3264
|
+
4801: "worldchain-sepolia",
|
|
3265
|
+
5e3: "mantle-mainnet",
|
|
3266
|
+
5003: "mantle-sepolia",
|
|
3267
|
+
5373: "settlus-septestnet",
|
|
3268
|
+
5611: "opbnb-testnet",
|
|
3269
|
+
7e3: "zetachain-mainnet",
|
|
3270
|
+
7001: "zetachain-testnet",
|
|
3271
|
+
8008: "polynomial-mainnet",
|
|
3272
|
+
8009: "polynomial-sepolia",
|
|
3273
|
+
8453: "base-mainnet",
|
|
3274
|
+
10143: "monad-testnet",
|
|
3275
|
+
10200: "gnosis-chiado",
|
|
3276
|
+
11011: "shape-sepolia",
|
|
3277
|
+
11124: "abstract-testnet",
|
|
3278
|
+
17e3: "eth-holesky",
|
|
3279
|
+
33111: "apechain-curtis",
|
|
3280
|
+
33139: "apechain-mainnet",
|
|
3281
|
+
37111: "lens-sepolia",
|
|
3282
|
+
42161: "arb-mainnet",
|
|
3283
|
+
42170: "arbnova-mainnet",
|
|
3284
|
+
43113: "avax-fuji",
|
|
3285
|
+
43114: "avax-mainnet",
|
|
3286
|
+
57054: "sonic-blaze",
|
|
3287
|
+
57073: "ink-mainnet",
|
|
3288
|
+
59141: "linea-sepolia",
|
|
3289
|
+
59144: "linea-mainnet",
|
|
3290
|
+
63157: "geist-mainnet",
|
|
3291
|
+
80002: "polygon-amoy",
|
|
3292
|
+
80094: "berachain-mainnet",
|
|
3293
|
+
81457: "blast-mainnet",
|
|
3294
|
+
84532: "base-sepolia",
|
|
3295
|
+
421614: "arb-sepolia",
|
|
3296
|
+
534351: "scroll-sepolia",
|
|
3297
|
+
534352: "scroll-mainnet",
|
|
3298
|
+
631571: "geist-polter",
|
|
3299
|
+
763373: "ink-sepolia",
|
|
3300
|
+
7777777: "zora-mainnet",
|
|
3301
|
+
11155111: "eth-sepolia",
|
|
3302
|
+
11155420: "opt-sepolia",
|
|
3303
|
+
168587773: "blast-sepolia",
|
|
3304
|
+
241320161: "xmtp-testnet",
|
|
3305
|
+
666666666: "degen-mainnet",
|
|
3306
|
+
994873017: "lumia-prism",
|
|
3307
|
+
999999999: "zora-sepolia",
|
|
3308
|
+
1952959480: "lumia-testnet"
|
|
3309
|
+
};
|
|
3310
|
+
|
|
3311
|
+
// src/ecosystem/generated/quicknodeNetworkMap.ts
|
|
3312
|
+
var quicknodeNetworkMap = {
|
|
3313
|
+
1: "mainnet",
|
|
3314
|
+
10: "optimism",
|
|
3315
|
+
14: "flare-mainnet",
|
|
3316
|
+
56: "bsc",
|
|
3317
|
+
81: "joc-mainnet",
|
|
3318
|
+
97: "bsc-testnet",
|
|
3319
|
+
100: "xdai",
|
|
3320
|
+
114: "flare-coston2",
|
|
3321
|
+
130: "unichain-mainnet",
|
|
3322
|
+
137: "matic",
|
|
3323
|
+
164: "omni-omega",
|
|
3324
|
+
166: "omni-mainnet",
|
|
3325
|
+
250: "fantom",
|
|
3326
|
+
252: "fraxtal-mainnet",
|
|
3327
|
+
295: "hedera-mainnet",
|
|
3328
|
+
296: "hedera-testnet",
|
|
3329
|
+
300: "zksync-sepolia",
|
|
3330
|
+
324: "zksync-mainnet",
|
|
3331
|
+
480: "worldchain-mainnet",
|
|
3332
|
+
545: "flow-testnet",
|
|
3333
|
+
690: "redstone-mainnet",
|
|
3334
|
+
747: "flow-mainnet",
|
|
3335
|
+
1001: "kaia-kairos",
|
|
3336
|
+
1101: "zkevm-mainnet",
|
|
3337
|
+
1135: "lisk-mainnet",
|
|
3338
|
+
1301: "unichain-sepolia",
|
|
3339
|
+
1315: "story-aeneid",
|
|
3340
|
+
1328: "sei-atlantic",
|
|
3341
|
+
1329: "sei-pacific",
|
|
3342
|
+
1480: "vana-mainnet",
|
|
3343
|
+
1513: "story-testnet",
|
|
3344
|
+
1516: "story-odyssey",
|
|
3345
|
+
1993: "b3-sepolia",
|
|
3346
|
+
2442: "zkevm-cardona",
|
|
3347
|
+
2741: "abstract-mainnet",
|
|
3348
|
+
2810: "morph-holesky",
|
|
3349
|
+
2818: "morph-mainnet",
|
|
3350
|
+
3338: "peaq-mainnet",
|
|
3351
|
+
4801: "worldchain-sepolia",
|
|
3352
|
+
5e3: "mantle-mainnet",
|
|
3353
|
+
5003: "mantle-sepolia",
|
|
3354
|
+
6805: "race-mainnet",
|
|
3355
|
+
6806: "race-sepolia",
|
|
3356
|
+
7560: "cyber-mainnet",
|
|
3357
|
+
8217: "kaia-mainnet",
|
|
3358
|
+
8333: "b3-mainnet",
|
|
3359
|
+
8453: "base-mainnet",
|
|
3360
|
+
11124: "abstract-testnet",
|
|
3361
|
+
13371: "imx-mainnet",
|
|
3362
|
+
13473: "imx-testnet",
|
|
3363
|
+
14800: "vana-moksha",
|
|
3364
|
+
16600: "0g-newton",
|
|
3365
|
+
17e3: "ethereum-holesky",
|
|
3366
|
+
34443: "mode-mainnet",
|
|
3367
|
+
42161: "arbitrum-mainnet",
|
|
3368
|
+
42170: "nova-mainnet",
|
|
3369
|
+
42220: "celo-mainnet",
|
|
3370
|
+
43113: "avalanche-testnet",
|
|
3371
|
+
43114: "avalanche-mainnet",
|
|
3372
|
+
59144: "linea-mainnet",
|
|
3373
|
+
80002: "matic-amoy",
|
|
3374
|
+
80084: "bera-bartio",
|
|
3375
|
+
80085: "bera-artio",
|
|
3376
|
+
80094: "bera-mainnet",
|
|
3377
|
+
81457: "blast-mainnet",
|
|
3378
|
+
84532: "base-sepolia",
|
|
3379
|
+
421613: "arbitrum-goerli",
|
|
3380
|
+
421614: "arbitrum-sepolia",
|
|
3381
|
+
534351: "scroll-testnet",
|
|
3382
|
+
534352: "scroll-mainnet",
|
|
3383
|
+
660279: "xai-mainnet",
|
|
3384
|
+
763373: "ink-sepolia",
|
|
3385
|
+
7777777: "zora-mainnet",
|
|
3386
|
+
11155111: "ethereum-sepolia",
|
|
3387
|
+
11155420: "optimism-sepolia",
|
|
3388
|
+
111557560: "cyber-sepolia",
|
|
3389
|
+
168587773: "blast-sepolia",
|
|
3390
|
+
37714555429: "xai-testnet"
|
|
3391
|
+
};
|
|
3392
|
+
|
|
3393
|
+
// src/ecosystem/rpcs.ts
|
|
3394
|
+
var publicRPCs = {
|
|
3395
|
+
[ChainId.mainnet]: "https://eth.llamarpc.com",
|
|
3396
|
+
[ChainId.polygon]: "https://polygon.llamarpc.com",
|
|
3397
|
+
[ChainId.arbitrum]: "https://polygon.llamarpc.com",
|
|
3398
|
+
[ChainId.base]: "https://base.llamarpc.com",
|
|
3399
|
+
[ChainId.bnb]: "https://binance.llamarpc.com",
|
|
3400
|
+
[ChainId.metis]: "https://andromeda.metis.io/?owner=1088",
|
|
3401
|
+
[ChainId.gnosis]: "https://rpc.ankr.com/gnosis",
|
|
3402
|
+
[ChainId.scroll]: "https://rpc.scroll.io",
|
|
3403
|
+
[ChainId.zksync]: "https://mainnet.era.zksync.io",
|
|
3404
|
+
[ChainId.fantom]: "https://rpc.ftm.tools",
|
|
3405
|
+
[ChainId.avalanche]: "https://api.avax.network/ext/bc/C/rpc",
|
|
3406
|
+
[ChainId.linea]: "https://rpc.linea.build"
|
|
3407
|
+
};
|
|
3408
|
+
var alchemySupportedChainIds = Object.values(ChainId).filter(
|
|
3409
|
+
(id) => alechmyNetworkMap[id]
|
|
3410
|
+
);
|
|
3411
|
+
var getNetworkEnv = (chainId) => {
|
|
3412
|
+
const symbol = Object.entries(ChainId).find(
|
|
3413
|
+
([, value]) => value === chainId
|
|
3414
|
+
)?.[0];
|
|
3415
|
+
if (!symbol) {
|
|
3416
|
+
throw new Error(
|
|
3417
|
+
`Didn't find a viem symbol for chainId: ${chainId}. Wire it up in 'src/chainIds.ts'!`
|
|
3418
|
+
);
|
|
3419
|
+
}
|
|
3420
|
+
const env = `RPC_${symbol.toUpperCase()}`;
|
|
3421
|
+
return env;
|
|
3422
|
+
};
|
|
3423
|
+
function getExplicitRPC(chainId) {
|
|
3424
|
+
const env = getNetworkEnv(chainId);
|
|
3425
|
+
if (process.env[env]) {
|
|
3426
|
+
return process.env[env];
|
|
3427
|
+
}
|
|
3428
|
+
throw new Error(`Env '${env}' is not set. Please set it manually.`);
|
|
3429
|
+
}
|
|
3430
|
+
function getAlchemyRPC(chainId, alchemyKey) {
|
|
3431
|
+
const alchemyId = alechmyNetworkMap[chainId];
|
|
3432
|
+
if (!alchemyId) {
|
|
3433
|
+
throw new Error(`ChainId '${chainId}' is not supported by Alchemy.`);
|
|
3434
|
+
}
|
|
3435
|
+
if (!alchemyKey) {
|
|
3436
|
+
throw new Error(
|
|
3437
|
+
`ChainId '${chainId}' is supported by Alchemy, but no 'alchemyKey' was provided.`
|
|
3438
|
+
);
|
|
3439
|
+
}
|
|
3440
|
+
return `https://${alchemyId}.g.alchemy.com/v2/${alchemyKey}`;
|
|
3441
|
+
}
|
|
3442
|
+
function getPublicRpc(chainId) {
|
|
3443
|
+
const publicRpc = publicRPCs[chainId];
|
|
3444
|
+
if (!publicRpc)
|
|
3445
|
+
throw new Error(`No default public rpc for '${chainId}' configured.`);
|
|
3446
|
+
return publicRpc;
|
|
3447
|
+
}
|
|
3448
|
+
function getQuickNodeRpc(chainId, options) {
|
|
3449
|
+
const quickNodeSlug = quicknodeNetworkMap[chainId];
|
|
3450
|
+
if (!quickNodeSlug) {
|
|
3451
|
+
throw new Error(`ChainId '${chainId}' is not supported by Quicknode.`);
|
|
3452
|
+
}
|
|
3453
|
+
if (!options.quicknodeEndpointName) {
|
|
3454
|
+
throw new Error(
|
|
3455
|
+
`ChainId '${chainId}' is supported by Quicknode, but no 'quicknodeEndpointName' was provided.`
|
|
3456
|
+
);
|
|
3457
|
+
}
|
|
3458
|
+
if (!options.quicknodeToken) {
|
|
3459
|
+
throw new Error(
|
|
3460
|
+
`ChainId '${chainId}' is supported by Quicknode, but no 'quicknodeToken' was provided.`
|
|
3461
|
+
);
|
|
3462
|
+
}
|
|
3463
|
+
if (chainId === ChainId.mainnet) {
|
|
3464
|
+
return `https://${options.quicknodeEndpointName}.quiknode.pro/${options.quicknodeToken}`;
|
|
3465
|
+
}
|
|
3466
|
+
return `https://${options.quicknodeEndpointName}.${quickNodeSlug}.quiknode.pro/${options.quicknodeToken}`;
|
|
3467
|
+
}
|
|
3468
|
+
var getRPCUrl = (chainId, options) => {
|
|
3469
|
+
if (!Object.values(ChainId).includes(chainId)) {
|
|
3470
|
+
throw new Error(
|
|
3471
|
+
`ChainId '${chainId}' is not supported by this library. Feel free to open an issue.`
|
|
3472
|
+
);
|
|
3473
|
+
}
|
|
3474
|
+
try {
|
|
3475
|
+
return getExplicitRPC(chainId);
|
|
3476
|
+
} catch (e) {
|
|
3477
|
+
}
|
|
3478
|
+
if (options?.alchemyKey) {
|
|
3479
|
+
try {
|
|
3480
|
+
return getAlchemyRPC(chainId, options?.alchemyKey);
|
|
3481
|
+
} catch (e) {
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
if (options?.quicknodeEndpointName && options.quicknodeToken) {
|
|
3485
|
+
try {
|
|
3486
|
+
return getQuickNodeRpc(chainId, {
|
|
3487
|
+
quicknodeToken: options.quicknodeToken,
|
|
3488
|
+
quicknodeEndpointName: options.quicknodeEndpointName
|
|
3489
|
+
});
|
|
3490
|
+
} catch (e) {
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
try {
|
|
3494
|
+
return getPublicRpc(chainId);
|
|
3495
|
+
} catch (e) {
|
|
3496
|
+
}
|
|
3497
|
+
};
|
|
3498
|
+
var clientCache = {};
|
|
3499
|
+
function getClient(chainId, {
|
|
3500
|
+
httpConfig,
|
|
3501
|
+
clientConfig,
|
|
3502
|
+
providerConfig,
|
|
3503
|
+
forceRebuildClient
|
|
3504
|
+
}) {
|
|
3505
|
+
if (!clientCache[chainId] || forceRebuildClient) {
|
|
3506
|
+
const rpcURL = getRPCUrl(chainId, providerConfig);
|
|
3507
|
+
clientCache[chainId] = (0, import_viem5.createClient)({
|
|
3508
|
+
chain: ChainList[chainId],
|
|
3509
|
+
transport: (0, import_viem5.http)(rpcURL, httpConfig),
|
|
3510
|
+
...clientConfig
|
|
3511
|
+
});
|
|
3512
|
+
}
|
|
3513
|
+
return clientCache[chainId];
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3154
3516
|
// src/ecosystem/constants.ts
|
|
3155
3517
|
var erc1967_ImplementationSlot = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
|
|
3156
3518
|
var erc1967_AdminSlot = "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103";
|
|
@@ -3204,11 +3566,11 @@ async function diffCode(before, after) {
|
|
|
3204
3566
|
}
|
|
3205
3567
|
|
|
3206
3568
|
// src/seatbelt/logs.ts
|
|
3207
|
-
var
|
|
3569
|
+
var import_viem6 = require("viem");
|
|
3208
3570
|
function parseLogs({ logs, eventDb }) {
|
|
3209
3571
|
const parsedLogs = logs.map((log) => {
|
|
3210
3572
|
try {
|
|
3211
|
-
const decoded = (0,
|
|
3573
|
+
const decoded = (0, import_viem6.decodeEventLog)({
|
|
3212
3574
|
data: log.data,
|
|
3213
3575
|
topics: log.topics,
|
|
3214
3576
|
abi: eventDb
|
|
@@ -3347,6 +3709,8 @@ async function renderTenderlyReport({
|
|
|
3347
3709
|
}
|
|
3348
3710
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3349
3711
|
0 && (module.exports = {
|
|
3712
|
+
ChainId,
|
|
3713
|
+
ChainList,
|
|
3350
3714
|
EVENT_DB,
|
|
3351
3715
|
HALF_RAY,
|
|
3352
3716
|
HALF_WAD,
|
|
@@ -3360,6 +3724,7 @@ async function renderTenderlyReport({
|
|
|
3360
3724
|
SelfdestuctCheckState,
|
|
3361
3725
|
WAD,
|
|
3362
3726
|
WAD_RAY_RATIO,
|
|
3727
|
+
alchemySupportedChainIds,
|
|
3363
3728
|
bitmapToIndexes,
|
|
3364
3729
|
calculateAvailableBorrowsMarketReferenceCurrency,
|
|
3365
3730
|
calculateCompoundedInterest,
|
|
@@ -3375,17 +3740,24 @@ async function renderTenderlyReport({
|
|
|
3375
3740
|
erc1967_ImplementationSlot,
|
|
3376
3741
|
foundry_getStandardJsonInput,
|
|
3377
3742
|
foundry_getStorageLayout,
|
|
3743
|
+
getAlchemyRPC,
|
|
3378
3744
|
getBits,
|
|
3745
|
+
getClient,
|
|
3379
3746
|
getCurrentDebtBalance,
|
|
3380
3747
|
getCurrentLiquidityBalance,
|
|
3748
|
+
getExplicitRPC,
|
|
3381
3749
|
getExplorer,
|
|
3382
3750
|
getGovernance,
|
|
3383
3751
|
getMarketReferenceCurrencyAndUsdBalance,
|
|
3752
|
+
getNetworkEnv,
|
|
3384
3753
|
getNonFinalizedPayloads,
|
|
3385
3754
|
getNonFinalizedProposals,
|
|
3386
3755
|
getNormalizedDebt,
|
|
3387
3756
|
getNormalizedIncome,
|
|
3388
3757
|
getPayloadsController,
|
|
3758
|
+
getPublicRpc,
|
|
3759
|
+
getQuickNodeRpc,
|
|
3760
|
+
getRPCUrl,
|
|
3389
3761
|
getSourceCode,
|
|
3390
3762
|
isPayloadFinal,
|
|
3391
3763
|
isProposalFinal,
|
|
@@ -3393,6 +3765,7 @@ async function renderTenderlyReport({
|
|
|
3393
3765
|
makeProposalExecutableOnTestClient,
|
|
3394
3766
|
parseEtherscanStyleSourceCode,
|
|
3395
3767
|
parseLogs,
|
|
3768
|
+
publicRPCs,
|
|
3396
3769
|
rayDiv,
|
|
3397
3770
|
rayMul,
|
|
3398
3771
|
rayToWad,
|