@bgd-labs/toolbox 0.0.20 → 0.0.21

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/node.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as StandardJsonInput } from './index-DPOHC58S.mjs';
2
- export { b3 as AggregatorInterface_ABI, a0 as Aip, aw as BundleParams, ag as ChainId, ah as ChainList, ac as ContractObject, af as EVENT_DB, a2 as ExplorerConfig, aL as GenericIndexerArgs, X as GovernanceContract, u as HALF_RAY, H as HALF_WAD, I as HUMAN_READABLE_PAYLOAD_STATE, V as HUMAN_READABLE_PROPOSAL_STATE, aX as IAToken_ABI, b0 as IAaveOracle_ABI, b4 as IAaveV3ConfigEngine_ABI, ba as IAuthorizedForwarder_ABI, b1 as ICollector_ABI, a$ as IDualAggregator_ABI, b7 as IERC20Metadata_ABI, b9 as IERC20_ABI, b5 as IEmissionManager_ABI, aZ as IPoolAddressesProvider_ABI, b8 as IPoolConfigurator_ABI, b2 as IPool_ABI, aV as IReserveInterestRateStrategy_ABI, b6 as IRewardsController_ABI, aW as IStataTokenFactory_ABI, a_ as IStataTokenV2_ABI, aY as IWrappedTokenGatewayV3_ABI, aK as IndexerTopicState, L as LTV_PRECISION, P as Payload, G as PayloadState, J as PayloadsControllerContract, T as Proposal, U as ProposalState, t as RAY, R as ReserveConfiguration, e as SECONDS_PER_YEAR, aO as SelfdestuctCheckState, aT as SoltypeElement, aU as StateDiff, ab as StateObject, ai as SupportedChainIds, ad as TenderlySimRequest, a6 as Tenderly_createVnetParamsResponse, W as WAD, v as WAD_RAY_RATIO, f as aaveAddressesProvider_IncentivesControllerSlot, aB as alchemyNetworkMap, ak as alchemySupportedChainIds, q as assetToBase, b as bitmapToIndexes, o as calculateAvailableBorrowsMarketReferenceCurrency, h as calculateCompoundedInterest, r as calculateHealthFactor, n as calculateHealthFactorFromBalances, i as calculateLinearInterest, aF as chainlinkFeeds, aP as checkForSelfdestruct, a as decodeReserveConfiguration, c as decodeReserveConfigurationV2, d as decodeUserConfiguration, aJ as diffCode, aI as erc1967_AdminSlot, aH as erc1967_ImplementationSlot, aD as etherscanExplorers, B as fetchImmutablePoolAddresses, C as fetchMutablePoolAddresses, D as fetchPoolAddresses, ay as flashbotsClientExtension, ax as flashbotsOnFetchRequest, aM as genericIndexer, an as getAlchemyRPC, g as getBits, as as getClient, av as getContractDeploymentBlock, m as getCurrentDebtBalance, l as getCurrentLiquidityBalance, am as getExplicitRPC, a3 as getExplorer, Y as getGovernance, ap as getHyperRPC, at as getImplementationSlot, au as getLogsRecursive, p as getMarketReferenceCurrencyAndUsdBalance, al as getNetworkEnv, Q as getNonFinalizedPayloads, $ as getNonFinalizedProposals, k as getNormalizedDebt, j as getNormalizedIncome, M as getPayloadStorageOverrides, K as getPayloadsController, ao as getPublicRpc, aq as getQuicknodeRpc, ar as getRPCUrl, F as getReserveConfigurations, E as getReserveTokens, a4 as getSourceCode, aS as getVerificationStatus, aG as hyperRPCSupportedNetworks, O as isPayloadFinal, _ as isProposalFinal, N as makePayloadExecutableOnTestClient, Z as makeProposalExecutableOnTestClient, az as onMevHandler, a5 as parseEtherscanStyleSourceCode, aN as parseLogs, aA as priceUpdateDecoder, aj as publicRPCs, aC as quicknodeNetworkMap, x as rayDiv, w as rayMul, y as rayToWad, aQ as renderTenderlyReport, aE as routescanExplorers, s as setBits, aa as tenderly_createVnet, a7 as tenderly_deleteVnet, a9 as tenderly_getVnet, ae as tenderly_sim, a8 as tenderly_simVnet, aR as toTxLink, a1 as validateAip, A as wadDiv, z as wadToRay } from './index-DPOHC58S.mjs';
1
+ import { S as StandardJsonInput } from './index-BygjJn_o.mjs';
2
+ export { bd as AggregatorInterface_ABI, a0 as Aip, aG as BundleParams, aq as ChainId, ar as ChainList, b1 as Change, af as ContractObject, ap as EVENT_DB, a2 as ExplorerConfig, aV as GenericIndexerArgs, X as GovernanceContract, u as HALF_RAY, H as HALF_WAD, I as HUMAN_READABLE_PAYLOAD_STATE, V as HUMAN_READABLE_PROPOSAL_STATE, b5 as IAToken_ABI, ba as IAaveOracle_ABI, be as IAaveV3ConfigEngine_ABI, bk as IAuthorizedForwarder_ABI, bb as ICollector_ABI, b9 as IDualAggregator_ABI, bh as IERC20Metadata_ABI, bj as IERC20_ABI, bf as IEmissionManager_ABI, b7 as IPoolAddressesProvider_ABI, bi as IPoolConfigurator_ABI, bc as IPool_ABI, b3 as IReserveInterestRateStrategy_ABI, bg as IRewardsController_ABI, b4 as IStataTokenFactory_ABI, b8 as IStataTokenV2_ABI, b6 as IWrappedTokenGatewayV3_ABI, aU as IndexerTopicState, ah as Input, L as LTV_PRECISION, P as Payload, G as PayloadState, J as PayloadsControllerContract, T as Proposal, U as ProposalState, t as RAY, R as ReserveConfiguration, e as SECONDS_PER_YEAR, aY as SelfdestuctCheckState, ac as SoltypeElement, ad as StateDiff, ae as StateObject, as as SupportedChainIds, ak as TenderlyLog, aj as TenderlyLogRaw, ag as TenderlySimRequest, ao as TenderlySimulationResponse, an as TenderlySimulationResponseObject, al as TenderlyStackTrace, a6 as Tenderly_createVnetParamsResponse, ai as Trace, am as TransactionInfo, W as WAD, v as WAD_RAY_RATIO, f as aaveAddressesProvider_IncentivesControllerSlot, aL as alchemyNetworkMap, au as alchemySupportedChainIds, q as assetToBase, b as bitmapToIndexes, o as calculateAvailableBorrowsMarketReferenceCurrency, h as calculateCompoundedInterest, r as calculateHealthFactor, n as calculateHealthFactorFromBalances, i as calculateLinearInterest, aP as chainlinkFeeds, aZ as checkForSelfdestruct, a as decodeReserveConfiguration, c as decodeReserveConfigurationV2, d as decodeUserConfiguration, aT as diffCode, aS as erc1967_AdminSlot, aR as erc1967_ImplementationSlot, aN as etherscanExplorers, B as fetchImmutablePoolAddresses, C as fetchMutablePoolAddresses, D as fetchPoolAddresses, aI as flashbotsClientExtension, aH as flashbotsOnFetchRequest, aW as genericIndexer, ax as getAlchemyRPC, g as getBits, aC as getClient, aF as getContractDeploymentBlock, m as getCurrentDebtBalance, l as getCurrentLiquidityBalance, aw as getExplicitRPC, a3 as getExplorer, Y as getGovernance, az as getHyperRPC, aD as getImplementationSlot, aE as getLogsRecursive, p as getMarketReferenceCurrencyAndUsdBalance, av as getNetworkEnv, Q as getNonFinalizedPayloads, $ as getNonFinalizedProposals, k as getNormalizedDebt, j as getNormalizedIncome, M as getPayloadStorageOverrides, K as getPayloadsController, ay as getPublicRpc, aA as getQuicknodeRpc, aB as getRPCUrl, F as getReserveConfigurations, E as getReserveTokens, a4 as getSourceCode, b0 as getVerificationStatus, aQ as hyperRPCSupportedNetworks, O as isPayloadFinal, _ as isProposalFinal, N as makePayloadExecutableOnTestClient, Z as makeProposalExecutableOnTestClient, aJ as onMevHandler, a5 as parseEtherscanStyleSourceCode, aX as parseLogs, aK as priceUpdateDecoder, at as publicRPCs, aM as quicknodeNetworkMap, x as rayDiv, w as rayMul, y as rayToWad, a_ as renderTenderlyReport, aO as routescanExplorers, s as setBits, aa as tenderly_createVnet, a7 as tenderly_deleteVnet, a9 as tenderly_getVnet, ab as tenderly_sim, a8 as tenderly_simVnet, a$ as toTxLink, b2 as transformTenderlyStateDiff, a1 as validateAip, A as wadDiv, z as wadToRay } from './index-BygjJn_o.mjs';
3
3
  import 'viem';
