@xyo-network/xl1-protocol 1.4.3 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/index.mjs +45 -115
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/index.mjs +45 -115
- package/dist/node/index.mjs.map +1 -1
- package/dist/types/block/AllowedBlockPayload.d.ts +2 -2
- package/dist/types/block/AllowedBlockPayload.d.ts.map +1 -1
- package/dist/types/chain/ChainAnalyzer.d.ts +1 -1
- package/dist/types/chain/ChainAnalyzer.d.ts.map +1 -1
- package/dist/types/constants/TransactionGasCosts.d.ts +6 -25
- package/dist/types/constants/TransactionGasCosts.d.ts.map +1 -1
- package/dist/types/index.d.ts +12 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/iterator/ChainIterator.d.ts +3 -3
- package/dist/types/iterator/ChainIterator.d.ts.map +1 -1
- package/dist/types/iterator/ChainIteratorEventData.d.ts +1 -1
- package/dist/types/iterator/ChainIteratorEventData.d.ts.map +1 -1
- package/dist/types/payload/elevatable/ChainStakeIntent.d.ts +1 -1
- package/dist/types/payload/elevatable/ChainStakeIntent.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoNetwork.d.ts +1 -1
- package/dist/types/provider/v1/XyoNetwork.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoProvider.d.ts +2 -2
- package/dist/types/provider/v1/XyoProvider.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoRunner.d.ts +1 -1
- package/dist/types/provider/v1/XyoRunner.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoSigner.d.ts +2 -2
- package/dist/types/provider/v1/XyoSigner.d.ts.map +1 -1
- package/dist/types/provider/v1/XyoViewer.d.ts +3 -3
- package/dist/types/provider/v1/XyoViewer.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Account.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Account.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Block.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Block.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Chain.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Chain.d.ts.map +1 -1
- package/dist/types/provider/v2/viewer/Transaction.d.ts +1 -1
- package/dist/types/provider/v2/viewer/Transaction.d.ts.map +1 -1
- package/dist/types/repository/TransactionReadRepository.d.ts +1 -1
- package/dist/types/repository/TransactionReadRepository.d.ts.map +1 -1
- package/dist/types/repository/TransactionRepositoryIterator.d.ts +1 -1
- package/dist/types/repository/TransactionRepositoryIterator.d.ts.map +1 -1
- package/dist/types/repository/TransactionWriteRepository.d.ts +1 -1
- package/dist/types/repository/TransactionWriteRepository.d.ts.map +1 -1
- package/dist/types/services/BlockProducer.d.ts +3 -3
- package/dist/types/services/BlockProducer.d.ts.map +1 -1
- package/dist/types/services/Election.d.ts +1 -1
- package/dist/types/services/Election.d.ts.map +1 -1
- package/dist/types/services/PendingTransactionsService.d.ts +1 -1
- package/dist/types/services/PendingTransactionsService.d.ts.map +1 -1
- package/dist/types/services/stakeIntent/StakeIntentService.d.ts +1 -1
- package/dist/types/services/stakeIntent/StakeIntentService.d.ts.map +1 -1
- package/dist/types/transaction/TransactionBoundWitness.d.ts +2 -2
- package/dist/types/transaction/TransactionBoundWitness.d.ts.map +1 -1
- package/dist/types/transaction/TransactionFeesFields.d.ts +1 -1
- package/dist/types/transaction/TransactionFeesFields.d.ts.map +1 -1
- package/dist/types/validation/block/BlockValidationFunction.d.ts +1 -1
- package/dist/types/validation/block/BlockValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts +5 -3
- package/dist/types/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts +1 -1
- package/dist/types/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts +1 -1
- package/dist/types/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts +1 -1
- package/dist/types/validation/transaction/HydratedTransactionStateValidationFunction.d.ts.map +1 -1
- package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts +1 -1
- package/dist/types/validation/transaction/HydratedTransactionValidationFunction.d.ts.map +1 -1
- package/dist/types/xl1/XL1.d.ts +8 -25
- package/dist/types/xl1/XL1.d.ts.map +1 -1
- package/package.json +3 -10
- package/src/block/AllowedBlockPayload.ts +3 -3
- package/src/chain/ChainAnalyzer.ts +1 -1
- package/src/index.ts +12 -12
- package/src/iterator/ChainIterator.ts +3 -4
- package/src/iterator/ChainIteratorEventData.ts +1 -1
- package/src/payload/elevatable/ChainStakeIntent.ts +1 -2
- package/src/provider/v1/XyoNetwork.ts +1 -1
- package/src/provider/v1/XyoProvider.ts +2 -3
- package/src/provider/v1/XyoRunner.ts +1 -1
- package/src/provider/v1/XyoSigner.ts +2 -2
- package/src/provider/v1/XyoViewer.ts +3 -3
- package/src/provider/v2/viewer/Account.ts +1 -1
- package/src/provider/v2/viewer/Block.ts +1 -2
- package/src/provider/v2/viewer/Chain.ts +1 -2
- package/src/provider/v2/viewer/Transaction.ts +1 -2
- package/src/repository/TransactionReadRepository.ts +1 -2
- package/src/repository/TransactionRepositoryIterator.ts +1 -2
- package/src/repository/TransactionWriteRepository.ts +1 -2
- package/src/services/BlockProducer.ts +3 -3
- package/src/services/Election.ts +1 -2
- package/src/services/PendingTransactionsService.ts +1 -2
- package/src/services/stakeIntent/StakeIntentService.ts +1 -1
- package/src/transaction/TransactionBoundWitness.ts +2 -3
- package/src/transaction/TransactionFeesFields.ts +10 -8
- package/src/validation/block/BlockValidationFunction.ts +1 -1
- package/src/validation/block/HydratedBlockStateValidationFunction.ts +3 -3
- package/src/validation/block/HydratedBlockValidationFunction.ts +1 -1
- package/src/validation/payload/InBlockPayloadValidationFunction.ts +1 -1
- package/src/validation/transaction/HydratedTransactionStateValidationFunction.ts +1 -1
- package/src/validation/transaction/HydratedTransactionValidationFunction.ts +1 -1
- package/src/xl1/XL1.ts +9 -95
- package/tsconfig.json +0 -21
- package/dist/index.d.ts +0 -564
- package/dist/index.d.ts.map +0 -1
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,112 +1,3 @@
|
|
|
1
|
-
// src/xl1/XL1.ts
|
|
2
|
-
function XL1(value) {
|
|
3
|
-
const xl1Value = value;
|
|
4
|
-
return new Proxy(xl1Value, {
|
|
5
|
-
get(target, prop) {
|
|
6
|
-
if (prop === "toAtto") {
|
|
7
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.xl1);
|
|
8
|
-
}
|
|
9
|
-
return Reflect.get(target, prop);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function MilliXL1(value) {
|
|
14
|
-
const xl1Value = value;
|
|
15
|
-
return new Proxy(xl1Value, {
|
|
16
|
-
get(target, prop) {
|
|
17
|
-
if (prop === "toAtto") {
|
|
18
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.milli);
|
|
19
|
-
}
|
|
20
|
-
return Reflect.get(target, prop);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function MicroXL1(value) {
|
|
25
|
-
const xl1Value = value;
|
|
26
|
-
return new Proxy(xl1Value, {
|
|
27
|
-
get(target, prop) {
|
|
28
|
-
if (prop === "toAtto") {
|
|
29
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.micro);
|
|
30
|
-
}
|
|
31
|
-
return Reflect.get(target, prop);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function NanoXL1(value) {
|
|
36
|
-
const xl1Value = value;
|
|
37
|
-
return new Proxy(xl1Value, {
|
|
38
|
-
get(target, prop) {
|
|
39
|
-
if (prop === "toAtto") {
|
|
40
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.nano);
|
|
41
|
-
}
|
|
42
|
-
return Reflect.get(target, prop);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function PicoXL1(value) {
|
|
47
|
-
const xl1Value = value;
|
|
48
|
-
return new Proxy(xl1Value, {
|
|
49
|
-
get(target, prop) {
|
|
50
|
-
if (prop === "toAtto") {
|
|
51
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.pico);
|
|
52
|
-
}
|
|
53
|
-
return Reflect.get(target, prop);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function FemtoXL1(value) {
|
|
58
|
-
const xl1Value = value;
|
|
59
|
-
return new Proxy(xl1Value, {
|
|
60
|
-
get(target, prop) {
|
|
61
|
-
if (prop === "toAtto") {
|
|
62
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.femto);
|
|
63
|
-
}
|
|
64
|
-
return Reflect.get(target, prop);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function AttoXL1(value) {
|
|
69
|
-
const xl1Value = value;
|
|
70
|
-
return new Proxy(xl1Value, {
|
|
71
|
-
get(target, prop) {
|
|
72
|
-
if (prop === "toAtto") {
|
|
73
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.atto);
|
|
74
|
-
}
|
|
75
|
-
return Reflect.get(target, prop);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
var XL1ConvertDict = {
|
|
80
|
-
xl1: 18,
|
|
81
|
-
milli: 15,
|
|
82
|
-
micro: 12,
|
|
83
|
-
nano: 9,
|
|
84
|
-
pico: 6,
|
|
85
|
-
femto: 3,
|
|
86
|
-
atto: 0
|
|
87
|
-
};
|
|
88
|
-
var XL1Places = {
|
|
89
|
-
xl1: 18n,
|
|
90
|
-
milli: 15n,
|
|
91
|
-
micro: 12n,
|
|
92
|
-
nano: 9n,
|
|
93
|
-
pico: 6n,
|
|
94
|
-
femto: 3n,
|
|
95
|
-
atto: 0n
|
|
96
|
-
};
|
|
97
|
-
var AttoXL1ConvertFactor = {
|
|
98
|
-
xl1: 10n ** XL1Places.xl1,
|
|
99
|
-
milli: 10n ** XL1Places.milli,
|
|
100
|
-
micro: 10n ** XL1Places.micro,
|
|
101
|
-
nano: 10n ** XL1Places.nano,
|
|
102
|
-
pico: 10n ** XL1Places.pico,
|
|
103
|
-
femto: 10n ** XL1Places.femto,
|
|
104
|
-
atto: 10n ** XL1Places.atto
|
|
105
|
-
};
|
|
106
|
-
function xl1ConvertFactor(unit) {
|
|
107
|
-
return 10n ** XL1Places[unit];
|
|
108
|
-
}
|
|
109
|
-
|
|
110
1
|
// src/block/AllowedBlockPayload.ts
|
|
111
2
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
112
3
|
import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
|
|
@@ -173,17 +64,56 @@ var asOptionalTransactionBoundWitness = AsObjectFactory4.createOptional(isTransa
|
|
|
173
64
|
var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
|
|
174
65
|
var asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.createOptional(isTransactionBoundWitnessWithStorageMeta);
|
|
175
66
|
|
|
67
|
+
// src/xl1/XL1.ts
|
|
68
|
+
var XL1 = (value) => value;
|
|
69
|
+
var MilliXL1 = (value) => value;
|
|
70
|
+
var MicroXL1 = (value) => value;
|
|
71
|
+
var NanoXL1 = (value) => value;
|
|
72
|
+
var PicoXL1 = (value) => value;
|
|
73
|
+
var FemtoXL1 = (value) => value;
|
|
74
|
+
var AttoXL1 = (value) => value;
|
|
75
|
+
var XL1ConvertDict = {
|
|
76
|
+
xl1: 18,
|
|
77
|
+
milli: 15,
|
|
78
|
+
micro: 12,
|
|
79
|
+
nano: 9,
|
|
80
|
+
pico: 6,
|
|
81
|
+
femto: 3,
|
|
82
|
+
atto: 0
|
|
83
|
+
};
|
|
84
|
+
var XL1Places = {
|
|
85
|
+
xl1: 18n,
|
|
86
|
+
milli: 15n,
|
|
87
|
+
micro: 12n,
|
|
88
|
+
nano: 9n,
|
|
89
|
+
pico: 6n,
|
|
90
|
+
femto: 3n,
|
|
91
|
+
atto: 0n
|
|
92
|
+
};
|
|
93
|
+
var AttoXL1ConvertFactor = {
|
|
94
|
+
xl1: 10n ** XL1Places.xl1,
|
|
95
|
+
milli: 10n ** XL1Places.milli,
|
|
96
|
+
micro: 10n ** XL1Places.micro,
|
|
97
|
+
nano: 10n ** XL1Places.nano,
|
|
98
|
+
pico: 10n ** XL1Places.pico,
|
|
99
|
+
femto: 10n ** XL1Places.femto,
|
|
100
|
+
atto: 10n ** XL1Places.atto
|
|
101
|
+
};
|
|
102
|
+
function xl1ConvertFactor(unit) {
|
|
103
|
+
return 10n ** XL1Places[unit];
|
|
104
|
+
}
|
|
105
|
+
|
|
176
106
|
// src/transaction/TransactionFeesFields.ts
|
|
177
107
|
var minTransactionFees = {
|
|
178
|
-
base:
|
|
179
|
-
gasPrice:
|
|
180
|
-
gasLimit:
|
|
181
|
-
priority:
|
|
108
|
+
base: AttoXL1(1000n * AttoXL1ConvertFactor.micro),
|
|
109
|
+
gasPrice: AttoXL1(1n * AttoXL1ConvertFactor.micro),
|
|
110
|
+
gasLimit: AttoXL1(1000n * AttoXL1ConvertFactor.micro),
|
|
111
|
+
priority: AttoXL1(0n * AttoXL1ConvertFactor.micro)
|
|
182
112
|
};
|
|
183
113
|
var defaultTransactionFees = {
|
|
184
114
|
base: minTransactionFees.base,
|
|
185
|
-
gasPrice:
|
|
186
|
-
gasLimit:
|
|
115
|
+
gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.micro),
|
|
116
|
+
gasLimit: AttoXL1(1000000n * AttoXL1ConvertFactor.micro),
|
|
187
117
|
priority: minTransactionFees.priority
|
|
188
118
|
};
|
|
189
119
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/xl1/XL1.ts","../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/transaction/TransactionFeesFields.ts","../../src/block/BlockBoundWitness.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\nexport type TypingFunc<T extends bigint> = {\n (value: bigint): T\n toAtto: () => AttoXL1\n}\n\nexport function XL1(value: bigint): XL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as XL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.xl1)\n }\n return Reflect.get(target, prop)\n },\n }) as XL1 & { toAtto(): AttoXL1 }\n}\n\nexport function MilliXL1(value: bigint): MilliXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as MilliXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.milli)\n }\n return Reflect.get(target, prop)\n },\n }) as MilliXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function MicroXL1(value: bigint): MicroXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as MicroXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.micro)\n }\n return Reflect.get(target, prop)\n },\n }) as MicroXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function NanoXL1(value: bigint): NanoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as NanoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.nano)\n }\n return Reflect.get(target, prop)\n },\n }) as NanoXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function PicoXL1(value: bigint): PicoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as PicoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.pico)\n }\n return Reflect.get(target, prop)\n },\n }) as PicoXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function FemtoXL1(value: bigint): FemtoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as FemtoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.femto)\n }\n return Reflect.get(target, prop)\n },\n }) as FemtoXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function AttoXL1(value: bigint): AttoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as AttoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.atto)\n }\n return Reflect.get(target, prop)\n },\n }) as AttoXL1 & { toAtto(): AttoXL1 }\n}\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\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\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '#payload'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '#payload'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '#transaction'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '#fields'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Record<Address, Hex>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '#fields'\nimport type { FromFields, OptionalExecutable } from '#payload'\n\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hex } from '@xylabs/hex'\n\nimport type { AttoXL1 } from '../xl1/index.ts'\nimport { MicroXL1 } 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 minTransactionFees: TransactionFeesBigInt = {\n base: MicroXL1(1000n).toAtto(),\n gasPrice: MicroXL1(1n).toAtto(),\n gasLimit: MicroXL1(1000n).toAtto(),\n priority: MicroXL1(0n).toAtto(),\n} as const\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: MicroXL1(10n).toAtto(),\n gasLimit: MicroXL1(1_000_000n).toAtto(),\n priority: minTransactionFees.priority,\n} as const\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956] as const\n","import { MicroXL1 } from '../xl1/index.ts'\n\nexport 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: MicroXL1(10n),\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: MicroXL1(1000n),\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: MicroXL1(1000n),\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: MicroXL1(100n),\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: MicroXL1(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","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";AAeO,SAAS,IAAI,OAA4C;AAC9D,QAAM,WAAW;AAEjB,SAAO,IAAI,MAAM,UAAU;AAAA,IACzB,IAAI,QAAQ,MAAM;AAChB,UAAI,SAAS,UAAU;AACrB,eAAO,MAAM,QAAQ,SAAS,qBAAqB,GAAG;AAAA,MACxD;AACA,aAAO,QAAQ,IAAI,QAAQ,IAAI;AAAA,IACjC;AAAA,EACF,CAAC;AACH;AAEO,SAAS,SAAS,OAAiD;AACxE,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YzC,IAAM,+BAA+BA,uBAAkD,gCAAgC;;;ACf9H,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,gCAAgC;AAgBtC,IAAM,4BAA4BA,uBAA+C,6BAA6B;;;ACjBrH,SAAS,mBAAAC,wBAAuB;AAEhC,SAAS,yBAAAC,wBAAuB,iBAAAC,sBAAqB;AAiB9C,IAAM,kCAAkC;AAWxC,IAAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,uBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;AAExG,IAAM,qDACXA,iBAAgB,eAA2D,0CAA0C;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
|
|
1
|
+
{"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/xl1/XL1.ts","../../src/transaction/TransactionFeesFields.ts","../../src/block/BlockBoundWitness.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } 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)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Record<Address, Hex>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { 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: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\nexport type TypingFunc<T extends bigint> = (value: bigint) => T\n\nexport const XL1: TypingFunc<XL1> = (value: bigint): XL1 => value as XL1\nexport const MilliXL1: TypingFunc<MilliXL1> = (value: bigint): MilliXL1 => value as MilliXL1\nexport const MicroXL1: TypingFunc<MicroXL1> = (value: bigint): MicroXL1 => value as MicroXL1\nexport const NanoXL1: TypingFunc<NanoXL1> = (value: bigint): NanoXL1 => value as NanoXL1\nexport const PicoXL1: TypingFunc<PicoXL1> = (value: bigint): PicoXL1 => value as PicoXL1\nexport const FemtoXL1: TypingFunc<FemtoXL1> = (value: bigint): FemtoXL1 => value as FemtoXL1\nexport const AttoXL1: TypingFunc<AttoXL1> = (value: bigint): AttoXL1 => value as AttoXL1\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\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\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import type { Hex } from '@xylabs/hex'\n\nimport {\n AttoXL1,\n AttoXL1ConvertFactor,\n} 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 minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.micro),\n gasPrice: AttoXL1(1n * AttoXL1ConvertFactor.micro),\n gasLimit: AttoXL1(1000n * AttoXL1ConvertFactor.micro),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.micro),\n} as const\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.micro),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.micro),\n priority: minTransactionFees.priority,\n} as const\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956] as const\n","import { MicroXL1 } from '../xl1/index.ts'\n\nexport 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: MicroXL1(10n),\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: MicroXL1(1000n),\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: MicroXL1(1000n),\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: MicroXL1(100n),\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: MicroXL1(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","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAK/B,IAAM,yBAAyB;AAc/B,IAAM,qBAAqB,CAAC,MAA8C;AAC/E,SAAO,sBAAwC,sBAAsB,EAAE,CAAC,KACnE,qBAAqB,EAAE,GAAG,MAAM,UAChC,qBAAqB,EAAE,GAAG,MAAM;AACvC;AACO,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AACpE,IAAM,6BAA6B,gBAAgB,eAAe,kBAAkB;AAE3F,IAAM,uBAAuB,CAAC,QAAgB;AAC5C,SAAQ,OAAO,UAAU,GAAG,KAAK,OAAO,IAAK,MAAM;AACrD;;;AC7BA,SAAS,oBAAoB;AAOtB,IAAM,UAAU,CAAC,UAAwC;AAC9D,SAAQ,MAAqB,SAAS;AACx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Meta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,112 +1,3 @@
|
|
|
1
|
-
// src/xl1/XL1.ts
|
|
2
|
-
function XL1(value) {
|
|
3
|
-
const xl1Value = value;
|
|
4
|
-
return new Proxy(xl1Value, {
|
|
5
|
-
get(target, prop) {
|
|
6
|
-
if (prop === "toAtto") {
|
|
7
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.xl1);
|
|
8
|
-
}
|
|
9
|
-
return Reflect.get(target, prop);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function MilliXL1(value) {
|
|
14
|
-
const xl1Value = value;
|
|
15
|
-
return new Proxy(xl1Value, {
|
|
16
|
-
get(target, prop) {
|
|
17
|
-
if (prop === "toAtto") {
|
|
18
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.milli);
|
|
19
|
-
}
|
|
20
|
-
return Reflect.get(target, prop);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function MicroXL1(value) {
|
|
25
|
-
const xl1Value = value;
|
|
26
|
-
return new Proxy(xl1Value, {
|
|
27
|
-
get(target, prop) {
|
|
28
|
-
if (prop === "toAtto") {
|
|
29
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.micro);
|
|
30
|
-
}
|
|
31
|
-
return Reflect.get(target, prop);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function NanoXL1(value) {
|
|
36
|
-
const xl1Value = value;
|
|
37
|
-
return new Proxy(xl1Value, {
|
|
38
|
-
get(target, prop) {
|
|
39
|
-
if (prop === "toAtto") {
|
|
40
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.nano);
|
|
41
|
-
}
|
|
42
|
-
return Reflect.get(target, prop);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function PicoXL1(value) {
|
|
47
|
-
const xl1Value = value;
|
|
48
|
-
return new Proxy(xl1Value, {
|
|
49
|
-
get(target, prop) {
|
|
50
|
-
if (prop === "toAtto") {
|
|
51
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.pico);
|
|
52
|
-
}
|
|
53
|
-
return Reflect.get(target, prop);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function FemtoXL1(value) {
|
|
58
|
-
const xl1Value = value;
|
|
59
|
-
return new Proxy(xl1Value, {
|
|
60
|
-
get(target, prop) {
|
|
61
|
-
if (prop === "toAtto") {
|
|
62
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.femto);
|
|
63
|
-
}
|
|
64
|
-
return Reflect.get(target, prop);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function AttoXL1(value) {
|
|
69
|
-
const xl1Value = value;
|
|
70
|
-
return new Proxy(xl1Value, {
|
|
71
|
-
get(target, prop) {
|
|
72
|
-
if (prop === "toAtto") {
|
|
73
|
-
return () => AttoXL1(target * AttoXL1ConvertFactor.atto);
|
|
74
|
-
}
|
|
75
|
-
return Reflect.get(target, prop);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
var XL1ConvertDict = {
|
|
80
|
-
xl1: 18,
|
|
81
|
-
milli: 15,
|
|
82
|
-
micro: 12,
|
|
83
|
-
nano: 9,
|
|
84
|
-
pico: 6,
|
|
85
|
-
femto: 3,
|
|
86
|
-
atto: 0
|
|
87
|
-
};
|
|
88
|
-
var XL1Places = {
|
|
89
|
-
xl1: 18n,
|
|
90
|
-
milli: 15n,
|
|
91
|
-
micro: 12n,
|
|
92
|
-
nano: 9n,
|
|
93
|
-
pico: 6n,
|
|
94
|
-
femto: 3n,
|
|
95
|
-
atto: 0n
|
|
96
|
-
};
|
|
97
|
-
var AttoXL1ConvertFactor = {
|
|
98
|
-
xl1: 10n ** XL1Places.xl1,
|
|
99
|
-
milli: 10n ** XL1Places.milli,
|
|
100
|
-
micro: 10n ** XL1Places.micro,
|
|
101
|
-
nano: 10n ** XL1Places.nano,
|
|
102
|
-
pico: 10n ** XL1Places.pico,
|
|
103
|
-
femto: 10n ** XL1Places.femto,
|
|
104
|
-
atto: 10n ** XL1Places.atto
|
|
105
|
-
};
|
|
106
|
-
function xl1ConvertFactor(unit) {
|
|
107
|
-
return 10n ** XL1Places[unit];
|
|
108
|
-
}
|
|
109
|
-
|
|
110
1
|
// src/block/AllowedBlockPayload.ts
|
|
111
2
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
112
3
|
import { isHashStorageMeta, isSchema } from "@xyo-network/payload-model";
|
|
@@ -173,17 +64,56 @@ var asOptionalTransactionBoundWitness = AsObjectFactory4.createOptional(isTransa
|
|
|
173
64
|
var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.create(isTransactionBoundWitnessWithStorageMeta);
|
|
174
65
|
var asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory4.createOptional(isTransactionBoundWitnessWithStorageMeta);
|
|
175
66
|
|
|
67
|
+
// src/xl1/XL1.ts
|
|
68
|
+
var XL1 = (value) => value;
|
|
69
|
+
var MilliXL1 = (value) => value;
|
|
70
|
+
var MicroXL1 = (value) => value;
|
|
71
|
+
var NanoXL1 = (value) => value;
|
|
72
|
+
var PicoXL1 = (value) => value;
|
|
73
|
+
var FemtoXL1 = (value) => value;
|
|
74
|
+
var AttoXL1 = (value) => value;
|
|
75
|
+
var XL1ConvertDict = {
|
|
76
|
+
xl1: 18,
|
|
77
|
+
milli: 15,
|
|
78
|
+
micro: 12,
|
|
79
|
+
nano: 9,
|
|
80
|
+
pico: 6,
|
|
81
|
+
femto: 3,
|
|
82
|
+
atto: 0
|
|
83
|
+
};
|
|
84
|
+
var XL1Places = {
|
|
85
|
+
xl1: 18n,
|
|
86
|
+
milli: 15n,
|
|
87
|
+
micro: 12n,
|
|
88
|
+
nano: 9n,
|
|
89
|
+
pico: 6n,
|
|
90
|
+
femto: 3n,
|
|
91
|
+
atto: 0n
|
|
92
|
+
};
|
|
93
|
+
var AttoXL1ConvertFactor = {
|
|
94
|
+
xl1: 10n ** XL1Places.xl1,
|
|
95
|
+
milli: 10n ** XL1Places.milli,
|
|
96
|
+
micro: 10n ** XL1Places.micro,
|
|
97
|
+
nano: 10n ** XL1Places.nano,
|
|
98
|
+
pico: 10n ** XL1Places.pico,
|
|
99
|
+
femto: 10n ** XL1Places.femto,
|
|
100
|
+
atto: 10n ** XL1Places.atto
|
|
101
|
+
};
|
|
102
|
+
function xl1ConvertFactor(unit) {
|
|
103
|
+
return 10n ** XL1Places[unit];
|
|
104
|
+
}
|
|
105
|
+
|
|
176
106
|
// src/transaction/TransactionFeesFields.ts
|
|
177
107
|
var minTransactionFees = {
|
|
178
|
-
base:
|
|
179
|
-
gasPrice:
|
|
180
|
-
gasLimit:
|
|
181
|
-
priority:
|
|
108
|
+
base: AttoXL1(1000n * AttoXL1ConvertFactor.micro),
|
|
109
|
+
gasPrice: AttoXL1(1n * AttoXL1ConvertFactor.micro),
|
|
110
|
+
gasLimit: AttoXL1(1000n * AttoXL1ConvertFactor.micro),
|
|
111
|
+
priority: AttoXL1(0n * AttoXL1ConvertFactor.micro)
|
|
182
112
|
};
|
|
183
113
|
var defaultTransactionFees = {
|
|
184
114
|
base: minTransactionFees.base,
|
|
185
|
-
gasPrice:
|
|
186
|
-
gasLimit:
|
|
115
|
+
gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.micro),
|
|
116
|
+
gasLimit: AttoXL1(1000000n * AttoXL1ConvertFactor.micro),
|
|
187
117
|
priority: minTransactionFees.priority
|
|
188
118
|
};
|
|
189
119
|
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/xl1/XL1.ts","../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/transaction/TransactionFeesFields.ts","../../src/block/BlockBoundWitness.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\nexport type TypingFunc<T extends bigint> = {\n (value: bigint): T\n toAtto: () => AttoXL1\n}\n\nexport function XL1(value: bigint): XL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as XL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.xl1)\n }\n return Reflect.get(target, prop)\n },\n }) as XL1 & { toAtto(): AttoXL1 }\n}\n\nexport function MilliXL1(value: bigint): MilliXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as MilliXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.milli)\n }\n return Reflect.get(target, prop)\n },\n }) as MilliXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function MicroXL1(value: bigint): MicroXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as MicroXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.micro)\n }\n return Reflect.get(target, prop)\n },\n }) as MicroXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function NanoXL1(value: bigint): NanoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as NanoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.nano)\n }\n return Reflect.get(target, prop)\n },\n }) as NanoXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function PicoXL1(value: bigint): PicoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as PicoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.pico)\n }\n return Reflect.get(target, prop)\n },\n }) as PicoXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function FemtoXL1(value: bigint): FemtoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as FemtoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.femto)\n }\n return Reflect.get(target, prop)\n },\n }) as FemtoXL1 & { toAtto(): AttoXL1 }\n}\n\nexport function AttoXL1(value: bigint): AttoXL1 & { toAtto(): AttoXL1 } {\n const xl1Value = value as AttoXL1\n\n return new Proxy(xl1Value, {\n get(target, prop) {\n if (prop === 'toAtto') {\n return () => AttoXL1(target * AttoXL1ConvertFactor.atto)\n }\n return Reflect.get(target, prop)\n },\n }) as AttoXL1 & { toAtto(): AttoXL1 }\n}\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\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\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '#payload'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '#payload'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '#transaction'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '#fields'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Record<Address, Hex>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '#fields'\nimport type { FromFields, OptionalExecutable } from '#payload'\n\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hex } from '@xylabs/hex'\n\nimport type { AttoXL1 } from '../xl1/index.ts'\nimport { MicroXL1 } 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 minTransactionFees: TransactionFeesBigInt = {\n base: MicroXL1(1000n).toAtto(),\n gasPrice: MicroXL1(1n).toAtto(),\n gasLimit: MicroXL1(1000n).toAtto(),\n priority: MicroXL1(0n).toAtto(),\n} as const\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: MicroXL1(10n).toAtto(),\n gasLimit: MicroXL1(1_000_000n).toAtto(),\n priority: minTransactionFees.priority,\n} as const\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956] as const\n","import { MicroXL1 } from '../xl1/index.ts'\n\nexport 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: MicroXL1(10n),\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: MicroXL1(1000n),\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: MicroXL1(1000n),\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: MicroXL1(100n),\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: MicroXL1(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","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";AAeO,SAAS,IAAI,OAA4C;AAC9D,QAAM,WAAW;AAEjB,SAAO,IAAI,MAAM,UAAU;AAAA,IACzB,IAAI,QAAQ,MAAM;AAChB,UAAI,SAAS,UAAU;AACrB,eAAO,MAAM,QAAQ,SAAS,qBAAqB,GAAG;AAAA,MACxD;AACA,aAAO,QAAQ,IAAI,QAAQ,IAAI;AAAA,IACjC;AAAA,EACF,CAAC;AACH;AAEO,SAAS,SAAS,OAAiD;AACxE,QAAM,WAAW;AAEjB,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,uBAAkD,gCAAgC;;;ACf9H,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,gCAAgC;AAgBtC,IAAM,4BAA4BA,uBAA+C,6BAA6B;;;ACjBrH,SAAS,mBAAAC,wBAAuB;AAEhC,SAAS,yBAAAC,wBAAuB,iBAAAC,sBAAqB;AAiB9C,IAAM,kCAAkC;AAWxC,IAAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,uBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;AAExG,IAAM,qDACXA,iBAAgB,eAA2D,0CAA0C;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
|
|
1
|
+
{"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/xl1/XL1.ts","../../src/transaction/TransactionFeesFields.ts","../../src/block/BlockBoundWitness.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } 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)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Record<Address, Hex>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { 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: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\nexport type TypingFunc<T extends bigint> = (value: bigint) => T\n\nexport const XL1: TypingFunc<XL1> = (value: bigint): XL1 => value as XL1\nexport const MilliXL1: TypingFunc<MilliXL1> = (value: bigint): MilliXL1 => value as MilliXL1\nexport const MicroXL1: TypingFunc<MicroXL1> = (value: bigint): MicroXL1 => value as MicroXL1\nexport const NanoXL1: TypingFunc<NanoXL1> = (value: bigint): NanoXL1 => value as NanoXL1\nexport const PicoXL1: TypingFunc<PicoXL1> = (value: bigint): PicoXL1 => value as PicoXL1\nexport const FemtoXL1: TypingFunc<FemtoXL1> = (value: bigint): FemtoXL1 => value as FemtoXL1\nexport const AttoXL1: TypingFunc<AttoXL1> = (value: bigint): AttoXL1 => value as AttoXL1\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\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\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import type { Hex } from '@xylabs/hex'\n\nimport {\n AttoXL1,\n AttoXL1ConvertFactor,\n} 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 minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.micro),\n gasPrice: AttoXL1(1n * AttoXL1ConvertFactor.micro),\n gasLimit: AttoXL1(1000n * AttoXL1ConvertFactor.micro),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.micro),\n} as const\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.micro),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.micro),\n priority: minTransactionFees.priority,\n} as const\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956] as const\n","import { MicroXL1 } from '../xl1/index.ts'\n\nexport 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: MicroXL1(10n),\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: MicroXL1(1000n),\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: MicroXL1(1000n),\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: MicroXL1(100n),\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: MicroXL1(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","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAK/B,IAAM,yBAAyB;AAc/B,IAAM,qBAAqB,CAAC,MAA8C;AAC/E,SAAO,sBAAwC,sBAAsB,EAAE,CAAC,KACnE,qBAAqB,EAAE,GAAG,MAAM,UAChC,qBAAqB,EAAE,GAAG,MAAM;AACvC;AACO,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AACpE,IAAM,6BAA6B,gBAAgB,eAAe,kBAAkB;AAE3F,IAAM,uBAAuB,CAAC,QAAgB;AAC5C,SAAQ,OAAO,UAAU,GAAG,KAAK,OAAO,IAAK,MAAM;AACrD;;;AC7BA,SAAS,oBAAoB;AAOtB,IAAM,UAAU,CAAC,UAAwC;AAC9D,SAAQ,MAAqB,SAAS;AACxC;AASO,IAAM,eAAe,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AAA;AAAA,EAGnC,gBAAgB,SAAS,IAAI;AAAA;AAAA,EAG7B,mBAAmB,SAAS,IAAI;AAClC;;;ACnBA,SAAS,mBAAAG,wBAAuB;AAEhC;AAAA,EACE,yBAAAC;AAAA,EACA;AAAA,OACK;AAEA,IAAM,oBAAoB;AAqB1B,IAAM,gBAAgBA,uBAAmC,iBAAiB;AAC1E,IAAM,gBAAgBD,iBAAgB,OAAoB,aAAa;AACvE,IAAM,wBAAwBA,iBAAgB,eAA4B,aAAa;AAKvF,IAAM,2BAA2B,iCAA8C,iBAAiB;AAChG,IAAM,2BAA2BA,iBAAgB,OAAiC,wBAAwB;AAC1G,IAAM,mCAAmCA,iBAAgB,eAAyC,wBAAwB;;;ACrCjI,SAAS,yBAAAE,8BAA6B;AAE/B,IAAM,sBAAsB;AAmB5B,IAAM,kBAAkBA,uBAAqC,mBAAmB;;;ACpBvF,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,mCAAmC;AAYzC,IAAM,+BAA+BA,uBAAkD,gCAAgC;;;ACf9H,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,gCAAgC;AAgBtC,IAAM,4BAA4BA,uBAA+C,6BAA6B;;;ACjBrH,SAAS,mBAAAC,wBAAuB;AAEhC,SAAS,yBAAAC,wBAAuB,iBAAAC,sBAAqB;AAiB9C,IAAM,kCAAkC;AAWxC,IAAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,uBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;AAExG,IAAM,qDACXA,iBAAgB,eAA2D,0CAA0C;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
|