@quantovainc/qcore 0.4.0 → 0.4.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantovainc/qcore",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Quantova's post quantum client core for JavaScript. Signs with ML-DSA-65 and builds Q1 addresses.",
5
5
  "scripts": {
6
6
  "build": "bash scripts/build.sh",
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "qcore-js",
3
3
  "type": "module",
4
4
  "description": "The JavaScript binding for the Quantova client core, generated over QCore with wasm-bindgen. The core does the key derivation, the post quantum signing, and the wire, the page does the fetch.",
5
- "version": "0.4.0",
5
+ "version": "0.4.2",
6
6
  "license": "Apache-2.0 OR MIT",
7
7
  "repository": {
8
8
  "type": "git",
Binary file
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qcore-js",
3
3
  "description": "The JavaScript binding for the Quantova client core, generated over QCore with wasm-bindgen. The core does the key derivation, the post quantum signing, and the wire, the page does the fetch.",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "repository": {
7
7
  "type": "git",
Binary file
package/shared.js CHANGED
@@ -29,8 +29,9 @@ function accountNonce(nonce) {
29
29
  }
30
30
 
31
31
  const VALIDITY_BLOCKS = 300n;
32
+ const ORDER_HOLD_UNTIL = 1n << 62n;
32
33
  const MAX_PLAUSIBLE_HEAD = 1n << 40n;
33
- const HEAD_BLOCKS_PER_SEC = 4n;
34
+ const HEAD_BLOCKS_PER_SEC = 20n;
34
35
  const HEAD_SLACK_SECS = 60n;
35
36
  const GENESIS_FLOOR_SECS = 1735689600n;
36
37
  const U64_MAX = 0xffffffffffffffffn;
@@ -613,6 +614,7 @@ function makeClient(core) {
613
614
  const signed = JSON.parse(
614
615
  core.sign_call(callerSeedHex, accountIndex(callerIndex), contract, order.call_args, accountNonceUsed, meterLimitOf(meterLimit), String(fee), chainId, until, String(transferFee))
615
616
  );
617
+ this._guardSigned(orderKey, nonce, order.call_args, ORDER_HOLD_UNTIL, expectedOrderNonce != null);
616
618
  this._guardSigned(from, accountNonceUsed, signed.tx_hex, until, expectedNonce != null);
617
619
  const outcome = await this.submit(signed.tx_hex);
618
620
  this._remember(from, accountNonceUsed, outcome);
package/shared.mjs CHANGED
@@ -29,8 +29,9 @@ function accountNonce(nonce) {
29
29
  }
30
30
 
31
31
  const VALIDITY_BLOCKS = 300n;
32
+ const ORDER_HOLD_UNTIL = 1n << 62n;
32
33
  const MAX_PLAUSIBLE_HEAD = 1n << 40n;
33
- const HEAD_BLOCKS_PER_SEC = 4n;
34
+ const HEAD_BLOCKS_PER_SEC = 20n;
34
35
  const HEAD_SLACK_SECS = 60n;
35
36
  const GENESIS_FLOOR_SECS = 1735689600n;
36
37
  const U64_MAX = 0xffffffffffffffffn;
@@ -613,6 +614,7 @@ function makeClient(core) {
613
614
  const signed = JSON.parse(
614
615
  core.sign_call(callerSeedHex, accountIndex(callerIndex), contract, order.call_args, accountNonceUsed, meterLimitOf(meterLimit), String(fee), chainId, until, String(transferFee))
615
616
  );
617
+ this._guardSigned(orderKey, nonce, order.call_args, ORDER_HOLD_UNTIL, expectedOrderNonce != null);
616
618
  this._guardSigned(from, accountNonceUsed, signed.tx_hex, until, expectedNonce != null);
617
619
  const outcome = await this.submit(signed.tx_hex);
618
620
  this._remember(from, accountNonceUsed, outcome);