4
4
  import '@bgd-labs/aave-address-book/abis';
5
5
  import 'arktype/internal/methods/object.ts';
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as StandardJsonInput } from './index-DPOHC58S.js';
2
- export { b3 as AggregatorInterface_ABI, a0 as Aip, aw as BundleParams, ag as ChainId, ah as ChainList, ac as ContractObject, af as EVENT_DB, a2 as ExplorerConfig, aL as GenericIndexerArgs, X as GovernanceContract, u as HALF_RAY, H as HALF_WAD, I as HUMAN_READABLE_PAYLOAD_STATE, V as HUMAN_READABLE_PROPOSAL_STATE, aX as IAToken_ABI, b0 as IAaveOracle_ABI, b4 as IAaveV3ConfigEngine_ABI, ba as IAuthorizedForwarder_ABI, b1 as ICollector_ABI, a$ as IDualAggregator_ABI, b7 as IERC20Metadata_ABI, b9 as IERC20_ABI, b5 as IEmissionManager_ABI, aZ as IPoolAddressesProvider_ABI, b8 as IPoolConfigurator_ABI, b2 as IPool_ABI, aV as IReserveInterestRateStrategy_ABI, b6 as IRewardsController_ABI, aW as IStataTokenFactory_ABI, a_ as IStataTokenV2_ABI, aY as IWrappedTokenGatewayV3_ABI, aK as IndexerTopicState, L as LTV_PRECISION, P as Payload, G as PayloadState, J as PayloadsControllerContract, T as Proposal, U as ProposalState, t as RAY, R as ReserveConfiguration, e as SECONDS_PER_YEAR, aO as SelfdestuctCheckState, aT as SoltypeElement, aU as StateDiff, ab as StateObject, ai as SupportedChainIds, ad as TenderlySimRequest, a6 as Tenderly_createVnetParamsResponse, W as WAD, v as WAD_RAY_RATIO, f as aaveAddressesProvider_IncentivesControllerSlot, aB as alchemyNetworkMap, ak as alchemySupportedChainIds, q as assetToBase, b as bitmapToIndexes, o as calculateAvailableBorrowsMarketReferenceCurrency, h as calculateCompoundedInterest, r as calculateHealthFactor, n as calculateHealthFactorFromBalances, i as calculateLinearInterest, aF as chainlinkFeeds, aP as checkForSelfdestruct, a as decodeReserveConfiguration, c as decodeReserveConfigurationV2, d as decodeUserConfiguration, aJ as diffCode, aI as erc1967_AdminSlot, aH as erc1967_ImplementationSlot, aD as etherscanExplorers, B as fetchImmutablePoolAddresses, C as fetchMutablePoolAddresses, D as fetchPoolAddresses, ay as flashbotsClientExtension, ax as flashbotsOnFetchRequest, aM as genericIndexer, an as getAlchemyRPC, g as getBits, as as getClient, av as getContractDeploymentBlock, m as getCurrentDebtBalance, l as getCurrentLiquidityBalance, am as getExplicitRPC, a3 as getExplorer, Y as getGovernance, ap as getHyperRPC, at as getImplementationSlot, au as getLogsRecursive, p as getMarketReferenceCurrencyAndUsdBalance, al as getNetworkEnv, Q as getNonFinalizedPayloads, $ as getNonFinalizedProposals, k as getNormalizedDebt, j as getNormalizedIncome, M as getPayloadStorageOverrides, K as getPayloadsController, ao as getPublicRpc, aq as getQuicknodeRpc, ar as getRPCUrl, F as getReserveConfigurations, E as getReserveTokens, a4 as getSourceCode, aS as getVerificationStatus, aG as hyperRPCSupportedNetworks, O as isPayloadFinal, _ as isProposalFinal, N as makePayloadExecutableOnTestClient, Z as makeProposalExecutableOnTestClient, az as onMevHandler, a5 as parseEtherscanStyleSourceCode, aN as parseLogs, aA as priceUpdateDecoder, aj as publicRPCs, aC as quicknodeNetworkMap, x as rayDiv, w as rayMul, y as rayToWad, aQ as renderTenderlyReport, aE as routescanExplorers, s as setBits, aa as tenderly_createVnet, a7 as tenderly_deleteVnet, a9 as tenderly_getVnet, ae as tenderly_sim, a8 as tenderly_simVnet, aR as toTxLink, a1 as validateAip, A as wadDiv, z as wadToRay } from './index-DPOHC58S.js';
1
+ import { S as StandardJsonInput } from './index-BygjJn_o.js';
2
+ export { bd as AggregatorInterface_ABI, a0 as Aip, aG as BundleParams, aq as ChainId, ar as ChainList, b1 as Change, af as ContractObject, ap as EVENT_DB, a2 as ExplorerConfig, aV as GenericIndexerArgs, X as GovernanceContract, u as HALF_RAY, H as HALF_WAD, I as HUMAN_READABLE_PAYLOAD_STATE, V as HUMAN_READABLE_PROPOSAL_STATE, b5 as IAToken_ABI, ba as IAaveOracle_ABI, be as IAaveV3ConfigEngine_ABI, bk as IAuthorizedForwarder_ABI, bb as ICollector_ABI, b9 as IDualAggregator_ABI, bh as IERC20Metadata_ABI, bj as IERC20_ABI, bf as IEmissionManager_ABI, b7 as IPoolAddressesProvider_ABI, bi as IPoolConfigurator_ABI, bc as IPool_ABI, b3 as IReserveInterestRateStrategy_ABI, bg as IRewardsController_ABI, b4 as IStataTokenFactory_ABI, b8 as IStataTokenV2_ABI, b6 as IWrappedTokenGatewayV3_ABI, aU as IndexerTopicState, ah as Input, L as LTV_PRECISION, P as Payload, G as PayloadState, J as PayloadsControllerContract, T as Proposal, U as ProposalState, t as RAY, R as ReserveConfiguration, e as SECONDS_PER_YEAR, aY as SelfdestuctCheckState, ac as SoltypeElement, ad as StateDiff, ae as StateObject, as as SupportedChainIds, ak as TenderlyLog, aj as TenderlyLogRaw, ag as TenderlySimRequest, ao as TenderlySimulationResponse, an as TenderlySimulationResponseObject, al as TenderlyStackTrace, a6 as Tenderly_createVnetParamsResponse, ai as Trace, am as TransactionInfo, W as WAD, v as WAD_RAY_RATIO, f as aaveAddressesProvider_IncentivesControllerSlot, aL as alchemyNetworkMap, au as alchemySupportedChainIds, q as assetToBase, b as bitmapToIndexes, o as calculateAvailableBorrowsMarketReferenceCurrency, h as calculateCompoundedInterest, r as calculateHealthFactor, n as calculateHealthFactorFromBalances, i as calculateLinearInterest, aP as chainlinkFeeds, aZ as checkForSelfdestruct, a as decodeReserveConfiguration, c as decodeReserveConfigurationV2, d as decodeUserConfiguration, aT as diffCode, aS as erc1967_AdminSlot, aR as erc1967_ImplementationSlot, aN as etherscanExplorers, B as fetchImmutablePoolAddresses, C as fetchMutablePoolAddresses, D as fetchPoolAddresses, aI as flashbotsClientExtension, aH as flashbotsOnFetchRequest, aW as genericIndexer, ax as getAlchemyRPC, g as getBits, aC as getClient, aF as getContractDeploymentBlock, m as getCurrentDebtBalance, l as getCurrentLiquidityBalance, aw as getExplicitRPC, a3 as getExplorer, Y as getGovernance, az as getHyperRPC, aD as getImplementationSlot, aE as getLogsRecursive, p as getMarketReferenceCurrencyAndUsdBalance, av as getNetworkEnv, Q as getNonFinalizedPayloads, $ as getNonFinalizedProposals, k as getNormalizedDebt, j as getNormalizedIncome, M as getPayloadStorageOverrides, K as getPayloadsController, ay as getPublicRpc, aA as getQuicknodeRpc, aB as getRPCUrl, F as getReserveConfigurations, E as getReserveTokens, a4 as getSourceCode, b0 as getVerificationStatus, aQ as hyperRPCSupportedNetworks, O as isPayloadFinal, _ as isProposalFinal, N as makePayloadExecutableOnTestClient, Z as makeProposalExecutableOnTestClient, aJ as onMevHandler, a5 as parseEtherscanStyleSourceCode, aX as parseLogs, aK as priceUpdateDecoder, at as publicRPCs, aM as quicknodeNetworkMap, x as rayDiv, w as rayMul, y as rayToWad, a_ as renderTenderlyReport, aO as routescanExplorers, s as setBits, aa as tenderly_createVnet, a7 as tenderly_deleteVnet, a9 as tenderly_getVnet, ab as tenderly_sim, a8 as tenderly_simVnet, a$ as toTxLink, b2 as transformTenderlyStateDiff, a1 as validateAip, A as wadDiv, z as wadToRay } from './index-BygjJn_o.js';
3
3
  import 'viem';
