@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/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- 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
+ 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';
2
2
  import 'viem';
3
3
  import '@bgd-labs/aave-address-book/abis';
4
4
  import 'arktype/internal/methods/object.ts';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- 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
+ 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';
2
2
  import 'viem';
3
3
  import '@bgd-labs/aave-address-book/abis';
4
4
  import 'arktype/internal/methods/object.ts';
package/dist/index.js CHANGED
@@ -139,6 +139,7 @@ __export(index_exports, {
139
139
  tenderly_sim: () => tenderly_sim,
140
140
  tenderly_simVnet: () => tenderly_simVnet,
141
141
  toTxLink: () => toTxLink,
142
+ transformTenderlyStateDiff: () => transformTenderlyStateDiff,
142
143
  validateAip: () => validateAip,
143
144
  wadDiv: () => wadDiv,
144
145
  wadToRay: () => wadToRay
@@ -26557,6 +26558,76 @@ function renderUnixTime(time) {
26557
26558
  function toTxLink(txn, client) {
26558
26559
  return `${client.chain?.blockExplorers?.default.url}/tx/${txn}`;
26559
26560
  }
26561
+
26562
+ // src/seatbelt/state.ts
26563
+ var import_viem10 = require("viem");
26564
+ function transformTenderlyStateDiff(stateDiff) {
26565
+ const formattedDiffs = stateDiff.reduce(
26566
+ (diffs, diff) => {
26567
+ if (!diff.raw?.[0]) return diffs;
26568
+ const addr = (0, import_viem10.getAddress)(diff.raw[0].address);
26569
+ if (!diffs[addr]) diffs[addr] = [diff];
26570
+ else diffs[addr].push(diff);
26571
+ return diffs;
26572
+ },
26573
+ {}
26574
+ );
26575
+ const allChanges = {};
26576
+ for (const [address, diffs] of Object.entries(formattedDiffs)) {
26577
+ const changes = [];
26578
+ for (const diff of diffs) {
26579
+ if (!diff.soltype) {
26580
+ for (const w of diff.raw) {
26581
+ const oldVal = JSON.stringify(w.original);
26582
+ const newVal = JSON.stringify(w.dirty);
26583
+ changes.push({
26584
+ before: oldVal,
26585
+ after: newVal,
26586
+ name: `Slot \`${w.key}\``
26587
+ });
26588
+ }
26589
+ } else if (diff.soltype.simple_type) {
26590
+ changes.push({
26591
+ before: diff.original,
26592
+ after: diff.dirty,
26593
+ name: diff.soltype.name,
26594
+ type: diff.soltype?.name
26595
+ });
26596
+ } else if (diff.soltype.type.startsWith("mapping")) {
26597
+ const keys = Array.from(
26598
+ /* @__PURE__ */ new Set([
26599
+ ...Object.keys(diff.original || {}),
26600
+ ...Object.keys(diff.dirty || {})
26601
+ ])
26602
+ );
26603
+ const original = diff.original || {};
26604
+ const dirty = diff.dirty || {};
26605
+ for (const k of keys) {
26606
+ if (original[k] || dirty[k])
26607
+ changes.push({
26608
+ before: original[k],
26609
+ after: dirty[k],
26610
+ name: k,
26611
+ type: diff.soltype?.name
26612
+ });
26613
+ }
26614
+ } else {
26615
+ for (const w of diff.raw) {
26616
+ const oldVal = JSON.stringify(w.original);
26617
+ const newVal = JSON.stringify(w.dirty);
26618
+ changes.push({
26619
+ before: oldVal,
26620
+ after: newVal,
26621
+ name: w.key,
26622
+ type: "slot"
26623
+ });
26624
+ }
26625
+ }
26626
+ }
26627
+ allChanges[address] = changes;
26628
+ }
26629
+ return allChanges;
26630
+ }
26560
26631
  // Annotate the CommonJS export names for ESM import in node:
26561
26632
  0 && (module.exports = {
26562
26633
  AggregatorInterface_ABI,
@@ -26668,6 +26739,7 @@ function toTxLink(txn, client) {
26668
26739
  tenderly_sim,
26669
26740
  tenderly_simVnet,
26670
26741
  toTxLink,
26742
+ transformTenderlyStateDiff,
26671
26743
  validateAip,
26672
26744
  wadDiv,
26673
26745
  wadToRay