trac-peer 0.1.45 → 0.1.46

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-peer",
3
3
  "main": "src/index.js",
4
- "version": "0.1.45",
4
+ "version": "0.1.46",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "hypercore": "11.6.2",
package/src/api.js CHANGED
@@ -86,8 +86,8 @@ export class ProtocolApi{
86
86
  address, command_hash, nonce);
87
87
  }
88
88
 
89
- async prepareTxCommand(command){
90
- return await this.peer.protocol_instance.mapTxCommand(command);
89
+ prepareTxCommand(command){
90
+ return this.peer.protocol_instance.mapTxCommand(command);
91
91
  }
92
92
 
93
93
  /**
@@ -95,9 +95,9 @@ export class ProtocolApi{
95
95
  *
96
96
  * Signing steps:
97
97
  * let nonce = api.generateNonce()
98
- * let tx = api.generateTx(address, sha256(JSON.stringify(api.prepareTxCommand(command))), nonce)
99
- * let sig = your_sign_lib.sign(tx + nonce, address)
100
- * api.tx(tx, api.prepareTxCommand(command), address, sig, nonce)
98
+ * let tx_hash = api.generateTx(address, a_sha256_function(JSON.stringify(api.prepareTxCommand(command))), nonce)
99
+ * let signature = your_ed25519_sign_lib.sign(tx + nonce, address)
100
+ * api.tx(tx_hash, api.prepareTxCommand(command), address, signature, nonce)
101
101
  *
102
102
  * @param tx
103
103
  * @param prepared_command
package/src/check.js CHANGED
@@ -161,7 +161,7 @@ class Check {
161
161
  $$type: "object",
162
162
  dispatch : {
163
163
  $$type : "object",
164
- id : { type : "number", integer: true, min : 0, max : 2147483647 },
164
+ id : { type : "number", integer: true, min : 0, max : Number.MAX_SAFE_INTEGER },
165
165
  type : { type : "string", min : 1, max : 256 },
166
166
  address : { type : "is_hex" }
167
167
  }
@@ -183,7 +183,7 @@ class Check {
183
183
  $$type: "object",
184
184
  dispatch : {
185
185
  $$type : "object",
186
- id : { type : "number", integer: true, min : 0, max : 2147483647 },
186
+ id : { type : "number", integer: true, min : 0, max : Number.MAX_SAFE_INTEGER },
187
187
  pinned : { type : "boolean" },
188
188
  type : { type : "string", min : 1, max : 256 },
189
189
  address : { type : "is_hex" }
@@ -387,9 +387,9 @@ class Check {
387
387
  type : { type : "string", min : 1, max : 256 },
388
388
  address : { type : "is_hex" },
389
389
  deleted_by : { type : "is_hex", nullable : true },
390
- reply_to : { type : "number", integer : true, min : 0, max : 2147483647, nullable : true },
390
+ reply_to : { type : "number", integer : true, min : 0, max : Number.MAX_SAFE_INTEGER, nullable : true },
391
391
  pinned : { type : "boolean" },
392
- pin_id : { type : "number", integer : true, min : 0, max : 2147483647, nullable : true },
392
+ pin_id : { type : "number", integer : true, min : 0, max : Number.MAX_SAFE_INTEGER, nullable : true },
393
393
  }
394
394
  }
395
395
  };
@@ -455,7 +455,7 @@ class Check {
455
455
  type : { type : "string", min : 1, max : 256 },
456
456
  value : { type : "any", nullable : true }
457
457
  },
458
- msbsl : { type : "number", integer : true, min : 0, max : 2147483647 },
458
+ msbsl : { type : "number", integer : true, min : 0, max : Number.MAX_SAFE_INTEGER },
459
459
  ipk : { type : "is_hex" },
460
460
  wp : { type : "is_hex" }
461
461
  }
package/src/protocol.js CHANGED
@@ -186,7 +186,7 @@ class Protocol{
186
186
  return null;
187
187
  }
188
188
 
189
- async mapTxCommand(command){
189
+ mapTxCommand(command){
190
190
  return null;
191
191
  }
192
192