@mainsail/contracts 0.0.1-evm.1 → 0.0.1-evm.11
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/distribution/contracts/api/api.d.ts +4 -0
- package/distribution/contracts/api/api.d.ts.map +1 -1
- package/distribution/contracts/api/api.js.map +1 -1
- package/distribution/contracts/api-sync.d.ts +0 -1
- package/distribution/contracts/api-sync.d.ts.map +1 -1
- package/distribution/contracts/crypto/block.d.ts +2 -3
- package/distribution/contracts/crypto/block.d.ts.map +1 -1
- package/distribution/contracts/crypto/commit.d.ts +0 -1
- package/distribution/contracts/crypto/commit.d.ts.map +1 -1
- package/distribution/contracts/crypto/identities.d.ts +3 -0
- package/distribution/contracts/crypto/identities.d.ts.map +1 -1
- package/distribution/contracts/crypto/networks.d.ts +4 -4
- package/distribution/contracts/crypto/networks.d.ts.map +1 -1
- package/distribution/contracts/crypto/transactions.d.ts +27 -55
- package/distribution/contracts/crypto/transactions.d.ts.map +1 -1
- package/distribution/contracts/database.d.ts +15 -3
- package/distribution/contracts/database.d.ts.map +1 -1
- package/distribution/contracts/evm/contract-service.d.ts +23 -0
- package/distribution/contracts/evm/contract-service.d.ts.map +1 -0
- package/distribution/contracts/evm/contract-service.js +2 -0
- package/distribution/contracts/evm/contract-service.js.map +1 -0
- package/distribution/contracts/evm/evm.d.ts +66 -4
- package/distribution/contracts/evm/evm.d.ts.map +1 -1
- package/distribution/contracts/evm/evm.js +1 -2
- package/distribution/contracts/evm/evm.js.map +1 -1
- package/distribution/contracts/evm/gas-fee.d.ts +1 -1
- package/distribution/contracts/evm/gas-fee.d.ts.map +1 -1
- package/distribution/contracts/evm/index.d.ts +2 -0
- package/distribution/contracts/evm/index.d.ts.map +1 -1
- package/distribution/contracts/evm/index.js +2 -0
- package/distribution/contracts/evm/index.js.map +1 -1
- package/distribution/contracts/evm/state.d.ts +4 -0
- package/distribution/contracts/evm/state.d.ts.map +1 -0
- package/distribution/contracts/evm/state.js +2 -0
- package/distribution/contracts/evm/state.js.map +1 -0
- package/distribution/contracts/evm/worker.d.ts +6 -1
- package/distribution/contracts/evm/worker.d.ts.map +1 -1
- package/distribution/contracts/index.d.ts +1 -1
- package/distribution/contracts/index.d.ts.map +1 -1
- package/distribution/contracts/index.js +1 -1
- package/distribution/contracts/index.js.map +1 -1
- package/distribution/contracts/network-generator.d.ts +6 -7
- package/distribution/contracts/network-generator.d.ts.map +1 -1
- package/distribution/contracts/processor.d.ts +4 -8
- package/distribution/contracts/processor.d.ts.map +1 -1
- package/distribution/contracts/serializer.d.ts +1 -1
- package/distribution/contracts/serializer.d.ts.map +1 -1
- package/distribution/contracts/snapshot.d.ts +44 -0
- package/distribution/contracts/snapshot.d.ts.map +1 -0
- package/distribution/contracts/snapshot.js +2 -0
- package/distribution/contracts/snapshot.js.map +1 -0
- package/distribution/contracts/state/index.d.ts +0 -7
- package/distribution/contracts/state/index.d.ts.map +1 -1
- package/distribution/contracts/state/index.js +0 -7
- package/distribution/contracts/state/index.js.map +1 -1
- package/distribution/contracts/state/store.d.ts +3 -17
- package/distribution/contracts/state/store.d.ts.map +1 -1
- package/distribution/contracts/state/wallets.d.ts +7 -105
- package/distribution/contracts/state/wallets.d.ts.map +1 -1
- package/distribution/contracts/state/wallets.js +1 -15
- package/distribution/contracts/state/wallets.js.map +1 -1
- package/distribution/contracts/transaction-pool/client.d.ts +1 -4
- package/distribution/contracts/transaction-pool/client.d.ts.map +1 -1
- package/distribution/contracts/transaction-pool/mempool.d.ts +4 -5
- package/distribution/contracts/transaction-pool/mempool.d.ts.map +1 -1
- package/distribution/contracts/transaction-pool/query.d.ts +1 -5
- package/distribution/contracts/transaction-pool/query.d.ts.map +1 -1
- package/distribution/contracts/transaction-pool/sender-mempool.d.ts +2 -2
- package/distribution/contracts/transaction-pool/sender-mempool.d.ts.map +1 -1
- package/distribution/contracts/transaction-pool/sender-state.d.ts +3 -1
- package/distribution/contracts/transaction-pool/sender-state.d.ts.map +1 -1
- package/distribution/contracts/transaction-pool/service.d.ts +2 -2
- package/distribution/contracts/transaction-pool/service.d.ts.map +1 -1
- package/distribution/contracts/transaction-pool/worker.d.ts +3 -10
- package/distribution/contracts/transaction-pool/worker.d.ts.map +1 -1
- package/distribution/contracts/transactions.d.ts +9 -27
- package/distribution/contracts/transactions.d.ts.map +1 -1
- package/distribution/contracts/validator-set.d.ts +5 -3
- package/distribution/contracts/validator-set.d.ts.map +1 -1
- package/distribution/contracts/validator.d.ts +1 -1
- package/distribution/contracts/validator.d.ts.map +1 -1
- package/distribution/events.d.ts +2 -1
- package/distribution/events.d.ts.map +1 -1
- package/distribution/events.js +1 -0
- package/distribution/events.js.map +1 -1
- package/distribution/exceptions/crypto.d.ts +14 -6
- package/distribution/exceptions/crypto.d.ts.map +1 -1
- package/distribution/exceptions/crypto.js +18 -4
- package/distribution/exceptions/crypto.js.map +1 -1
- package/distribution/exceptions/pool.d.ts +2 -3
- package/distribution/exceptions/pool.d.ts.map +1 -1
- package/distribution/exceptions/pool.js +1 -1
- package/distribution/exceptions/pool.js.map +1 -1
- package/distribution/exceptions/processor.js +1 -1
- package/distribution/exceptions/processor.js.map +1 -1
- package/distribution/exceptions/validation.d.ts +1 -1
- package/distribution/exceptions/validation.d.ts.map +1 -1
- package/distribution/exceptions/validation.js +2 -2
- package/distribution/exceptions/validation.js.map +1 -1
- package/distribution/identifiers.d.ts +24 -35
- package/distribution/identifiers.d.ts.map +1 -1
- package/distribution/identifiers.js +25 -36
- package/distribution/identifiers.js.map +1 -1
- package/package.json +2 -2
- package/distribution/contracts/fees.d.ts +0 -10
- package/distribution/contracts/fees.d.ts.map +0 -1
- package/distribution/contracts/fees.js +0 -2
- package/distribution/contracts/fees.js.map +0 -1
- package/distribution/contracts/state/attributes.d.ts +0 -22
- package/distribution/contracts/state/attributes.d.ts.map +0 -1
- package/distribution/contracts/state/attributes.js +0 -9
- package/distribution/contracts/state/attributes.js.map +0 -1
- package/distribution/contracts/state/block-state.d.ts +0 -12
- package/distribution/contracts/state/block-state.d.ts.map +0 -1
- package/distribution/contracts/state/block-state.js +0 -2
- package/distribution/contracts/state/block-state.js.map +0 -1
- package/distribution/contracts/state/index-set.d.ts +0 -5
- package/distribution/contracts/state/index-set.d.ts.map +0 -1
- package/distribution/contracts/state/index-set.js +0 -2
- package/distribution/contracts/state/index-set.js.map +0 -1
- package/distribution/contracts/state/repository.d.ts +0 -26
- package/distribution/contracts/state/repository.d.ts.map +0 -1
- package/distribution/contracts/state/repository.js +0 -2
- package/distribution/contracts/state/repository.js.map +0 -1
- package/distribution/contracts/state/service.d.ts +0 -11
- package/distribution/contracts/state/service.d.ts.map +0 -1
- package/distribution/contracts/state/service.js +0 -2
- package/distribution/contracts/state/service.js.map +0 -1
- package/distribution/contracts/state/snapshots.d.ts +0 -13
- package/distribution/contracts/state/snapshots.d.ts.map +0 -1
- package/distribution/contracts/state/snapshots.js +0 -2
- package/distribution/contracts/state/snapshots.js.map +0 -1
- package/distribution/contracts/state/state-verifier.d.ts +0 -4
- package/distribution/contracts/state/state-verifier.d.ts.map +0 -1
- package/distribution/contracts/state/state-verifier.js +0 -2
- package/distribution/contracts/state/state-verifier.js.map +0 -1
@@ -1,14 +1,19 @@
|
|
1
|
+
import { CommitHandler } from "../crypto/index.js";
|
2
|
+
import { EventListener } from "../kernel/index.js";
|
1
3
|
import { Subprocess } from "../kernel/ipc.js";
|
2
4
|
import { KeyValuePair } from "../types/index.js";
|
3
5
|
export interface WorkerFlags extends KeyValuePair {
|
4
6
|
}
|
5
7
|
export interface WorkerScriptHandler {
|
6
8
|
boot(flags: WorkerFlags): Promise<void>;
|
9
|
+
setPeerCount(peerCount: number): Promise<void>;
|
10
|
+
commit(height: number): Promise<void>;
|
11
|
+
start(height: number): Promise<void>;
|
7
12
|
}
|
8
13
|
export type WorkerFactory = () => Worker;
|
9
14
|
export type WorkerSubprocess = Subprocess<WorkerScriptHandler>;
|
10
15
|
export type WorkerSubprocessFactory = () => WorkerSubprocess;
|
11
|
-
export interface Worker extends WorkerScriptHandler {
|
16
|
+
export interface Worker extends Omit<WorkerScriptHandler, "commit">, CommitHandler, EventListener {
|
12
17
|
getQueueSize(): number;
|
13
18
|
kill(): Promise<number>;
|
14
19
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../source/contracts/evm/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,YAAY;CAAG;AAEpD,MAAM,WAAW,mBAAmB;IACnC,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../source/contracts/evm/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,YAAY;CAAG;AAEpD,MAAM,WAAW,mBAAmB;IACnC,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC;AAEzC,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAE/D,MAAM,MAAM,uBAAuB,GAAG,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,MAAO,SAAQ,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,EAAE,aAAa,EAAE,aAAa;IAChG,YAAY,IAAI,MAAM,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACxB"}
|
@@ -5,7 +5,6 @@ export * as ConsensusStorage from "./consensus-storage.js";
|
|
5
5
|
export * as Crypto from "./crypto/index.js";
|
6
6
|
export * as Database from "./database.js";
|
7
7
|
export * as Evm from "./evm/index.js";
|
8
|
-
export * as Fee from "./fees.js";
|
9
8
|
export * as Kernel from "./kernel/index.js";
|
10
9
|
export * as NetworkGenerator from "./network-generator.js";
|
11
10
|
export * as P2P from "./p2p/index.js";
|
@@ -13,6 +12,7 @@ export * as Processor from "./processor.js";
|
|
13
12
|
export * as Proposer from "./proposer.js";
|
14
13
|
export * as Serializer from "./serializer.js";
|
15
14
|
export * as Shared from "./shared/index.js";
|
15
|
+
export * as Snapshot from "./snapshot.js";
|
16
16
|
export * as State from "./state/index.js";
|
17
17
|
export * as TransactionPool from "./transaction-pool/index.js";
|
18
18
|
export * as Transactions from "./transactions.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC"}
|
@@ -5,7 +5,6 @@ export * as ConsensusStorage from "./consensus-storage.js";
|
|
5
5
|
export * as Crypto from "./crypto/index.js";
|
6
6
|
export * as Database from "./database.js";
|
7
7
|
export * as Evm from "./evm/index.js";
|
8
|
-
export * as Fee from "./fees.js";
|
9
8
|
export * as Kernel from "./kernel/index.js";
|
10
9
|
export * as NetworkGenerator from "./network-generator.js";
|
11
10
|
export * as P2P from "./p2p/index.js";
|
@@ -13,6 +12,7 @@ export * as Processor from "./processor.js";
|
|
13
12
|
export * as Proposer from "./proposer.js";
|
14
13
|
export * as Serializer from "./serializer.js";
|
15
14
|
export * as Shared from "./shared/index.js";
|
15
|
+
export * as Snapshot from "./snapshot.js";
|
16
16
|
export * as State from "./state/index.js";
|
17
17
|
export * as TransactionPool from "./transaction-pool/index.js";
|
18
18
|
export * as Transactions from "./transactions.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC"}
|
@@ -15,13 +15,6 @@ export type MilestoneOptions = {
|
|
15
15
|
blockTime: number;
|
16
16
|
epoch: Date;
|
17
17
|
vendorFieldLength: number;
|
18
|
-
address: {
|
19
|
-
bech32m: string;
|
20
|
-
} | {
|
21
|
-
base58: number;
|
22
|
-
} | {
|
23
|
-
keccak256: boolean;
|
24
|
-
};
|
25
18
|
};
|
26
19
|
export type NetworkOptions = {
|
27
20
|
network: string;
|
@@ -40,6 +33,12 @@ export type GenesisBlockOptions = {
|
|
40
33
|
premine: string;
|
41
34
|
pubKeyHash: number;
|
42
35
|
epoch: Date;
|
36
|
+
snapshot?: SnapshotOptions;
|
37
|
+
};
|
38
|
+
export type SnapshotOptions = {
|
39
|
+
path: string;
|
40
|
+
snapshotHash?: string;
|
41
|
+
stateHash?: string;
|
43
42
|
};
|
44
43
|
export type InternalOptions = EnvironmentOptions & MilestoneOptions & NetworkOptions & RewardOptions & GenesisBlockOptions & {
|
45
44
|
peers: string[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"network-generator.d.ts","sourceRoot":"","sources":["../../source/contracts/network-generator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"network-generator.d.ts","sourceRoot":"","sources":["../../source/contracts/network-generator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;CAC1B,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AO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Block, Commit, Transaction } from "./crypto/index.js";
|
2
|
-
import { TransactionReceipt } from "./evm/evm.js";
|
3
|
-
import { Store } from "./state/index.js";
|
2
|
+
import { AccountUpdate, TransactionReceipt } from "./evm/evm.js";
|
4
3
|
export interface ProcessableUnit {
|
5
4
|
readonly height: number;
|
6
5
|
readonly round: number;
|
7
6
|
readonly persist: boolean;
|
8
|
-
readonly store: Store;
|
9
7
|
hasProcessorResult(): boolean;
|
10
8
|
getProcessorResult(): BlockProcessorResult;
|
11
9
|
setProcessorResult(processorResult: BlockProcessorResult): void;
|
10
|
+
setAccountUpdates(accounts: Array<AccountUpdate>): void;
|
11
|
+
getAccountUpdates(): Array<AccountUpdate>;
|
12
12
|
getBlock(): Block;
|
13
13
|
getCommit(): Promise<Commit>;
|
14
14
|
}
|
@@ -25,11 +25,7 @@ export interface BlockProcessorResult {
|
|
25
25
|
gasUsed: number;
|
26
26
|
}
|
27
27
|
export interface TransactionProcessor {
|
28
|
-
process(unit: ProcessableUnit, transaction: Transaction): Promise<
|
29
|
-
}
|
30
|
-
export interface TransactionProcessorResult {
|
31
|
-
readonly gasUsed: number;
|
32
|
-
readonly receipt?: TransactionReceipt;
|
28
|
+
process(unit: ProcessableUnit, transaction: Transaction): Promise<TransactionReceipt>;
|
33
29
|
}
|
34
30
|
export interface Verifier {
|
35
31
|
verify(unit: ProcessableUnit): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../source/contracts/processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"processor.d.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AAkB,CAAC,CAAC;CACtF;AAED,MAAM,WAAW,QAAQ;IACxB,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
2
2
|
import { ByteBuffer } from "@mainsail/utils";
|
3
3
|
export type MandatoryPropertyType = "hash" | "publicKey" | "hex" | "signature" | "transactions" | "consensusSignature" | "validatorSet";
|
4
|
-
export type OptionalPropertyType = "uint8" | "uint16" | "uint32" | "uint48" | "uint64" | "address" | "bigint" | "blockId";
|
4
|
+
export type OptionalPropertyType = "uint8" | "uint16" | "uint32" | "uint48" | "uint64" | "uint256" | "address" | "bigint" | "blockId";
|
5
5
|
export type SerializationSchema = {
|
6
6
|
type: MandatoryPropertyType;
|
7
7
|
} | {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../source/contracts/serializer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAC9B,MAAM,GACN,WAAW,GACX,KAAK,GACL,WAAW,GACX,cAAc,GACd,oBAAoB,GACpB,cAAc,CAAC;AAElB,MAAM,MAAM,oBAAoB,GAC7B,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG;IAAE,IAAI,EAAE,qBAAqB,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEpH,MAAM,WAAW,0BAA0B;IAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM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C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,qBAAqB,GAC9B;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEnD,MAAM,WAAW,4BAA4B;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IAC1B,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElF,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,4BAA4B,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACvG"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { Commit } from "./crypto/index.js";
|
2
|
+
import { CommitKey } from "./evm/evm.js";
|
3
|
+
export interface LegacyImporter {
|
4
|
+
run(genesisBlock: Commit): Promise<LegacyImportResult>;
|
5
|
+
prepare(snapshotPath: string): Promise<void>;
|
6
|
+
import(options: LegacyImportOptions): Promise<LegacyImportResult>;
|
7
|
+
wallets: ImportedLegacyWallet[];
|
8
|
+
validators: ImportedLegacyValidator[];
|
9
|
+
voters: ImportedLegacyVoter[];
|
10
|
+
snapshotHash: string;
|
11
|
+
}
|
12
|
+
export interface LegacyImportOptions {
|
13
|
+
readonly timestamp: number;
|
14
|
+
readonly commitKey: CommitKey;
|
15
|
+
}
|
16
|
+
export interface LegacyImportResult {
|
17
|
+
readonly initialTotalSupply: bigint;
|
18
|
+
readonly stateHash: string;
|
19
|
+
}
|
20
|
+
export interface ImportedLegacyWallet {
|
21
|
+
readonly arkAddress: string;
|
22
|
+
readonly ethAddress?: string;
|
23
|
+
readonly publicKey?: string;
|
24
|
+
readonly balance: bigint;
|
25
|
+
readonly legacyAttributes: ImportedLegacyWalletAttributes;
|
26
|
+
}
|
27
|
+
export interface ImportedLegacyWalletAttributes {
|
28
|
+
readonly secondPublicKey?: string;
|
29
|
+
}
|
30
|
+
export interface ImportedLegacyVoter {
|
31
|
+
readonly arkAddress: string;
|
32
|
+
readonly ethAddress?: string;
|
33
|
+
readonly publicKey: string;
|
34
|
+
readonly vote: string;
|
35
|
+
}
|
36
|
+
export interface ImportedLegacyValidator {
|
37
|
+
readonly arkAddress: string;
|
38
|
+
readonly ethAddress?: string;
|
39
|
+
readonly publicKey: string;
|
40
|
+
readonly isResigned: boolean;
|
41
|
+
username: string;
|
42
|
+
blsPublicKey: string;
|
43
|
+
}
|
44
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../source/contracts/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC9B,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAElE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,UAAU,EAAE,uBAAuB,EAAE,CAAC;IACtC,MAAM,EAAE,mBA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":[],"mappings":""}
|
@@ -1,11 +1,4 @@
|
|
1
|
-
export * from "./attributes.js";
|
2
|
-
export * from "./block-state.js";
|
3
|
-
export * from "./index-set.js";
|
4
|
-
export * from "./repository.js";
|
5
|
-
export * from "./service.js";
|
6
|
-
export * from "./snapshots.js";
|
7
1
|
export * from "./state.js";
|
8
|
-
export * from "./state-verifier.js";
|
9
2
|
export * from "./store.js";
|
10
3
|
export * from "./wallets.js";
|
11
4
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/contracts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/contracts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
@@ -1,11 +1,4 @@
|
|
1
|
-
export * from "./attributes.js";
|
2
|
-
export * from "./block-state.js";
|
3
|
-
export * from "./index-set.js";
|
4
|
-
export * from "./repository.js";
|
5
|
-
export * from "./service.js";
|
6
|
-
export * from "./snapshots.js";
|
7
1
|
export * from "./state.js";
|
8
|
-
export * from "./state-verifier.js";
|
9
2
|
export * from "./store.js";
|
10
3
|
export * from "./wallets.js";
|
11
4
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/contracts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/contracts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
@@ -1,27 +1,13 @@
|
|
1
1
|
import { Block, Commit, CommitHandler } from "../crypto/index.js";
|
2
|
-
import { JsonObject } from "../types/index.js";
|
3
|
-
import { StateRepositoryChange } from "./repository.js";
|
4
|
-
import { WalletRepository, WalletRepositoryChange } from "./wallets.js";
|
5
|
-
export type StoreChange = {
|
6
|
-
walletRepository: WalletRepositoryChange;
|
7
|
-
store: StateRepositoryChange;
|
8
|
-
};
|
9
2
|
export interface Store extends CommitHandler {
|
10
|
-
readonly walletRepository: WalletRepository;
|
11
3
|
getGenesisCommit(): Commit;
|
12
4
|
setGenesisCommit(block: Commit): void;
|
13
|
-
getLastHeight(): number;
|
14
5
|
getLastBlock(): Block;
|
15
6
|
setLastBlock(block: Block): void;
|
7
|
+
setHeight(height: number): void;
|
8
|
+
getHeight(): number;
|
9
|
+
setTotalRound(totalRound: number): void;
|
16
10
|
getTotalRound(): number;
|
17
|
-
hasAttribute(key: string): boolean;
|
18
|
-
getAttribute<T>(key: string): T;
|
19
|
-
setAttribute<T>(key: string, value: T): void;
|
20
|
-
commitChanges(): void;
|
21
|
-
toJson(): JsonObject;
|
22
|
-
fromJson(data: JsonObject): void;
|
23
|
-
changesToJson(): StoreChange;
|
24
|
-
applyChanges(changes: StoreChange): void;
|
25
11
|
}
|
26
12
|
export type StoreFactory = (originalStore?: Store) => Store;
|
27
13
|
//# sourceMappingURL=store.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../source/contracts/state/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../source/contracts/state/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,WAAW,KAAM,SAAQ,aAAa;IAC3C,gBAAgB,IAAI,MAAM,CAAC;IAC3B,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,YAAY,IAAI,KAAK,CAAC;IACtB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAEjC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,IAAI,MAAM,CAAC;IAEpB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,aAAa,IAAI,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,aAAa,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC"}
|
@@ -1,32 +1,6 @@
|
|
1
1
|
import { BigNumber } from "@mainsail/utils";
|
2
|
-
|
3
|
-
import { BlockData, MultiSignatureAsset } from "../crypto/index.js";
|
4
|
-
import { StateRepository, StateRepositoryChange } from "./repository.js";
|
5
|
-
export interface WalletIndex {
|
6
|
-
has(key: string): boolean;
|
7
|
-
get(key: string): Wallet | undefined;
|
8
|
-
set(key: string, wallet: Wallet): void;
|
9
|
-
forget(key: string): void;
|
10
|
-
entries(): ReadonlyArray<[string, Wallet]>;
|
11
|
-
values(): ReadonlyArray<Wallet>;
|
12
|
-
keys(): string[];
|
13
|
-
size(): number;
|
14
|
-
clear(): void;
|
15
|
-
}
|
16
|
-
export declare enum WalletIndexes {
|
17
|
-
Addresses = "addresses",
|
18
|
-
PublicKeys = "publicKeys",
|
19
|
-
Usernames = "usernames",
|
20
|
-
Resignations = "resignations",
|
21
|
-
Validators = "validators"
|
22
|
-
}
|
23
|
-
export interface WalletChange extends StateRepositoryChange {
|
24
|
-
address: string;
|
25
|
-
}
|
26
|
-
export interface Wallet extends Omit<StateRepository, "fromJson" | "commitChanges" | "changesToJson"> {
|
2
|
+
export interface Wallet {
|
27
3
|
getAddress(): string;
|
28
|
-
getPublicKey(): string | undefined;
|
29
|
-
setPublicKey(publicKey: string): void;
|
30
4
|
getBalance(): BigNumber;
|
31
5
|
setBalance(balance: BigNumber): void;
|
32
6
|
increaseBalance(balance: BigNumber): Wallet;
|
@@ -35,86 +9,14 @@ export interface Wallet extends Omit<StateRepository, "fromJson" | "commitChange
|
|
35
9
|
setNonce(nonce: BigNumber): void;
|
36
10
|
increaseNonce(): void;
|
37
11
|
decreaseNonce(): void;
|
38
|
-
|
39
|
-
|
40
|
-
hasMultiSignature(): boolean;
|
41
|
-
clone(walletRepository: WalletRepository): Wallet;
|
42
|
-
getOriginal(): Wallet;
|
43
|
-
fromJson(data: JsonObject): Wallet;
|
44
|
-
commitChanges(walletRepository: WalletRepository): void;
|
45
|
-
changesToJson(): WalletChange;
|
46
|
-
toString(): string;
|
12
|
+
hasLegacySecondPublicKey(): boolean;
|
13
|
+
legacySecondPublicKey(): string;
|
47
14
|
}
|
48
15
|
export interface ValidatorWallet {
|
49
|
-
|
50
|
-
|
51
|
-
getConsensusPublicKey(): string;
|
52
|
-
getVoteBalance(): BigNumber;
|
53
|
-
getRank(): number;
|
54
|
-
setRank(rank: number): void;
|
55
|
-
unsetRank(): void;
|
56
|
-
getApproval(): number;
|
57
|
-
setApproval(approval: number): void;
|
58
|
-
unsetApproval(): void;
|
59
|
-
isResigned(): boolean;
|
60
|
-
toString(): string;
|
61
|
-
}
|
62
|
-
export type WalletFactory = (address: string, walletRepository: WalletRepository, wallet?: Wallet) => Wallet;
|
63
|
-
export type ValidatorWalletFactory = (wallet: Wallet) => ValidatorWallet;
|
64
|
-
export interface WalletValidatorAttributes {
|
65
|
-
username: string;
|
16
|
+
address: string;
|
17
|
+
blsPublicKey: string;
|
66
18
|
voteBalance: BigNumber;
|
67
|
-
|
68
|
-
|
69
|
-
round?: number;
|
70
|
-
resigned?: boolean;
|
71
|
-
}
|
72
|
-
export type WalletMultiSignatureAttributes = MultiSignatureAsset & {
|
73
|
-
legacy?: boolean;
|
74
|
-
};
|
75
|
-
export type WalletRepositoryChange = {
|
76
|
-
wallets: WalletChange[];
|
77
|
-
indexes: {
|
78
|
-
[index: string]: {
|
79
|
-
forgets: string[];
|
80
|
-
sets: Record<string, string>;
|
81
|
-
};
|
82
|
-
};
|
83
|
-
};
|
84
|
-
export interface WalletRepository {
|
85
|
-
allByAddress(): ReadonlyArray<Wallet>;
|
86
|
-
allByPublicKey(): ReadonlyArray<Wallet>;
|
87
|
-
allValidators(): ReadonlyArray<Wallet>;
|
88
|
-
allByIndex(indexName: string): ReadonlyArray<Wallet>;
|
89
|
-
findByAddress(address: string): Wallet;
|
90
|
-
findByPublicKey(publicKey: string): Promise<Wallet>;
|
91
|
-
findByUsername(username: string): Wallet;
|
92
|
-
findByIndex(index: string, key: string): Wallet;
|
93
|
-
hasByAddress(address: string): boolean;
|
94
|
-
hasByPublicKey(publicKey: string): boolean;
|
95
|
-
hasByUsername(username: string): boolean;
|
96
|
-
hasByIndex(indexName: string, key: string): boolean;
|
97
|
-
getIndex(name: string): WalletIndex;
|
98
|
-
setOnIndex(index: string, key: string, wallet: Wallet): void;
|
99
|
-
forgetOnIndex(index: string, key: string): void;
|
100
|
-
sizeOfIndex(index: string): number;
|
101
|
-
setDirtyWallet(wallet: Wallet): void;
|
102
|
-
getDirtyWallets(): IterableIterator<Wallet>;
|
103
|
-
commitChanges(): void;
|
104
|
-
changesToJson(): WalletRepositoryChange;
|
105
|
-
applyChanges(changes: WalletRepositoryChange): void;
|
106
|
-
}
|
107
|
-
export type WalletRepositoryFactory = (originalWalletRepository?: WalletRepository) => WalletRepository;
|
108
|
-
export type WalletRepositoryBySenderFactory = (originalWalletRepository: WalletRepository, publicKey: string) => Promise<WalletRepository>;
|
109
|
-
export declare enum SearchScope {
|
110
|
-
Wallets = 0,
|
111
|
-
Validators = 1,
|
112
|
-
Locks = 2,
|
113
|
-
Entities = 3
|
114
|
-
}
|
115
|
-
export interface SearchContext<T = any> {
|
116
|
-
query: Record<string, string[]>;
|
117
|
-
entries: ReadonlyArray<T>;
|
118
|
-
defaultOrder: string[];
|
19
|
+
votersCount: number;
|
20
|
+
isResigned: boolean;
|
119
21
|
}
|
120
22
|
//# sourceMappingURL=wallets.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../source/contracts/state/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../../source/contracts/state/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,MAAM;IACtB,UAAU,IAAI,MAAM,CAAC;IAErB,UAAU,IAAI,SAAS,CAAC;IACxB,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC;IAE5C,QAAQ,IAAI,SAAS,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,aAAa,IAAI,IAAI,CAAC;IACtB,aAAa,IAAI,IAAI,CAAC;IAGtB,wBAAwB,IAAI,OAAO,CAAC;IACpC,qBAAqB,IAAI,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACpB"}
|
@@ -1,16 +1,2 @@
|
|
1
|
-
export
|
2
|
-
(function (WalletIndexes) {
|
3
|
-
WalletIndexes["Addresses"] = "addresses";
|
4
|
-
WalletIndexes["PublicKeys"] = "publicKeys";
|
5
|
-
WalletIndexes["Usernames"] = "usernames";
|
6
|
-
WalletIndexes["Resignations"] = "resignations";
|
7
|
-
WalletIndexes["Validators"] = "validators";
|
8
|
-
})(WalletIndexes || (WalletIndexes = {}));
|
9
|
-
export var SearchScope;
|
10
|
-
(function (SearchScope) {
|
11
|
-
SearchScope[SearchScope["Wallets"] = 0] = "Wallets";
|
12
|
-
SearchScope[SearchScope["Validators"] = 1] = "Validators";
|
13
|
-
SearchScope[SearchScope["Locks"] = 2] = "Locks";
|
14
|
-
SearchScope[SearchScope["Entities"] = 3] = "Entities";
|
15
|
-
})(SearchScope || (SearchScope = {}));
|
1
|
+
export {};
|
16
2
|
//# sourceMappingURL=wallets.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wallets.js","sourceRoot":"","sources":["../../../source/contracts/state/wallets.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"wallets.js","sourceRoot":"","sources":["../../../source/contracts/state/wallets.ts"],"names":[],"mappings":""}
|
@@ -1,10 +1,7 @@
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
2
|
-
import { CommitHandler
|
2
|
+
import { CommitHandler } from "../crypto/index.js";
|
3
3
|
export interface Client extends CommitHandler {
|
4
|
-
setFailedTransactions(transactions: Transaction[]): void;
|
5
4
|
getTransactionBytes(): Promise<Buffer[]>;
|
6
|
-
listSnapshots(): Promise<number[]>;
|
7
|
-
importSnapshot(height: number): Promise<void>;
|
8
5
|
getStatus(): Promise<{
|
9
6
|
height: number;
|
10
7
|
version: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,MAAM,WAAW,MAAO,SAAQ,aAAa;IAC5C,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,SAAS,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D"}
|
@@ -2,13 +2,12 @@ import { Transaction } from "../crypto/index.js";
|
|
2
2
|
import { SenderMempool } from "./sender-mempool.js";
|
3
3
|
export interface Mempool {
|
4
4
|
getSize(): number;
|
5
|
-
hasSenderMempool(
|
6
|
-
getSenderMempool(
|
5
|
+
hasSenderMempool(address: string): boolean;
|
6
|
+
getSenderMempool(address: string): SenderMempool;
|
7
7
|
getSenderMempools(): Iterable<SenderMempool>;
|
8
8
|
addTransaction(transaction: Transaction): Promise<void>;
|
9
|
-
removeTransaction(
|
10
|
-
|
11
|
-
fixInvalidStates(): Promise<Transaction[]>;
|
9
|
+
removeTransaction(address: string, id: string): Promise<Transaction[]>;
|
10
|
+
reAddTransactions(addresses: string[]): Promise<Transaction[]>;
|
12
11
|
flush(): void;
|
13
12
|
}
|
14
13
|
//# sourceMappingURL=mempool.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mempool.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/mempool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,OAAO;IACvB,OAAO,IAAI,MAAM,CAAC;IAElB,gBAAgB,CAAC,
|
1
|
+
{"version":3,"file":"mempool.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/mempool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,OAAO;IACvB,OAAO,IAAI,MAAM,CAAC;IAElB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3C,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC;IACjD,iBAAiB,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;IAE7C,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACvE,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAE/D,KAAK,IAAI,IAAI,CAAC;CACd"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Transaction
|
1
|
+
import { Transaction } from "../crypto/index.js";
|
2
2
|
export type QueryPredicate = (transaction: Transaction) => Promise<boolean>;
|
3
3
|
export interface Query {
|
4
4
|
getAll(): QueryIterable;
|
@@ -9,10 +9,6 @@ export interface Query {
|
|
9
9
|
export interface QueryIterable {
|
10
10
|
wherePredicate(predicate: QueryPredicate): QueryIterable;
|
11
11
|
whereId(id: string): QueryIterable;
|
12
|
-
whereType(type: TransactionType | number): QueryIterable;
|
13
|
-
whereTypeGroup(typeGroup: TransactionTypeGroup | number): QueryIterable;
|
14
|
-
whereVersion(version: number): QueryIterable;
|
15
|
-
whereKind(transaction: Transaction): QueryIterable;
|
16
12
|
has(): Promise<boolean>;
|
17
13
|
first(): Promise<Transaction>;
|
18
14
|
all(): Promise<Transaction[]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5E,MAAM,WAAW,KAAK;IACrB,MAAM,IAAI,aAAa,CAAC;IACxB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,aAAa,CAAC;IACvD,qBAAqB,IAAI,aAAa,CAAC;IACvC,sBAAsB,IAAI,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC7B,cAAc,CAAC,SAAS,EAAE,cAAc,GAAG,aAAa,CAAC;IACzD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,CAAC;IAEnC,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACxB,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAC9B"}
|
@@ -6,7 +6,7 @@ export interface SenderMempool {
|
|
6
6
|
getFromLatest(): Iterable<Transaction>;
|
7
7
|
addTransaction(transaction: Transaction): Promise<void>;
|
8
8
|
removeTransaction(id: string): Transaction[];
|
9
|
-
|
9
|
+
reAddTransactions(): Promise<Transaction[]>;
|
10
10
|
}
|
11
|
-
export type SenderMempoolFactory = (
|
11
|
+
export type SenderMempoolFactory = (address: string) => Promise<SenderMempool>;
|
12
12
|
//# sourceMappingURL=sender-mempool.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sender-mempool.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/sender-mempool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,WAAW,aAAa;IAC7B,YAAY,IAAI,OAAO,CAAC;IACxB,OAAO,IAAI,MAAM,CAAC;IAElB,eAAe,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IACzC,aAAa,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEvC,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7C,
|
1
|
+
{"version":3,"file":"sender-mempool.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/sender-mempool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,WAAW,aAAa;IAC7B,YAAY,IAAI,OAAO,CAAC;IACxB,OAAO,IAAI,MAAM,CAAC;IAElB,eAAe,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IACzC,aAAa,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEvC,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7C,iBAAiB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAC5C;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC"}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { Transaction } from "../crypto/transactions.js";
|
2
2
|
export interface SenderState {
|
3
|
-
configure(
|
3
|
+
configure(address: string): Promise<SenderState>;
|
4
|
+
reset(): Promise<void>;
|
4
5
|
apply(transaction: Transaction): Promise<void>;
|
6
|
+
revert(transaction: Transaction): void;
|
5
7
|
}
|
6
8
|
//# sourceMappingURL=sender-state.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sender-state.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/sender-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,WAAW,WAAW;IAC3B,SAAS,CAAC,
|
1
|
+
{"version":3,"file":"sender-state.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/sender-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,WAAW,WAAW;IAC3B,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;CACvC"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { Transaction } from "../crypto/index.js";
|
2
2
|
export interface Service {
|
3
3
|
getPoolSize(): number;
|
4
4
|
addTransaction(transaction: Transaction): Promise<void>;
|
5
5
|
reAddTransactions(): Promise<void>;
|
6
|
-
commit(
|
6
|
+
commit(sendersAddresses: string[]): Promise<void>;
|
7
7
|
flush(): Promise<void>;
|
8
8
|
}
|
9
9
|
//# sourceMappingURL=service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../source/contracts/transaction-pool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,OAAO;IACvB,WAAW,IAAI,MAAM,CAAC;IAEtB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
|