@xyo-network/xl1-protocol 1.3.20 → 1.3.22
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/dist/neutral/index.mjs +56 -74
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/index.mjs +56 -74
- package/dist/node/index.mjs.map +1 -1
- package/dist/types/BlockDuration.d.ts.map +1 -0
- package/dist/types/ChainIterator.d.ts +3 -3
- package/dist/types/ChainIterator.d.ts.map +1 -1
- package/dist/types/ChainIteratorEventData.d.ts +1 -1
- package/dist/types/ChainIteratorEventData.d.ts.map +1 -1
- package/dist/types/ChainReference.d.ts.map +1 -0
- package/dist/types/Initializable.d.ts.map +1 -0
- package/dist/types/Steps.d.ts.map +1 -0
- package/dist/types/{protocol → block}/AllowedBlockPayload.d.ts +2 -2
- package/dist/types/block/AllowedBlockPayload.d.ts.map +1 -0
- package/dist/types/block/BlockBoundWitness.d.ts.map +1 -0
- package/dist/types/block/HydratedBlock.d.ts.map +1 -0
- package/dist/types/block/index.d.ts +4 -0
- package/dist/types/block/index.d.ts.map +1 -0
- package/dist/types/{protocol → chain}/ChainAnalyzer.d.ts +1 -1
- package/dist/types/chain/ChainAnalyzer.d.ts.map +1 -0
- package/dist/types/chain/index.d.ts +1 -2
- package/dist/types/chain/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/payload/elevatable/ChainStakeIntent.d.ts +1 -1
- package/dist/types/payload/elevatable/ChainStakeIntent.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoNetwork.d.ts +1 -1
- package/dist/types/provider/v1/XyoNetwork.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoProvider.d.ts +2 -1
- package/dist/types/provider/v1/XyoProvider.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoRunner.d.ts +1 -1
- package/dist/types/provider/v1/XyoRunner.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoSigner.d.ts +2 -1
- package/dist/types/provider/v1/XyoSigner.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoViewer.d.ts +3 -2
- package/dist/types/provider/v1/XyoViewer.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Account.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Account.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Block.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Block.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Chain.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Chain.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Transaction.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Transaction.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Xyo.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Xyo.d.ts.map +1 -1
- package/dist/types/repository/TransactionReadRepository.d.ts +1 -1
- package/dist/types/repository/TransactionReadRepository.d.ts.map +1 -1
- package/dist/types/repository/TransactionRepositoryIterator.d.ts +1 -1
- package/dist/types/repository/TransactionRepositoryIterator.d.ts.map +1 -1
- package/dist/types/repository/TransactionWriteRepository.d.ts +1 -1
- package/dist/types/repository/TransactionWriteRepository.d.ts.map +1 -1
- package/dist/types/services/BlockProducer.d.ts +2 -2
- package/dist/types/services/BlockProducer.d.ts.map +1 -1
- package/dist/types/{chain → services}/ChainServiceCollection.d.ts +6 -1
- package/dist/types/services/ChainServiceCollection.d.ts.map +1 -0
- package/dist/types/services/Election.d.ts +1 -1
- package/dist/types/services/Election.d.ts.map +1 -1
- package/dist/types/services/PendingTransactionsService.d.ts +1 -1
- package/dist/types/services/PendingTransactionsService.d.ts.map +1 -1
- package/dist/types/services/index.d.ts +1 -0
- package/dist/types/services/index.d.ts.map +1 -1
- package/dist/types/services/stakeIntent/StakeIntentService.d.ts +1 -1
- package/dist/types/services/stakeIntent/StakeIntentService.d.ts.map +1 -1
- package/dist/types/transaction/HydratedTransaction.d.ts.map +1 -0
- package/dist/types/{protocol → transaction}/TransactionBoundWitness.d.ts +2 -2
- package/dist/types/transaction/TransactionBoundWitness.d.ts.map +1 -0
- package/dist/types/transaction/TransactionFeesFields.d.ts.map +1 -0
- package/dist/types/transaction/index.d.ts +4 -0
- package/dist/types/transaction/index.d.ts.map +1 -0
- package/dist/types/validation/block/BlockValidationFunction.d.ts +1 -1
- package/dist/types/validation/block/BlockValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts +1 -1
- package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts +1 -1
- package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts +1 -1
- package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts +1 -1
- package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts +1 -2
- package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts.map +1 -1
- package/eslint.config.mjs +6 -2
- package/knip.config.ts +1 -1
- package/package.json +1 -3
- package/src/ChainIterator.ts +4 -3
- package/src/ChainIteratorEventData.ts +1 -1
- package/src/{protocol → block}/AllowedBlockPayload.ts +3 -3
- package/src/block/index.ts +3 -0
- package/src/{protocol → chain}/ChainAnalyzer.ts +1 -1
- package/src/chain/index.ts +1 -2
- package/src/index.ts +5 -3
- package/src/payload/elevatable/ChainStakeIntent.ts +1 -1
- package/src/provider/v1/XyoNetwork.ts +1 -1
- package/src/provider/v1/XyoProvider.ts +3 -3
- package/src/provider/v1/XyoRunner.ts +1 -1
- package/src/provider/v1/XyoSigner.ts +2 -3
- package/src/provider/v1/XyoViewer.ts +3 -4
- package/src/provider/v2/viewer/Account.ts +1 -1
- package/src/provider/v2/viewer/Block.ts +2 -1
- package/src/provider/v2/viewer/Chain.ts +2 -1
- package/src/provider/v2/viewer/Transaction.ts +2 -1
- package/src/provider/v2/viewer/Xyo.ts +1 -1
- package/src/repository/TransactionReadRepository.ts +2 -1
- package/src/repository/TransactionRepositoryIterator.ts +2 -1
- package/src/repository/TransactionWriteRepository.ts +2 -1
- package/src/services/BlockProducer.ts +3 -2
- package/src/{chain → services}/ChainServiceCollection.ts +7 -4
- package/src/services/Election.ts +2 -1
- package/src/services/PendingTransactionsService.ts +2 -1
- package/src/services/index.ts +1 -0
- package/src/services/stakeIntent/StakeIntentService.ts +1 -1
- package/src/{protocol → transaction}/TransactionBoundWitness.ts +3 -2
- package/src/transaction/index.ts +3 -0
- package/src/validation/block/BlockValidationFunction.ts +1 -1
- package/src/validation/block/HydratedBlockStateValidationFunction.ts +1 -1
- package/src/validation/block/HydratedBlockValidationFunction.ts +1 -1
- package/src/validation/payload/InBlockPayloadValidationFunction.ts +1 -1
- package/src/validation/transaction/HydratedTransactionStateValidationFunction.ts +1 -1
- package/src/validation/transaction/HydratedTransactionValidationFunction.ts +3 -2
- package/dist/types/chain/ChainServiceCollection.d.ts.map +0 -1
- package/dist/types/chain/Initializable.d.ts.map +0 -1
- package/dist/types/protocol/AllowedBlockPayload.d.ts.map +0 -1
- package/dist/types/protocol/BlockBoundWitness.d.ts.map +0 -1
- package/dist/types/protocol/BlockDuration.d.ts.map +0 -1
- package/dist/types/protocol/BlockNumber.d.ts +0 -37
- package/dist/types/protocol/BlockNumber.d.ts.map +0 -1
- package/dist/types/protocol/ChainAnalyzer.d.ts.map +0 -1
- package/dist/types/protocol/ChainReference.d.ts.map +0 -1
- package/dist/types/protocol/HydratedBlock.d.ts.map +0 -1
- package/dist/types/protocol/HydratedTransaction.d.ts.map +0 -1
- package/dist/types/protocol/Issuer.d.ts +0 -5
- package/dist/types/protocol/Issuer.d.ts.map +0 -1
- package/dist/types/protocol/Steps.d.ts.map +0 -1
- package/dist/types/protocol/TransactionBoundWitness.d.ts.map +0 -1
- package/dist/types/protocol/TransactionFeesFields.d.ts.map +0 -1
- package/dist/types/protocol/index.d.ts +0 -13
- package/dist/types/protocol/index.d.ts.map +0 -1
- package/knip.log +0 -491
- package/src/protocol/BlockNumber.ts +0 -39
- package/src/protocol/Issuer.ts +0 -5
- package/src/protocol/index.ts +0 -12
- /package/dist/types/{protocol/BlockDuration.d.ts → BlockDuration.d.ts} +0 -0
- /package/dist/types/{protocol/ChainReference.d.ts → ChainReference.d.ts} +0 -0
- /package/dist/types/{chain/Initializable.d.ts → Initializable.d.ts} +0 -0
- /package/dist/types/{protocol/Steps.d.ts → Steps.d.ts} +0 -0
- /package/dist/types/{protocol → block}/BlockBoundWitness.d.ts +0 -0
- /package/dist/types/{protocol → block}/HydratedBlock.d.ts +0 -0
- /package/dist/types/{protocol → transaction}/HydratedTransaction.d.ts +0 -0
- /package/dist/types/{protocol → transaction}/TransactionFeesFields.d.ts +0 -0
- /package/src/{protocol/BlockDuration.ts → BlockDuration.ts} +0 -0
- /package/src/{protocol/ChainReference.ts → ChainReference.ts} +0 -0
- /package/src/{chain/Initializable.ts → Initializable.ts} +0 -0
- /package/src/{protocol/Steps.ts → Steps.ts} +0 -0
- /package/src/{protocol → block}/BlockBoundWitness.ts +0 -0
- /package/src/{protocol → block}/HydratedBlock.ts +0 -0
- /package/src/{protocol → transaction}/HydratedTransaction.ts +0 -0
- /package/src/{protocol → transaction}/TransactionFeesFields.ts +0 -0
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
var getDefaultGasConfig = /* @__PURE__ */ __name(() => {
|
|
9
|
-
return {
|
|
10
|
-
gasLimit: 2e6,
|
|
11
|
-
gasPrice: parseUnits("100", "gwei")
|
|
12
|
-
};
|
|
13
|
-
}, "getDefaultGasConfig");
|
|
14
|
-
var ETH_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
15
|
-
var toEthAddress = /* @__PURE__ */ __name((value) => {
|
|
16
|
-
const address = typeof value === "object" ? value.address : value;
|
|
17
|
-
return getAddress(toHex(address, {
|
|
18
|
-
prefix: true,
|
|
19
|
-
bitLength: 160
|
|
20
|
-
}));
|
|
21
|
-
}, "toEthAddress");
|
|
22
|
-
|
|
23
|
-
// src/network/Status.ts
|
|
24
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
25
|
-
var NetworkStatusSchema = "network.xyo.chain.status";
|
|
26
|
-
var isNetworkStatus = isPayloadOfSchemaType(NetworkStatusSchema);
|
|
4
|
+
// src/block/AllowedBlockPayload.ts
|
|
5
|
+
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
6
|
+
import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
|
|
7
|
+
import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
27
8
|
|
|
28
9
|
// src/payload/elevatable/ChainStakeIntent.ts
|
|
29
10
|
import { AsObjectFactory } from "@xylabs/object";
|
|
30
|
-
import { isPayloadOfSchemaType
|
|
11
|
+
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
31
12
|
var ChainStakeIntentSchema = "network.xyo.chain.stake.intent";
|
|
32
13
|
var isChainStakeIntent = /* @__PURE__ */ __name((x) => {
|
|
33
|
-
return
|
|
14
|
+
return isPayloadOfSchemaType(ChainStakeIntentSchema)(x) && asNonNegativeInteger(x.nbf) !== void 0 && asNonNegativeInteger(x.exp) !== void 0;
|
|
34
15
|
}, "isChainStakeIntent");
|
|
35
16
|
var asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent);
|
|
36
17
|
var asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent);
|
|
@@ -52,27 +33,22 @@ var asExecutable = /* @__PURE__ */ __name((value) => {
|
|
|
52
33
|
|
|
53
34
|
// src/payload/elevatable/Hash.ts
|
|
54
35
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/object";
|
|
55
|
-
import { isPayloadOfSchemaType as
|
|
36
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
|
|
56
37
|
var HashSchema = "network.xyo.hash";
|
|
57
|
-
var isHashPayload =
|
|
38
|
+
var isHashPayload = isPayloadOfSchemaType2(HashSchema);
|
|
58
39
|
var asHashPayload = AsObjectFactory2.create(isHashPayload);
|
|
59
40
|
var asHashPayloadWithStorageMeta = AsObjectFactory2.create(isHashPayload);
|
|
60
41
|
var asOptionalHashPayload = AsObjectFactory2.createOptional(isHashPayload);
|
|
61
42
|
|
|
62
43
|
// src/payload/elevatable/TransferPayload.ts
|
|
63
44
|
import { AsObjectFactory as AsObjectFactory3 } from "@xylabs/object";
|
|
64
|
-
import { isPayloadOfSchemaType as
|
|
45
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType3 } from "@xyo-network/payload-model";
|
|
65
46
|
var TransferSchema = "network.xyo.transfer";
|
|
66
|
-
var isTransfer =
|
|
47
|
+
var isTransfer = isPayloadOfSchemaType3(TransferSchema);
|
|
67
48
|
var asTransfer = AsObjectFactory3.create(isTransfer);
|
|
68
49
|
var asOptionalTransfer = AsObjectFactory3.createOptional(isTransfer);
|
|
69
50
|
|
|
70
|
-
// src/
|
|
71
|
-
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
72
|
-
import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
|
|
73
|
-
import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
74
|
-
|
|
75
|
-
// src/protocol/TransactionBoundWitness.ts
|
|
51
|
+
// src/transaction/TransactionBoundWitness.ts
|
|
76
52
|
import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
|
|
77
53
|
import { isBoundWitness } from "@xyo-network/boundwitness-model";
|
|
78
54
|
import { isStorageMeta } from "@xyo-network/payload-model";
|
|
@@ -91,7 +67,7 @@ var asOptionalTransactionBoundWitness = AsObjectFactory4.createOptional(isTransa
|
|
|
91
67
|
var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
|
|
92
68
|
var asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.createOptional(isTransactionBoundWitnessWithStorageMeta);
|
|
93
69
|
|
|
94
|
-
// src/
|
|
70
|
+
// src/block/AllowedBlockPayload.ts
|
|
95
71
|
var AllowedBlockPayloadSchemas = [
|
|
96
72
|
TransferSchema,
|
|
97
73
|
ChainStakeIntentSchema,
|
|
@@ -109,7 +85,7 @@ var isAllowedBlockPayloadWithHashStorageMeta = /* @__PURE__ */ __name((value) =>
|
|
|
109
85
|
return isAllowedBlockPayload(value) && isHashStorageMeta(value);
|
|
110
86
|
}, "isAllowedBlockPayloadWithHashStorageMeta");
|
|
111
87
|
|
|
112
|
-
// src/
|
|
88
|
+
// src/block/BlockBoundWitness.ts
|
|
113
89
|
import { isHex } from "@xylabs/hex";
|
|
114
90
|
import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
|
|
115
91
|
import { isBoundWitness as isBoundWitness2 } from "@xyo-network/boundwitness-model";
|
|
@@ -126,52 +102,64 @@ var asOptionalBlockBoundWitness = AsObjectFactory5.createOptional(isBlockBoundWi
|
|
|
126
102
|
var asBlockBoundWitnessWithStorageMeta = AsObjectFactory5.create(isBlockBoundWitnessWithStorageMeta);
|
|
127
103
|
var asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory5.createOptional(isBlockBoundWitnessWithStorageMeta);
|
|
128
104
|
|
|
129
|
-
// src/
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
105
|
+
// src/ethereum.ts
|
|
106
|
+
import { toHex } from "@xylabs/hex";
|
|
107
|
+
import { getAddress } from "ethers";
|
|
108
|
+
import { parseUnits } from "ethers/utils";
|
|
109
|
+
var getDefaultGasConfig = /* @__PURE__ */ __name(() => {
|
|
110
|
+
return {
|
|
111
|
+
gasLimit: 2e6,
|
|
112
|
+
gasPrice: parseUnits("100", "gwei")
|
|
113
|
+
};
|
|
114
|
+
}, "getDefaultGasConfig");
|
|
115
|
+
var ETH_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
116
|
+
var toEthAddress = /* @__PURE__ */ __name((value) => {
|
|
117
|
+
const address = typeof value === "object" ? value.address : value;
|
|
118
|
+
return getAddress(toHex(address, {
|
|
119
|
+
prefix: true,
|
|
120
|
+
bitLength: 160
|
|
121
|
+
}));
|
|
122
|
+
}, "toEthAddress");
|
|
139
123
|
|
|
140
|
-
// src/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
1103,
|
|
145
|
-
11576,
|
|
146
|
-
121551,
|
|
147
|
-
1276282,
|
|
148
|
-
13400956
|
|
149
|
-
];
|
|
124
|
+
// src/network/Status.ts
|
|
125
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType4 } from "@xyo-network/payload-model";
|
|
126
|
+
var NetworkStatusSchema = "network.xyo.chain.status";
|
|
127
|
+
var isNetworkStatus = isPayloadOfSchemaType4(NetworkStatusSchema);
|
|
150
128
|
|
|
151
129
|
// src/services/Chain/ChainIdentification.ts
|
|
152
|
-
import { isPayloadOfSchemaType as
|
|
130
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
|
|
153
131
|
var ChainIdentificationPayloadSchema = "network.xyo.chain.identification";
|
|
154
|
-
var isChainIdentificationPayload =
|
|
132
|
+
var isChainIdentificationPayload = isPayloadOfSchemaType5(ChainIdentificationPayloadSchema);
|
|
155
133
|
|
|
156
134
|
// src/services/Chain/ChainInformation.ts
|
|
157
|
-
import { isPayloadOfSchemaType as
|
|
135
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
|
|
158
136
|
var ChainInformationPayloadSchema = "network.xyo.chain.information";
|
|
159
|
-
var isChainInformationPayload =
|
|
137
|
+
var isChainInformationPayload = isPayloadOfSchemaType6(ChainInformationPayloadSchema);
|
|
160
138
|
|
|
161
139
|
// src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
|
|
162
|
-
import { AsObjectFactory as
|
|
163
|
-
import { isPayloadOfSchemaType as
|
|
140
|
+
import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
|
|
141
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType7, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
|
|
164
142
|
var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
|
|
165
143
|
var isChainIndexingServiceState = /* @__PURE__ */ __name((payload) => {
|
|
166
|
-
return
|
|
144
|
+
return isPayloadOfSchemaType7(ChainIndexingServiceStateSchema)(payload);
|
|
167
145
|
}, "isChainIndexingServiceState");
|
|
168
|
-
var asChainIndexingServiceState =
|
|
146
|
+
var asChainIndexingServiceState = AsObjectFactory6.create(isChainIndexingServiceState);
|
|
169
147
|
var isChainIndexingServiceStateWithStorageMeta = /* @__PURE__ */ __name((value) => isChainIndexingServiceState(value) && isStorageMeta3(value), "isChainIndexingServiceStateWithStorageMeta");
|
|
170
|
-
var asChainIndexingServiceStateWithStorageMeta =
|
|
171
|
-
var asOptionalChainIndexingServiceStateWithStorageMeta =
|
|
148
|
+
var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.create(isChainIndexingServiceStateWithStorageMeta);
|
|
149
|
+
var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.createOptional(isChainIndexingServiceStateWithStorageMeta);
|
|
150
|
+
|
|
151
|
+
// src/Steps.ts
|
|
152
|
+
var StepSizes = [
|
|
153
|
+
10,
|
|
154
|
+
105,
|
|
155
|
+
1103,
|
|
156
|
+
11576,
|
|
157
|
+
121551,
|
|
158
|
+
1276282,
|
|
159
|
+
13400956
|
|
160
|
+
];
|
|
172
161
|
export {
|
|
173
162
|
AllowedBlockPayloadSchemas,
|
|
174
|
-
BlockNumberSchema,
|
|
175
163
|
ChainIdentificationPayloadSchema,
|
|
176
164
|
ChainIndexingServiceStateSchema,
|
|
177
165
|
ChainInformationPayloadSchema,
|
|
@@ -183,8 +171,6 @@ export {
|
|
|
183
171
|
TransferSchema,
|
|
184
172
|
asBlockBoundWitness,
|
|
185
173
|
asBlockBoundWitnessWithStorageMeta,
|
|
186
|
-
asBlockNumber,
|
|
187
|
-
asBlockNumberWithSources,
|
|
188
174
|
asChainIndexingServiceState,
|
|
189
175
|
asChainIndexingServiceStateWithStorageMeta,
|
|
190
176
|
asChainStakeIntent,
|
|
@@ -193,8 +179,6 @@ export {
|
|
|
193
179
|
asHashPayloadWithStorageMeta,
|
|
194
180
|
asOptionalBlockBoundWitness,
|
|
195
181
|
asOptionalBlockBoundWitnessWithStorageMeta,
|
|
196
|
-
asOptionalBlockNumber,
|
|
197
|
-
asOptionalBlockNumberWithSources,
|
|
198
182
|
asOptionalChainIndexingServiceStateWithStorageMeta,
|
|
199
183
|
asOptionalChainStakeIntent,
|
|
200
184
|
asOptionalHashPayload,
|
|
@@ -211,8 +195,6 @@ export {
|
|
|
211
195
|
isAllowedBlockPayloadWithHashStorageMeta,
|
|
212
196
|
isBlockBoundWitness,
|
|
213
197
|
isBlockBoundWitnessWithStorageMeta,
|
|
214
|
-
isBlockNumber,
|
|
215
|
-
isBlockNumberWithSources,
|
|
216
198
|
isChainIdentificationPayload,
|
|
217
199
|
isChainIndexingServiceState,
|
|
218
200
|
isChainIndexingServiceStateWithStorageMeta,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ethereum.ts","../../src/network/Status.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/protocol/AllowedBlockPayload.ts","../../src/protocol/TransactionBoundWitness.ts","../../src/protocol/BlockBoundWitness.ts","../../src/protocol/BlockNumber.ts","../../src/protocol/Steps.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["import type { Hex } from '@xylabs/hex'\nimport { toHex } from '@xylabs/hex'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { getAddress } from 'ethers'\nimport { parseUnits } from 'ethers/utils'\n\nexport interface GasConfig {\n gasLimit?: number\n gasPrice?: bigint\n}\n\nexport const getDefaultGasConfig = (): GasConfig => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport type EthAddress = Hex\n\nexport const ETH_ZERO_ADDRESS: EthAddress = '0x0000000000000000000000000000000000000000' as const\n\nexport const toEthAddress = (value: bigint | string | AccountInstance): EthAddress => {\n const address = (typeof value === 'object') ? value.address : value\n return getAddress(toHex(address, { prefix: true, bitLength: 160 })) as EthAddress\n}\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../protocol/BlockDuration.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Record<Address, Hex>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type {\n FromFields,\n OptionalExecutable,\n} from '../payload/index.ts'\nimport type { BlockDuration } from './BlockDuration.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";;;;AACA,SAASA,aAAa;AAEtB,SAASC,kBAAkB;AAC3B,SAASC,kBAAkB;AAOpB,IAAMC,sBAAsB,6BAAA;AACjC,SAAO;IACLC,UAAU;IACVC,UAAUC,WAAW,OAAO,MAAA;EAC9B;AACF,GALmC;AAS5B,IAAMC,mBAA+B;AAErC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,QAAMC,UAAW,OAAOD,UAAU,WAAYA,MAAMC,UAAUD;AAC9D,SAAOE,WAAWC,MAAMF,SAAS;IAAEG,QAAQ;IAAMC,WAAW;EAAI,CAAA,CAAA;AAClE,GAH4B;;;ACrB5B,SAASC,6BAA6B;AAE/B,IAAMC,sBAAsB;AAmB5B,IAAMC,kBAAkBF,s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SAASC,yBAAAA,8BAA6B;AAE/B,IAAMC,mCAAmC;AAYzC,IAAMC,+BAA+BF,uBAAkDC,gCAAAA;;;ACf9F,SAASE,yBAAAA,8BAA6B;AAE/B,IAAMC,gCAAgC;AAgBtC,IAAMC,4BAA4BF,uBAA+CC,6BAAAA;;;ACjBxF,SAASE,mBAAAA,wBAAuB;AAEhC,SAASC,yBAAAA,wBAAuBC,iBAAAA,sBAAqB;AAiB9C,IAAMC,kCAAkC;AAWxC,IAAMC,8BAA8B,wBAAkCC,YAAAA;AAC3E,SAAOC,uBAAoDH,+BAAAA,EAAiCE,OAAAA;AAC9F,GAF2C;AAGpC,IAAME,8BAA8BC,iBAAgBC,OAA6CL,2BAAAA;AAEjG,IAAMM,6CACX,wBAAkCC,UAClCP,4BAA+BO,KAAAA,KAAUC,eAAcD,KAAAA,GADvD;AAGK,IAAME,6CACXL,iBAAgBC,OAAmDC,0CAAAA;AAE9D,IAAMI,qDACXN,iBAAgBO,eAA2DL,0CAAAA;","names":["toHex","getAddress","parseUnits","getDefaultGasConfig","gasLimit","gasPrice","parseUnits","ETH_ZERO_ADDRESS","toEthAddress","value","address","getAddress","toHex","prefix","bitLength","isPayloadOfSchemaType","NetworkStatusSchema","isNetworkStatus","AsObjectFactory","isPayloadOfSchemaType","ChainStakeIntentSchema","isChainStakeIntent","x","isPayloadOfSchemaType","asNonNegativeInteger","nbf","undefined","exp","asChainStakeIntent","AsObjectFactory","create","asOptionalChainStakeIntent","createOptional","num","Number","isInteger","isAnyPayload","hasFrom","value","from","undefined","isExecutable","isAnyPayload","Array","isArray","script","asExecutable","AsObjectFactory","isPayloadOfSchemaType","HashSchema","isHashPayload","asHashPayload","create","asHashPayloadWithStorageMeta","asOptionalHashPayload","createOptional","AsObjectFactory","isPayloadOfSchemaType","TransferSchema","isTransfer","asTransfer","create","asOptionalTransfer","createOptional","BoundWitnessSchema","isHashStorageMeta","isSchema","isSchemaPayload","SchemaSchema","AsObjectFactory","isBoundWitness","isStorageMeta","isTransactionBoundWitness","value","typedObj","isBoundWitness","chain","undefined","fees","exp","nbf","isSignedTransactionBoundWitness","isSigned","$signatures","length","addresses","isTransactionBoundWitnessWithStorageMeta","isStorageMeta","isSignedTransactionBoundWitnessWithStorageMeta","asTransactionBoundWitness","AsObjectFactory","create","asOptionalTransactionBoundWitness","createOptional","asTransactionBoundWitnessWithStorageMeta","asOptionalTransactionBoundWitnessWithStorageMeta","AllowedBlockPayloadSchemas","TransferSchema","ChainStakeIntentSchema","SchemaSchema","BoundWitnessSchema","HashSchema","isAllowedBlockPayloadSchema","value","isSchema","includes","isAllowedBlockPayload","isTransfer","isChainStakeIntent","isSchemaPayload","isTransactionBoundWitness","isHashPayload","isAllowedBlockPayloadWithHashStorageMeta","isHashStorageMeta","isHex","AsObjectFactory","isBoundWitness","isStorageMeta","isBlockBoundWitness","value","typedObj","isBoundWitness","Number","isInteger","block","isHex","chain","isBlockBoundWitnessWithStorageMeta","isStorageMeta","asBlockBoundWitness","AsObjectFactory","create","asOptionalBlockBoundWitness","createOptional","asBlockBoundWitnessWithStorageMeta","asOptionalBlockBoundWitnessWithStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","BlockNumberSchema","isBlockNumber","asBlockNumber","create","asOptionalBlockNumber","createOptional","isBlockNumberWithSources","asBlockNumberWithSources","asOptionalBlockNumberWithSources","StepSizes","isPayloadOfSchemaType","ChainIdentificationPayloadSchema","isChainIdentificationPayload","isPayloadOfSchemaType","ChainInformationPayloadSchema","isChainInformationPayload","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta","ChainIndexingServiceStateSchema","isChainIndexingServiceState","payload","isPayloadOfSchemaType","asChainIndexingServiceState","AsObjectFactory","create","isChainIndexingServiceStateWithStorageMeta","value","isStorageMeta","asChainIndexingServiceStateWithStorageMeta","asOptionalChainIndexingServiceStateWithStorageMeta","createOptional"]}
|
|
1
|
+
{"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/ethereum.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts","../../src/Steps.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '#payload'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '#payload'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '#transaction'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../BlockDuration.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Record<Address, Hex>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type {\n FromFields,\n OptionalExecutable,\n} from '#payload'\n\nimport type { BlockDuration } from '../BlockDuration.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","import type { Hex } from '@xylabs/hex'\nimport { toHex } from '@xylabs/hex'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { getAddress } from 'ethers'\nimport { parseUnits } from 'ethers/utils'\n\nexport interface GasConfig {\n gasLimit?: number\n gasPrice?: bigint\n}\n\nexport const getDefaultGasConfig = (): GasConfig => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport type EthAddress = Hex\n\nexport const ETH_ZERO_ADDRESS: EthAddress = '0x0000000000000000000000000000000000000000' as const\n\nexport const toEthAddress = (value: bigint | string | AccountInstance): EthAddress => {\n const address = (typeof value === 'object') ? value.address : value\n return getAddress(toHex(address, { prefix: true, bitLength: 160 })) as EthAddress\n}\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956]\n"],"mappings":";;;;AAAA,SAASA,0BAA0B;AAEn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BAA6B;AAE/B,IAAMC,mCAAmC;AAYzC,IAAMC,+BAA+BF,uBAAkDC,gCAAAA;;;ACf9F,SAASE,yBAAAA,8BAA6B;AAE/B,IAAMC,gCAAgC;AAgBtC,IAAMC,4BAA4BF,uBAA+CC,6BAAAA;;;ACjBxF,SAASE,mBAAAA,wBAAuB;AAEhC,SAASC,yBAAAA,wBAAuBC,iBAAAA,sBAAqB;AAiB9C,IAAMC,kCAAkC;AAWxC,IAAMC,8BAA8B,wBAAkCC,YAAAA;AAC3E,SAAOC,uBAAoDH,+BAAAA,EAAiCE,OAAAA;AAC9F,GAF2C;AAGpC,IAAME,8BAA8BC,iBAAgBC,OAA6CL,2BAAAA;AAEjG,IAAMM,6CACX,wBAAkCC,UAClCP,4BAA+BO,KAAAA,KAAUC,eAAcD,KAAAA,GADvD;AAGK,IAAME,6CACXL,iBAAgBC,OAAmDC,0CAAAA;AAE9D,IAAMI,qDACXN,iBAAgBO,eAA2DL,0CAAAA;;;AC7CtE,IAAMM,YAAY;EAAC;EAAI;EAAK;EAAM;EAAQ;EAAS;EAAW;;","names":["BoundWitnessSchema","isHashStorageMeta","isSchema","isSchemaPayload","SchemaSchema","AsObjectFactory","isPayloadOfSchemaType","ChainStakeIntentSchema","isChainStakeIntent","x","isPayloadOfSchemaType","asNonNegativeInteger","nbf","undefined","exp","asChainStakeIntent","AsObjectFactory","create","asOptionalChainStakeIntent","createOptional","num","Number","isInteger","isAnyPayload","hasFrom","value","from","undefined","isExecutable","isAnyPayload","Array","isArray","script","asExecutable","AsObjectFactory","isPayloadOfSchemaType","HashSchema","isHashPayload","asHashPayload","create","asHashPayloadWithStorageMeta","asOptionalHashPayload","createOptional","AsObjectFactory","isPayloadOfSchemaType","TransferSchema","isTransfer","asTransfer","create","asOptionalTransfer","createOptional","AsObjectFactory","isBoundWitness","isStorageMeta","isTransactionBoundWitness","value","typedObj","isBoundWitness","chain","undefined","fees","exp","nbf","isSignedTransactionBoundWitness","isSigned","$signatures","length","addresses","isTransactionBoundWitnessWithStorageMeta","isStorageMeta","isSignedTransactionBoundWitnessWithStorageMeta","asTransactionBoundWitness","AsObjectFactory","create","asOptionalTransactionBoundWitness","createOptional","asTransactionBoundWitnessWithStorageMeta","asOptionalTransactionBoundWitnessWithStorageMeta","AllowedBlockPayloadSchemas","TransferSchema","ChainStakeIntentSchema","SchemaSchema","BoundWitnessSchema","HashSchema","isAllowedBlockPayloadSchema","value","isSchema","includes","isAllowedBlockPayload","isTransfer","isChainStakeIntent","isSchemaPayload","isTransactionBoundWitness","isHashPayload","isAllowedBlockPayloadWithHashStorageMeta","isHashStorageMeta","isHex","AsObjectFactory","isBoundWitness","isStorageMeta","isBlockBoundWitness","value","typedObj","isBoundWitness","Number","isInteger","block","isHex","chain","isBlockBoundWitnessWithStorageMeta","isStorageMeta","asBlockBoundWitness","AsObjectFactory","create","asOptionalBlockBoundWitness","createOptional","asBlockBoundWitnessWithStorageMeta","asOptionalBlockBoundWitnessWithStorageMeta","toHex","getAddress","parseUnits","getDefaultGasConfig","gasLimit","gasPrice","parseUnits","ETH_ZERO_ADDRESS","toEthAddress","value","address","getAddress","toHex","prefix","bitLength","isPayloadOfSchemaType","NetworkStatusSchema","isNetworkStatus","isPayloadOfSchemaType","ChainIdentificationPayloadSchema","isChainIdentificationPayload","isPayloadOfSchemaType","ChainInformationPayloadSchema","isChainInformationPayload","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta","ChainIndexingServiceStateSchema","isChainIndexingServiceState","payload","isPayloadOfSchemaType","asChainIndexingServiceState","AsObjectFactory","create","isChainIndexingServiceStateWithStorageMeta","value","isStorageMeta","asChainIndexingServiceStateWithStorageMeta","asOptionalChainIndexingServiceStateWithStorageMeta","createOptional","StepSizes"]}
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
var getDefaultGasConfig = /* @__PURE__ */ __name(() => {
|
|
9
|
-
return {
|
|
10
|
-
gasLimit: 2e6,
|
|
11
|
-
gasPrice: parseUnits("100", "gwei")
|
|
12
|
-
};
|
|
13
|
-
}, "getDefaultGasConfig");
|
|
14
|
-
var ETH_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
15
|
-
var toEthAddress = /* @__PURE__ */ __name((value) => {
|
|
16
|
-
const address = typeof value === "object" ? value.address : value;
|
|
17
|
-
return getAddress(toHex(address, {
|
|
18
|
-
prefix: true,
|
|
19
|
-
bitLength: 160
|
|
20
|
-
}));
|
|
21
|
-
}, "toEthAddress");
|
|
22
|
-
|
|
23
|
-
// src/network/Status.ts
|
|
24
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
25
|
-
var NetworkStatusSchema = "network.xyo.chain.status";
|
|
26
|
-
var isNetworkStatus = isPayloadOfSchemaType(NetworkStatusSchema);
|
|
4
|
+
// src/block/AllowedBlockPayload.ts
|
|
5
|
+
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
6
|
+
import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
|
|
7
|
+
import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
27
8
|
|
|
28
9
|
// src/payload/elevatable/ChainStakeIntent.ts
|
|
29
10
|
import { AsObjectFactory } from "@xylabs/object";
|
|
30
|
-
import { isPayloadOfSchemaType
|
|
11
|
+
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
31
12
|
var ChainStakeIntentSchema = "network.xyo.chain.stake.intent";
|
|
32
13
|
var isChainStakeIntent = /* @__PURE__ */ __name((x) => {
|
|
33
|
-
return
|
|
14
|
+
return isPayloadOfSchemaType(ChainStakeIntentSchema)(x) && asNonNegativeInteger(x.nbf) !== void 0 && asNonNegativeInteger(x.exp) !== void 0;
|
|
34
15
|
}, "isChainStakeIntent");
|
|
35
16
|
var asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent);
|
|
36
17
|
var asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent);
|
|
@@ -52,27 +33,22 @@ var asExecutable = /* @__PURE__ */ __name((value) => {
|
|
|
52
33
|
|
|
53
34
|
// src/payload/elevatable/Hash.ts
|
|
54
35
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/object";
|
|
55
|
-
import { isPayloadOfSchemaType as
|
|
36
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
|
|
56
37
|
var HashSchema = "network.xyo.hash";
|
|
57
|
-
var isHashPayload =
|
|
38
|
+
var isHashPayload = isPayloadOfSchemaType2(HashSchema);
|
|
58
39
|
var asHashPayload = AsObjectFactory2.create(isHashPayload);
|
|
59
40
|
var asHashPayloadWithStorageMeta = AsObjectFactory2.create(isHashPayload);
|
|
60
41
|
var asOptionalHashPayload = AsObjectFactory2.createOptional(isHashPayload);
|
|
61
42
|
|
|
62
43
|
// src/payload/elevatable/TransferPayload.ts
|
|
63
44
|
import { AsObjectFactory as AsObjectFactory3 } from "@xylabs/object";
|
|
64
|
-
import { isPayloadOfSchemaType as
|
|
45
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType3 } from "@xyo-network/payload-model";
|
|
65
46
|
var TransferSchema = "network.xyo.transfer";
|
|
66
|
-
var isTransfer =
|
|
47
|
+
var isTransfer = isPayloadOfSchemaType3(TransferSchema);
|
|
67
48
|
var asTransfer = AsObjectFactory3.create(isTransfer);
|
|
68
49
|
var asOptionalTransfer = AsObjectFactory3.createOptional(isTransfer);
|
|
69
50
|
|
|
70
|
-
// src/
|
|
71
|
-
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
72
|
-
import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
|
|
73
|
-
import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
74
|
-
|
|
75
|
-
// src/protocol/TransactionBoundWitness.ts
|
|
51
|
+
// src/transaction/TransactionBoundWitness.ts
|
|
76
52
|
import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
|
|
77
53
|
import { isBoundWitness } from "@xyo-network/boundwitness-model";
|
|
78
54
|
import { isStorageMeta } from "@xyo-network/payload-model";
|
|
@@ -91,7 +67,7 @@ var asOptionalTransactionBoundWitness = AsObjectFactory4.createOptional(isTransa
|
|
|
91
67
|
var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
|
|
92
68
|
var asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.createOptional(isTransactionBoundWitnessWithStorageMeta);
|
|
93
69
|
|
|
94
|
-
// src/
|
|
70
|
+
// src/block/AllowedBlockPayload.ts
|
|
95
71
|
var AllowedBlockPayloadSchemas = [
|
|
96
72
|
TransferSchema,
|
|
97
73
|
ChainStakeIntentSchema,
|
|
@@ -109,7 +85,7 @@ var isAllowedBlockPayloadWithHashStorageMeta = /* @__PURE__ */ __name((value) =>
|
|
|
109
85
|
return isAllowedBlockPayload(value) && isHashStorageMeta(value);
|
|
110
86
|
}, "isAllowedBlockPayloadWithHashStorageMeta");
|
|
111
87
|
|
|
112
|
-
// src/
|
|
88
|
+
// src/block/BlockBoundWitness.ts
|
|
113
89
|
import { isHex } from "@xylabs/hex";
|
|
114
90
|
import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
|
|
115
91
|
import { isBoundWitness as isBoundWitness2 } from "@xyo-network/boundwitness-model";
|
|
@@ -126,52 +102,64 @@ var asOptionalBlockBoundWitness = AsObjectFactory5.createOptional(isBlockBoundWi
|
|
|
126
102
|
var asBlockBoundWitnessWithStorageMeta = AsObjectFactory5.create(isBlockBoundWitnessWithStorageMeta);
|
|
127
103
|
var asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory5.createOptional(isBlockBoundWitnessWithStorageMeta);
|
|
128
104
|
|
|
129
|
-
// src/
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
105
|
+
// src/ethereum.ts
|
|
106
|
+
import { toHex } from "@xylabs/hex";
|
|
107
|
+
import { getAddress } from "ethers";
|
|
108
|
+
import { parseUnits } from "ethers/utils";
|
|
109
|
+
var getDefaultGasConfig = /* @__PURE__ */ __name(() => {
|
|
110
|
+
return {
|
|
111
|
+
gasLimit: 2e6,
|
|
112
|
+
gasPrice: parseUnits("100", "gwei")
|
|
113
|
+
};
|
|
114
|
+
}, "getDefaultGasConfig");
|
|
115
|
+
var ETH_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
116
|
+
var toEthAddress = /* @__PURE__ */ __name((value) => {
|
|
117
|
+
const address = typeof value === "object" ? value.address : value;
|
|
118
|
+
return getAddress(toHex(address, {
|
|
119
|
+
prefix: true,
|
|
120
|
+
bitLength: 160
|
|
121
|
+
}));
|
|
122
|
+
}, "toEthAddress");
|
|
139
123
|
|
|
140
|
-
// src/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
1103,
|
|
145
|
-
11576,
|
|
146
|
-
121551,
|
|
147
|
-
1276282,
|
|
148
|
-
13400956
|
|
149
|
-
];
|
|
124
|
+
// src/network/Status.ts
|
|
125
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType4 } from "@xyo-network/payload-model";
|
|
126
|
+
var NetworkStatusSchema = "network.xyo.chain.status";
|
|
127
|
+
var isNetworkStatus = isPayloadOfSchemaType4(NetworkStatusSchema);
|
|
150
128
|
|
|
151
129
|
// src/services/Chain/ChainIdentification.ts
|
|
152
|
-
import { isPayloadOfSchemaType as
|
|
130
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
|
|
153
131
|
var ChainIdentificationPayloadSchema = "network.xyo.chain.identification";
|
|
154
|
-
var isChainIdentificationPayload =
|
|
132
|
+
var isChainIdentificationPayload = isPayloadOfSchemaType5(ChainIdentificationPayloadSchema);
|
|
155
133
|
|
|
156
134
|
// src/services/Chain/ChainInformation.ts
|
|
157
|
-
import { isPayloadOfSchemaType as
|
|
135
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
|
|
158
136
|
var ChainInformationPayloadSchema = "network.xyo.chain.information";
|
|
159
|
-
var isChainInformationPayload =
|
|
137
|
+
var isChainInformationPayload = isPayloadOfSchemaType6(ChainInformationPayloadSchema);
|
|
160
138
|
|
|
161
139
|
// src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
|
|
162
|
-
import { AsObjectFactory as
|
|
163
|
-
import { isPayloadOfSchemaType as
|
|
140
|
+
import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
|
|
141
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType7, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
|
|
164
142
|
var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
|
|
165
143
|
var isChainIndexingServiceState = /* @__PURE__ */ __name((payload) => {
|
|
166
|
-
return
|
|
144
|
+
return isPayloadOfSchemaType7(ChainIndexingServiceStateSchema)(payload);
|
|
167
145
|
}, "isChainIndexingServiceState");
|
|
168
|
-
var asChainIndexingServiceState =
|
|
146
|
+
var asChainIndexingServiceState = AsObjectFactory6.create(isChainIndexingServiceState);
|
|
169
147
|
var isChainIndexingServiceStateWithStorageMeta = /* @__PURE__ */ __name((value) => isChainIndexingServiceState(value) && isStorageMeta3(value), "isChainIndexingServiceStateWithStorageMeta");
|
|
170
|
-
var asChainIndexingServiceStateWithStorageMeta =
|
|
171
|
-
var asOptionalChainIndexingServiceStateWithStorageMeta =
|
|
148
|
+
var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.create(isChainIndexingServiceStateWithStorageMeta);
|
|
149
|
+
var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory6.createOptional(isChainIndexingServiceStateWithStorageMeta);
|
|
150
|
+
|
|
151
|
+
// src/Steps.ts
|
|
152
|
+
var StepSizes = [
|
|
153
|
+
10,
|
|
154
|
+
105,
|
|
155
|
+
1103,
|
|
156
|
+
11576,
|
|
157
|
+
121551,
|
|
158
|
+
1276282,
|
|
159
|
+
13400956
|
|
160
|
+
];
|
|
172
161
|
export {
|
|
173
162
|
AllowedBlockPayloadSchemas,
|
|
174
|
-
BlockNumberSchema,
|
|
175
163
|
ChainIdentificationPayloadSchema,
|
|
176
164
|
ChainIndexingServiceStateSchema,
|
|
177
165
|
ChainInformationPayloadSchema,
|
|
@@ -183,8 +171,6 @@ export {
|
|
|
183
171
|
TransferSchema,
|
|
184
172
|
asBlockBoundWitness,
|
|
185
173
|
asBlockBoundWitnessWithStorageMeta,
|
|
186
|
-
asBlockNumber,
|
|
187
|
-
asBlockNumberWithSources,
|
|
188
174
|
asChainIndexingServiceState,
|
|
189
175
|
asChainIndexingServiceStateWithStorageMeta,
|
|
190
176
|
asChainStakeIntent,
|
|
@@ -193,8 +179,6 @@ export {
|
|
|
193
179
|
asHashPayloadWithStorageMeta,
|
|
194
180
|
asOptionalBlockBoundWitness,
|
|
195
181
|
asOptionalBlockBoundWitnessWithStorageMeta,
|
|
196
|
-
asOptionalBlockNumber,
|
|
197
|
-
asOptionalBlockNumberWithSources,
|
|
198
182
|
asOptionalChainIndexingServiceStateWithStorageMeta,
|
|
199
183
|
asOptionalChainStakeIntent,
|
|
200
184
|
asOptionalHashPayload,
|
|
@@ -211,8 +195,6 @@ export {
|
|
|
211
195
|
isAllowedBlockPayloadWithHashStorageMeta,
|
|
212
196
|
isBlockBoundWitness,
|
|
213
197
|
isBlockBoundWitnessWithStorageMeta,
|
|
214
|
-
isBlockNumber,
|
|
215
|
-
isBlockNumberWithSources,
|
|
216
198
|
isChainIdentificationPayload,
|
|
217
199
|
isChainIndexingServiceState,
|
|
218
200
|
isChainIndexingServiceStateWithStorageMeta,
|