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 +1 -1
- package/src/api.js +5 -5
- package/src/check.js +5 -5
- package/src/protocol.js +1 -1
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -86,8 +86,8 @@ export class ProtocolApi{
|
|
|
86
86
|
address, command_hash, nonce);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
return
|
|
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
|
|
99
|
-
* let
|
|
100
|
-
* api.tx(
|
|
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 :
|
|
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 :
|
|
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 :
|
|
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 :
|
|
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 :
|
|
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
|
}
|