@bgd-labs/toolbox 0.0.28 → 0.0.29
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 +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +39 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -13
- package/dist/index.mjs.map +1 -1
- package/dist/node.js +39 -13
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +39 -13
- package/dist/node.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14030,7 +14030,7 @@ declare function parseLogs({ logs, eventDb }: ParseLogsArgs): LogType[];
|
|
|
14030
14030
|
* @param logs
|
|
14031
14031
|
* @returns
|
|
14032
14032
|
*/
|
|
14033
|
-
declare function enhanceLogs(client: Client, logs: LogType[]): Promise<
|
|
14033
|
+
declare function enhanceLogs(client: Client, logs: LogType[]): Promise<LogType[]>;
|
|
14034
14034
|
|
|
14035
14035
|
declare enum SelfdestructCheckState {
|
|
14036
14036
|
TRUSTED = 0,
|
|
@@ -14117,6 +14117,7 @@ type StreamChangedType = {
|
|
|
14117
14117
|
tokenAddress?: Address;
|
|
14118
14118
|
ratePerSecond?: string;
|
|
14119
14119
|
remainingBalance?: string;
|
|
14120
|
+
deposit?: string;
|
|
14120
14121
|
};
|
|
14121
14122
|
type InterestDataChangedType = {
|
|
14122
14123
|
optimalUsageRatio: number | string;
|
|
@@ -14129,8 +14130,12 @@ type ChangeMap = {
|
|
|
14129
14130
|
_streams: StreamChangedType;
|
|
14130
14131
|
_interestRateData: InterestDataChangedType;
|
|
14131
14132
|
assetsSources: string;
|
|
14132
|
-
|
|
14133
|
-
|
|
14133
|
+
totalSupply: string;
|
|
14134
|
+
_balances: Record<string, string>;
|
|
14135
|
+
_allowances: Record<string, string>;
|
|
14136
|
+
balanceOf: Record<string, string>;
|
|
14137
|
+
allowed: Record<string, string>;
|
|
14138
|
+
balances: Record<string, string>;
|
|
14134
14139
|
};
|
|
14135
14140
|
type Change<TName extends string = string> = {
|
|
14136
14141
|
type: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -14030,7 +14030,7 @@ declare function parseLogs({ logs, eventDb }: ParseLogsArgs): LogType[];
|
|
|
14030
14030
|
* @param logs
|
|
14031
14031
|
* @returns
|
|
14032
14032
|
*/
|
|
14033
|
-
declare function enhanceLogs(client: Client, logs: LogType[]): Promise<
|
|
14033
|
+
declare function enhanceLogs(client: Client, logs: LogType[]): Promise<LogType[]>;
|
|
14034
14034
|
|
|
14035
14035
|
declare enum SelfdestructCheckState {
|
|
14036
14036
|
TRUSTED = 0,
|
|
@@ -14117,6 +14117,7 @@ type StreamChangedType = {
|
|
|
14117
14117
|
tokenAddress?: Address;
|
|
14118
14118
|
ratePerSecond?: string;
|
|
14119
14119
|
remainingBalance?: string;
|
|
14120
|
+
deposit?: string;
|
|
14120
14121
|
};
|
|
14121
14122
|
type InterestDataChangedType = {
|
|
14122
14123
|
optimalUsageRatio: number | string;
|
|
@@ -14129,8 +14130,12 @@ type ChangeMap = {
|
|
|
14129
14130
|
_streams: StreamChangedType;
|
|
14130
14131
|
_interestRateData: InterestDataChangedType;
|
|
14131
14132
|
assetsSources: string;
|
|
14132
|
-
|
|
14133
|
-
|
|
14133
|
+
totalSupply: string;
|
|
14134
|
+
_balances: Record<string, string>;
|
|
14135
|
+
_allowances: Record<string, string>;
|
|
14136
|
+
balanceOf: Record<string, string>;
|
|
14137
|
+
allowed: Record<string, string>;
|
|
14138
|
+
balances: Record<string, string>;
|
|
14134
14139
|
};
|
|
14135
14140
|
type Change<TName extends string = string> = {
|
|
14136
14141
|
type: string;
|
package/dist/index.js
CHANGED
|
@@ -33181,6 +33181,7 @@ function enhanceLogs(client, logs) {
|
|
|
33181
33181
|
}
|
|
33182
33182
|
return log;
|
|
33183
33183
|
}
|
|
33184
|
+
return log;
|
|
33184
33185
|
})
|
|
33185
33186
|
);
|
|
33186
33187
|
}
|
|
@@ -33584,18 +33585,26 @@ async function enhanceStateDiff(client, diff) {
|
|
|
33584
33585
|
}
|
|
33585
33586
|
if (isChangeOfType(change, "_streams")) {
|
|
33586
33587
|
await formatBeforeAndAfter(change, async (data) => {
|
|
33587
|
-
if (data.tokenAddress
|
|
33588
|
+
if (data.tokenAddress) {
|
|
33588
33589
|
const assetInfo = await findAsset(client, data.tokenAddress);
|
|
33589
|
-
|
|
33590
|
-
|
|
33591
|
-
|
|
33592
|
-
|
|
33593
|
-
|
|
33594
|
-
|
|
33595
|
-
|
|
33596
|
-
|
|
33597
|
-
|
|
33598
|
-
|
|
33590
|
+
if (data.ratePerSecond)
|
|
33591
|
+
data.ratePerSecond = prettifyNumber({
|
|
33592
|
+
decimals: assetInfo.decimals,
|
|
33593
|
+
value: data.ratePerSecond,
|
|
33594
|
+
showDecimals: true
|
|
33595
|
+
});
|
|
33596
|
+
if (data.remainingBalance)
|
|
33597
|
+
data.remainingBalance = prettifyNumber({
|
|
33598
|
+
showDecimals: true,
|
|
33599
|
+
decimals: assetInfo.decimals,
|
|
33600
|
+
value: data.remainingBalance
|
|
33601
|
+
});
|
|
33602
|
+
if (data.deposit)
|
|
33603
|
+
data.deposit = prettifyNumber({
|
|
33604
|
+
showDecimals: true,
|
|
33605
|
+
decimals: assetInfo.decimals,
|
|
33606
|
+
value: data.deposit
|
|
33607
|
+
});
|
|
33599
33608
|
}
|
|
33600
33609
|
return data;
|
|
33601
33610
|
});
|
|
@@ -33605,15 +33614,31 @@ async function enhanceStateDiff(client, diff) {
|
|
|
33605
33614
|
return addAssetPrice(client, data);
|
|
33606
33615
|
});
|
|
33607
33616
|
}
|
|
33608
|
-
if (
|
|
33617
|
+
if (change.type === "mapping (address => uint256)" || isChangeOfType(change, "totalSupply")) {
|
|
33609
33618
|
await formatBeforeAndAfter(change, async (data) => {
|
|
33610
33619
|
const asset = await findAsset(client, key);
|
|
33611
|
-
if (asset)
|
|
33620
|
+
if (asset) {
|
|
33612
33621
|
return prettifyNumber({
|
|
33613
33622
|
decimals: asset.decimals,
|
|
33614
33623
|
value: data,
|
|
33615
33624
|
showDecimals: true
|
|
33616
33625
|
});
|
|
33626
|
+
}
|
|
33627
|
+
return data;
|
|
33628
|
+
});
|
|
33629
|
+
}
|
|
33630
|
+
if (isChangeOfType(change, "_allowances") || isChangeOfType(change, "allowed")) {
|
|
33631
|
+
await formatBeforeAndAfter(change, async (data) => {
|
|
33632
|
+
const asset = await findAsset(client, key);
|
|
33633
|
+
if (asset && typeof data === "object") {
|
|
33634
|
+
Object.keys(data).forEach((key2) => {
|
|
33635
|
+
data[key2] = prettifyNumber({
|
|
33636
|
+
decimals: asset.decimals,
|
|
33637
|
+
value: data[key2],
|
|
33638
|
+
showDecimals: true
|
|
33639
|
+
});
|
|
33640
|
+
});
|
|
33641
|
+
}
|
|
33617
33642
|
return data;
|
|
33618
33643
|
});
|
|
33619
33644
|
}
|
|
@@ -33750,6 +33775,7 @@ ${payload.actions.map(
|
|
|
33750
33775
|
report += "\n";
|
|
33751
33776
|
}
|
|
33752
33777
|
if (logs.length) {
|
|
33778
|
+
console.log(logs);
|
|
33753
33779
|
report += "### Events emitted from the proposal\n\n";
|
|
33754
33780
|
report += "| Address | Event Name | Arguments |\n";
|
|
33755
33781
|
report += "|---------|------------|-----------|\n";
|