aftermath-ts-sdk 0.0.121 → 0.0.122

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.
@@ -1 +1 @@
1
- {"version":3,"file":"transactionsApiHelpers.d.ts","sourceRoot":"","sources":["../../../src/general/api/transactionsApiHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,gCAAgC,EAChC,gBAAgB,EAChB,iBAAiB,EAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,qBAAa,sBAAsB;IAKtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAY5C,2BAA2B,UAC1B,gCAAgC,WAC9B,iBAAiB,UAClB,MAAM,KACZ,QAAQ,sBAAsB,CAAC,CAkBhC;IAEK,+BAA+B,OACjC,gBAAgB,KAClB,QAAQ,gBAAgB,CAAC,CAe1B;IAEK,wCAAwC,OAC1C,gBAAgB,GAAG,QAAQ,gBAAgB,CAAC,KAC9C,QAAQ,qBAAqB,CAAC,CAI/B;IAUF,OAAc,uBAAuB,mBACpB,MAAM,eACT,MAAM,gBACL,MAAM,KAClB,GAAG,MAAM,KAAK,MAAM,KAAK,MAAM,EAAE,CACkB;IAEtD,OAAc,kBAAkB;cAErB,IAAI;;;MACyC;CACxD"}
1
+ {"version":3,"file":"transactionsApiHelpers.d.ts","sourceRoot":"","sources":["../../../src/general/api/transactionsApiHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,gCAAgC,EAChC,gBAAgB,EAChB,iBAAiB,EAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,qBAAa,sBAAsB;IAKtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAY5C,2BAA2B,UAC1B,gCAAgC,WAC9B,iBAAiB,UAClB,MAAM,KACZ,QAAQ,sBAAsB,CAAC,CAkBhC;IAEK,+BAA+B,OACjC,gBAAgB,KAClB,QAAQ,gBAAgB,CAAC,CAiB1B;IAEK,wCAAwC,OAC1C,gBAAgB,GAAG,QAAQ,gBAAgB,CAAC,KAC9C,QAAQ,qBAAqB,CAAC,CAI/B;IAUF,OAAc,uBAAuB,mBACpB,MAAM,eACT,MAAM,gBACL,MAAM,KAClB,GAAG,MAAM,KAAK,MAAM,KAAK,MAAM,EAAE,CACkB;IAEtD,OAAc,kBAAkB;cAErB,IAAI;;;MACyC;CACxD"}
@@ -40,14 +40,17 @@ class TransactionsApiHelpers {
40
40
  const sender = tx.blockData.sender;
41
41
  if (!sender)
42
42
  throw new Error("no sender set for transaction");
43
- const response = yield this.Provider.provider.devInspectTransactionBlock({
44
- sender,
45
- transactionBlock: tx,
46
- });
47
- const gasUsed = (0, sui_js_1.getTotalGasUsedUpperBound)(response.effects);
43
+ const [txResponse, referenceGasPrice] = yield Promise.all([
44
+ this.Provider.provider.dryRunTransactionBlock({
45
+ transactionBlock: tx.serialize(),
46
+ }),
47
+ this.Provider.provider.getReferenceGasPrice(),
48
+ ]);
49
+ const gasUsed = (0, sui_js_1.getTotalGasUsedUpperBound)(txResponse.effects);
48
50
  if (gasUsed === undefined)
49
- throw Error("dev inspect move call failed");
51
+ throw Error("dry run move call failed");
50
52
  tx.setGasBudget(gasUsed);
53
+ tx.setGasPrice(referenceGasPrice);
51
54
  return tx;
52
55
  });
53
56
  this.fetchSetGasBudgetAndSerializeTransaction = (tx) => __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aftermath-ts-sdk",
3
- "version": "0.0.121",
3
+ "version": "0.0.122",
4
4
  "description": "Aftermath TypeScript SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",