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