4
4
  import '@bgd-labs/aave-address-book/abis';
5
5
  import 'arktype/internal/methods/object.ts';
package/dist/node.js CHANGED
@@ -143,6 +143,7 @@ __export(node_exports, {
143
143
  tenderly_sim: () => tenderly_sim,
144
144
  tenderly_simVnet: () => tenderly_simVnet,
145
145
  toTxLink: () => toTxLink,
146
+ transformTenderlyStateDiff: () => transformTenderlyStateDiff,
146
147
  validateAip: () => validateAip,
147
148
  wadDiv: () => wadDiv,
148
149
  wadToRay: () => wadToRay
@@ -26562,6 +26563,76 @@ function toTxLink(txn, client) {
26562
26563
  return `${client.chain?.blockExplorers?.default.url}/tx/${txn}`;
26563
26564
  }
26564
26565
 
26566
+ // src/seatbelt/state.ts
26567
+ var import_viem10 = require("viem");
26568
+ function transformTenderlyStateDiff(stateDiff) {
26569
+ const formattedDiffs = stateDiff.reduce(
26570
+ (diffs, diff) => {
26571
+ if (!diff.raw?.[0]) return diffs;
26572
+ const addr = (0, import_viem10.getAddress)(diff.raw[0].address);
26573
+ if (!diffs[addr]) diffs[addr] = [diff];
26574
+ else diffs[addr].push(diff);
26575
+ return diffs;
26576
+ },
26577
+ {}
26578
+ );
26579
+ const allChanges = {};
26580
+ for (const [address, diffs] of Object.entries(formattedDiffs)) {
26581
+ const changes = [];
26582
+ for (const diff of diffs) {
26583
+ if (!diff.soltype) {
26584
+ for (const w of diff.raw) {
26585
+ const oldVal = JSON.stringify(w.original);
26586
+ const newVal = JSON.stringify(w.dirty);
26587
+ changes.push({
26588
+ before: oldVal,
26589
+ after: newVal,
26590
+ name: `Slot \`${w.key}\``
26591
+ });
26592
+ }
26593
+ } else if (diff.soltype.simple_type) {
26594
+ changes.push({
26595
+ before: diff.original,
26596
+ after: diff.dirty,
26597
+ name: diff.soltype.name,
26598
+ type: diff.soltype?.name
26599
+ });
26600
+ } else if (diff.soltype.type.startsWith("mapping")) {
26601
+ const keys = Array.from(
26602
+ /* @__PURE__ */ new Set([
26603
+ ...Object.keys(diff.original || {}),
26604
+ ...Object.keys(diff.dirty || {})
26605
+ ])
26606
+ );
26607
+ const original = diff.original || {};
26608
+ const dirty = diff.dirty || {};
26609
+ for (const k of keys) {
26610
+ if (original[k] || dirty[k])
26611
+ changes.push({
26612
+ before: original[k],
26613
+ after: dirty[k],
26614
+ name: k,
26615
+ type: diff.soltype?.name
26616
+ });
26617
+ }
26618
+ } else {
26619
+ for (const w of diff.raw) {
26620
+ const oldVal = JSON.stringify(w.original);
26621
+ const newVal = JSON.stringify(w.dirty);
26622
+ changes.push({
26623
+ before: oldVal,
26624
+ after: newVal,
26625
+ name: w.key,
26626
+ type: "slot"
26627
+ });
26628
+ }
26629
+ }
26630
+ }
26631
+ allChanges[address] = changes;
26632
+ }
26633
+ return allChanges;
26634
+ }
26635
+
26565
26636
  // src/ecosystem/foundry.ts
26566
26637
  var import_node_child_process = require("child_process");
26567
26638
  var import_diff2 = require("diff");
@@ -26733,6 +26804,7 @@ function diffFoundryStorageLayout(layoutBefore, layoutAfter) {
26733
26804
  tenderly_sim,
26734
26805
  tenderly_simVnet,
26735
26806
  toTxLink,
26807
+ transformTenderlyStateDiff,
26736
26808
  validateAip,
26737
26809
  wadDiv,
26738
26810
  wadToRay