abel-ghost-sdk 0.0.6 → 0.0.7
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.ts +1 -1
- package/dist/index.js +9 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,5 +26,5 @@ export declare class AbelGhostSDK {
|
|
|
26
26
|
getAssetLabels(assetId: number | bigint): Promise<string[]>;
|
|
27
27
|
getAllAssetIDs(): Promise<bigint[]>;
|
|
28
28
|
private getBoxesByLength;
|
|
29
|
-
getBlockTimesAndTc(firstRound: number | bigint, lastRound: number | bigint): Promise<
|
|
29
|
+
getBlockTimesAndTc(firstRound: number | bigint, lastRound: number | bigint): Promise<BlockRoundTimeAndTc[]>;
|
|
30
30
|
}
|
package/dist/index.js
CHANGED
|
@@ -60,15 +60,18 @@ export class AbelGhostSDK {
|
|
|
60
60
|
return boxNames.filter((boxName) => boxName.nameRaw.length === length);
|
|
61
61
|
}
|
|
62
62
|
async getBlockTimesAndTc(firstRound, lastRound) {
|
|
63
|
-
const
|
|
64
|
-
const
|
|
63
|
+
const firstDataRound = BigInt(firstRound);
|
|
64
|
+
const lastDataRound = BigInt(lastRound);
|
|
65
|
+
const simRound = BigInt(lastRound);
|
|
66
|
+
const firstValid = simRound + BigInt(1); // simulating with first-valid after simulate round, this is actually valid
|
|
67
|
+
const lastValid = simRound + BigInt(1);
|
|
65
68
|
return (await this.baseSDK.getBlockTimesAndTc({
|
|
66
|
-
methodArgsOrArgsArray: { firstRound:
|
|
67
|
-
extraMethodCallArgs: { firstValidRound:
|
|
68
|
-
extraSimulateArgs: { round:
|
|
69
|
+
methodArgsOrArgsArray: { firstRound: firstDataRound, lastRound: lastDataRound },
|
|
70
|
+
extraMethodCallArgs: { firstValidRound: firstValid, lastValidRound: lastValid },
|
|
71
|
+
extraSimulateArgs: { round: simRound },
|
|
69
72
|
})).map((data, i) => ({
|
|
70
73
|
...data,
|
|
71
|
-
rnd: BigInt(
|
|
74
|
+
rnd: BigInt(firstDataRound) + BigInt(i),
|
|
72
75
|
}));
|
|
73
76
|
}
|
|
74
77
|
}
|