@ocap/state 1.30.1 → 1.30.3
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,13 +1,5 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
1
|
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
2
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
3
|
var __exportAll = (all, symbols) => {
|
|
12
4
|
let target = {};
|
|
13
5
|
for (var name in all) {
|
|
@@ -21,25 +13,6 @@ var __exportAll = (all, symbols) => {
|
|
|
21
13
|
}
|
|
22
14
|
return target;
|
|
23
15
|
};
|
|
24
|
-
var __copyProps = (to, from, except, desc) => {
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
27
|
-
key = keys[i];
|
|
28
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
29
|
-
__defProp(to, key, {
|
|
30
|
-
get: ((k) => from[k]).bind(null, key),
|
|
31
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return to;
|
|
37
|
-
};
|
|
38
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
39
|
-
value: mod,
|
|
40
|
-
enumerable: true
|
|
41
|
-
}) : target, mod));
|
|
42
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
43
16
|
|
|
44
17
|
//#endregion
|
|
45
|
-
export {
|
|
18
|
+
export { __exportAll };
|
package/esm/states/rollup.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { __exportAll
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
2
|
import { create as create$1, update as update$1 } from "../contexts/state.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { toAddress } from "@ocap/util";
|
|
3
|
+
import { BN, toAddress } from "@ocap/util";
|
|
5
4
|
import { CustomError } from "@ocap/util/lib/error";
|
|
6
5
|
import pick from "lodash/pick.js";
|
|
7
6
|
import { patterns, schemas, v, vBN, vBNPositive, vDID, vStripUnknown, vValidate } from "@arcblock/validator";
|
|
@@ -18,7 +17,6 @@ var rollup_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
17
|
update: () => update,
|
|
19
18
|
validate: () => validate
|
|
20
19
|
});
|
|
21
|
-
var import_bn = /* @__PURE__ */ __toESM(require_bn(), 1);
|
|
22
20
|
const isHttpOrHttpsUrl = (s) => {
|
|
23
21
|
try {
|
|
24
22
|
return ["http:", "https:"].includes(new URL(s).protocol);
|
|
@@ -85,10 +83,10 @@ const schema = v.pipe(v.object({
|
|
|
85
83
|
publishSlashRate: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(1e4)),
|
|
86
84
|
context: schemas.context,
|
|
87
85
|
data: v.optional(v.nullable(v.any()))
|
|
88
|
-
}), v.forward(v.check((d) => new
|
|
89
|
-
const max = new
|
|
90
|
-
return max.gt(new
|
|
91
|
-
}, "maxDepositAmount must be > minDepositAmount and < minStakeAmount"), ["maxDepositAmount"]), v.forward(v.check((d) => new
|
|
86
|
+
}), v.forward(v.check((d) => new BN(d.maxStakeAmount).gte(new BN(d.minStakeAmount)), "maxStakeAmount must be >= minStakeAmount"), ["maxStakeAmount"]), v.forward(v.check((d) => d.minSignerCount >= d.seedValidators.length, "minSignerCount must be >= seedValidators count"), ["minSignerCount"]), v.forward(v.check((d) => d.maxSignerCount >= d.minSignerCount, "maxSignerCount must be >= minSignerCount"), ["maxSignerCount"]), v.forward(v.check((d) => d.maxBlockSize >= d.minBlockSize, "maxBlockSize must be >= minBlockSize"), ["maxBlockSize"]), v.forward(v.check((d) => new BN(d.minDepositAmount).lt(new BN(d.minStakeAmount)), "minDepositAmount must be < minStakeAmount"), ["minDepositAmount"]), v.forward(v.check((d) => {
|
|
87
|
+
const max = new BN(d.maxDepositAmount);
|
|
88
|
+
return max.gt(new BN(d.minDepositAmount)) && max.lt(new BN(d.minStakeAmount));
|
|
89
|
+
}, "maxDepositAmount must be > minDepositAmount and < minStakeAmount"), ["maxDepositAmount"]), v.forward(v.check((d) => new BN(d.maxWithdrawAmount).gt(new BN(d.minWithdrawAmount)), "maxWithdrawAmount must be > minWithdrawAmount"), ["maxWithdrawAmount"]), v.forward(v.check((d) => new BN(d.maxDepositFee).gte(new BN(d.minDepositFee)), "maxDepositFee must be >= minDepositFee"), ["maxDepositFee"]), v.forward(v.check((d) => new BN(d.maxWithdrawFee).gte(new BN(d.minWithdrawFee)), "maxWithdrawFee must be >= minWithdrawFee"), ["maxWithdrawFee"]), v.forward(v.check((d) => d.leaveWaitingPeriod >= d.minBlockInterval, "leaveWaitingPeriod must be >= minBlockInterval"), ["leaveWaitingPeriod"]), v.forward(v.check((d) => d.publishWaitingPeriod >= d.minBlockInterval, "publishWaitingPeriod must be >= minBlockInterval"), ["publishWaitingPeriod"]), vStripUnknown());
|
|
92
90
|
const create = (attrs, context) => {
|
|
93
91
|
const rollup = {
|
|
94
92
|
context: create$1(context),
|
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
8
|
var __exportAll = (all, symbols) => {
|
|
10
9
|
let target = {};
|
|
11
10
|
for (var name in all) {
|
|
@@ -40,6 +39,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
40
39
|
|
|
41
40
|
//#endregion
|
|
42
41
|
|
|
43
|
-
exports.__commonJSMin = __commonJSMin;
|
|
44
42
|
exports.__exportAll = __exportAll;
|
|
45
43
|
exports.__toESM = __toESM;
|
package/lib/states/rollup.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_contexts_state = require('../contexts/state.cjs');
|
|
3
|
-
const require_bn$1 = require('../node_modules/bn.js/lib/bn.cjs');
|
|
4
3
|
let _ocap_util = require("@ocap/util");
|
|
5
4
|
let _ocap_util_lib_error = require("@ocap/util/lib/error");
|
|
6
5
|
let lodash_pick = require("lodash/pick");
|
|
@@ -19,7 +18,6 @@ var rollup_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
|
19
18
|
update: () => update,
|
|
20
19
|
validate: () => validate
|
|
21
20
|
});
|
|
22
|
-
var import_bn = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_bn$1.default, 1);
|
|
23
21
|
const isHttpOrHttpsUrl = (s) => {
|
|
24
22
|
try {
|
|
25
23
|
return ["http:", "https:"].includes(new URL(s).protocol);
|
|
@@ -86,10 +84,10 @@ const schema = _arcblock_validator.v.pipe(_arcblock_validator.v.object({
|
|
|
86
84
|
publishSlashRate: _arcblock_validator.v.pipe(_arcblock_validator.v.number(), _arcblock_validator.v.integer(), _arcblock_validator.v.minValue(1), _arcblock_validator.v.maxValue(1e4)),
|
|
87
85
|
context: _arcblock_validator.schemas.context,
|
|
88
86
|
data: _arcblock_validator.v.optional(_arcblock_validator.v.nullable(_arcblock_validator.v.any()))
|
|
89
|
-
}), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new
|
|
90
|
-
const max = new
|
|
91
|
-
return max.gt(new
|
|
92
|
-
}, "maxDepositAmount must be > minDepositAmount and < minStakeAmount"), ["maxDepositAmount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new
|
|
87
|
+
}), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new _ocap_util.BN(d.maxStakeAmount).gte(new _ocap_util.BN(d.minStakeAmount)), "maxStakeAmount must be >= minStakeAmount"), ["maxStakeAmount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => d.minSignerCount >= d.seedValidators.length, "minSignerCount must be >= seedValidators count"), ["minSignerCount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => d.maxSignerCount >= d.minSignerCount, "maxSignerCount must be >= minSignerCount"), ["maxSignerCount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => d.maxBlockSize >= d.minBlockSize, "maxBlockSize must be >= minBlockSize"), ["maxBlockSize"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new _ocap_util.BN(d.minDepositAmount).lt(new _ocap_util.BN(d.minStakeAmount)), "minDepositAmount must be < minStakeAmount"), ["minDepositAmount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => {
|
|
88
|
+
const max = new _ocap_util.BN(d.maxDepositAmount);
|
|
89
|
+
return max.gt(new _ocap_util.BN(d.minDepositAmount)) && max.lt(new _ocap_util.BN(d.minStakeAmount));
|
|
90
|
+
}, "maxDepositAmount must be > minDepositAmount and < minStakeAmount"), ["maxDepositAmount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new _ocap_util.BN(d.maxWithdrawAmount).gt(new _ocap_util.BN(d.minWithdrawAmount)), "maxWithdrawAmount must be > minWithdrawAmount"), ["maxWithdrawAmount"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new _ocap_util.BN(d.maxDepositFee).gte(new _ocap_util.BN(d.minDepositFee)), "maxDepositFee must be >= minDepositFee"), ["maxDepositFee"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => new _ocap_util.BN(d.maxWithdrawFee).gte(new _ocap_util.BN(d.minWithdrawFee)), "maxWithdrawFee must be >= minWithdrawFee"), ["maxWithdrawFee"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => d.leaveWaitingPeriod >= d.minBlockInterval, "leaveWaitingPeriod must be >= minBlockInterval"), ["leaveWaitingPeriod"]), _arcblock_validator.v.forward(_arcblock_validator.v.check((d) => d.publishWaitingPeriod >= d.minBlockInterval, "publishWaitingPeriod must be >= minBlockInterval"), ["publishWaitingPeriod"]), (0, _arcblock_validator.vStripUnknown)());
|
|
93
91
|
const create = (attrs, context) => {
|
|
94
92
|
const rollup = {
|
|
95
93
|
context: require_contexts_state.create(context),
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.30.
|
|
6
|
+
"version": "1.30.3",
|
|
7
7
|
"description": "State management utilities for OCAP blockchain",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./lib/index.cjs",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"clean": "rm -rf lib esm"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@arcblock/did": "1.30.
|
|
44
|
-
"@arcblock/validator": "1.30.
|
|
45
|
-
"@ocap/contract": "1.30.
|
|
46
|
-
"@ocap/mcrypto": "1.30.
|
|
47
|
-
"@ocap/message": "1.30.
|
|
48
|
-
"@ocap/types": "1.30.
|
|
49
|
-
"@ocap/util": "1.30.
|
|
50
|
-
"@ocap/wallet": "1.30.
|
|
43
|
+
"@arcblock/did": "1.30.3",
|
|
44
|
+
"@arcblock/validator": "1.30.3",
|
|
45
|
+
"@ocap/contract": "1.30.3",
|
|
46
|
+
"@ocap/mcrypto": "1.30.3",
|
|
47
|
+
"@ocap/message": "1.30.3",
|
|
48
|
+
"@ocap/types": "1.30.3",
|
|
49
|
+
"@ocap/util": "1.30.3",
|
|
50
|
+
"@ocap/wallet": "1.30.3",
|
|
51
51
|
"bloom-filters": "^1.3.9",
|
|
52
52
|
"lodash": "^4.17.23"
|
|
53
53
|
},
|