@xyo-network/xl1-protocol 1.12.23 → 1.12.25
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/block/AllowedBlockPayload.d.ts.map +1 -1
- package/dist/neutral/constants/defaultRewardRatio.d.ts +1 -1
- package/dist/neutral/constants/defaultRewardRatio.d.ts.map +1 -1
- package/dist/neutral/index.mjs +73 -98
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/interfaces/view/index.d.ts +0 -1
- package/dist/neutral/interfaces/view/index.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Time.d.ts +12 -4
- package/dist/neutral/payload/elevatable/Time.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/index.d.ts +0 -3
- package/dist/neutral/payload/elevatable/index.d.ts.map +1 -1
- package/dist/neutral/services/index.d.ts +0 -1
- package/dist/neutral/services/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/block/AllowedBlockPayload.ts +1 -2
- package/src/constants/defaultRewardRatio.ts +1 -1
- package/src/interfaces/view/index.ts +0 -1
- package/src/payload/elevatable/Time.ts +24 -6
- package/src/payload/elevatable/index.ts +0 -3
- package/src/services/index.ts +0 -1
- package/dist/neutral/interfaces/view/Bridge.d.ts +0 -9
- package/dist/neutral/interfaces/view/Bridge.d.ts.map +0 -1
- package/dist/neutral/payload/elevatable/BridgeBack.d.ts +0 -15
- package/dist/neutral/payload/elevatable/BridgeBack.d.ts.map +0 -1
- package/dist/neutral/payload/elevatable/BridgeComplete.d.ts +0 -13
- package/dist/neutral/payload/elevatable/BridgeComplete.d.ts.map +0 -1
- package/dist/neutral/payload/elevatable/BridgeRequest.d.ts +0 -15
- package/dist/neutral/payload/elevatable/BridgeRequest.d.ts.map +0 -1
- package/dist/neutral/services/BridgeService.d.ts +0 -5
- package/dist/neutral/services/BridgeService.d.ts.map +0 -1
- package/src/interfaces/view/Bridge.ts +0 -13
- package/src/payload/elevatable/BridgeBack.ts +0 -26
- package/src/payload/elevatable/BridgeComplete.ts +0 -24
- package/src/payload/elevatable/BridgeRequest.ts +0 -30
- package/src/services/BridgeService.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllowedBlockPayload.d.ts","sourceRoot":"","sources":["../../../src/block/AllowedBlockPayload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EACV,4BAA4B,EAAE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EACxI,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EAA6B,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEjG,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACN,4BAA4B,GAC5B,YAAY,GACZ,uBAAuB,GACvB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,WAAW,GACX,uBAAuB,CAAA;AAE7B,eAAO,MAAM,0BAA0B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AllowedBlockPayload.d.ts","sourceRoot":"","sources":["../../../src/block/AllowedBlockPayload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EACV,4BAA4B,EAAE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EACxI,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EAA6B,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEjG,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACN,4BAA4B,GAC5B,YAAY,GACZ,uBAAuB,GACvB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,WAAW,GACX,uBAAuB,CAAA;AAE7B,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAW9C,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAA;AAEjF,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,yBAErE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,mBAU/D,CAAA;AAED,eAAO,MAAM,wCAAwC,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,eAAe,CAAC,mBAAmB,CAErH,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;mBAA2D,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const defaultRewardRatio: 0.
|
|
1
|
+
export declare const defaultRewardRatio: 0.05;
|
|
2
2
|
//# sourceMappingURL=defaultRewardRatio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultRewardRatio.d.ts","sourceRoot":"","sources":["../../../src/constants/defaultRewardRatio.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAG,
|
|
1
|
+
{"version":3,"file":"defaultRewardRatio.d.ts","sourceRoot":"","sources":["../../../src/constants/defaultRewardRatio.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAG,IAAa,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -25,35 +25,14 @@ var BridgeSourceObservationSchema = "network.xyo.chain.bridge.observation.source
|
|
|
25
25
|
var isBridgeSourceObservation = isPayloadOfSchemaType3(BridgeSourceObservationSchema);
|
|
26
26
|
var asBridgeSourceObservation = AsObjectFactory3.create(isBridgeSourceObservation);
|
|
27
27
|
|
|
28
|
-
// src/payload/elevatable/BridgeBack.ts
|
|
29
|
-
import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
|
|
30
|
-
import { isPayloadOfSchemaType as isPayloadOfSchemaType4 } from "@xyo-network/payload-model";
|
|
31
|
-
var BridgeBackSchema = "network.xyo.chain.bridge.back";
|
|
32
|
-
var isBridgeBack = isPayloadOfSchemaType4(BridgeBackSchema);
|
|
33
|
-
var asBridgeBack = AsObjectFactory4.create(isBridgeBack);
|
|
34
|
-
|
|
35
|
-
// src/payload/elevatable/BridgeComplete.ts
|
|
36
|
-
import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
|
|
37
|
-
import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
|
|
38
|
-
var BridgeCompleteSchema = "network.xyo.chain.bridge.complete";
|
|
39
|
-
var isBridgeComplete = isPayloadOfSchemaType5(BridgeCompleteSchema);
|
|
40
|
-
var asBridgeComplete = AsObjectFactory5.create(isBridgeComplete);
|
|
41
|
-
|
|
42
|
-
// src/payload/elevatable/BridgeRequest.ts
|
|
43
|
-
import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
|
|
44
|
-
import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
|
|
45
|
-
var BridgeRequestSchema = "network.xyo.chain.bridge.request";
|
|
46
|
-
var isBridgeRequest = isPayloadOfSchemaType6(BridgeRequestSchema);
|
|
47
|
-
var asBridgeRequest = AsObjectFactory6.create(isBridgeRequest);
|
|
48
|
-
|
|
49
28
|
// src/payload/elevatable/ChainStakeIntent.ts
|
|
50
|
-
import { AsObjectFactory as
|
|
51
|
-
import { isPayloadOfSchemaType as
|
|
29
|
+
import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
|
|
30
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType4, isStorageMeta } from "@xyo-network/payload-model";
|
|
52
31
|
var ChainStakeIntentSchema = "network.xyo.chain.stake.intent";
|
|
53
32
|
var isChainStakeIntent = (x) => {
|
|
54
|
-
return
|
|
33
|
+
return isPayloadOfSchemaType4(ChainStakeIntentSchema)(x) && asNonNegativeInteger(x.nbf) !== void 0 && asNonNegativeInteger(x.exp) !== void 0;
|
|
55
34
|
};
|
|
56
|
-
var asChainStakeIntent =
|
|
35
|
+
var asChainStakeIntent = AsObjectFactory4.create(isChainStakeIntent);
|
|
57
36
|
var isChainStakeIntentWithStorageMeta = (x) => {
|
|
58
37
|
return isChainStakeIntent(x) && isStorageMeta(x);
|
|
59
38
|
};
|
|
@@ -74,40 +53,45 @@ var asExecutable = (value) => {
|
|
|
74
53
|
};
|
|
75
54
|
|
|
76
55
|
// src/payload/elevatable/Hash.ts
|
|
77
|
-
import { AsObjectFactory as
|
|
78
|
-
import { isPayloadOfSchemaType as
|
|
56
|
+
import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
|
|
57
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
|
|
79
58
|
var HashSchema = "network.xyo.hash";
|
|
80
|
-
var isHashPayload =
|
|
81
|
-
var asHashPayload =
|
|
82
|
-
var asHashPayloadWithStorageMeta =
|
|
59
|
+
var isHashPayload = isPayloadOfSchemaType5(HashSchema);
|
|
60
|
+
var asHashPayload = AsObjectFactory5.create(isHashPayload);
|
|
61
|
+
var asHashPayloadWithStorageMeta = AsObjectFactory5.create(isHashPayload);
|
|
83
62
|
|
|
84
63
|
// src/payload/elevatable/StepComplete.ts
|
|
85
|
-
import { AsObjectFactory as
|
|
86
|
-
import { isPayloadOfSchemaType as
|
|
64
|
+
import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
|
|
65
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType6 } from "@xyo-network/payload-model";
|
|
87
66
|
var StepCompleteSchema = "network.xyo.chain.step.complete";
|
|
88
|
-
var isStepComplete =
|
|
89
|
-
var asStepComplete =
|
|
67
|
+
var isStepComplete = isPayloadOfSchemaType6(StepCompleteSchema);
|
|
68
|
+
var asStepComplete = AsObjectFactory6.create(isStepComplete);
|
|
90
69
|
|
|
91
70
|
// src/payload/elevatable/Time.ts
|
|
92
|
-
import { AsObjectFactory as
|
|
93
|
-
import { isPayloadOfSchemaType as
|
|
71
|
+
import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
|
|
72
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
|
|
94
73
|
var TimeSchema = "network.xyo.time";
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
74
|
+
var isSafeEpoch = (value) => {
|
|
75
|
+
return typeof value === "number" && value < 2 * Date.now();
|
|
76
|
+
};
|
|
77
|
+
var isTimePayload = (value) => {
|
|
78
|
+
return isPayloadOfSchemaType7(TimeSchema)(value) && isSafeEpoch(value.epoch);
|
|
79
|
+
};
|
|
80
|
+
var asTimePayload = AsObjectFactory7.create(isTimePayload);
|
|
81
|
+
var asTimePayloadWithStorageMeta = AsObjectFactory7.create(isTimePayload);
|
|
98
82
|
|
|
99
83
|
// src/payload/elevatable/TransferPayload.ts
|
|
100
|
-
import { AsObjectFactory as
|
|
101
|
-
import { isPayloadOfSchemaType as
|
|
84
|
+
import { AsObjectFactory as AsObjectFactory8 } from "@xylabs/object";
|
|
85
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType8 } from "@xyo-network/payload-model";
|
|
102
86
|
var TransferSchema = "network.xyo.transfer";
|
|
103
|
-
var isTransfer =
|
|
104
|
-
var asTransfer =
|
|
87
|
+
var isTransfer = isPayloadOfSchemaType8(TransferSchema);
|
|
88
|
+
var asTransfer = AsObjectFactory8.create(isTransfer);
|
|
105
89
|
|
|
106
90
|
// src/transaction/AnyHydratedTransaction.ts
|
|
107
|
-
import { AsObjectFactory as
|
|
91
|
+
import { AsObjectFactory as AsObjectFactory11 } from "@xylabs/object";
|
|
108
92
|
|
|
109
93
|
// src/isHydratedBoundWitness.ts
|
|
110
|
-
import { AsObjectFactory as
|
|
94
|
+
import { AsObjectFactory as AsObjectFactory9 } from "@xylabs/object";
|
|
111
95
|
import { isBoundWitness } from "@xyo-network/boundwitness-model";
|
|
112
96
|
import { isAnyPayload as isAnyPayload2, isStorageMeta as isStorageMeta2 } from "@xyo-network/payload-model";
|
|
113
97
|
var isHydratedBoundWitness = (value) => {
|
|
@@ -116,10 +100,10 @@ var isHydratedBoundWitness = (value) => {
|
|
|
116
100
|
var isHydratedBoundWitnessWithStorageMeta = (value) => {
|
|
117
101
|
return isHydratedBoundWitness(value) && isStorageMeta2(value[0]) && !value[1].some((item) => !isStorageMeta2(item));
|
|
118
102
|
};
|
|
119
|
-
var asHydratedBoundWitness =
|
|
103
|
+
var asHydratedBoundWitness = AsObjectFactory9.create(
|
|
120
104
|
isHydratedBoundWitness
|
|
121
105
|
);
|
|
122
|
-
var asHydratedBoundWitnessWithStorageMeta =
|
|
106
|
+
var asHydratedBoundWitnessWithStorageMeta = AsObjectFactory9.create(
|
|
123
107
|
isHydratedBoundWitnessWithStorageMeta
|
|
124
108
|
);
|
|
125
109
|
|
|
@@ -127,24 +111,24 @@ var asHydratedBoundWitnessWithStorageMeta = AsObjectFactory12.create(
|
|
|
127
111
|
import {
|
|
128
112
|
isAddress
|
|
129
113
|
} from "@xylabs/hex";
|
|
130
|
-
import { AsObjectFactory as
|
|
114
|
+
import { AsObjectFactory as AsObjectFactory10 } from "@xylabs/object";
|
|
131
115
|
import { isBoundWitness as isBoundWitness2 } from "@xyo-network/boundwitness-model";
|
|
132
116
|
var isTransactionBoundWitness = (value) => {
|
|
133
117
|
const typedObj = value;
|
|
134
118
|
return isBoundWitness2(value) && isAddress(typedObj.chain) && typedObj.fees !== void 0 && typedObj.exp !== void 0 && typedObj.nbf !== void 0;
|
|
135
119
|
};
|
|
136
|
-
var asTransactionBoundWitness =
|
|
120
|
+
var asTransactionBoundWitness = AsObjectFactory10.create(isTransactionBoundWitness);
|
|
137
121
|
|
|
138
122
|
// src/transaction/AnyHydratedTransaction.ts
|
|
139
123
|
var isAnyHydratedTransaction = (value) => {
|
|
140
124
|
return isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0]);
|
|
141
125
|
};
|
|
142
|
-
var asAnyHydratedTransaction =
|
|
126
|
+
var asAnyHydratedTransaction = AsObjectFactory11.create(
|
|
143
127
|
isAnyHydratedTransaction
|
|
144
128
|
);
|
|
145
129
|
|
|
146
130
|
// src/transaction/HydratedTransaction.ts
|
|
147
|
-
import { AsObjectFactory as
|
|
131
|
+
import { AsObjectFactory as AsObjectFactory12 } from "@xylabs/object";
|
|
148
132
|
import { isSigned } from "@xyo-network/boundwitness-model";
|
|
149
133
|
import {
|
|
150
134
|
isStorageMeta as isStorageMeta3
|
|
@@ -152,47 +136,47 @@ import {
|
|
|
152
136
|
var isHydratedTransaction = (value) => {
|
|
153
137
|
return isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0]) && isSigned(value[0]) && isStorageMeta3(value[0]);
|
|
154
138
|
};
|
|
155
|
-
var asHydratedTransaction =
|
|
139
|
+
var asHydratedTransaction = AsObjectFactory12.create(
|
|
156
140
|
// eslint-disable-next-line sonarjs/deprecation
|
|
157
141
|
isHydratedTransaction
|
|
158
142
|
);
|
|
159
143
|
|
|
160
144
|
// src/transaction/HydratedTransactionWithStorageMeta.ts
|
|
161
|
-
import { AsObjectFactory as
|
|
145
|
+
import { AsObjectFactory as AsObjectFactory13 } from "@xylabs/object";
|
|
162
146
|
import {
|
|
163
147
|
isStorageMeta as isStorageMeta4
|
|
164
148
|
} from "@xyo-network/payload-model";
|
|
165
149
|
var isHydratedTransactionWithStorageMeta = (value) => {
|
|
166
150
|
return isAnyHydratedTransaction(value) && isStorageMeta4(value[0]) && !value[1].some((v) => !isStorageMeta4(v));
|
|
167
151
|
};
|
|
168
|
-
var asHydratedTransactionWithStorageMeta =
|
|
152
|
+
var asHydratedTransactionWithStorageMeta = AsObjectFactory13.create(
|
|
169
153
|
isHydratedTransactionWithStorageMeta
|
|
170
154
|
);
|
|
171
155
|
|
|
172
156
|
// src/transaction/SignedHydratedTransaction.ts
|
|
173
|
-
import { AsObjectFactory as
|
|
157
|
+
import { AsObjectFactory as AsObjectFactory14 } from "@xylabs/object";
|
|
174
158
|
import { isSigned as isSigned2 } from "@xyo-network/boundwitness-model";
|
|
175
159
|
var isSignedHydratedTransaction = (value) => {
|
|
176
160
|
return isAnyHydratedTransaction(value) && isSigned2(value[0]);
|
|
177
161
|
};
|
|
178
|
-
var asSignedHydratedTransaction =
|
|
162
|
+
var asSignedHydratedTransaction = AsObjectFactory14.create(
|
|
179
163
|
isSignedHydratedTransaction
|
|
180
164
|
);
|
|
181
165
|
|
|
182
166
|
// src/transaction/SignedHydratedTransactionWithStorageMeta.ts
|
|
183
|
-
import { AsObjectFactory as
|
|
167
|
+
import { AsObjectFactory as AsObjectFactory15 } from "@xylabs/object";
|
|
184
168
|
import {
|
|
185
169
|
isStorageMeta as isStorageMeta5
|
|
186
170
|
} from "@xyo-network/payload-model";
|
|
187
171
|
var isSignedHydratedTransactionWithStorageMeta = (value) => {
|
|
188
172
|
return isSignedHydratedTransaction(value) && isStorageMeta5(value[0]) && !value[1].some((v) => !isStorageMeta5(v));
|
|
189
173
|
};
|
|
190
|
-
var asSignedHydratedTransactionWithStorageMeta =
|
|
174
|
+
var asSignedHydratedTransactionWithStorageMeta = AsObjectFactory15.create(
|
|
191
175
|
isSignedHydratedTransactionWithStorageMeta
|
|
192
176
|
);
|
|
193
177
|
|
|
194
178
|
// src/transaction/TransactionBoundWitnessDeprecated.ts
|
|
195
|
-
import { AsObjectFactory as
|
|
179
|
+
import { AsObjectFactory as AsObjectFactory16 } from "@xylabs/object";
|
|
196
180
|
import { isSigned as isSigned3 } from "@xyo-network/boundwitness-model";
|
|
197
181
|
import { isHashStorageMeta, isStorageMeta as isStorageMeta6 } from "@xyo-network/payload-model";
|
|
198
182
|
var isSignedTransactionBoundWitness = (value) => {
|
|
@@ -202,12 +186,12 @@ var isTransactionBoundWitnessWithStorageMeta = (value) => isTransactionBoundWitn
|
|
|
202
186
|
var isTransactionBoundWitnessWithHashStorageMeta = (value) => isTransactionBoundWitness(value) && isHashStorageMeta(value);
|
|
203
187
|
var isSignedTransactionBoundWitnessWithStorageMeta = (value) => isSignedTransactionBoundWitness(value) && isStorageMeta6(value);
|
|
204
188
|
var isSignedTransactionBoundWitnessWithHashStorageMeta = (value) => isSignedTransactionBoundWitness(value) && isHashStorageMeta(value);
|
|
205
|
-
var asTransactionBoundWitnessWithStorageMeta =
|
|
206
|
-
var asTransactionBoundWitnessWithHashStorageMeta =
|
|
189
|
+
var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory16.create(isTransactionBoundWitnessWithStorageMeta);
|
|
190
|
+
var asTransactionBoundWitnessWithHashStorageMeta = AsObjectFactory16.create(isTransactionBoundWitnessWithHashStorageMeta);
|
|
207
191
|
|
|
208
192
|
// src/transaction/TransactionFeesFields.ts
|
|
209
193
|
import { isHex } from "@xylabs/hex";
|
|
210
|
-
import { AsObjectFactory as
|
|
194
|
+
import { AsObjectFactory as AsObjectFactory17 } from "@xylabs/object";
|
|
211
195
|
import { isObject } from "@xylabs/typeof";
|
|
212
196
|
|
|
213
197
|
// src/xl1/isXL1Factory.ts
|
|
@@ -343,7 +327,7 @@ var isTransactionFeesBigInt = (value) => {
|
|
|
343
327
|
} = value;
|
|
344
328
|
return isAttoXL1(base) && isAttoXL1(gasLimit) && isAttoXL1(gasPrice) && isAttoXL1(priority);
|
|
345
329
|
};
|
|
346
|
-
var asTransactionFeesBigInt =
|
|
330
|
+
var asTransactionFeesBigInt = AsObjectFactory17.create(
|
|
347
331
|
isTransactionFeesBigInt
|
|
348
332
|
);
|
|
349
333
|
var isTransactionFeesHex = (value) => {
|
|
@@ -358,17 +342,17 @@ var isTransactionFeesHex = (value) => {
|
|
|
358
342
|
} = value;
|
|
359
343
|
return isHex(base) && isHex(gasLimit) && isHex(gasPrice) && isHex(priority);
|
|
360
344
|
};
|
|
361
|
-
var asTransactionFeesHex =
|
|
345
|
+
var asTransactionFeesHex = AsObjectFactory17.create(
|
|
362
346
|
isTransactionFeesHex
|
|
363
347
|
);
|
|
364
348
|
|
|
365
349
|
// src/transaction/UnsignedHydratedTransaction.ts
|
|
366
|
-
import { AsObjectFactory as
|
|
350
|
+
import { AsObjectFactory as AsObjectFactory18 } from "@xylabs/object";
|
|
367
351
|
import { isUnsigned } from "@xyo-network/boundwitness-model";
|
|
368
352
|
var isUnsignedHydratedTransaction = (value) => {
|
|
369
353
|
return isAnyHydratedTransaction(value) && isUnsigned(value[0]);
|
|
370
354
|
};
|
|
371
|
-
var asUnsignedHydratedTransaction =
|
|
355
|
+
var asUnsignedHydratedTransaction = AsObjectFactory18.create(
|
|
372
356
|
isUnsignedHydratedTransaction
|
|
373
357
|
);
|
|
374
358
|
|
|
@@ -377,7 +361,6 @@ var AllowedBlockPayloadSchemas = [
|
|
|
377
361
|
BoundWitnessSchema,
|
|
378
362
|
BridgeDestinationObservationSchema,
|
|
379
363
|
BridgeIntentSchema,
|
|
380
|
-
BridgeRequestSchema,
|
|
381
364
|
BridgeSourceObservationSchema,
|
|
382
365
|
ChainStakeIntentSchema,
|
|
383
366
|
HashSchema,
|
|
@@ -399,7 +382,7 @@ var AllowedBlockPayloadZod = z2.object({ schema: z2.enum(AllowedBlockPayloadSche
|
|
|
399
382
|
|
|
400
383
|
// src/block/BlockBoundWitness.ts
|
|
401
384
|
import { isHex as isHex2 } from "@xylabs/hex";
|
|
402
|
-
import { AsObjectFactory as
|
|
385
|
+
import { AsObjectFactory as AsObjectFactory19 } from "@xylabs/object";
|
|
403
386
|
import { isBoundWitness as isBoundWitness3, isSigned as isSigned4 } from "@xyo-network/boundwitness-model";
|
|
404
387
|
import { isHashStorageMeta as isHashStorageMeta3, isStorageMeta as isStorageMeta7 } from "@xyo-network/payload-model";
|
|
405
388
|
var isBlockBoundWitness = (value) => {
|
|
@@ -421,19 +404,19 @@ var isBlockBoundWitnessWithHashStorageMeta = (value) => {
|
|
|
421
404
|
var isSignedBlockBoundWitnessWithHashStorageMeta = (value) => {
|
|
422
405
|
return isBlockBoundWitnessWithHashStorageMeta(value) && isSigned4(value);
|
|
423
406
|
};
|
|
424
|
-
var asBlockBoundWitness =
|
|
425
|
-
var asSignedBlockBoundWitness =
|
|
426
|
-
var asBlockBoundWitnessWithStorageMeta =
|
|
427
|
-
var asSignedBlockBoundWitnessWithStorageMeta =
|
|
428
|
-
var asBlockBoundWitnessWithHashStorageMeta =
|
|
429
|
-
var asSignedBlockBoundWitnessWithHashStorageMeta =
|
|
407
|
+
var asBlockBoundWitness = AsObjectFactory19.create(isBlockBoundWitness);
|
|
408
|
+
var asSignedBlockBoundWitness = AsObjectFactory19.create(isSignedBlockBoundWitness);
|
|
409
|
+
var asBlockBoundWitnessWithStorageMeta = AsObjectFactory19.create(isBlockBoundWitnessWithStorageMeta);
|
|
410
|
+
var asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory19.create(isSignedBlockBoundWitnessWithStorageMeta);
|
|
411
|
+
var asBlockBoundWitnessWithHashStorageMeta = AsObjectFactory19.create(isBlockBoundWitnessWithHashStorageMeta);
|
|
412
|
+
var asSignedBlockBoundWitnessWithHashStorageMeta = AsObjectFactory19.create(isSignedBlockBoundWitnessWithHashStorageMeta);
|
|
430
413
|
|
|
431
414
|
// src/block/HydratedBlock.ts
|
|
432
|
-
import { AsObjectFactory as
|
|
415
|
+
import { AsObjectFactory as AsObjectFactory20 } from "@xylabs/object";
|
|
433
416
|
var isHydratedBlock = (value) => {
|
|
434
417
|
return isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0]);
|
|
435
418
|
};
|
|
436
|
-
var asHydratedBlock =
|
|
419
|
+
var asHydratedBlock = AsObjectFactory20.create(
|
|
437
420
|
isHydratedBlock
|
|
438
421
|
);
|
|
439
422
|
|
|
@@ -444,7 +427,7 @@ var XYO_NETWORK_STAKING_ADDRESS = "1969196919691969196919691969196919691969";
|
|
|
444
427
|
var XYO_STEP_REWARD_ADDRESS = "1216197612161976121619761216197612161976";
|
|
445
428
|
|
|
446
429
|
// src/constants/defaultRewardRatio.ts
|
|
447
|
-
var defaultRewardRatio = 0.
|
|
430
|
+
var defaultRewardRatio = 0.05;
|
|
448
431
|
|
|
449
432
|
// src/constants/minTransactionFees.ts
|
|
450
433
|
var minTransactionFees = {
|
|
@@ -502,21 +485,21 @@ var XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_
|
|
|
502
485
|
var XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1e6 + XL1_PROTOCOL_VERSION_MINOR * 1e3 + XL1_PROTOCOL_VERSION_PATCH;
|
|
503
486
|
|
|
504
487
|
// src/fields/BlockNumber.ts
|
|
505
|
-
import { AsObjectFactory as
|
|
488
|
+
import { AsObjectFactory as AsObjectFactory21 } from "@xylabs/object";
|
|
506
489
|
import {
|
|
507
|
-
isPayloadOfSchemaType as
|
|
490
|
+
isPayloadOfSchemaType as isPayloadOfSchemaType9,
|
|
508
491
|
isPayloadOfSchemaTypeWithSources
|
|
509
492
|
} from "@xyo-network/payload-model";
|
|
510
493
|
var BlockNumberSchema = "network.xyo.chain.block.number";
|
|
511
|
-
var isBlockNumber =
|
|
512
|
-
var asBlockNumber =
|
|
494
|
+
var isBlockNumber = isPayloadOfSchemaType9(BlockNumberSchema);
|
|
495
|
+
var asBlockNumber = AsObjectFactory21.create(isBlockNumber);
|
|
513
496
|
var isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
|
|
514
|
-
var asBlockNumberWithSources =
|
|
497
|
+
var asBlockNumberWithSources = AsObjectFactory21.create(isBlockNumberWithSources);
|
|
515
498
|
|
|
516
499
|
// src/network/Status.ts
|
|
517
|
-
import { isPayloadOfSchemaType as
|
|
500
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType10 } from "@xyo-network/payload-model";
|
|
518
501
|
var NetworkStatusSchema = "network.xyo.chain.status";
|
|
519
|
-
var isNetworkStatus =
|
|
502
|
+
var isNetworkStatus = isPayloadOfSchemaType10(NetworkStatusSchema);
|
|
520
503
|
|
|
521
504
|
// src/provider/XyoDataLake.ts
|
|
522
505
|
var isDataLakeViewer = (value) => {
|
|
@@ -527,15 +510,15 @@ var isDataLakeProvider = (value) => {
|
|
|
527
510
|
};
|
|
528
511
|
|
|
529
512
|
// src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts
|
|
530
|
-
import { AsObjectFactory as
|
|
531
|
-
import { isPayloadOfSchemaType as
|
|
513
|
+
import { AsObjectFactory as AsObjectFactory22 } from "@xylabs/object";
|
|
514
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType11, isStorageMeta as isStorageMeta8 } from "@xyo-network/payload-model";
|
|
532
515
|
var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
|
|
533
516
|
var isChainIndexingServiceState = (payload) => {
|
|
534
|
-
return
|
|
517
|
+
return isPayloadOfSchemaType11(ChainIndexingServiceStateSchema)(payload);
|
|
535
518
|
};
|
|
536
|
-
var asChainIndexingServiceState =
|
|
519
|
+
var asChainIndexingServiceState = AsObjectFactory22.create(isChainIndexingServiceState);
|
|
537
520
|
var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta8(value);
|
|
538
|
-
var asChainIndexingServiceStateWithStorageMeta =
|
|
521
|
+
var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory22.create(isChainIndexingServiceStateWithStorageMeta);
|
|
539
522
|
|
|
540
523
|
// src/validation/error.ts
|
|
541
524
|
import { isHash } from "@xylabs/hex";
|
|
@@ -623,11 +606,8 @@ export {
|
|
|
623
606
|
BlockNumberSchema,
|
|
624
607
|
BlockValidationError,
|
|
625
608
|
BoundWitnessValidationError,
|
|
626
|
-
BridgeBackSchema,
|
|
627
|
-
BridgeCompleteSchema,
|
|
628
609
|
BridgeDestinationObservationSchema,
|
|
629
610
|
BridgeIntentSchema,
|
|
630
|
-
BridgeRequestSchema,
|
|
631
611
|
BridgeSourceObservationSchema,
|
|
632
612
|
ChainIndexingServiceStateSchema,
|
|
633
613
|
ChainStakeIntentSchema,
|
|
@@ -673,11 +653,8 @@ export {
|
|
|
673
653
|
asBlockBoundWitnessWithStorageMeta,
|
|
674
654
|
asBlockNumber,
|
|
675
655
|
asBlockNumberWithSources,
|
|
676
|
-
asBridgeBack,
|
|
677
|
-
asBridgeComplete,
|
|
678
656
|
asBridgeDestinationObservation,
|
|
679
657
|
asBridgeIntent,
|
|
680
|
-
asBridgeRequest,
|
|
681
658
|
asBridgeSourceObservation,
|
|
682
659
|
asChainIndexingServiceState,
|
|
683
660
|
asChainIndexingServiceStateWithStorageMeta,
|
|
@@ -725,11 +702,8 @@ export {
|
|
|
725
702
|
isBlockNumberWithSources,
|
|
726
703
|
isBlockValidationError,
|
|
727
704
|
isBoundWitnessValidationError,
|
|
728
|
-
isBridgeBack,
|
|
729
|
-
isBridgeComplete,
|
|
730
705
|
isBridgeDestinationObservation,
|
|
731
706
|
isBridgeIntent,
|
|
732
|
-
isBridgeRequest,
|
|
733
707
|
isBridgeSourceObservation,
|
|
734
708
|
isChainIndexingServiceState,
|
|
735
709
|
isChainIndexingServiceStateWithStorageMeta,
|
|
@@ -753,6 +727,7 @@ export {
|
|
|
753
727
|
isNanoXL1,
|
|
754
728
|
isNetworkStatus,
|
|
755
729
|
isPicoXL1,
|
|
730
|
+
isSafeEpoch,
|
|
756
731
|
isSignedBlockBoundWitness,
|
|
757
732
|
isSignedBlockBoundWitnessWithHashStorageMeta,
|
|
758
733
|
isSignedBlockBoundWitnessWithStorageMeta,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/Bridge/BridgeDestinationObservation.ts","../../src/payload/elevatable/Bridge/BridgeIntent.ts","../../src/payload/elevatable/Bridge/BridgeSourceObservation.ts","../../src/payload/elevatable/BridgeBack.ts","../../src/payload/elevatable/BridgeComplete.ts","../../src/payload/elevatable/BridgeRequest.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/StepComplete.ts","../../src/payload/elevatable/Time.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/AnyHydratedTransaction.ts","../../src/isHydratedBoundWitness.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/transaction/HydratedTransaction.ts","../../src/transaction/HydratedTransactionWithStorageMeta.ts","../../src/transaction/SignedHydratedTransaction.ts","../../src/transaction/SignedHydratedTransactionWithStorageMeta.ts","../../src/transaction/TransactionBoundWitnessDeprecated.ts","../../src/transaction/TransactionFeesFields.ts","../../src/xl1/isXL1Factory.ts","../../src/xl1/xl1MaxValue.ts","../../src/xl1/XL1Units.ts","../../src/xl1/AttoXL1.ts","../../src/xl1/FemtoXL1.ts","../../src/xl1/MicroXL1.ts","../../src/xl1/MilliXL1.ts","../../src/xl1/NanoXL1.ts","../../src/xl1/PicoXL1.ts","../../src/xl1/XL1.ts","../../src/transaction/UnsignedHydratedTransaction.ts","../../src/block/BlockBoundWitness.ts","../../src/block/HydratedBlock.ts","../../src/constants/addresses.ts","../../src/constants/defaultRewardRatio.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/constants/version.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/provider/XyoDataLake.ts","../../src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts","../../src/validation/error.ts","../../src/validation/block/error.ts","../../src/validation/boundwitness/error.ts","../../src/validation/payload/error.ts","../../src/validation/transaction/error.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'\nimport z from 'zod'\n\nimport type {\n BridgeDestinationObservation, BridgeIntent, BridgeSourceObservation, ChainStakeIntent, HashPayload, StepComplete, TimePayload, Transfer,\n} from '../payload/index.ts'\nimport {\n BridgeDestinationObservationSchema, BridgeIntentSchema, BridgeRequestSchema, BridgeSourceObservationSchema, ChainStakeIntentSchema, HashSchema,\n isBridgeDestinationObservation, isBridgeIntent, isBridgeSourceObservation, isChainStakeIntent, isHashPayload, isTimePayload, isTransfer, StepCompleteSchema,\n TimeSchema, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload\n = Transfer\n | BridgeDestinationObservation\n | BridgeIntent\n | BridgeSourceObservation\n | ChainStakeIntent\n | HashPayload\n | SchemaPayload\n | StepComplete\n | TimePayload\n | TransactionBoundWitness\n\nexport const AllowedBlockPayloadSchemas: Schema[] = [\n BoundWitnessSchema,\n BridgeDestinationObservationSchema,\n BridgeIntentSchema,\n BridgeRequestSchema,\n BridgeSourceObservationSchema,\n ChainStakeIntentSchema,\n HashSchema,\n SchemaSchema,\n StepCompleteSchema,\n TimeSchema,\n TransferSchema,\n]\n\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)\n || isBridgeDestinationObservation(value)\n || isBridgeIntent(value)\n || isBridgeSourceObservation(value)\n || isChainStakeIntent(value)\n || isHashPayload(value)\n || isSchemaPayload(value)\n || isTimePayload(value)\n || isTransactionBoundWitness(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n\nexport const AllowedBlockPayloadZod = z.object({ schema: z.enum(AllowedBlockPayloadSchemas) })\n","import type { Hex } 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 { BridgeDetailsFields } from './BridgeDetails.ts'\n\nexport const BridgeDestinationObservationSchema = 'network.xyo.chain.bridge.observation.destination' as const\nexport type BridgeDestinationObservationSchema = typeof BridgeDestinationObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport interface BridgeDestinationObservationFields extends BridgeDetailsFields {\n /**\n * Destination chain confirmation\n */\n destConfirmation?: Hex\n}\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport type BridgeDestinationObservation = Payload<BridgeDestinationObservationFields, BridgeDestinationObservationSchema>\n\nexport const isBridgeDestinationObservation = isPayloadOfSchemaType<BridgeDestinationObservation>(BridgeDestinationObservationSchema)\n\nexport const asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationObservation)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BridgeDetailsFields } from './BridgeDetails.ts'\n\nexport const BridgeIntentSchema = 'network.xyo.chain.bridge.intent' as const\nexport type BridgeIntentSchema = typeof BridgeIntentSchema\n\n/**\n * Represents an Addresses intent to initiate a token bridge.\n */\nexport interface BridgeIntentFields extends BridgeDetailsFields {\n /**\n * Unique identifier for replay protection\n */\n nonce: string\n}\n\nexport type BridgeIntent = Payload<BridgeIntentFields, BridgeIntentSchema>\n\nexport const isBridgeIntent = isPayloadOfSchemaType<BridgeIntent>(BridgeIntentSchema)\n\nexport const asBridgeIntent = AsObjectFactory.create(isBridgeIntent)\n","import type { Hex } 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 { BridgeDetailsFields } from './BridgeDetails.ts'\n\nexport const BridgeSourceObservationSchema = 'network.xyo.chain.bridge.observation.source' as const\nexport type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport interface BridgeSourceObservationFields extends BridgeDetailsFields {\n /**\n * Source chain confirmation\n */\n srcConfirmation?: Hex\n}\n\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport type BridgeSourceObservation = Payload<BridgeSourceObservationFields, BridgeSourceObservationSchema>\n\nexport const isBridgeSourceObservation = isPayloadOfSchemaType<BridgeSourceObservation>(BridgeSourceObservationSchema)\n\nexport const asBridgeSourceObservation = AsObjectFactory.create(isBridgeSourceObservation)\n","import type { Address, EthAddress } 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 BridgeBackSchema = 'network.xyo.chain.bridge.back' as const\nexport type BridgeBackSchema = typeof BridgeBackSchema\n\n/* Report a bridging from WXL1 to XL1 */\n\nexport interface BridgeBackFields extends FromFields {\n destAddress: Address\n src: 'ethereum'\n srcAddress: EthAddress\n // usually the source's block number\n srcTime: number\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 BridgeBack = Payload<BridgeBackFields, BridgeBackSchema>\n\nexport const isBridgeBack = isPayloadOfSchemaType<BridgeBack>(BridgeBackSchema)\n\nexport const asBridgeBack = AsObjectFactory.create(isBridgeBack)\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\nimport type { FromFields } from './Executable.ts'\n\nexport const BridgeCompleteSchema = 'network.xyo.chain.bridge.complete' as const\nexport type BridgeCompleteSchema = typeof BridgeCompleteSchema\n\n/* Complete a bridging from XL1 to WXL1 */\n\nexport interface BridgeCompleteFields extends FromFields {\n // usually the destination's block number\n destTime: number\n request: Hash\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 BridgeComplete = Payload<BridgeCompleteFields, BridgeCompleteSchema>\n\nexport const isBridgeComplete = isPayloadOfSchemaType<BridgeComplete>(BridgeCompleteSchema)\n\nexport const asBridgeComplete = AsObjectFactory.create(isBridgeComplete)\n","import type {\n Address, EthAddress, 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\n/* Request a bridging from XL1 to WXL1 */\n\nexport const BridgeRequestSchema = 'network.xyo.chain.bridge.request' as const\nexport type BridgeRequestSchema = typeof BridgeRequestSchema\n\nexport interface BridgeRequestFields extends FromFields {\n amount: Hex\n\n dest: 'ethereum'\n destAddress: EthAddress\n\n // xl1 address\n srcAddress: Address\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 BridgeRequest = Payload<BridgeRequestFields, BridgeRequestSchema>\n\nexport const isBridgeRequest = isPayloadOfSchemaType<BridgeRequest>(BridgeRequestSchema)\n\nexport const asBridgeRequest = AsObjectFactory.create(isBridgeRequest)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.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)\n\nexport const isChainStakeIntentWithStorageMeta = (x?: unknown | null): x is WithStorageMeta<ChainStakeIntent> => {\n return isChainStakeIntent(x) && isStorageMeta(x)\n}\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)\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\nimport type { FromFields } from './Executable.ts'\n\nexport const StepCompleteSchema = 'network.xyo.chain.step.complete' as const\nexport type StepCompleteSchema = typeof StepCompleteSchema\n\n/* This records the completion of a step in the network - needed for network staking rewards */\n/* We will only write these for steps that are eligible for rewards Step 3 (2311) */\n\nexport interface StepCompleteFields extends FromFields {\n block: number /* The block number on the XL1 network */\n hash: Hash /* The Step Hash */\n size: number /* The size of the step */\n stakeBlock: number /* The block number on ethereum or other staking system */\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 StepComplete = Payload<StepCompleteFields, StepCompleteSchema>\n\nexport const isStepComplete = isPayloadOfSchemaType<StepComplete>(StepCompleteSchema)\n\nexport const asStepComplete = AsObjectFactory.create(isStepComplete)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\n// xl1 = xl1 block number, epoch = epoch number, ethereum = ethereum block number\nexport type TimeDomain = 'xl1' | 'epoch' | 'ethereum'\n\nexport const TimeSchema = 'network.xyo.time' as const\nexport type TimeSchema = typeof TimeSchema\n\nexport interface TimeFields {\n // in milliseconds\n epoch: number\n // in block number\n ethereum?: number\n // in block number\n xl1?: number\n}\n\nexport type TimePayload = Payload<TimeFields, TimeSchema>\n\nexport const isTimePayload = isPayloadOfSchemaType<TimePayload>(TimeSchema)\n\nexport const asTimePayload = AsObjectFactory.create(isTimePayload)\nexport const asTimePayloadWithStorageMeta = AsObjectFactory.create(isTimePayload)\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 other addresses\n transfers: Partial<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)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type AnyHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isAnyHydratedTransaction = (\n value: unknown,\n): value is AnyHydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0])\n )\n}\n\nexport const asAnyHydratedTransaction = AsObjectFactory.create<AnyHydratedTransaction>(\n isAnyHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { HydratedBoundWitness, HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isAnyPayload, isStorageMeta } from '@xyo-network/payload-model'\n\nexport const isHydratedBoundWitness = (\n value: unknown,\n): value is HydratedBoundWitness => {\n return (\n Array.isArray(value)\n && value.length === 2\n && isBoundWitness(value[0])\n && Array.isArray(value[1])\n && !value[1].some(item => (!isAnyPayload(item)))\n )\n}\n\nexport const isHydratedBoundWitnessWithStorageMeta = (\n value: unknown,\n): value is HydratedBoundWitnessWithStorageMeta => {\n return (\n isHydratedBoundWitness(value)\n && isStorageMeta(value[0])\n && !value[1].some(item => (!isStorageMeta(item)))\n )\n}\n\nexport const asHydratedBoundWitness = AsObjectFactory.create<HydratedBoundWitness>(\n isHydratedBoundWitness,\n)\n\nexport const asHydratedBoundWitnessWithStorageMeta = AsObjectFactory.create<HydratedBoundWitnessWithStorageMeta>(\n isHydratedBoundWitnessWithStorageMeta,\n)\n","import {\n type Address, type Hex, isAddress,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Hex | Address & { __chain: true }\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 && isAddress(typedObj.chain)\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isSigned, type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\n/** @deprecated Use HydratedTransactionWithStorageMeta instead */\nexport type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\n/** @deprecated Use isHydratedTransactionWithStorageMeta instead */\nexport const isHydratedTransaction = (\n value: unknown,\n// eslint-disable-next-line sonarjs/deprecation\n): value is HydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0]) && isSigned(value[0]) && isStorageMeta(value[0])\n )\n}\n\n/** @deprecated Use asHydratedTransactionWithStorageMeta instead */\n// eslint-disable-next-line sonarjs/deprecation\nexport const asHydratedTransaction = AsObjectFactory.create<HydratedTransaction>(\n // eslint-disable-next-line sonarjs/deprecation\n isHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is HydratedTransactionWithStorageMeta => {\n return (\n isAnyHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asHydratedTransactionWithStorageMeta = AsObjectFactory.create<HydratedTransactionWithStorageMeta>(\n isHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [Signed<T>, P[]]\n\nexport const isSignedHydratedTransaction = (\n value: unknown,\n): value is SignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isSigned(value[0])\n )\n}\n\nexport const asSignedHydratedTransaction = AsObjectFactory.create<SignedHydratedTransaction>(\n isSignedHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isSignedHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is SignedHydratedTransactionWithStorageMeta => {\n return (\n isSignedHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asSignedHydratedTransactionWithStorageMeta = AsObjectFactory.create<SignedHydratedTransactionWithStorageMeta>(\n isSignedHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\n\nexport const asTransactionBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashStorageMeta)\n","import { type Hex, isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isObject } from '@xylabs/typeof'\n\nimport { type AttoXL1, isAttoXL1 } from '../xl1/index.ts'\n\nexport interface TransactionFeesBigInt {\n base: AttoXL1\n gasLimit: AttoXL1\n gasPrice: AttoXL1\n priority: AttoXL1\n}\n\nexport type TransactionFeesHex = {\n [K in keyof TransactionFeesBigInt]: Hex;\n}\n\nexport interface TransactionFeesFields {\n fees: TransactionFeesHex\n}\n\nexport const isTransactionFeesBigInt = (value: unknown): value is TransactionFeesBigInt => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesBigInt\n return (\n isAttoXL1(base)\n && isAttoXL1(gasLimit)\n && isAttoXL1(gasPrice)\n && isAttoXL1(priority)\n )\n}\n\nexport const asTransactionFeesBigInt = AsObjectFactory.create<TransactionFeesBigInt>(\n isTransactionFeesBigInt,\n)\n\nexport const isTransactionFeesHex = (value: unknown): value is TransactionFeesHex => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesHex\n return (\n isHex(base)\n && isHex(gasLimit)\n && isHex(gasPrice)\n && isHex(priority)\n )\n}\n\nexport const asTransactionFeesHex = AsObjectFactory.create<TransactionFeesHex>(\n isTransactionFeesHex,\n)\n","import * as z from 'zod'\n\nimport { xl1MaxValue } from './xl1MaxValue.ts'\n\nexport const isXL1Factory = <T extends bigint>(places: bigint) => (val: unknown): val is T => {\n if (typeof val !== 'bigint') return false\n return val >= 0n && val <= xl1MaxValue(places)\n}\n\nexport const XL1ZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.bigint().refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const XL1TransformZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.union([z.bigint(), z.number(), z.string(), z.boolean()]).transform(val => BigInt(val) as T).refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const asXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1ZodFactory<T>(places, 'local')\n return (val: unknown): T => {\n const result = zod.safeParse(val)\n if (result.success) {\n return result.data as T\n }\n throw result.error\n }\n}\n\nexport const toXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1TransformZodFactory<T>(places, 'local')\n return (val: unknown): T | undefined => {\n const result = zod.safeParse(val)\n return result.success ? result.data as T : undefined\n }\n}\n","export const xl1MaxValue = (places: bigint) => 10n ** (32n - places) - 1n\n","type XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const AttoXL1MaxValue = xl1MaxValue(XL1Places.atto)\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' }\nexport const isAttoXL1 = isXL1Factory<AttoXL1>(XL1Places.atto)\nexport const asAttoXL1 = asXL1Factory<AttoXL1>(XL1Places.atto)\nexport const toAttoXL1 = toXL1Factory<AttoXL1>(XL1Places.atto)\n\nexport const AttoXL1 = asAttoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const FemtoXL1MaxValue = xl1MaxValue(XL1Places.femto)\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' }\nexport const isFemtoXL1 = isXL1Factory<FemtoXL1>(XL1Places.femto)\nexport const asFemtoXL1 = asXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const toFemtoXL1 = toXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const FemtoXL1 = asFemtoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MicroXL1MaxValue = xl1MaxValue(XL1Places.micro)\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' }\nexport const isMicroXL1 = isXL1Factory<MicroXL1>(XL1Places.micro)\nexport const asMicroXL1 = asXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const toMicroXL1 = toXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const MicroXL1 = asMicroXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MilliXL1MaxValue = xl1MaxValue(XL1Places.milli)\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' }\nexport const isMilliXL1 = isXL1Factory<MilliXL1>(XL1Places.milli)\nexport const asMilliXL1 = asXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const toMilliXL1 = toXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const MilliXL1 = asMilliXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const NanoXL1MaxValue = xl1MaxValue(XL1Places.nano)\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' }\nexport const isNanoXL1 = isXL1Factory<NanoXL1>(XL1Places.nano)\nexport const asNanoXL1 = asXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const toNanoXL1 = toXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const NanoXL1 = asNanoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const PicoXL1MaxValue = xl1MaxValue(XL1Places.pico)\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' }\nexport const isPicoXL1 = isXL1Factory<PicoXL1>(XL1Places.pico)\nexport const asPicoXL1 = asXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const toPicoXL1 = toXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const PicoXL1 = asPicoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const XL1MaxValue = xl1MaxValue(XL1Places.xl1)\nexport type XL1 = bigint & { readonly _tag: 'XL1' }\nexport const isXL1 = isXL1Factory<XL1>(XL1Places.xl1)\nexport const asXL1 = asXL1Factory<XL1>(XL1Places.xl1)\n\nexport const toXL1 = toXL1Factory<XL1>(XL1Places.xl1)\n\nexport const XL1 = asXL1\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isUnsigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type UnsignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isUnsignedHydratedTransaction = (\n value: unknown,\n): value is UnsignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isUnsigned(value[0])\n )\n}\n\nexport const asUnsignedHydratedTransaction = AsObjectFactory.create<UnsignedHydratedTransaction>(\n isUnsignedHydratedTransaction,\n)\n","import type { Hash } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { Chain } from '../model.ts'\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: Chain\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: Hash[]\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 isSignedBlockBoundWitness = (value: unknown): value is Signed<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value is Signed<WithStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isHashStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is Signed<WithHashStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithHashStorageMeta(value) && isSigned(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)\n\nexport const asBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashStorageMeta)\nexport const asSignedBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashStorageMeta)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { type Payload, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport {\n type BlockBoundWitness,\n isBlockBoundWitnessWithStorageMeta,\n} from './BlockBoundWitness.ts'\n\nexport type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedBlock = (\n value: unknown,\n): value is HydratedBlock => {\n return (\n isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedBlock = AsObjectFactory.create<HydratedBlock>(\n isHydratedBlock,\n)\n","import type { Address } from '@xylabs/hex'\n\n/**\n * The Zero Address is used as a marker address for various protocol operations.\n */\nexport const XYO_ZERO_ADDRESS = '0000000000000000000000000000000000000000' as const as Address\n\n/**\n * The Bridge Address is used as a marker address for bridge transactions.\n */\nexport const XYO_BRIDGE_ADDRESS = '3012193230121932301219323012193230121932' as const as Address\n\n/**\n * The Network Staking Address is used as a marker address for staking the network.\n */\nexport const XYO_NETWORK_STAKING_ADDRESS = '1969196919691969196919691969196919691969' as const as Address\n\n/**\n * The Step Reward Address is used as a marker address for step rewards.\n */\nexport const XYO_STEP_REWARD_ADDRESS = '1216197612161976121619761216197612161976' as const as Address\n","// the percent of the block rewards the producer gets\nexport const defaultRewardRatio = 0.5 as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.nano),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.nano),\n} as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\nimport { minTransactionFees } from './minTransactionFees.ts'\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: minTransactionFees.priority,\n} as const\n","import { AsTypeFactory } from '@xylabs/object'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes = [7, 31, 211, 2311, 30_031, 510_511, 9_699_691, 223_092_871, 6_469_693_231] as const\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`, { required: true })\n return StepSizes[validatedStep]\n}\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","export const XL1_PROTOCOL_VERSION_MAJOR = 1 as const\nexport const XL1_PROTOCOL_VERSION_MINOR = 2 as const\nexport const XL1_PROTOCOL_VERSION_PATCH = 0 as const\nexport const XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_VERSION_MINOR}.${XL1_PROTOCOL_VERSION_PATCH}` as const\nexport const XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1_000_000 + XL1_PROTOCOL_VERSION_MINOR * 1000 + XL1_PROTOCOL_VERSION_PATCH\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/**\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)\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)\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 { Hash } from '@xylabs/hex'\nimport type { Promisable } from '@xylabs/promise'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport type DataLakeData = Payload | ArrayBuffer\n\nexport interface XyoDataLakeViewer {\n // if resolves to hash payload, keep going until hitting a non-payload or maxDepth, or unable to find\n fetch(hashes: Hash[], maxDepth?: number): Promisable<DataLakeData[]>\n // same as fetch but never follows hash payloads\n get(hashes: Hash[]): Promisable<DataLakeData[]>\n // same as fetch, except returns each step in tuple containing the result and the steps\n trace(hash: Hash): Promisable<[DataLakeData | undefined, Payload[]]>\n}\n\nexport interface XyoDataLake extends XyoDataLakeViewer {\n add(items: DataLakeData[]): Promisable<DataLakeData[]>\n}\n\n/** @deprecated use XyoDataLake instead */\nexport interface XyoDataLakeProvider extends XyoDataLake {\n}\n\nexport const isDataLakeViewer = (value: unknown): value is XyoDataLakeViewer => {\n return (\n typeof value === 'object'\n && value !== null\n && 'fetch' in value\n && typeof (value as XyoDataLakeViewer).fetch === 'function'\n && 'get' in value\n && typeof (value as XyoDataLakeViewer).get === 'function'\n && 'trace' in value\n && typeof (value as XyoDataLakeViewer).trace === 'function'\n )\n}\n\nexport const isDataLakeProvider = (value: unknown): value is XyoDataLake => {\n return (\n isDataLakeViewer(value)\n && 'add' in value\n && typeof (value as XyoDataLake).add === 'function'\n )\n}\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","import { type Hash, isHash } from '@xylabs/hex'\nimport { isError } from '@xylabs/typeof'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport class ValidationError<TValue = Payload> extends Error {\n hash: Hash\n value: TValue\n constructor(hash: Hash, value: TValue, message?: string, cause?: unknown) {\n super(message)\n this.hash = hash\n this.name = this.constructor.name\n this.value = value\n this.cause = cause\n }\n}\n\nexport const isValidationError = <TValue = Payload>(\n error: unknown,\n): error is ValidationError<TValue> => {\n return (\n isError(error) && isHash((error as ValidationError<TValue>)?.hash) && (error as ValidationError<TValue>)?.value !== undefined\n )\n}\n","import type { Hash, Hex } from '@xylabs/hex'\n\nimport { type BlockBoundWitness, type HydratedBlock } from '../../block/index.ts'\nimport type { Chain } from '../../model.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BlockValidationError extends ValidationError<BlockBoundWitness> {}\n\nexport const isBlockValidationError = (\n error: unknown,\n): error is BlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockValidationError extends ValidationError<HydratedBlock> {}\n\nexport const isHydratedBlockValidationError = (\n error: unknown,\n): error is HydratedBlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockStateValidationError extends ValidationError<HydratedBlock> {\n chainId: Chain\n constructor(hash: Hash, chainId: Hex, value: HydratedBlock, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.chainId = chainId\n }\n}\n\nexport const isHydratedBlockStateValidationError = (\n error: unknown,\n): error is HydratedBlockStateValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockStateValidationError.constructor.name\n )\n}\n","import type { HydratedBoundWitness } from '@xyo-network/archivist-model'\nimport { type BoundWitness } from '@xyo-network/boundwitness-model'\n\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BoundWitnessValidationError extends ValidationError<BoundWitness> {}\n\nexport const isBoundWitnessValidationError = (\n error: unknown,\n): error is BoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BoundWitnessValidationError.constructor.name\n )\n}\n\nexport class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {}\n\nexport const isHydratedBoundWitnessValidationError = (\n error: unknown,\n): error is HydratedBoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBoundWitnessValidationError.constructor.name\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class InBlockPayloadValidationError extends ValidationError<Payload> {\n block: HydratedBlock\n constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.block = block\n }\n}\n\nexport const isInBlockPayloadValidationError = (\n error: unknown,\n): error is InBlockPayloadValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === InBlockPayloadValidationError.constructor.name\n )\n}\n","import { type SignedHydratedTransaction } from '../../transaction/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class HydratedTransactionValidationError extends ValidationError<SignedHydratedTransaction> {}\n\nexport const isHydratedTransactionValidationError = (\n error: unknown,\n): error is HydratedTransactionValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedTransactionValidationError.constructor.name\n )\n}\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,qBAAAA,oBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;AAC9C,OAAOC,QAAO;;;ACJd,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAI/B,IAAM,qCAAqC;AAkB3C,IAAM,iCAAiC,sBAAoD,kCAAkC;AAE7H,IAAM,iCAAiC,gBAAgB,OAAO,8BAA8B;;;AC3BnG,SAAS,mBAAAC,wBAAuB;AAEhC,SAAS,yBAAAC,8BAA6B;AAI/B,IAAM,qBAAqB;AAe3B,IAAM,iBAAiBA,uBAAoC,kBAAkB;AAE7E,IAAM,iBAAiBD,iBAAgB,OAAO,cAAc;;;ACtBnE,SAAS,mBAAAE,wBAAuB;AAEhC,SAAS,yBAAAC,8BAA6B;AAI/B,IAAM,gCAAgC;AAkBtC,IAAM,4BAA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,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,kCAAkC,YAAY;AAEjE;;;ACtCO,IAAM,8BAAN,cAA0C,gBAA8B;AAAC;AAEzE,IAAM,gCAAgC,CAC3C,UACyC;AACzC,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,4BAA4B,YAAY;AAE3D;AAEO,IAAM,sCAAN,cAAkD,gBAAsC;AAAC;AAEzF,IAAM,wCAAwC,CACnD,UACiD;AACjD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,oCAAoC,YAAY;AAEnE;;;ACnBO,IAAM,gCAAN,cAA4C,gBAAyB;AAAA,EAC1E;AAAA,EACA,YAAY,MAAY,OAAsB,OAAgB,SAAkB,OAAiB;AAC/F,UAAM,MAAM,OAAO,SAAS,KAAK;AACjC,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,IAAM,kCAAkC,CAC7C,UAC2C;AAC3C,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,8BAA8B,YAAY;AAE7D;;;AClBO,IAAM,qCAAN,cAAiD,gBAA2C;AAAC;AAE7F,IAAM,uCAAuC,CAClD,UACgD;AAChD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,mCAAmC,YAAY;AAElE;","names":["isHashStorageMeta","z","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isAnyPayload","isStorageMeta","AsObjectFactory","isBoundWitness","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isSigned","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isStorageMeta","isSigned","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","isHashStorageMeta","z","isHex","AsObjectFactory","isBoundWitness","isSigned","isHashStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
|
|
1
|
+
{"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/Bridge/BridgeDestinationObservation.ts","../../src/payload/elevatable/Bridge/BridgeIntent.ts","../../src/payload/elevatable/Bridge/BridgeSourceObservation.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/StepComplete.ts","../../src/payload/elevatable/Time.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/AnyHydratedTransaction.ts","../../src/isHydratedBoundWitness.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/transaction/HydratedTransaction.ts","../../src/transaction/HydratedTransactionWithStorageMeta.ts","../../src/transaction/SignedHydratedTransaction.ts","../../src/transaction/SignedHydratedTransactionWithStorageMeta.ts","../../src/transaction/TransactionBoundWitnessDeprecated.ts","../../src/transaction/TransactionFeesFields.ts","../../src/xl1/isXL1Factory.ts","../../src/xl1/xl1MaxValue.ts","../../src/xl1/XL1Units.ts","../../src/xl1/AttoXL1.ts","../../src/xl1/FemtoXL1.ts","../../src/xl1/MicroXL1.ts","../../src/xl1/MilliXL1.ts","../../src/xl1/NanoXL1.ts","../../src/xl1/PicoXL1.ts","../../src/xl1/XL1.ts","../../src/transaction/UnsignedHydratedTransaction.ts","../../src/block/BlockBoundWitness.ts","../../src/block/HydratedBlock.ts","../../src/constants/addresses.ts","../../src/constants/defaultRewardRatio.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/constants/version.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/provider/XyoDataLake.ts","../../src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts","../../src/validation/error.ts","../../src/validation/block/error.ts","../../src/validation/boundwitness/error.ts","../../src/validation/payload/error.ts","../../src/validation/transaction/error.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'\nimport z from 'zod'\n\nimport type {\n BridgeDestinationObservation, BridgeIntent, BridgeSourceObservation, ChainStakeIntent, HashPayload, StepComplete, TimePayload, Transfer,\n} from '../payload/index.ts'\nimport {\n BridgeDestinationObservationSchema, BridgeIntentSchema, BridgeSourceObservationSchema, ChainStakeIntentSchema, HashSchema,\n isBridgeDestinationObservation, isBridgeIntent, isBridgeSourceObservation, isChainStakeIntent, isHashPayload, isTimePayload, isTransfer, StepCompleteSchema,\n TimeSchema, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload\n = Transfer\n | BridgeDestinationObservation\n | BridgeIntent\n | BridgeSourceObservation\n | ChainStakeIntent\n | HashPayload\n | SchemaPayload\n | StepComplete\n | TimePayload\n | TransactionBoundWitness\n\nexport const AllowedBlockPayloadSchemas: Schema[] = [\n BoundWitnessSchema,\n BridgeDestinationObservationSchema,\n BridgeIntentSchema,\n BridgeSourceObservationSchema,\n ChainStakeIntentSchema,\n HashSchema,\n SchemaSchema,\n StepCompleteSchema,\n TimeSchema,\n TransferSchema,\n]\n\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)\n || isBridgeDestinationObservation(value)\n || isBridgeIntent(value)\n || isBridgeSourceObservation(value)\n || isChainStakeIntent(value)\n || isHashPayload(value)\n || isSchemaPayload(value)\n || isTimePayload(value)\n || isTransactionBoundWitness(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n\nexport const AllowedBlockPayloadZod = z.object({ schema: z.enum(AllowedBlockPayloadSchemas) })\n","import type { Hex } 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 { BridgeDetailsFields } from './BridgeDetails.ts'\n\nexport const BridgeDestinationObservationSchema = 'network.xyo.chain.bridge.observation.destination' as const\nexport type BridgeDestinationObservationSchema = typeof BridgeDestinationObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport interface BridgeDestinationObservationFields extends BridgeDetailsFields {\n /**\n * Destination chain confirmation\n */\n destConfirmation?: Hex\n}\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport type BridgeDestinationObservation = Payload<BridgeDestinationObservationFields, BridgeDestinationObservationSchema>\n\nexport const isBridgeDestinationObservation = isPayloadOfSchemaType<BridgeDestinationObservation>(BridgeDestinationObservationSchema)\n\nexport const asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationObservation)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BridgeDetailsFields } from './BridgeDetails.ts'\n\nexport const BridgeIntentSchema = 'network.xyo.chain.bridge.intent' as const\nexport type BridgeIntentSchema = typeof BridgeIntentSchema\n\n/**\n * Represents an Addresses intent to initiate a token bridge.\n */\nexport interface BridgeIntentFields extends BridgeDetailsFields {\n /**\n * Unique identifier for replay protection\n */\n nonce: string\n}\n\nexport type BridgeIntent = Payload<BridgeIntentFields, BridgeIntentSchema>\n\nexport const isBridgeIntent = isPayloadOfSchemaType<BridgeIntent>(BridgeIntentSchema)\n\nexport const asBridgeIntent = AsObjectFactory.create(isBridgeIntent)\n","import type { Hex } 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 { BridgeDetailsFields } from './BridgeDetails.ts'\n\nexport const BridgeSourceObservationSchema = 'network.xyo.chain.bridge.observation.source' as const\nexport type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport interface BridgeSourceObservationFields extends BridgeDetailsFields {\n /**\n * Source chain confirmation\n */\n srcConfirmation?: Hex\n}\n\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport type BridgeSourceObservation = Payload<BridgeSourceObservationFields, BridgeSourceObservationSchema>\n\nexport const isBridgeSourceObservation = isPayloadOfSchemaType<BridgeSourceObservation>(BridgeSourceObservationSchema)\n\nexport const asBridgeSourceObservation = AsObjectFactory.create(isBridgeSourceObservation)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.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)\n\nexport const isChainStakeIntentWithStorageMeta = (x?: unknown | null): x is WithStorageMeta<ChainStakeIntent> => {\n return isChainStakeIntent(x) && isStorageMeta(x)\n}\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)\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\nimport type { FromFields } from './Executable.ts'\n\nexport const StepCompleteSchema = 'network.xyo.chain.step.complete' as const\nexport type StepCompleteSchema = typeof StepCompleteSchema\n\n/* This records the completion of a step in the network - needed for network staking rewards */\n/* We will only write these for steps that are eligible for rewards Step 3 (2311) */\n\nexport interface StepCompleteFields extends FromFields {\n block: number /* The block number on the XL1 network */\n hash: Hash /* The Step Hash */\n size: number /* The size of the step */\n stakeBlock: number /* The block number on ethereum or other staking system */\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 StepComplete = Payload<StepCompleteFields, StepCompleteSchema>\n\nexport const isStepComplete = isPayloadOfSchemaType<StepComplete>(StepCompleteSchema)\n\nexport const asStepComplete = AsObjectFactory.create(isStepComplete)\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\n// xl1 = xl1 block number, epoch = epoch number, ethereum = ethereum block number\nexport type TimeDomain = 'xl1' | 'epoch' | 'ethereum'\n\nexport const TimeSchema = 'network.xyo.time' as const\nexport type TimeSchema = typeof TimeSchema\n\nexport interface XL1TimeFields {\n // block number\n xl1?: number\n // block hash\n xl1Hash?: Hash\n}\n\nexport interface EthereumTimeFields {\n // block number\n ethereum?: number\n // block hash\n ethereumHash?: Hash\n}\n\nexport interface TimeFields extends XL1TimeFields, EthereumTimeFields {\n // in milliseconds\n epoch: number\n}\n\nexport type TimePayload = Payload<TimeFields, TimeSchema>\n\n// to prevent scaling problems, we use double the current time as a max safe epoch\nexport const isSafeEpoch = (value: unknown): value is number => {\n return typeof value === 'number' && value < 2 * Date.now()\n}\n\nexport const isTimePayload = (value: unknown): value is TimePayload => {\n return isPayloadOfSchemaType<TimePayload>(TimeSchema)(value) && isSafeEpoch(value.epoch)\n}\n\nexport const asTimePayload = AsObjectFactory.create(isTimePayload)\nexport const asTimePayloadWithStorageMeta = AsObjectFactory.create(isTimePayload)\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 other addresses\n transfers: Partial<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)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type AnyHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isAnyHydratedTransaction = (\n value: unknown,\n): value is AnyHydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0])\n )\n}\n\nexport const asAnyHydratedTransaction = AsObjectFactory.create<AnyHydratedTransaction>(\n isAnyHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { HydratedBoundWitness, HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isAnyPayload, isStorageMeta } from '@xyo-network/payload-model'\n\nexport const isHydratedBoundWitness = (\n value: unknown,\n): value is HydratedBoundWitness => {\n return (\n Array.isArray(value)\n && value.length === 2\n && isBoundWitness(value[0])\n && Array.isArray(value[1])\n && !value[1].some(item => (!isAnyPayload(item)))\n )\n}\n\nexport const isHydratedBoundWitnessWithStorageMeta = (\n value: unknown,\n): value is HydratedBoundWitnessWithStorageMeta => {\n return (\n isHydratedBoundWitness(value)\n && isStorageMeta(value[0])\n && !value[1].some(item => (!isStorageMeta(item)))\n )\n}\n\nexport const asHydratedBoundWitness = AsObjectFactory.create<HydratedBoundWitness>(\n isHydratedBoundWitness,\n)\n\nexport const asHydratedBoundWitnessWithStorageMeta = AsObjectFactory.create<HydratedBoundWitnessWithStorageMeta>(\n isHydratedBoundWitnessWithStorageMeta,\n)\n","import {\n type Address, type Hex, isAddress,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Hex | Address & { __chain: true }\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 && isAddress(typedObj.chain)\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isSigned, type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\n/** @deprecated Use HydratedTransactionWithStorageMeta instead */\nexport type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\n/** @deprecated Use isHydratedTransactionWithStorageMeta instead */\nexport const isHydratedTransaction = (\n value: unknown,\n// eslint-disable-next-line sonarjs/deprecation\n): value is HydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0]) && isSigned(value[0]) && isStorageMeta(value[0])\n )\n}\n\n/** @deprecated Use asHydratedTransactionWithStorageMeta instead */\n// eslint-disable-next-line sonarjs/deprecation\nexport const asHydratedTransaction = AsObjectFactory.create<HydratedTransaction>(\n // eslint-disable-next-line sonarjs/deprecation\n isHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is HydratedTransactionWithStorageMeta => {\n return (\n isAnyHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asHydratedTransactionWithStorageMeta = AsObjectFactory.create<HydratedTransactionWithStorageMeta>(\n isHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [Signed<T>, P[]]\n\nexport const isSignedHydratedTransaction = (\n value: unknown,\n): value is SignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isSigned(value[0])\n )\n}\n\nexport const asSignedHydratedTransaction = AsObjectFactory.create<SignedHydratedTransaction>(\n isSignedHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isSignedHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is SignedHydratedTransactionWithStorageMeta => {\n return (\n isSignedHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asSignedHydratedTransactionWithStorageMeta = AsObjectFactory.create<SignedHydratedTransactionWithStorageMeta>(\n isSignedHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isHashStorageMeta(value)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\n\nexport const asTransactionBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashStorageMeta)\n","import { type Hex, isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isObject } from '@xylabs/typeof'\n\nimport { type AttoXL1, isAttoXL1 } from '../xl1/index.ts'\n\nexport interface TransactionFeesBigInt {\n base: AttoXL1\n gasLimit: AttoXL1\n gasPrice: AttoXL1\n priority: AttoXL1\n}\n\nexport type TransactionFeesHex = {\n [K in keyof TransactionFeesBigInt]: Hex;\n}\n\nexport interface TransactionFeesFields {\n fees: TransactionFeesHex\n}\n\nexport const isTransactionFeesBigInt = (value: unknown): value is TransactionFeesBigInt => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesBigInt\n return (\n isAttoXL1(base)\n && isAttoXL1(gasLimit)\n && isAttoXL1(gasPrice)\n && isAttoXL1(priority)\n )\n}\n\nexport const asTransactionFeesBigInt = AsObjectFactory.create<TransactionFeesBigInt>(\n isTransactionFeesBigInt,\n)\n\nexport const isTransactionFeesHex = (value: unknown): value is TransactionFeesHex => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesHex\n return (\n isHex(base)\n && isHex(gasLimit)\n && isHex(gasPrice)\n && isHex(priority)\n )\n}\n\nexport const asTransactionFeesHex = AsObjectFactory.create<TransactionFeesHex>(\n isTransactionFeesHex,\n)\n","import * as z from 'zod'\n\nimport { xl1MaxValue } from './xl1MaxValue.ts'\n\nexport const isXL1Factory = <T extends bigint>(places: bigint) => (val: unknown): val is T => {\n if (typeof val !== 'bigint') return false\n return val >= 0n && val <= xl1MaxValue(places)\n}\n\nexport const XL1ZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.bigint().refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const XL1TransformZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.union([z.bigint(), z.number(), z.string(), z.boolean()]).transform(val => BigInt(val) as T).refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const asXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1ZodFactory<T>(places, 'local')\n return (val: unknown): T => {\n const result = zod.safeParse(val)\n if (result.success) {\n return result.data as T\n }\n throw result.error\n }\n}\n\nexport const toXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1TransformZodFactory<T>(places, 'local')\n return (val: unknown): T | undefined => {\n const result = zod.safeParse(val)\n return result.success ? result.data as T : undefined\n }\n}\n","export const xl1MaxValue = (places: bigint) => 10n ** (32n - places) - 1n\n","type XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const AttoXL1MaxValue = xl1MaxValue(XL1Places.atto)\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' }\nexport const isAttoXL1 = isXL1Factory<AttoXL1>(XL1Places.atto)\nexport const asAttoXL1 = asXL1Factory<AttoXL1>(XL1Places.atto)\nexport const toAttoXL1 = toXL1Factory<AttoXL1>(XL1Places.atto)\n\nexport const AttoXL1 = asAttoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const FemtoXL1MaxValue = xl1MaxValue(XL1Places.femto)\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' }\nexport const isFemtoXL1 = isXL1Factory<FemtoXL1>(XL1Places.femto)\nexport const asFemtoXL1 = asXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const toFemtoXL1 = toXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const FemtoXL1 = asFemtoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MicroXL1MaxValue = xl1MaxValue(XL1Places.micro)\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' }\nexport const isMicroXL1 = isXL1Factory<MicroXL1>(XL1Places.micro)\nexport const asMicroXL1 = asXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const toMicroXL1 = toXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const MicroXL1 = asMicroXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MilliXL1MaxValue = xl1MaxValue(XL1Places.milli)\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' }\nexport const isMilliXL1 = isXL1Factory<MilliXL1>(XL1Places.milli)\nexport const asMilliXL1 = asXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const toMilliXL1 = toXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const MilliXL1 = asMilliXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const NanoXL1MaxValue = xl1MaxValue(XL1Places.nano)\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' }\nexport const isNanoXL1 = isXL1Factory<NanoXL1>(XL1Places.nano)\nexport const asNanoXL1 = asXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const toNanoXL1 = toXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const NanoXL1 = asNanoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const PicoXL1MaxValue = xl1MaxValue(XL1Places.pico)\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' }\nexport const isPicoXL1 = isXL1Factory<PicoXL1>(XL1Places.pico)\nexport const asPicoXL1 = asXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const toPicoXL1 = toXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const PicoXL1 = asPicoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const XL1MaxValue = xl1MaxValue(XL1Places.xl1)\nexport type XL1 = bigint & { readonly _tag: 'XL1' }\nexport const isXL1 = isXL1Factory<XL1>(XL1Places.xl1)\nexport const asXL1 = asXL1Factory<XL1>(XL1Places.xl1)\n\nexport const toXL1 = toXL1Factory<XL1>(XL1Places.xl1)\n\nexport const XL1 = asXL1\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isUnsigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type UnsignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isUnsignedHydratedTransaction = (\n value: unknown,\n): value is UnsignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isUnsigned(value[0])\n )\n}\n\nexport const asUnsignedHydratedTransaction = AsObjectFactory.create<UnsignedHydratedTransaction>(\n isUnsignedHydratedTransaction,\n)\n","import type { Hash } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashStorageMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { Chain } from '../model.ts'\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: Chain\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: Hash[]\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 isSignedBlockBoundWitness = (value: unknown): value is Signed<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value is Signed<WithStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is WithHashStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isHashStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithHashStorageMeta = (value: unknown): value is Signed<WithHashStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithHashStorageMeta(value) && isSigned(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)\n\nexport const asBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashStorageMeta)\nexport const asSignedBlockBoundWitnessWithHashStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashStorageMeta)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { type Payload, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport {\n type BlockBoundWitness,\n isBlockBoundWitnessWithStorageMeta,\n} from './BlockBoundWitness.ts'\n\nexport type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedBlock = (\n value: unknown,\n): value is HydratedBlock => {\n return (\n isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedBlock = AsObjectFactory.create<HydratedBlock>(\n isHydratedBlock,\n)\n","import type { Address } from '@xylabs/hex'\n\n/**\n * The Zero Address is used as a marker address for various protocol operations.\n */\nexport const XYO_ZERO_ADDRESS = '0000000000000000000000000000000000000000' as const as Address\n\n/**\n * The Bridge Address is used as a marker address for bridge transactions.\n */\nexport const XYO_BRIDGE_ADDRESS = '3012193230121932301219323012193230121932' as const as Address\n\n/**\n * The Network Staking Address is used as a marker address for staking the network.\n */\nexport const XYO_NETWORK_STAKING_ADDRESS = '1969196919691969196919691969196919691969' as const as Address\n\n/**\n * The Step Reward Address is used as a marker address for step rewards.\n */\nexport const XYO_STEP_REWARD_ADDRESS = '1216197612161976121619761216197612161976' as const as Address\n","// the percent of the block rewards the producer gets\nexport const defaultRewardRatio = 0.05 as const // 5.0% goes to block producer\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.nano),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.nano),\n} as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\nimport { minTransactionFees } from './minTransactionFees.ts'\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: minTransactionFees.priority,\n} as const\n","import { AsTypeFactory } from '@xylabs/object'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes = [7, 31, 211, 2311, 30_031, 510_511, 9_699_691, 223_092_871, 6_469_693_231] as const\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`, { required: true })\n return StepSizes[validatedStep]\n}\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","export const XL1_PROTOCOL_VERSION_MAJOR = 1 as const\nexport const XL1_PROTOCOL_VERSION_MINOR = 2 as const\nexport const XL1_PROTOCOL_VERSION_PATCH = 0 as const\nexport const XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_VERSION_MINOR}.${XL1_PROTOCOL_VERSION_PATCH}` as const\nexport const XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1_000_000 + XL1_PROTOCOL_VERSION_MINOR * 1000 + XL1_PROTOCOL_VERSION_PATCH\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/**\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)\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)\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 { Hash } from '@xylabs/hex'\nimport type { Promisable } from '@xylabs/promise'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport type DataLakeData = Payload | ArrayBuffer\n\nexport interface XyoDataLakeViewer {\n // if resolves to hash payload, keep going until hitting a non-payload or maxDepth, or unable to find\n fetch(hashes: Hash[], maxDepth?: number): Promisable<DataLakeData[]>\n // same as fetch but never follows hash payloads\n get(hashes: Hash[]): Promisable<DataLakeData[]>\n // same as fetch, except returns each step in tuple containing the result and the steps\n trace(hash: Hash): Promisable<[DataLakeData | undefined, Payload[]]>\n}\n\nexport interface XyoDataLake extends XyoDataLakeViewer {\n add(items: DataLakeData[]): Promisable<DataLakeData[]>\n}\n\n/** @deprecated use XyoDataLake instead */\nexport interface XyoDataLakeProvider extends XyoDataLake {\n}\n\nexport const isDataLakeViewer = (value: unknown): value is XyoDataLakeViewer => {\n return (\n typeof value === 'object'\n && value !== null\n && 'fetch' in value\n && typeof (value as XyoDataLakeViewer).fetch === 'function'\n && 'get' in value\n && typeof (value as XyoDataLakeViewer).get === 'function'\n && 'trace' in value\n && typeof (value as XyoDataLakeViewer).trace === 'function'\n )\n}\n\nexport const isDataLakeProvider = (value: unknown): value is XyoDataLake => {\n return (\n isDataLakeViewer(value)\n && 'add' in value\n && typeof (value as XyoDataLake).add === 'function'\n )\n}\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","import { type Hash, isHash } from '@xylabs/hex'\nimport { isError } from '@xylabs/typeof'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport class ValidationError<TValue = Payload> extends Error {\n hash: Hash\n value: TValue\n constructor(hash: Hash, value: TValue, message?: string, cause?: unknown) {\n super(message)\n this.hash = hash\n this.name = this.constructor.name\n this.value = value\n this.cause = cause\n }\n}\n\nexport const isValidationError = <TValue = Payload>(\n error: unknown,\n): error is ValidationError<TValue> => {\n return (\n isError(error) && isHash((error as ValidationError<TValue>)?.hash) && (error as ValidationError<TValue>)?.value !== undefined\n )\n}\n","import type { Hash, Hex } from '@xylabs/hex'\n\nimport { type BlockBoundWitness, type HydratedBlock } from '../../block/index.ts'\nimport type { Chain } from '../../model.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BlockValidationError extends ValidationError<BlockBoundWitness> {}\n\nexport const isBlockValidationError = (\n error: unknown,\n): error is BlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockValidationError extends ValidationError<HydratedBlock> {}\n\nexport const isHydratedBlockValidationError = (\n error: unknown,\n): error is HydratedBlockValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockValidationError.constructor.name\n )\n}\n\nexport class HydratedBlockStateValidationError extends ValidationError<HydratedBlock> {\n chainId: Chain\n constructor(hash: Hash, chainId: Hex, value: HydratedBlock, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.chainId = chainId\n }\n}\n\nexport const isHydratedBlockStateValidationError = (\n error: unknown,\n): error is HydratedBlockStateValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBlockStateValidationError.constructor.name\n )\n}\n","import type { HydratedBoundWitness } from '@xyo-network/archivist-model'\nimport { type BoundWitness } from '@xyo-network/boundwitness-model'\n\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BoundWitnessValidationError extends ValidationError<BoundWitness> {}\n\nexport const isBoundWitnessValidationError = (\n error: unknown,\n): error is BoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BoundWitnessValidationError.constructor.name\n )\n}\n\nexport class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {}\n\nexport const isHydratedBoundWitnessValidationError = (\n error: unknown,\n): error is HydratedBoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBoundWitnessValidationError.constructor.name\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class InBlockPayloadValidationError extends ValidationError<Payload> {\n block: HydratedBlock\n constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.block = block\n }\n}\n\nexport const isInBlockPayloadValidationError = (\n error: unknown,\n): error is InBlockPayloadValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === InBlockPayloadValidationError.constructor.name\n )\n}\n","import { type SignedHydratedTransaction } from '../../transaction/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class HydratedTransactionValidationError extends ValidationError<SignedHydratedTransaction> {}\n\nexport const isHydratedTransactionValidationError = (\n error: unknown,\n): error is HydratedTransactionValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedTransactionValidationError.constructor.name\n )\n}\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,qBAAAA,oBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;AAC9C,OAAOC,QAAO;;;ACJd,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAI/B,IAAM,qCAA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kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,kCAAkC,YAAY;AAEjE;;;ACtCO,IAAM,8BAAN,cAA0C,gBAA8B;AAAC;AAEzE,IAAM,gCAAgC,CAC3C,UACyC;AACzC,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,4BAA4B,YAAY;AAE3D;AAEO,IAAM,sCAAN,cAAkD,gBAAsC;AAAC;AAEzF,IAAM,wCAAwC,CACnD,UACiD;AACjD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,oCAAoC,YAAY;AAEnE;;;ACnBO,IAAM,gCAAN,cAA4C,gBAAyB;AAAA,EAC1E;AAAA,EACA,YAAY,MAAY,OAAsB,OAAgB,SAAkB,OAAiB;AAC/F,UAAM,MAAM,OAAO,SAAS,KAAK;AACjC,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,IAAM,kCAAkC,CAC7C,UAC2C;AAC3C,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,8BAA8B,YAAY;AAE7D;;;AClBO,IAAM,qCAAN,cAAiD,gBAA2C;AAAC;AAE7F,IAAM,uCAAuC,CAClD,UACgD;AAChD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,mCAAmC,YAAY;AAElE;","names":["isHashStorageMeta","z","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isAnyPayload","isStorageMeta","AsObjectFactory","isBoundWitness","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isSigned","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isStorageMeta","isSigned","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","isHashStorageMeta","z","isHex","AsObjectFactory","isBoundWitness","isSigned","isHashStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex';
|
|
1
2
|
import type { Payload } from '@xyo-network/payload-model';
|
|
2
3
|
export type TimeDomain = 'xl1' | 'epoch' | 'ethereum';
|
|
3
4
|
export declare const TimeSchema: "network.xyo.time";
|
|
4
5
|
export type TimeSchema = typeof TimeSchema;
|
|
5
|
-
export interface
|
|
6
|
-
epoch: number;
|
|
7
|
-
ethereum?: number;
|
|
6
|
+
export interface XL1TimeFields {
|
|
8
7
|
xl1?: number;
|
|
8
|
+
xl1Hash?: Hash;
|
|
9
|
+
}
|
|
10
|
+
export interface EthereumTimeFields {
|
|
11
|
+
ethereum?: number;
|
|
12
|
+
ethereumHash?: Hash;
|
|
13
|
+
}
|
|
14
|
+
export interface TimeFields extends XL1TimeFields, EthereumTimeFields {
|
|
15
|
+
epoch: number;
|
|
9
16
|
}
|
|
10
17
|
export type TimePayload = Payload<TimeFields, TimeSchema>;
|
|
11
|
-
export declare const
|
|
18
|
+
export declare const isSafeEpoch: (value: unknown) => value is number;
|
|
19
|
+
export declare const isTimePayload: (value: unknown) => value is TimePayload;
|
|
12
20
|
export declare const asTimePayload: import("@xylabs/object").AsTypeFunction<TimePayload>;
|
|
13
21
|
export declare const asTimePayloadWithStorageMeta: import("@xylabs/object").AsTypeFunction<TimePayload>;
|
|
14
22
|
//# sourceMappingURL=Time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/Time.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/Time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAIzD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAA;AAErD,eAAO,MAAM,UAAU,EAAG,kBAA2B,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAA;AAE1C,MAAM,WAAW,aAAa;IAE5B,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,OAAO,CAAC,EAAE,IAAI,CAAA;CACf;AAED,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,YAAY,CAAC,EAAE,IAAI,CAAA;CACpB;AAED,MAAM,WAAW,UAAW,SAAQ,aAAa,EAAE,kBAAkB;IAEnE,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAGzD,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAErD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,WAEvD,CAAA;AAED,eAAO,MAAM,aAAa,sDAAwC,CAAA;AAClE,eAAO,MAAM,4BAA4B,sDAAwC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,sBAAsB,CAAA"}
|
|
@@ -2,7 +2,6 @@ export * from './AccountBalanceService.ts';
|
|
|
2
2
|
export * from './BlockProducerService.ts';
|
|
3
3
|
export * from './BlockRewardService.ts';
|
|
4
4
|
export * from './BlockRewardServiceV2.ts';
|
|
5
|
-
export * from './BridgeService.ts';
|
|
6
5
|
export * from './Chain/index.ts';
|
|
7
6
|
export * from './ChainIterator/index.ts';
|
|
8
7
|
export * from './Election.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,cAAc,CAAA;AAC5B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
BridgeDestinationObservation, BridgeIntent, BridgeSourceObservation, ChainStakeIntent, HashPayload, StepComplete, TimePayload, Transfer,
|
|
10
10
|
} from '../payload/index.ts'
|
|
11
11
|
import {
|
|
12
|
-
BridgeDestinationObservationSchema, BridgeIntentSchema,
|
|
12
|
+
BridgeDestinationObservationSchema, BridgeIntentSchema, BridgeSourceObservationSchema, ChainStakeIntentSchema, HashSchema,
|
|
13
13
|
isBridgeDestinationObservation, isBridgeIntent, isBridgeSourceObservation, isChainStakeIntent, isHashPayload, isTimePayload, isTransfer, StepCompleteSchema,
|
|
14
14
|
TimeSchema, TransferSchema,
|
|
15
15
|
} from '../payload/index.ts'
|
|
@@ -31,7 +31,6 @@ export const AllowedBlockPayloadSchemas: Schema[] = [
|
|
|
31
31
|
BoundWitnessSchema,
|
|
32
32
|
BridgeDestinationObservationSchema,
|
|
33
33
|
BridgeIntentSchema,
|
|
34
|
-
BridgeRequestSchema,
|
|
35
34
|
BridgeSourceObservationSchema,
|
|
36
35
|
ChainStakeIntentSchema,
|
|
37
36
|
HashSchema,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// the percent of the block rewards the producer gets
|
|
2
|
-
export const defaultRewardRatio = 0.
|
|
2
|
+
export const defaultRewardRatio = 0.05 as const // 5.0% goes to block producer
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
1
2
|
import { AsObjectFactory } from '@xylabs/object'
|
|
2
3
|
import type { Payload } from '@xyo-network/payload-model'
|
|
3
4
|
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
@@ -8,18 +9,35 @@ export type TimeDomain = 'xl1' | 'epoch' | 'ethereum'
|
|
|
8
9
|
export const TimeSchema = 'network.xyo.time' as const
|
|
9
10
|
export type TimeSchema = typeof TimeSchema
|
|
10
11
|
|
|
11
|
-
export interface
|
|
12
|
+
export interface XL1TimeFields {
|
|
13
|
+
// block number
|
|
14
|
+
xl1?: number
|
|
15
|
+
// block hash
|
|
16
|
+
xl1Hash?: Hash
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface EthereumTimeFields {
|
|
20
|
+
// block number
|
|
21
|
+
ethereum?: number
|
|
22
|
+
// block hash
|
|
23
|
+
ethereumHash?: Hash
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TimeFields extends XL1TimeFields, EthereumTimeFields {
|
|
12
27
|
// in milliseconds
|
|
13
28
|
epoch: number
|
|
14
|
-
// in block number
|
|
15
|
-
ethereum?: number
|
|
16
|
-
// in block number
|
|
17
|
-
xl1?: number
|
|
18
29
|
}
|
|
19
30
|
|
|
20
31
|
export type TimePayload = Payload<TimeFields, TimeSchema>
|
|
21
32
|
|
|
22
|
-
|
|
33
|
+
// to prevent scaling problems, we use double the current time as a max safe epoch
|
|
34
|
+
export const isSafeEpoch = (value: unknown): value is number => {
|
|
35
|
+
return typeof value === 'number' && value < 2 * Date.now()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const isTimePayload = (value: unknown): value is TimePayload => {
|
|
39
|
+
return isPayloadOfSchemaType<TimePayload>(TimeSchema)(value) && isSafeEpoch(value.epoch)
|
|
40
|
+
}
|
|
23
41
|
|
|
24
42
|
export const asTimePayload = AsObjectFactory.create(isTimePayload)
|
|
25
43
|
export const asTimePayloadWithStorageMeta = AsObjectFactory.create(isTimePayload)
|
package/src/services/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './AccountBalanceService.ts'
|
|
|
2
2
|
export * from './BlockProducerService.ts'
|
|
3
3
|
export * from './BlockRewardService.ts'
|
|
4
4
|
export * from './BlockRewardServiceV2.ts'
|
|
5
|
-
export * from './BridgeService.ts'
|
|
6
5
|
export * from './Chain/index.ts'
|
|
7
6
|
export * from './ChainIterator/index.ts'
|
|
8
7
|
export * from './Election.ts'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/promise';
|
|
2
|
-
import type { BridgeBack, BridgeComplete, BridgeRequest } from '../../payload/index.ts';
|
|
3
|
-
export interface BridgeViewInterface {
|
|
4
|
-
completedBridgeBack(): Promisable<BridgeBack[]>;
|
|
5
|
-
completedBridgeRequests(): Promisable<[BridgeRequest, BridgeComplete][]>;
|
|
6
|
-
pendingBridgeBack(): Promisable<BridgeBack[]>;
|
|
7
|
-
pendingBridgeRequests(): Promisable<BridgeRequest[]>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=Bridge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/view/Bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EACV,UAAU,EAAE,cAAc,EAAE,aAAa,EAC1C,MAAM,wBAAwB,CAAA;AAE/B,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC,CAAA;IAC/C,uBAAuB,IAAI,UAAU,CAAC,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAC,CAAA;IAExE,iBAAiB,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC,CAAA;IAC7C,qBAAqB,IAAI,UAAU,CAAC,aAAa,EAAE,CAAC,CAAA;CACrD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Address, EthAddress } from '@xylabs/hex';
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import type { FromFields } from './Executable.ts';
|
|
4
|
-
export declare const BridgeBackSchema: "network.xyo.chain.bridge.back";
|
|
5
|
-
export type BridgeBackSchema = typeof BridgeBackSchema;
|
|
6
|
-
export interface BridgeBackFields extends FromFields {
|
|
7
|
-
destAddress: Address;
|
|
8
|
-
src: 'ethereum';
|
|
9
|
-
srcAddress: EthAddress;
|
|
10
|
-
srcTime: number;
|
|
11
|
-
}
|
|
12
|
-
export type BridgeBack = Payload<BridgeBackFields, BridgeBackSchema>;
|
|
13
|
-
export declare const isBridgeBack: (x?: unknown | null) => x is BridgeBack;
|
|
14
|
-
export declare const asBridgeBack: import("@xylabs/object").AsTypeFunction<BridgeBack>;
|
|
15
|
-
//# sourceMappingURL=BridgeBack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeBack.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/BridgeBack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,eAAO,MAAM,gBAAgB,EAAG,+BAAwC,CAAA;AACxE,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;AAItD,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,WAAW,EAAE,OAAO,CAAA;IACpB,GAAG,EAAE,UAAU,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;IAEtB,OAAO,EAAE,MAAM,CAAA;CAChB;AAGD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;AAEpE,eAAO,MAAM,YAAY,yCAAsD,CAAA;AAE/E,eAAO,MAAM,YAAY,qDAAuC,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex';
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import type { FromFields } from './Executable.ts';
|
|
4
|
-
export declare const BridgeCompleteSchema: "network.xyo.chain.bridge.complete";
|
|
5
|
-
export type BridgeCompleteSchema = typeof BridgeCompleteSchema;
|
|
6
|
-
export interface BridgeCompleteFields extends FromFields {
|
|
7
|
-
destTime: number;
|
|
8
|
-
request: Hash;
|
|
9
|
-
}
|
|
10
|
-
export type BridgeComplete = Payload<BridgeCompleteFields, BridgeCompleteSchema>;
|
|
11
|
-
export declare const isBridgeComplete: (x?: unknown | null) => x is BridgeComplete;
|
|
12
|
-
export declare const asBridgeComplete: import("@xylabs/object").AsTypeFunction<BridgeComplete>;
|
|
13
|
-
//# sourceMappingURL=BridgeComplete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeComplete.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/BridgeComplete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,eAAO,MAAM,oBAAoB,EAAG,mCAA4C,CAAA;AAChF,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAA;AAI9D,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IAEtD,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,IAAI,CAAA;CACd;AAGD,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAA;AAEhF,eAAO,MAAM,gBAAgB,6CAA8D,CAAA;AAE3F,eAAO,MAAM,gBAAgB,yDAA2C,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Address, EthAddress, Hex } from '@xylabs/hex';
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import type { FromFields } from './Executable.ts';
|
|
4
|
-
export declare const BridgeRequestSchema: "network.xyo.chain.bridge.request";
|
|
5
|
-
export type BridgeRequestSchema = typeof BridgeRequestSchema;
|
|
6
|
-
export interface BridgeRequestFields extends FromFields {
|
|
7
|
-
amount: Hex;
|
|
8
|
-
dest: 'ethereum';
|
|
9
|
-
destAddress: EthAddress;
|
|
10
|
-
srcAddress: Address;
|
|
11
|
-
}
|
|
12
|
-
export type BridgeRequest = Payload<BridgeRequestFields, BridgeRequestSchema>;
|
|
13
|
-
export declare const isBridgeRequest: (x?: unknown | null) => x is BridgeRequest;
|
|
14
|
-
export declare const asBridgeRequest: import("@xylabs/object").AsTypeFunction<BridgeRequest>;
|
|
15
|
-
//# sourceMappingURL=BridgeRequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeRequest.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/BridgeRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,UAAU,EAAE,GAAG,EACzB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIjD,eAAO,MAAM,mBAAmB,EAAG,kCAA2C,CAAA;AAC9E,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,MAAM,EAAE,GAAG,CAAA;IAEX,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,UAAU,CAAA;IAGvB,UAAU,EAAE,OAAO,CAAA;CACpB;AAGD,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAA;AAE7E,eAAO,MAAM,eAAe,4CAA4D,CAAA;AAExF,eAAO,MAAM,eAAe,wDAA0C,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeService.d.ts","sourceRoot":"","sources":["../../../src/services/BridgeService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,WAAW,aAAc,SAAQ,gBAAgB,EAAE,mBAAmB;CAAG"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
BridgeBack, BridgeComplete, BridgeRequest,
|
|
5
|
-
} from '../../payload/index.ts'
|
|
6
|
-
|
|
7
|
-
export interface BridgeViewInterface {
|
|
8
|
-
completedBridgeBack(): Promisable<BridgeBack[]>
|
|
9
|
-
completedBridgeRequests(): Promisable<[BridgeRequest, BridgeComplete][]>
|
|
10
|
-
// the from field in these will be 0 since they have not been completed yet
|
|
11
|
-
pendingBridgeBack(): Promisable<BridgeBack[]>
|
|
12
|
-
pendingBridgeRequests(): Promisable<BridgeRequest[]>
|
|
13
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Address, EthAddress } from '@xylabs/hex'
|
|
2
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
-
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
5
|
-
|
|
6
|
-
import type { FromFields } from './Executable.ts'
|
|
7
|
-
|
|
8
|
-
export const BridgeBackSchema = 'network.xyo.chain.bridge.back' as const
|
|
9
|
-
export type BridgeBackSchema = typeof BridgeBackSchema
|
|
10
|
-
|
|
11
|
-
/* Report a bridging from WXL1 to XL1 */
|
|
12
|
-
|
|
13
|
-
export interface BridgeBackFields extends FromFields {
|
|
14
|
-
destAddress: Address
|
|
15
|
-
src: 'ethereum'
|
|
16
|
-
srcAddress: EthAddress
|
|
17
|
-
// usually the source's block number
|
|
18
|
-
srcTime: number
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block
|
|
22
|
-
export type BridgeBack = Payload<BridgeBackFields, BridgeBackSchema>
|
|
23
|
-
|
|
24
|
-
export const isBridgeBack = isPayloadOfSchemaType<BridgeBack>(BridgeBackSchema)
|
|
25
|
-
|
|
26
|
-
export const asBridgeBack = AsObjectFactory.create(isBridgeBack)
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
-
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
5
|
-
|
|
6
|
-
import type { FromFields } from './Executable.ts'
|
|
7
|
-
|
|
8
|
-
export const BridgeCompleteSchema = 'network.xyo.chain.bridge.complete' as const
|
|
9
|
-
export type BridgeCompleteSchema = typeof BridgeCompleteSchema
|
|
10
|
-
|
|
11
|
-
/* Complete a bridging from XL1 to WXL1 */
|
|
12
|
-
|
|
13
|
-
export interface BridgeCompleteFields extends FromFields {
|
|
14
|
-
// usually the destination's block number
|
|
15
|
-
destTime: number
|
|
16
|
-
request: Hash
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block
|
|
20
|
-
export type BridgeComplete = Payload<BridgeCompleteFields, BridgeCompleteSchema>
|
|
21
|
-
|
|
22
|
-
export const isBridgeComplete = isPayloadOfSchemaType<BridgeComplete>(BridgeCompleteSchema)
|
|
23
|
-
|
|
24
|
-
export const asBridgeComplete = AsObjectFactory.create(isBridgeComplete)
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Address, EthAddress, Hex,
|
|
3
|
-
} from '@xylabs/hex'
|
|
4
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
5
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
6
|
-
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
7
|
-
|
|
8
|
-
import type { FromFields } from './Executable.ts'
|
|
9
|
-
|
|
10
|
-
/* Request a bridging from XL1 to WXL1 */
|
|
11
|
-
|
|
12
|
-
export const BridgeRequestSchema = 'network.xyo.chain.bridge.request' as const
|
|
13
|
-
export type BridgeRequestSchema = typeof BridgeRequestSchema
|
|
14
|
-
|
|
15
|
-
export interface BridgeRequestFields extends FromFields {
|
|
16
|
-
amount: Hex
|
|
17
|
-
|
|
18
|
-
dest: 'ethereum'
|
|
19
|
-
destAddress: EthAddress
|
|
20
|
-
|
|
21
|
-
// xl1 address
|
|
22
|
-
srcAddress: Address
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block
|
|
26
|
-
export type BridgeRequest = Payload<BridgeRequestFields, BridgeRequestSchema>
|
|
27
|
-
|
|
28
|
-
export const isBridgeRequest = isPayloadOfSchemaType<BridgeRequest>(BridgeRequestSchema)
|
|
29
|
-
|
|
30
|
-
export const asBridgeRequest = AsObjectFactory.create(isBridgeRequest)
|