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 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<BlockTimeAndTc[]>;
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 first = BigInt(firstRound);
64
- const last = BigInt(lastRound) - BigInt(1);
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: first, lastRound: last },
67
- extraMethodCallArgs: { firstValidRound: first, lastValidRound: last },
68
- extraSimulateArgs: { round: last },
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(first) + BigInt(i),
74
+ rnd: BigInt(firstDataRound) + BigInt(i),
72
75
  }));
73
76
  }
74
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abel-ghost-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",