@bgd-labs/toolbox 0.0.23 → 0.0.25
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 +22699 -6
- package/dist/index.d.ts +22699 -6
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js +40 -1
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +40 -2
- package/dist/node.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/index-DEnxlBVO.d.mts +0 -22673
- package/dist/index-DEnxlBVO.d.ts +0 -22673
package/dist/node.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { StandardJsonInput } from './index.mjs';
|
|
2
|
+
export { AggregatorInterface_ABI, Aip, BlockscoutStyleSourceCode, BundleParams, ChainId, ChainList, Change, ContractObject, EVENT_DB, EtherscanStyleSourceCode, ExplorerConfig, GenericIndexerArgs, GovernanceContract, HALF_RAY, HALF_WAD, HUMAN_READABLE_PAYLOAD_STATE, HUMAN_READABLE_PROPOSAL_STATE, IAToken_ABI, IAaveOracle_ABI, IAaveV3ConfigEngine_ABI, IAuthorizedForwarder_ABI, ICollector_ABI, IDualAggregator_ABI, IERC20Metadata_ABI, IERC20_ABI, IEmissionManager_ABI, IPoolAddressesProvider_ABI, IPoolConfigurator_ABI, IPool_ABI, IReserveInterestRateStrategy_ABI, IRewardsController_ABI, IStataTokenFactory_ABI, IStataTokenV2_ABI, IWrappedTokenGatewayV3_ABI, IndexerTopicState, Input, LTV_PRECISION, Payload, PayloadState, PayloadsControllerContract, Proposal, ProposalState, RAY, ReserveConfiguration, SECONDS_PER_YEAR, SelfdestuctCheckState, SoltypeElement, StateDiff, StateObject, SupportedChainIds, TenderlyLog, TenderlyLogRaw, TenderlySimRequest, TenderlySimulationResponse, TenderlySimulationResponseObject, TenderlyStackTrace, Tenderly_createVnetParamsResponse, Trace, TransactionInfo, WAD, WAD_RAY_RATIO, aaveAddressesProvider_IncentivesControllerSlot, alchemyNetworkMap, alchemySupportedChainIds, assetToBase, bitmapToIndexes, blockscoutExplorers, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateHealthFactor, calculateHealthFactorFromBalances, calculateLinearInterest, chainlinkFeeds, checkForSelfdestruct, decodeReserveConfiguration, decodeReserveConfigurationV2, decodeUserConfiguration, diffCode, erc1967_AdminSlot, erc1967_ImplementationSlot, etherscanExplorers, fetchImmutablePoolAddresses, fetchMutablePoolAddresses, fetchPoolAddresses, flashbotsClientExtension, flashbotsOnFetchRequest, genericIndexer, getAlchemyRPC, getBits, getClient, getContractDeploymentBlock, getCurrentDebtBalance, getCurrentLiquidityBalance, getExplicitRPC, getExplorer, getGovernance, getHyperRPC, getImplementationSlot, getLogsRecursive, getMarketReferenceCurrencyAndUsdBalance, getNetworkEnv, getNonFinalizedPayloads, getNonFinalizedProposals, getNormalizedDebt, getNormalizedIncome, getPayloadStorageOverrides, getPayloadsController, getPublicRpc, getQuicknodeRpc, getRPCUrl, getReserveConfigurations, getReserveTokens, getSourceCode, getVerificationStatus, hyperRPCSupportedNetworks, isPayloadFinal, isProposalFinal, makePayloadExecutableOnTestClient, makeProposalExecutableOnTestClient, onMevHandler, parseBlockscoutStyleSourceCode, parseEtherscanStyleSourceCode, parseLogs, priceUpdateDecoder, publicRPCs, quicknodeNetworkMap, rayDiv, rayMul, rayToWad, renderTenderlyReport, routescanExplorers, setBits, tenderly_createVnet, tenderly_deleteVnet, tenderly_getVnet, tenderly_sim, tenderly_simVnet, toTxLink, transformTenderlyStateDiff, validateAip, wadDiv, wadToRay } from './index.mjs';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import '@bgd-labs/aave-address-book/abis';
|
|
5
5
|
import 'arktype/internal/methods/object.ts';
|
|
@@ -43,4 +43,4 @@ declare function foundry_getStorageLayout(input: string): FoundryStorage;
|
|
|
43
43
|
declare function foundry_format(input: string): string;
|
|
44
44
|
declare function diffFoundryStorageLayout(layoutBefore: FoundryStorage, layoutAfter: FoundryStorage): string;
|
|
45
45
|
|
|
46
|
-
export { type FoundryStorage, type Storage, type StorageType, diffFoundryStorageLayout, foundry_format, foundry_getStandardJsonInput, foundry_getStorageLayout };
|
|
46
|
+
export { type FoundryStorage, StandardJsonInput, type Storage, type StorageType, diffFoundryStorageLayout, foundry_format, foundry_getStandardJsonInput, foundry_getStorageLayout };
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { StandardJsonInput } from './index.js';
|
|
2
|
+
export { AggregatorInterface_ABI, Aip, BlockscoutStyleSourceCode, BundleParams, ChainId, ChainList, Change, ContractObject, EVENT_DB, EtherscanStyleSourceCode, ExplorerConfig, GenericIndexerArgs, GovernanceContract, HALF_RAY, HALF_WAD, HUMAN_READABLE_PAYLOAD_STATE, HUMAN_READABLE_PROPOSAL_STATE, IAToken_ABI, IAaveOracle_ABI, IAaveV3ConfigEngine_ABI, IAuthorizedForwarder_ABI, ICollector_ABI, IDualAggregator_ABI, IERC20Metadata_ABI, IERC20_ABI, IEmissionManager_ABI, IPoolAddressesProvider_ABI, IPoolConfigurator_ABI, IPool_ABI, IReserveInterestRateStrategy_ABI, IRewardsController_ABI, IStataTokenFactory_ABI, IStataTokenV2_ABI, IWrappedTokenGatewayV3_ABI, IndexerTopicState, Input, LTV_PRECISION, Payload, PayloadState, PayloadsControllerContract, Proposal, ProposalState, RAY, ReserveConfiguration, SECONDS_PER_YEAR, SelfdestuctCheckState, SoltypeElement, StateDiff, StateObject, SupportedChainIds, TenderlyLog, TenderlyLogRaw, TenderlySimRequest, TenderlySimulationResponse, TenderlySimulationResponseObject, TenderlyStackTrace, Tenderly_createVnetParamsResponse, Trace, TransactionInfo, WAD, WAD_RAY_RATIO, aaveAddressesProvider_IncentivesControllerSlot, alchemyNetworkMap, alchemySupportedChainIds, assetToBase, bitmapToIndexes, blockscoutExplorers, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateHealthFactor, calculateHealthFactorFromBalances, calculateLinearInterest, chainlinkFeeds, checkForSelfdestruct, decodeReserveConfiguration, decodeReserveConfigurationV2, decodeUserConfiguration, diffCode, erc1967_AdminSlot, erc1967_ImplementationSlot, etherscanExplorers, fetchImmutablePoolAddresses, fetchMutablePoolAddresses, fetchPoolAddresses, flashbotsClientExtension, flashbotsOnFetchRequest, genericIndexer, getAlchemyRPC, getBits, getClient, getContractDeploymentBlock, getCurrentDebtBalance, getCurrentLiquidityBalance, getExplicitRPC, getExplorer, getGovernance, getHyperRPC, getImplementationSlot, getLogsRecursive, getMarketReferenceCurrencyAndUsdBalance, getNetworkEnv, getNonFinalizedPayloads, getNonFinalizedProposals, getNormalizedDebt, getNormalizedIncome, getPayloadStorageOverrides, getPayloadsController, getPublicRpc, getQuicknodeRpc, getRPCUrl, getReserveConfigurations, getReserveTokens, getSourceCode, getVerificationStatus, hyperRPCSupportedNetworks, isPayloadFinal, isProposalFinal, makePayloadExecutableOnTestClient, makeProposalExecutableOnTestClient, onMevHandler, parseBlockscoutStyleSourceCode, parseEtherscanStyleSourceCode, parseLogs, priceUpdateDecoder, publicRPCs, quicknodeNetworkMap, rayDiv, rayMul, rayToWad, renderTenderlyReport, routescanExplorers, setBits, tenderly_createVnet, tenderly_deleteVnet, tenderly_getVnet, tenderly_sim, tenderly_simVnet, toTxLink, transformTenderlyStateDiff, validateAip, wadDiv, wadToRay } from './index.js';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import '@bgd-labs/aave-address-book/abis';
|
|
5
5
|
import 'arktype/internal/methods/object.ts';
|
|
@@ -43,4 +43,4 @@ declare function foundry_getStorageLayout(input: string): FoundryStorage;
|
|
|
43
43
|
declare function foundry_format(input: string): string;
|
|
44
44
|
declare function diffFoundryStorageLayout(layoutBefore: FoundryStorage, layoutAfter: FoundryStorage): string;
|
|
45
45
|
|
|
46
|
-
export { type FoundryStorage, type Storage, type StorageType, diffFoundryStorageLayout, foundry_format, foundry_getStandardJsonInput, foundry_getStorageLayout };
|
|
46
|
+
export { type FoundryStorage, StandardJsonInput, type Storage, type StorageType, diffFoundryStorageLayout, foundry_format, foundry_getStandardJsonInput, foundry_getStorageLayout };
|
package/dist/node.js
CHANGED
|
@@ -127,6 +127,7 @@ __export(node_exports, {
|
|
|
127
127
|
makePayloadExecutableOnTestClient: () => makePayloadExecutableOnTestClient,
|
|
128
128
|
makeProposalExecutableOnTestClient: () => makeProposalExecutableOnTestClient,
|
|
129
129
|
onMevHandler: () => onMevHandler,
|
|
130
|
+
parseBlockscoutStyleSourceCode: () => parseBlockscoutStyleSourceCode,
|
|
130
131
|
parseEtherscanStyleSourceCode: () => parseEtherscanStyleSourceCode,
|
|
131
132
|
parseLogs: () => parseLogs,
|
|
132
133
|
priceUpdateDecoder: () => priceUpdateDecoder,
|
|
@@ -13940,6 +13941,7 @@ async function getSourceCode(params) {
|
|
|
13940
13941
|
if (params.apiKey) payload.apikey = params.apiKey;
|
|
13941
13942
|
const formattedPayload = new URLSearchParams(payload).toString();
|
|
13942
13943
|
const url = `${params.apiUrl ? params.apiUrl : getExplorer(params.chainId).api}?${formattedPayload}`;
|
|
13944
|
+
console.log(url);
|
|
13943
13945
|
const request = await fetch(url);
|
|
13944
13946
|
const { status, message, result } = await request.json();
|
|
13945
13947
|
if (status != "1") {
|
|
@@ -13953,6 +13955,24 @@ function parseEtherscanStyleSourceCode(sourceCode) {
|
|
|
13953
13955
|
}
|
|
13954
13956
|
return JSON.parse(sourceCode);
|
|
13955
13957
|
}
|
|
13958
|
+
function parseBlockscoutStyleSourceCode(sourceCode) {
|
|
13959
|
+
const result = {
|
|
13960
|
+
language: "unknown",
|
|
13961
|
+
settings: sourceCode.CompilerSettings,
|
|
13962
|
+
libraries: sourceCode.CompilerSettings.libraries,
|
|
13963
|
+
sources: {
|
|
13964
|
+
[sourceCode.FileName]: { content: sourceCode.SourceCode },
|
|
13965
|
+
...sourceCode.AdditionalSources.reduce(
|
|
13966
|
+
(acc, code) => {
|
|
13967
|
+
acc[code.Filename] = { content: code.SourceCode };
|
|
13968
|
+
return acc;
|
|
13969
|
+
},
|
|
13970
|
+
{}
|
|
13971
|
+
)
|
|
13972
|
+
}
|
|
13973
|
+
};
|
|
13974
|
+
return result;
|
|
13975
|
+
}
|
|
13956
13976
|
|
|
13957
13977
|
// src/ecosystem/tenderly.ts
|
|
13958
13978
|
var import_viem5 = require("viem");
|
|
@@ -28560,7 +28580,25 @@ async function diffCode(before, after) {
|
|
|
28560
28580
|
])
|
|
28561
28581
|
);
|
|
28562
28582
|
for (const [name, path, source] of contractsBefore) {
|
|
28563
|
-
const
|
|
28583
|
+
const matchingIndexes = contractsAfter.reduce((acc, val, i) => {
|
|
28584
|
+
if (val[0] === name) acc.push(i);
|
|
28585
|
+
return acc;
|
|
28586
|
+
}, []);
|
|
28587
|
+
let indexAfter = -1;
|
|
28588
|
+
if (matchingIndexes.length === 1) {
|
|
28589
|
+
indexAfter = matchingIndexes[0];
|
|
28590
|
+
} else if (matchingIndexes.length > 1) {
|
|
28591
|
+
let maxSimilarity = -1;
|
|
28592
|
+
for (const idx of matchingIndexes) {
|
|
28593
|
+
const afterSource = contractsAfter[idx][2];
|
|
28594
|
+
const diff = (0, import_diff.diffChars)(source, afterSource);
|
|
28595
|
+
const similarity = diff.reduce((acc, part) => acc + (part.added || part.removed ? 0 : part.count || part.value.length), 0);
|
|
28596
|
+
if (similarity > maxSimilarity) {
|
|
28597
|
+
maxSimilarity = similarity;
|
|
28598
|
+
indexAfter = idx;
|
|
28599
|
+
}
|
|
28600
|
+
}
|
|
28601
|
+
}
|
|
28564
28602
|
if (indexAfter === -1) {
|
|
28565
28603
|
changes[name] = (0, import_diff.createPatch)(path, source, "");
|
|
28566
28604
|
} else {
|
|
@@ -29079,6 +29117,7 @@ function diffFoundryStorageLayout(layoutBefore, layoutAfter) {
|
|
|
29079
29117
|
makePayloadExecutableOnTestClient,
|
|
29080
29118
|
makeProposalExecutableOnTestClient,
|
|
29081
29119
|
onMevHandler,
|
|
29120
|
+
parseBlockscoutStyleSourceCode,
|
|
29082
29121
|
parseEtherscanStyleSourceCode,
|
|
29083
29122
|
parseLogs,
|
|
29084
29123
|
priceUpdateDecoder,
|