@super-protocol/sdk-js 0.6.1 → 0.6.3-beta.0

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.
@@ -2,6 +2,7 @@ import Web3 from "web3";
2
2
  declare class NonceTracker {
3
3
  private web3;
4
4
  private store;
5
+ private static logger;
5
6
  constructor(web3: Web3);
6
7
  initAccount(address: string): Promise<void>;
7
8
  isManaged(address: string): boolean;
@@ -35,11 +35,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
38
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
+ var logger_1 = __importDefault(require("../logger"));
39
43
  var NonceTracker = /** @class */ (function () {
40
44
  function NonceTracker(web3) {
41
45
  this.web3 = web3;
42
46
  this.store = {};
47
+ NonceTracker.logger.trace("Created NonceTracker");
43
48
  }
44
49
  NonceTracker.prototype.initAccount = function (address) {
45
50
  return __awaiter(this, void 0, void 0, function () {
@@ -56,6 +61,7 @@ var NonceTracker = /** @class */ (function () {
56
61
  if (address in this.store) {
57
62
  return [2 /*return*/];
58
63
  }
64
+ NonceTracker.logger.trace("Initialized ".concat(address, " account with nonce: ").concat(txCount));
59
65
  this.store[address] = txCount;
60
66
  return [2 /*return*/];
61
67
  }
@@ -73,12 +79,15 @@ var NonceTracker = /** @class */ (function () {
73
79
  };
74
80
  NonceTracker.prototype.getNonce = function (address) {
75
81
  this.checkAccount(address);
82
+ NonceTracker.logger.trace("Get nonce: ".concat(this.store[address]));
76
83
  return this.store[address];
77
84
  };
78
85
  NonceTracker.prototype.consumeNonce = function (address) {
79
86
  this.checkAccount(address);
87
+ NonceTracker.logger.trace("Consume nonce: ".concat(this.store[address] + 1));
80
88
  return this.store[address]++;
81
89
  };
90
+ NonceTracker.logger = logger_1.default.child({ className: "NonceTracker" });
82
91
  return NonceTracker;
83
92
  }());
84
93
  exports.default = NonceTracker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-protocol/sdk-js",
3
- "version": "0.6.1",
3
+ "version": "0.6.3-beta.0",
4
4
  "main": "build/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -18,13 +18,14 @@
18
18
  "prepare": "npm run build",
19
19
  "docs": "typedoc src/index.ts --excludePrivate --plugin typedoc-plugin-markdown --out ./auto-docs",
20
20
  "docs-cleanup": "rm -rf auto-docs",
21
- "bump": "npm version prerelease --preid=beta && git push && git push --tags",
22
- "patch:beta": "npm version prepatch --preid=beta && git push && git push --tags",
23
- "minor:beta": "npm version preminor --preid=beta && git push && git push --tags",
24
- "major:beta": "npm version premajor --preid=beta && git push && git push --tags",
25
- "patch": "npm version patch && git push && git push --tags",
26
- "minor": "npm version minor && git push && git push --tags",
27
- "major": "npm version major && git push && git push --tags",
21
+ "bump": "npm version prerelease --preid=beta && npm run tag:publish",
22
+ "patch:beta": "npm version prepatch --preid=beta && npm run tag:publish",
23
+ "minor:beta": "npm version preminor --preid=beta && npm run tag:publish",
24
+ "major:beta": "npm version premajor --preid=beta && npm run tag:publish",
25
+ "patch": "npm version patch && npm run tag:publish",
26
+ "minor": "npm version minor && npm run tag:publish",
27
+ "major": "npm version major && npm run tag:publish",
28
+ "tag:publish": "git push origin && git push public && git push public $(git tag --points-at HEAD)",
28
29
  "dto:update": "npm run dto:clean && npm run dto:generate",
29
30
  "dto:clean": "rm -rf ./src/proto/*",
30
31
  "dto:generate": "cd ./dto/src && protoc --plugin=../../node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=esModuleInterop=true --ts_proto_opt=unrecognizedEnum=false --ts_proto_out=../../src/proto ./*"