@xyo-network/xl1-protocol 1.13.9 → 1.13.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/block/AllowedBlockPayload.d.ts +3 -3
- package/dist/neutral/index.mjs +46 -19
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/StepIdentity.d.ts +2 -6
- package/dist/neutral/model/StepIdentity.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Time.d.ts +44 -16
- package/dist/neutral/payload/elevatable/Time.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/model/StepIdentity.ts +4 -9
- package/src/payload/elevatable/Time.ts +20 -14
|
@@ -4,7 +4,7 @@ import z from 'zod';
|
|
|
4
4
|
import type { BridgeDestinationObservation, BridgeIntent, BridgeSourceObservation, ChainStakeIntent, HashPayload, StepComplete, TimePayload, Transfer } from '../payload/index.ts';
|
|
5
5
|
import { type TransactionBoundWitness } from '../transaction/index.ts';
|
|
6
6
|
export type AllowedBlockPayload = Transfer | BridgeDestinationObservation | BridgeIntent | BridgeSourceObservation | ChainStakeIntent | HashPayload | SchemaPayload | StepComplete | TimePayload | TransactionBoundWitness;
|
|
7
|
-
export declare const AllowedBlockPayloadSchemas: ("network.xyo.chain.bridge.observation.destination" | "network.xyo.chain.bridge.intent" | "network.xyo.chain.bridge.observation.source" | "network.xyo.chain.stake.intent" | "network.xyo.hash" | "network.xyo.chain.step.complete" | "network.xyo.
|
|
7
|
+
export declare const AllowedBlockPayloadSchemas: ("network.xyo.chain.bridge.observation.destination" | "network.xyo.chain.bridge.intent" | "network.xyo.chain.bridge.observation.source" | "network.xyo.chain.stake.intent" | "network.xyo.hash" | "network.xyo.chain.step.complete" | "network.xyo.transfer" | "network.xyo.time" | "network.xyo.boundwitness" | "network.xyo.schema")[];
|
|
8
8
|
export declare const AllowedBlockPayloadSchemaZod: z.ZodEnum<{
|
|
9
9
|
"network.xyo.chain.bridge.observation.destination": "network.xyo.chain.bridge.observation.destination";
|
|
10
10
|
"network.xyo.chain.bridge.intent": "network.xyo.chain.bridge.intent";
|
|
@@ -12,13 +12,13 @@ export declare const AllowedBlockPayloadSchemaZod: z.ZodEnum<{
|
|
|
12
12
|
"network.xyo.chain.stake.intent": "network.xyo.chain.stake.intent";
|
|
13
13
|
"network.xyo.hash": "network.xyo.hash";
|
|
14
14
|
"network.xyo.chain.step.complete": "network.xyo.chain.step.complete";
|
|
15
|
-
"network.xyo.time": "network.xyo.time";
|
|
16
15
|
"network.xyo.transfer": "network.xyo.transfer";
|
|
16
|
+
"network.xyo.time": "network.xyo.time";
|
|
17
17
|
"network.xyo.boundwitness": "network.xyo.boundwitness";
|
|
18
18
|
"network.xyo.schema": "network.xyo.schema";
|
|
19
19
|
}>;
|
|
20
20
|
export type AllowedBlockPayloadSchema = z.infer<typeof AllowedBlockPayloadSchemaZod>;
|
|
21
|
-
export declare const isAllowedBlockPayloadSchema: (value: unknown) => value is "network.xyo.chain.bridge.observation.destination" | "network.xyo.chain.bridge.intent" | "network.xyo.chain.bridge.observation.source" | "network.xyo.chain.stake.intent" | "network.xyo.hash" | "network.xyo.chain.step.complete" | "network.xyo.
|
|
21
|
+
export declare const isAllowedBlockPayloadSchema: (value: unknown) => value is "network.xyo.chain.bridge.observation.destination" | "network.xyo.chain.bridge.intent" | "network.xyo.chain.bridge.observation.source" | "network.xyo.chain.stake.intent" | "network.xyo.hash" | "network.xyo.chain.step.complete" | "network.xyo.transfer" | "network.xyo.time" | "network.xyo.boundwitness" | "network.xyo.schema";
|
|
22
22
|
export declare const isAllowedBlockPayload: (value: unknown) => value is AllowedBlockPayload;
|
|
23
23
|
export declare const isAllowedBlockPayloadWithHashMeta: (value: unknown) => value is WithStorageMeta<AllowedBlockPayload>;
|
|
24
24
|
//# sourceMappingURL=AllowedBlockPayload.d.ts.map
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -287,7 +287,7 @@ var XL1Amount = class _XL1Amount {
|
|
|
287
287
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
288
288
|
import { isHashMeta as isHashMeta3 } from "@xyo-network/payload-model";
|
|
289
289
|
import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
290
|
-
import
|
|
290
|
+
import z15 from "zod";
|
|
291
291
|
|
|
292
292
|
// src/model/BlockNumber/BlockNumber.ts
|
|
293
293
|
import z3 from "zod";
|
|
@@ -422,8 +422,8 @@ function fromXL1BlockNumberKey(key, assert) {
|
|
|
422
422
|
import { isUndefined } from "@xylabs/typeof";
|
|
423
423
|
import * as z10 from "zod";
|
|
424
424
|
var StepIdentityZod = z10.object({
|
|
425
|
-
block:
|
|
426
|
-
step: z10.number().int().nonnegative()
|
|
425
|
+
block: XL1BlockNumberZod.describe("The block number at which the step occurs"),
|
|
426
|
+
step: z10.number().int().nonnegative().describe("The index of the step into the StepSize array")
|
|
427
427
|
});
|
|
428
428
|
function tryParseInt(value) {
|
|
429
429
|
if (value === "") return void 0;
|
|
@@ -586,25 +586,18 @@ var isStepComplete = isPayloadOfSchemaType3(StepCompleteSchema);
|
|
|
586
586
|
var asStepComplete = AsObjectFactory6.create(isStepComplete);
|
|
587
587
|
|
|
588
588
|
// src/payload/elevatable/Time.ts
|
|
589
|
-
import {
|
|
590
|
-
import {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
return typeof value === "number" && value < 2 * Date.now();
|
|
594
|
-
};
|
|
595
|
-
var isTimePayload = (value) => {
|
|
596
|
-
return isPayloadOfSchemaType4(TimeSchema)(value) && isSafeEpoch(value.epoch);
|
|
597
|
-
};
|
|
598
|
-
var asTimePayload = AsObjectFactory7.create(isTimePayload);
|
|
599
|
-
var asTimePayloadWithStorageMeta = AsObjectFactory7.create(isTimePayload);
|
|
589
|
+
import { HashZod } from "@xylabs/hex";
|
|
590
|
+
import { AsObjectFactory as AsObjectFactory8 } from "@xylabs/object";
|
|
591
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
|
|
592
|
+
import z14 from "zod";
|
|
600
593
|
|
|
601
594
|
// src/payload/elevatable/TransferPayload.ts
|
|
602
595
|
import {
|
|
603
596
|
AddressZod,
|
|
604
597
|
HexZod as HexZod4
|
|
605
598
|
} from "@xylabs/hex";
|
|
606
|
-
import { AsObjectFactory as
|
|
607
|
-
import { isPayloadOfSchemaType as
|
|
599
|
+
import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
|
|
600
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType4, PayloadZod } from "@xyo-network/payload-model";
|
|
608
601
|
import z13 from "zod";
|
|
609
602
|
var TransferSchema = "network.xyo.transfer";
|
|
610
603
|
var TransferFieldsZod = z13.object({
|
|
@@ -616,8 +609,37 @@ var TransferFieldsZod = z13.object({
|
|
|
616
609
|
});
|
|
617
610
|
var PayloadZodOfSchema = (schema) => PayloadZod.extend({ schema: z13.literal(schema) });
|
|
618
611
|
var TransferZod = PayloadZodOfSchema(TransferSchema).extend(TransferFieldsZod.shape);
|
|
619
|
-
var isTransfer =
|
|
620
|
-
var asTransfer =
|
|
612
|
+
var isTransfer = isPayloadOfSchemaType4(TransferSchema);
|
|
613
|
+
var asTransfer = AsObjectFactory7.create(isTransfer);
|
|
614
|
+
|
|
615
|
+
// src/payload/elevatable/Time.ts
|
|
616
|
+
var TimeSchema = "network.xyo.time";
|
|
617
|
+
var XL1TimeFieldsZod = z14.object({
|
|
618
|
+
// block number
|
|
619
|
+
xl1: z14.number().optional(),
|
|
620
|
+
// block hash
|
|
621
|
+
xl1Hash: HashZod.optional()
|
|
622
|
+
});
|
|
623
|
+
var EthereumTimeFieldsZod = z14.object({
|
|
624
|
+
// block number
|
|
625
|
+
ethereum: z14.number().optional(),
|
|
626
|
+
// block hash
|
|
627
|
+
ethereumHash: HashZod.optional()
|
|
628
|
+
});
|
|
629
|
+
var EpochTimeFieldsZod = z14.object({
|
|
630
|
+
// in milliseconds
|
|
631
|
+
epoch: z14.number()
|
|
632
|
+
});
|
|
633
|
+
var TimeFieldsZod = XL1TimeFieldsZod.extend(XL1TimeFieldsZod.shape).extend(EthereumTimeFieldsZod.shape).extend(EpochTimeFieldsZod.shape);
|
|
634
|
+
var TimePayloadZod = PayloadZodOfSchema(TimeSchema).extend(TimeFieldsZod.shape);
|
|
635
|
+
var isSafeEpoch = (value) => {
|
|
636
|
+
return typeof value === "number" && value < 2 * Date.now();
|
|
637
|
+
};
|
|
638
|
+
var isTimePayload = (value) => {
|
|
639
|
+
return isPayloadOfSchemaType5(TimeSchema)(value) && isSafeEpoch(value.epoch);
|
|
640
|
+
};
|
|
641
|
+
var asTimePayload = AsObjectFactory8.create(isTimePayload);
|
|
642
|
+
var asTimePayloadWithStorageMeta = AsObjectFactory8.create(isTimePayload);
|
|
621
643
|
|
|
622
644
|
// src/payload/StepIdentityPayload.ts
|
|
623
645
|
import { AsObjectFactory as AsObjectFactory9 } from "@xylabs/object";
|
|
@@ -818,7 +840,7 @@ var AllowedBlockPayloadSchemas = [
|
|
|
818
840
|
TimeSchema,
|
|
819
841
|
TransferSchema
|
|
820
842
|
];
|
|
821
|
-
var AllowedBlockPayloadSchemaZod =
|
|
843
|
+
var AllowedBlockPayloadSchemaZod = z15.enum(AllowedBlockPayloadSchemas);
|
|
822
844
|
var isAllowedBlockPayloadSchema = zodIsFactory(AllowedBlockPayloadSchemaZod);
|
|
823
845
|
var isAllowedBlockPayload = (value) => {
|
|
824
846
|
return isTransfer(value) || isBridgeDestinationObservation(value) || isBridgeIntent(value) || isBridgeSourceObservation(value) || isChainStakeIntent(value) || isHashPayload(value) || isSchemaPayload(value) || isTimePayload(value) || isTransactionBoundWitness(value);
|
|
@@ -1057,8 +1079,10 @@ export {
|
|
|
1057
1079
|
ChainStakeIntentSchema,
|
|
1058
1080
|
ELEVATE_OPCODE,
|
|
1059
1081
|
ETH_BLOCK_NUMBER_ZERO,
|
|
1082
|
+
EpochTimeFieldsZod,
|
|
1060
1083
|
EthBlockNumberZod,
|
|
1061
1084
|
EthBlockRangeZod,
|
|
1085
|
+
EthereumTimeFieldsZod,
|
|
1062
1086
|
FemtoXL1,
|
|
1063
1087
|
FemtoXL1MaxValue,
|
|
1064
1088
|
HashSchema,
|
|
@@ -1089,6 +1113,8 @@ export {
|
|
|
1089
1113
|
StepIdentityZod,
|
|
1090
1114
|
StepRewardFractions,
|
|
1091
1115
|
StepSizes,
|
|
1116
|
+
TimeFieldsZod,
|
|
1117
|
+
TimePayloadZod,
|
|
1092
1118
|
TimeSchema,
|
|
1093
1119
|
TransactionGasCosts,
|
|
1094
1120
|
TransferFieldsZod,
|
|
@@ -1101,6 +1127,7 @@ export {
|
|
|
1101
1127
|
XL1BlockRangeZod,
|
|
1102
1128
|
XL1MaxValue,
|
|
1103
1129
|
XL1Places,
|
|
1130
|
+
XL1TimeFieldsZod,
|
|
1104
1131
|
XL1_BLOCK_NUMBER_ZERO,
|
|
1105
1132
|
XL1_ETH_MAIN_ERC20_CONTRACT_ADDRESS,
|
|
1106
1133
|
XL1_ETH_MAIN_GOVERNANCE_ADDRESS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/amount/splitOnDecimal.ts","../../src/amount/splitOnDecimalToString.ts","../../src/amount/ShiftedBigInt.ts","../../src/amount/XL1Amount.ts","../../src/xl1/isXL1Factory.ts","../../src/xl1/xl1MaxValue.ts","../../src/xl1/XL1Units.ts","../../src/xl1/AttoXL1.ts","../../src/xl1/FemtoXL1.ts","../../src/xl1/MicroXL1.ts","../../src/xl1/MilliXL1.ts","../../src/xl1/NanoXL1.ts","../../src/xl1/PicoXL1.ts","../../src/xl1/XL1.ts","../../src/block/AllowedBlockPayload.ts","../../src/model/BlockNumber/BlockNumber.ts","../../src/model/zod/zodAsFactory.ts","../../src/model/zod/zodIsFactory.ts","../../src/model/zod/zodToFactory.ts","../../src/model/BlockNumber/Numberish.ts","../../src/model/BlockNumber/EthBlockNumber.ts","../../src/model/BlockNumber/XL1BlockNumber.ts","../../src/model/BlockRange/BlockRange.ts","../../src/model/BlockRange/EthBlockRange.ts","../../src/model/BlockRange/Range.ts","../../src/model/BlockRange/XL1BlockRange.ts","../../src/model/StepIdentity.ts","../../src/payload/elevatable/Bridge/BridgeDestinationObservation.ts","../../src/payload/elevatable/Bridge/BridgeDetails.ts","../../src/payload/elevatable/Bridge/BridgeIntent.ts","../../src/payload/elevatable/Bridge/BridgeSourceObservation.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/StepComplete.ts","../../src/payload/elevatable/Time.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/payload/StepIdentityPayload.ts","../../src/transaction/AnyHydratedTransaction.ts","../../src/isHydratedBoundWitness.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/transaction/HydratedTransaction.ts","../../src/transaction/HydratedTransactionWithHashMeta.ts","../../src/transaction/HydratedTransactionWithStorageMeta.ts","../../src/transaction/SignedHydratedTransaction.ts","../../src/transaction/SignedHydratedTransactionWithHashMeta.ts","../../src/transaction/SignedHydratedTransactionWithStorageMeta.ts","../../src/transaction/TransactionBoundWitnessDeprecated.ts","../../src/transaction/TransactionFeesFields.ts","../../src/transaction/UnsignedHydratedTransaction.ts","../../src/transaction/UnsignedHydratedTransactionWithHashMeta.ts","../../src/block/BlockBoundWitness.ts","../../src/block/HydratedBlock.ts","../../src/constants/addresses.ts","../../src/constants/defaultRewardRatio.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/OpCodes.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/constants/version.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/validation/error.ts","../../src/validation/boundwitness/error.ts","../../src/validation/payload/error.ts","../../src/validation/transaction/error.ts"],"sourcesContent":["export const splitOnDecimal = (value: bigint, places = 18): [bigint, bigint] => {\n const whole = value / BigInt(10 ** places)\n const decimal = value % BigInt(10 ** places)\n return [whole, decimal]\n}\n","import { splitOnDecimal } from './splitOnDecimal.ts'\n\nexport const splitOnDecimalToString = (\n value: bigint,\n places = 18,\n maxDecimal = places,\n maxCharacters = 9,\n minDecimals = 1,\n locale: Intl.LocalesArgument = 'en-US',\n): string => {\n const [whole, decimal] = splitOnDecimal(value, places)\n const remainderLength = decimal.toString().length\n const precedingZerosInDecimal = places - remainderLength\n if (whole === 0n && precedingZerosInDecimal >= maxDecimal && decimal !== 0n) return '< 0.'.padEnd(maxDecimal + 5, '0') + '1'\n\n const wholeCharacters = whole.toString(10).length\n const calcMaxDecimalCharacters = maxCharacters === -1 ? places : wholeCharacters > maxCharacters ? 0 : maxCharacters - wholeCharacters\n const maxDecimalCharacters = Math.min(maxDecimal, calcMaxDecimalCharacters)\n\n // Format whole number with thousand separators according to locale\n const formattedWhole = new Intl.NumberFormat(locale, {\n maximumFractionDigits: 0,\n useGrouping: true,\n }).format(whole)\n\n // Get decimal separator for the locale\n const decimalSeparator = new Intl.NumberFormat(locale)\n .formatToParts(1.1)\n .find(part => part.type === 'decimal')?.value ?? '.'\n\n // Pad decimal part to correct number of places\n let paddedDecimal = decimal.toString().padStart(places, '0').slice(0, maxDecimalCharacters)\n // remove unneeded trailing zeros (honoring minDecimals)\n while (paddedDecimal.length > minDecimals && paddedDecimal.endsWith('0')) {\n paddedDecimal = paddedDecimal.slice(0, -1)\n }\n\n return `${formattedWhole}${paddedDecimal.length > 0 ? decimalSeparator : ''}${paddedDecimal}`\n}\n","import type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts'\nimport { splitOnDecimalToString } from './splitOnDecimalToString.ts'\n\nexport class ShiftedBigInt {\n static readonly defaultConfig: ShiftedBigIntConfig = {\n places: 18,\n maxDecimal: 18,\n maxCharacters: 9,\n minDecimals: 1,\n locale: 'en-US',\n }\n\n config: ShiftedBigIntConfig\n value: bigint\n\n constructor(\n value: bigint | ShiftedBigInt,\n config: Partial<ShiftedBigIntConfig> = {},\n ) {\n this.value = typeof value === 'bigint' ? value : value.value\n this.config = {\n ...ShiftedBigInt.defaultConfig, ...(typeof value === 'bigint' ? {} : value.config), ...config,\n }\n }\n\n get locale(): Intl.LocalesArgument {\n return this.config.locale ?? 'en-US'\n }\n\n get maxCharacters(): number {\n return this.config.maxCharacters ?? 9\n }\n\n get maxDecimal(): number {\n return this.config.maxDecimal ?? this.places\n }\n\n get minDecimals(): number {\n return this.config.minDecimals ?? 1\n }\n\n get places(): number {\n return this.config.places ?? 18\n }\n\n toFullString(): string {\n return splitOnDecimalToString(\n this.value,\n this.places,\n this.places,\n Infinity,\n this.places,\n this.locale,\n )\n }\n\n toShortString(): string {\n return splitOnDecimalToString(\n this.value,\n this.places,\n this.maxDecimal,\n this.maxCharacters,\n this.minDecimals,\n this.locale,\n )\n }\n\n toString(): string {\n return this.toFullString()\n }\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport { assertEx } from '@xylabs/assert'\n\nimport {\n AttoXL1, FemtoXL1, MicroXL1, MilliXL1, NanoXL1, PicoXL1, XL1,\n XL1Places,\n} from '../xl1/index.ts'\nimport { ShiftedBigInt } from './ShiftedBigInt.ts'\nimport type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts'\n\nconst MAX_XL1_AMOUNT = 2n ** 256n - 1n\nconst allowedPlaces = Object.values(XL1Places)\n\nexport interface XL1AmountInstance {\n value: AttoXL1\n\n to(places: bigint | number): bigint\n\n milli: MilliXL1\n\n micro: MicroXL1\n\n nano: NanoXL1\n\n pico: PicoXL1\n\n femto: FemtoXL1\n\n atto: AttoXL1\n\n xl1: XL1\n\n toString(places: number, config: Partial<ShiftedBigIntConfig>): string\n}\n\nexport class XL1Amount implements XL1AmountInstance {\n value: AttoXL1\n private locale: Intl.LocalesArgument\n\n constructor(value: bigint, locale: Intl.LocalesArgument = 'en-US') {\n this.locale = locale\n this.value = AttoXL1(value > MAX_XL1_AMOUNT ? MAX_XL1_AMOUNT : value < 0n ? 0n : value)\n }\n\n static from(value: bigint, places: bigint = XL1Places.atto) {\n assertEx(allowedPlaces.includes(places), () => `Invalid conversion places (${places} not in ${allowedPlaces})`)\n return new XL1Amount(value * 10n ** BigInt(places))\n }\n\n static fromMilli(value: MilliXL1) {\n return this.from(value, XL1Places.milli)\n }\n\n static fromMicro(value: MicroXL1) {\n return this.from(value, XL1Places.micro)\n }\n\n static fromNano(value: NanoXL1) {\n return this.from(value, XL1Places.nano)\n }\n\n static fromPico(value: PicoXL1) {\n return this.from(value, XL1Places.pico)\n }\n\n static fromFemto(value: FemtoXL1) {\n return this.from(value, XL1Places.femto)\n }\n\n static fromAtto(value: AttoXL1) {\n return this.from(value, XL1Places.atto)\n }\n\n static fromXL1(value: XL1) {\n return this.from(value, XL1Places.xl1)\n }\n\n to(places: number | bigint = XL1Places.atto) {\n return this.value / 10n ** BigInt(places)\n }\n\n get milli() {\n return MilliXL1(this.to(XL1Places.milli))\n }\n\n get micro() {\n return MicroXL1(this.to(XL1Places.micro))\n }\n\n get nano() {\n return NanoXL1(this.to(XL1Places.nano))\n }\n\n get pico() {\n return PicoXL1(this.to(XL1Places.pico))\n }\n\n get femto() {\n return FemtoXL1(this.to(XL1Places.femto))\n }\n\n get atto() {\n return AttoXL1(this.to(XL1Places.atto))\n }\n\n get xl1() {\n return XL1(this.to(XL1Places.xl1))\n }\n\n toString(places: number = Number(XL1Places.atto), config: Partial<ShiftedBigIntConfig> = {}): string {\n assertEx(allowedPlaces.includes(BigInt(places)), () => `Invalid conversion places (${places} not in ${allowedPlaces})`)\n return new ShiftedBigInt(\n this.value,\n {\n places,\n locale: this.locale,\n maxDecimal: places,\n minDecimals: 0,\n maxCharacters: places,\n ...config,\n },\n ).toShortString()\n }\n}\n","import * as z from 'zod'\n\nimport { xl1MaxValue } from './xl1MaxValue.ts'\n\nexport const isXL1Factory = <T extends bigint>(places: bigint) => (val: unknown): val is T => {\n if (typeof val !== 'bigint') return false\n return val >= 0n && val <= xl1MaxValue(places)\n}\n\nexport const XL1ZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.bigint().refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const XL1TransformZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.union([z.bigint(), z.number(), z.string(), z.boolean()]).transform(val => BigInt(val) as T).refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const asXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1ZodFactory<T>(places, 'local')\n return (val: unknown): T => {\n const result = zod.safeParse(val)\n if (result.success) {\n return result.data as T\n }\n throw result.error\n }\n}\n\nexport const toXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1TransformZodFactory<T>(places, 'local')\n return (val: unknown): T | undefined => {\n const result = zod.safeParse(val)\n return result.success ? result.data as T : undefined\n }\n}\n","export const xl1MaxValue = (places: bigint) => 10n ** (32n - places) - 1n\n","type XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const AttoXL1MaxValue = xl1MaxValue(XL1Places.atto)\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' }\nexport const isAttoXL1 = isXL1Factory<AttoXL1>(XL1Places.atto)\nexport const asAttoXL1 = asXL1Factory<AttoXL1>(XL1Places.atto)\nexport const toAttoXL1 = toXL1Factory<AttoXL1>(XL1Places.atto)\n\nexport const AttoXL1 = asAttoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const FemtoXL1MaxValue = xl1MaxValue(XL1Places.femto)\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' }\nexport const isFemtoXL1 = isXL1Factory<FemtoXL1>(XL1Places.femto)\nexport const asFemtoXL1 = asXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const toFemtoXL1 = toXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const FemtoXL1 = asFemtoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MicroXL1MaxValue = xl1MaxValue(XL1Places.micro)\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' }\nexport const isMicroXL1 = isXL1Factory<MicroXL1>(XL1Places.micro)\nexport const asMicroXL1 = asXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const toMicroXL1 = toXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const MicroXL1 = asMicroXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MilliXL1MaxValue = xl1MaxValue(XL1Places.milli)\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' }\nexport const isMilliXL1 = isXL1Factory<MilliXL1>(XL1Places.milli)\nexport const asMilliXL1 = asXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const toMilliXL1 = toXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const MilliXL1 = asMilliXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const NanoXL1MaxValue = xl1MaxValue(XL1Places.nano)\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' }\nexport const isNanoXL1 = isXL1Factory<NanoXL1>(XL1Places.nano)\nexport const asNanoXL1 = asXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const toNanoXL1 = toXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const NanoXL1 = asNanoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const PicoXL1MaxValue = xl1MaxValue(XL1Places.pico)\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' }\nexport const isPicoXL1 = isXL1Factory<PicoXL1>(XL1Places.pico)\nexport const asPicoXL1 = asXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const toPicoXL1 = toXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const PicoXL1 = asPicoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const XL1MaxValue = xl1MaxValue(XL1Places.xl1)\nexport type XL1 = bigint & { readonly _tag: 'XL1' }\nexport const isXL1 = isXL1Factory<XL1>(XL1Places.xl1)\nexport const asXL1 = asXL1Factory<XL1>(XL1Places.xl1)\n\nexport const toXL1 = toXL1Factory<XL1>(XL1Places.xl1)\n\nexport const XL1 = asXL1\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashMeta } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport z from 'zod'\n\nimport { zodIsFactory } from '../model/index.ts'\nimport type {\n BridgeDestinationObservation, BridgeIntent, BridgeSourceObservation, ChainStakeIntent, HashPayload, StepComplete, TimePayload, Transfer,\n} from '../payload/index.ts'\nimport {\n BridgeDestinationObservationSchema, BridgeIntentSchema, BridgeSourceObservationSchema, ChainStakeIntentSchema, HashSchema,\n isBridgeDestinationObservation, isBridgeIntent, isBridgeSourceObservation, isChainStakeIntent, isHashPayload, isTimePayload, isTransfer, StepCompleteSchema,\n TimeSchema, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload\n = Transfer\n | BridgeDestinationObservation\n | BridgeIntent\n | BridgeSourceObservation\n | ChainStakeIntent\n | HashPayload\n | SchemaPayload\n | StepComplete\n | TimePayload\n | TransactionBoundWitness\n\nexport const AllowedBlockPayloadSchemas = [\n BoundWitnessSchema,\n BridgeDestinationObservationSchema,\n BridgeIntentSchema,\n BridgeSourceObservationSchema,\n ChainStakeIntentSchema,\n HashSchema,\n SchemaSchema,\n StepCompleteSchema,\n TimeSchema,\n TransferSchema,\n] satisfies Schema[]\n\nexport const AllowedBlockPayloadSchemaZod = z.enum(AllowedBlockPayloadSchemas)\nexport type AllowedBlockPayloadSchema = z.infer<typeof AllowedBlockPayloadSchemaZod>\nexport const isAllowedBlockPayloadSchema = zodIsFactory<AllowedBlockPayloadSchema>(AllowedBlockPayloadSchemaZod)\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value)\n || isBridgeDestinationObservation(value)\n || isBridgeIntent(value)\n || isBridgeSourceObservation(value)\n || isChainStakeIntent(value)\n || isHashPayload(value)\n || isSchemaPayload(value)\n || isTimePayload(value)\n || isTransactionBoundWitness(value)\n}\n\nexport const isAllowedBlockPayloadWithHashMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashMeta(value)\n}\n","import { type Brand } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\nimport { NumberishZod } from './Numberish.ts'\n\nexport type BlockNumber = Brand<number, { readonly __blockNumber: true }>\n\nexport const BlockNumberZod = z.number().transform(v => v as BlockNumber)\nexport const NumberishBlockNumberZod = NumberishZod.transform(v => v as BlockNumber)\n\nexport const asBlockNumber = zodAsFactory<BlockNumber>(BlockNumberZod, 'asBlockNumber')\nexport const toBlockNumber = zodToFactory<BlockNumber>(NumberishBlockNumberZod, 'toBlockNumber')\n\nexport const BLOCK_NUMBER_ZERO = asBlockNumber(0)\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport type z from 'zod'\n\nimport type { ZodFactoryConfig } from './Config.ts'\n\nexport function zodAsFactory<T>(zod: z.ZodType<T>, name: string) {\n function asFunc(value: unknown): T | undefined\n function asFunc(value: unknown, assert: ZodFactoryConfig): T\n function asFunc(value: unknown, assert?: ZodFactoryConfig): T | undefined {\n const result = zod.safeParse(value)\n if (result.success) {\n return result.data\n }\n if (assert !== undefined) {\n let assertConfig: AssertConfig\n switch (typeof assert) {\n case 'string': {\n assertConfig = `[${name}][${value}] ${assert}`\n break\n }\n case 'object': {\n assertConfig = `[${name}][${assert.name}][${value}] ${result.error.message}`\n break\n }\n case 'boolean': {\n assertConfig = `[${name}][${value}] ${result.error.message}`\n break\n }\n case 'function': {\n assertConfig = assert(value, result.error.message)\n break\n }\n default: {\n assertConfig = true\n }\n }\n return assertError(value, assertConfig, result.error.message)\n }\n }\n\n return asFunc\n}\n","import type z from 'zod'\n\nexport function zodIsFactory<T>(zod: z.ZodType<T>) {\n return (value: unknown): value is T => zod.safeParse(value).success\n}\n","import type z from 'zod'\n\nimport { zodAsFactory } from './zodAsFactory.ts'\n\nexport function zodToFactory<T>(zod: z.ZodType<T>, name: string) {\n return zodAsFactory<T>(zod, name)\n}\n","import z from 'zod'\n\nexport const NumberishZod = z.union([z.number(), z.string(), z.bigint()])\n .transform(v => (typeof v === 'bigint' ? Number(v) : typeof v === 'string' ? Number(v) : v))\n .pipe(z.number())\n","import { type Brand } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\nimport type { BlockNumber } from './BlockNumber.ts'\nimport { NumberishBlockNumberZod } from './BlockNumber.ts'\n\nexport type EthBlockNumber = Brand<BlockNumber, { readonly __ethBlockNumber: true }>\n\nexport const EthBlockNumberZod = z.number().transform(v => v as EthBlockNumber)\nexport const NumberishEthBlockNumberZod = NumberishBlockNumberZod.transform(v => v as EthBlockNumber)\n\nexport const asEthBlockNumber = zodAsFactory<EthBlockNumber>(EthBlockNumberZod, 'asEthBlockNumber')\nexport const toEthBlockNumber = zodToFactory<EthBlockNumber>(NumberishEthBlockNumberZod, 'toEthBlockNumber')\n\nexport const ETH_BLOCK_NUMBER_ZERO = asEthBlockNumber(0)\n","import { type Brand } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\nimport type { BlockNumber } from './BlockNumber.ts'\nimport { NumberishBlockNumberZod } from './BlockNumber.ts'\n\nexport type XL1BlockNumber = Brand<BlockNumber, { readonly __xl1BlockNumber: true }>\n\nexport const XL1BlockNumberZod = z.number().transform(v => v as XL1BlockNumber)\nexport const NumberishXL1BlockNumberZod = NumberishBlockNumberZod.transform(v => v as XL1BlockNumber)\n\nexport const asXL1BlockNumber = zodAsFactory<XL1BlockNumber>(XL1BlockNumberZod, 'asXL1BlockNumber')\nexport const toXL1BlockNumber = zodToFactory<XL1BlockNumber>(NumberishXL1BlockNumberZod, 'toXL1BlockNumber')\n\nexport const XL1_BLOCK_NUMBER_ZERO = asXL1BlockNumber(0)\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport { type Brand, isDefined } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport {\n asBlockNumber,\n type BlockNumber, BlockNumberZod, NumberishBlockNumberZod,\n} from '../BlockNumber/index.ts'\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\n\nexport type BlockRange = [BlockNumber, BlockNumber]\nexport type NumberishBlockRange = [BlockNumber, BlockNumber]\n\nexport const BlockRangeZod = z.tuple([BlockNumberZod, BlockNumberZod])\nexport const NumberishBlockRangeZod = z.tuple([NumberishBlockNumberZod, NumberishBlockNumberZod])\n\nexport const asBlockRange = zodAsFactory<BlockRange>(BlockRangeZod, 'BlockRange')\nexport const toBlockRange = zodToFactory<BlockRange>(NumberishBlockRangeZod, 'BlockRange')\n\nexport type BlockRangeKey = Brand<string, { readonly __blockRangeKey: true }>\nexport const toBlockNumberKey = (range: BlockRange) => `${range[0]}|${range[1]}` as BlockRangeKey\n\nexport function fromBlockNumberKey(key: BlockRangeKey): BlockRange | undefined\nexport function fromBlockNumberKey(key: BlockRangeKey, assert: AssertConfig): BlockRange\nexport function fromBlockNumberKey(key: BlockRangeKey, assert?: AssertConfig): BlockRange | undefined {\n const [start, end] = key.split('|').map(v => asBlockNumber(Number(v)))\n const result = (isDefined(start) && isDefined(end)) ? [start, end] : undefined\n return assertError(result, assert, `Invalid BlockRangeKey: ${key}`)\n}\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport { type Brand, isDefined } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport type { EthBlockNumber } from '../BlockNumber/index.ts'\nimport {\n asEthBlockNumber,\n EthBlockNumberZod,\n NumberishEthBlockNumberZod,\n} from '../BlockNumber/index.ts'\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\n\nexport type EthBlockRange = [EthBlockNumber, EthBlockNumber]\nexport type NumberishEthBlockRange = [EthBlockNumber, EthBlockNumber]\n\nexport const EthBlockRangeZod = z.tuple([EthBlockNumberZod, EthBlockNumberZod])\nexport const NumberishEthBlockRangeZod = z.tuple([NumberishEthBlockNumberZod, NumberishEthBlockNumberZod])\n\nexport const asEthBlockRange = zodAsFactory<EthBlockRange>(EthBlockRangeZod, 'EthBlockRange')\nexport const toEthBlockRange = zodToFactory<EthBlockRange>(NumberishEthBlockRangeZod, 'EthBlockRange')\n\nexport type EthBlockRangeKey = Brand<string, { readonly __ethBlockRangeKey: true }>\nexport const toEthBlockNumberKey = (range: EthBlockRange) => `${range[0]}|${range[1]}` as EthBlockRangeKey\n\nexport function fromEthBlockNumberKey(key: EthBlockRangeKey): EthBlockRange | undefined\nexport function fromEthBlockNumberKey(key: EthBlockRangeKey, assert: AssertConfig): EthBlockRange\nexport function fromEthBlockNumberKey(key: EthBlockRangeKey, assert?: AssertConfig): EthBlockRange | undefined {\n const [start, end] = key.split('|').map(v => asEthBlockNumber(Number(v)))\n const result = (isDefined(start) && isDefined(end)) ? [start, end] : undefined\n return assertError(result, assert, `Invalid EthBlockRangeKey: ${key}`)\n}\n","import z from 'zod'\n\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '../zod/index.ts'\n\nexport const RangeZod = z.tuple([z.number(), z.number()])\n\nexport type Range = z.infer<typeof RangeZod>\n\nexport const isRange = zodIsFactory<Range>(RangeZod)\nexport const asRange = zodAsFactory<Range>(RangeZod, 'Range')\nexport const toRange = zodToFactory<Range>(RangeZod, 'Range')\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport { type Brand, isDefined } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport type { XL1BlockNumber } from '../BlockNumber/index.ts'\nimport {\n asXL1BlockNumber,\n NumberishXL1BlockNumberZod,\n XL1BlockNumberZod,\n} from '../BlockNumber/index.ts'\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\n\nexport type XL1BlockRange = [XL1BlockNumber, XL1BlockNumber]\nexport type NumberishXL1BlockRange = [XL1BlockNumber, XL1BlockNumber]\n\nexport const XL1BlockRangeZod = z.tuple([XL1BlockNumberZod, XL1BlockNumberZod])\nexport const NumberishXL1BlockRangeZod = z.tuple([NumberishXL1BlockNumberZod, NumberishXL1BlockNumberZod])\n\nexport const asXL1BlockRange = zodAsFactory<XL1BlockRange>(XL1BlockRangeZod, 'XL1BlockRange')\nexport const toXL1BlockRange = zodToFactory<XL1BlockRange>(NumberishXL1BlockRangeZod, 'XL1BlockRange')\n\nexport type XL1BlockRangeKey = Brand<string, { readonly __xl1BlockRangeKey: true }>\nexport const toXL1BlockNumberKey = (range: XL1BlockRange) => `${range[0]}|${range[1]}` as XL1BlockRangeKey\n\nexport function fromXL1BlockNumberKey(key: XL1BlockRangeKey): XL1BlockRange | undefined\nexport function fromXL1BlockNumberKey(key: XL1BlockRangeKey, assert: AssertConfig): XL1BlockRange\nexport function fromXL1BlockNumberKey(key: XL1BlockRangeKey, assert?: AssertConfig): XL1BlockRange | undefined {\n const [start, end] = key.split('|').map(v => asXL1BlockNumber(Number(v)))\n const result = (isDefined(start) && isDefined(end)) ? [start, end] : undefined\n return assertError(result, assert, `Invalid XL1BlockRangeKey: ${key}`)\n}\n","import { type Brand, isUndefined } from '@xylabs/typeof'\nimport * as z from 'zod'\n\nimport { toXL1BlockNumber, type XL1BlockNumber } from './BlockNumber/index.ts'\n\nexport const StepIdentityZod = z.object({\n block: z.number().int().nonnegative(),\n step: z.number().int().nonnegative(),\n})\n\nexport interface StepIdentity {\n block: XL1BlockNumber\n // the index of the step into the StepSize array\n step: number\n}\n\n/** @deprecated use StepIdentity instead */\nexport interface StepContext extends StepIdentity {}\n\n// this string is the block and the step separated by a pipe\nexport type StepIdentityString = Brand<string, { readonly __stepIdentityString: true }>\n\nfunction tryParseInt(value: string): number | undefined {\n // Prevent coercion of empty strings to 0\n if (value === '') return undefined\n // Parse number\n const num = Number(value)\n // Check if integer\n return Number.isInteger(num) ? num : undefined\n}\n\nexport const asStepIdentity = (stepIdentityString: string): StepIdentity | undefined => {\n try {\n const [blockNumberString, stepString] = stepIdentityString.split('|')\n if (isUndefined(blockNumberString) || isUndefined(stepString)) {\n return undefined\n }\n const step = tryParseInt(stepString)\n const block = toXL1BlockNumber(blockNumberString)\n if (isUndefined(block) || isUndefined(step)) {\n return undefined\n }\n\n return { block, step }\n } catch {\n return undefined\n }\n}\n","import { HexZod } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport type z from 'zod'\n\nimport { BridgeDetailsFieldsZod } from './BridgeDetails.ts'\n\nexport const BridgeDestinationObservationSchema = 'network.xyo.chain.bridge.observation.destination' as const\nexport type BridgeDestinationObservationSchema = typeof BridgeDestinationObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport const BridgeDestinationObservationFieldsZod = BridgeDetailsFieldsZod.extend({\n /**\n * Destination chain confirmation\n */\n destConfirmation: HexZod.optional().describe('Destination chain confirmation'),\n})\n\nexport type BridgeDestinationObservationFields = z.infer<typeof BridgeDestinationObservationFieldsZod>\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport type BridgeDestinationObservation = Payload<BridgeDestinationObservationFields, BridgeDestinationObservationSchema>\n\nexport const isBridgeDestinationObservation = isPayloadOfZodType<BridgeDestinationObservation>(\n BridgeDestinationObservationFieldsZod,\n BridgeDestinationObservationSchema,\n)\n\nexport const asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationObservation)\n","import { HexZod } from '@xylabs/hex'\nimport z from 'zod'\n\n/**\n * Represents a transfer destination\n */\nexport const BridgeDetailsDestinationFieldsZod = z.object({\n /**\n * Destination network\n */\n dest: HexZod.describe('The destination network identifier'),\n /**\n * Destination address (EOA or contract)\n */\n destAddress: HexZod.describe('The destination address (EOA or contract)'),\n /**\n * Token amount to bridge to destination\n */\n destAmount: HexZod.describe('The token amount to bridge to destination'),\n /**\n * Token being bridged to\n */\n destToken: HexZod.describe('The token being bridged to'),\n})\n\n/**\n * Represents a transfer destination\n */\nexport type BridgeDetailsDestinationFields = z.infer<typeof BridgeDetailsDestinationFieldsZod>\n\n/**\n * Represents a transfer source\n */\nexport const BridgeDetailsSourceFieldsZod = z.object({\n /**\n * Source network\n */\n src: HexZod.describe('The source network identifier'),\n\n /**\n * Source address (EOA or contract)\n */\n srcAddress: HexZod.describe('The source address (EOA or contract)'),\n /**\n * Token amount to bridge from source\n */\n srcAmount: HexZod.describe('The token amount to bridge from source'),\n /**\n * Token being bridged from\n */\n srcToken: HexZod.describe('The token being bridged from'),\n})\n\n/**\n * Represents a transfer source\n */\nexport type BridgeDetailsSourceFields = z.infer<typeof BridgeDetailsSourceFieldsZod>\n\n/**\n * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.\n */\nexport const BridgeDetailsFieldsZod = BridgeDetailsSourceFieldsZod.extend(\n BridgeDetailsDestinationFieldsZod.shape,\n)\n\n/**\n * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.\n */\nexport type BridgeDetailsFields = z.infer<typeof BridgeDetailsFieldsZod>\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BridgeDetailsFieldsZod } from './BridgeDetails.ts'\n\nexport const BridgeIntentSchema = 'network.xyo.chain.bridge.intent' as const\nexport type BridgeIntentSchema = typeof BridgeIntentSchema\n\n/**\n * Represents an Address's intent to initiate a token bridge.\n */\nexport const BridgeIntentFieldsZod = BridgeDetailsFieldsZod.extend({\n /**\n * Unique identifier for replay protection\n */\n nonce: z.string().describe('Unique identifier for replay protection'),\n})\n\nexport type BridgeIntentFields = z.infer<typeof BridgeIntentFieldsZod>\n\nexport type BridgeIntent = Payload<BridgeIntentFields, BridgeIntentSchema>\n\nexport const isBridgeIntent = isPayloadOfZodType<BridgeIntent>(\n BridgeIntentFieldsZod,\n BridgeIntentSchema,\n)\n\nexport const asBridgeIntent = AsObjectFactory.create(isBridgeIntent)\n","import { HexZod } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport type z from 'zod'\n\nimport { BridgeDetailsFieldsZod } from './BridgeDetails.ts'\n\nexport const BridgeSourceObservationSchema = 'network.xyo.chain.bridge.observation.source' as const\nexport type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport const BridgeSourceObservationFieldsZod = BridgeDetailsFieldsZod.extend({\n /**\n * Source chain confirmation\n */\n srcConfirmation: HexZod.optional().describe('Source chain confirmation'),\n})\n\nexport type BridgeSourceObservationFields = z.infer<typeof BridgeSourceObservationFieldsZod>\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport type BridgeSourceObservation = Payload<BridgeSourceObservationFields, BridgeSourceObservationSchema>\n\nexport const isBridgeSourceObservation = isPayloadOfZodType<BridgeSourceObservation>(\n BridgeSourceObservationFieldsZod,\n BridgeSourceObservationSchema,\n)\n\nexport const asBridgeSourceObservation = AsObjectFactory.create(isBridgeSourceObservation)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\n\nexport const isChainStakeIntentWithStorageMeta = (x?: unknown | null): x is WithStorageMeta<ChainStakeIntent> => {\n return isChainStakeIntent(x) && isStorageMeta(x)\n}\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const StepCompleteSchema = 'network.xyo.chain.step.complete' as const\nexport type StepCompleteSchema = typeof StepCompleteSchema\n\n/* This records the completion of a step in the network - needed for network staking rewards */\n/* We will only write these for steps that are eligible for rewards Step 3 (2311) */\n\nexport interface StepCompleteFields extends FromFields {\n block: number /* The block number on the XL1 network */\n hash: Hash /* The Step Hash */\n size: number /* The size of the step */\n stakeBlock: number /* The block number on ethereum or other staking system */\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type StepComplete = Payload<StepCompleteFields, StepCompleteSchema>\n\nexport const isStepComplete = isPayloadOfSchemaType<StepComplete>(StepCompleteSchema)\n\nexport const asStepComplete = AsObjectFactory.create(isStepComplete)\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\n// xl1 = xl1 block number, epoch = epoch number, ethereum = ethereum block number\nexport type TimeDomain = 'xl1' | 'epoch' | 'ethereum'\n\nexport const TimeSchema = 'network.xyo.time' as const\nexport type TimeSchema = typeof TimeSchema\n\nexport interface XL1TimeFields {\n // block number\n xl1?: number\n // block hash\n xl1Hash?: Hash\n}\n\nexport interface EthereumTimeFields {\n // block number\n ethereum?: number\n // block hash\n ethereumHash?: Hash\n}\n\nexport interface TimeFields extends XL1TimeFields, EthereumTimeFields {\n // in milliseconds\n epoch: number\n}\n\nexport type TimePayload = Payload<TimeFields, TimeSchema>\n\n// to prevent scaling problems, we use double the current time as a max safe epoch\nexport const isSafeEpoch = (value: unknown): value is number => {\n return typeof value === 'number' && value < 2 * Date.now()\n}\n\nexport const isTimePayload = (value: unknown): value is TimePayload => {\n return isPayloadOfSchemaType<TimePayload>(TimeSchema)(value) && isSafeEpoch(value.epoch)\n}\n\nexport const asTimePayload = AsObjectFactory.create(isTimePayload)\nexport const asTimePayloadWithStorageMeta = AsObjectFactory.create(isTimePayload)\n","import {\n type Address,\n AddressZod,\n type Hex,\n HexZod,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isPayloadOfSchemaType, PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\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<TContext extends {} = {}> extends FromFields {\n context?: TContext\n epoch: number\n // the amount that is being sent to other addresses\n transfers: Partial<Record<Address, Hex>>\n}\n\nexport const TransferFieldsZod = z.object({\n $opCodes: z.array(z.string()).optional(),\n context: z.record(z.string(), z.json()).optional(),\n epoch: z.number(),\n from: AddressZod,\n transfers: z.record(AddressZod, HexZod),\n})\n\nexport const PayloadZodOfSchema = <S extends string>(schema: S) => PayloadZod.extend({ schema: z.literal(schema) })\n\nexport const TransferZod = PayloadZodOfSchema(TransferSchema).extend(TransferFieldsZod.shape)\n\nexport type Transfer = z.infer<typeof TransferZod>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport type { z } from 'zod'\n\nimport { StepIdentityZod } from '../model/index.ts'\n\nexport const StepIdentitySchema = 'network.xyo.chain.step.identity' as const\nexport type StepIdentitySchema = typeof StepIdentitySchema\n\nexport type StepIdentityFields = z.infer<typeof StepIdentityZod>\n\n/**\n * A Step Identity Payload\n */\nexport type StepIdentityPayload = Payload<StepIdentityFields, StepIdentitySchema>\n\nexport const isStepIdentityPayload = isPayloadOfZodType<StepIdentityPayload>(StepIdentityZod, StepIdentitySchema)\n\nexport const asStepIdentityPayload = AsObjectFactory.create(isStepIdentityPayload)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type AnyHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isAnyHydratedTransaction = (\n value: unknown,\n): value is AnyHydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0])\n )\n}\n\nexport const asAnyHydratedTransaction = AsObjectFactory.create<AnyHydratedTransaction>(\n isAnyHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { HydratedBoundWitness, HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isAnyPayload, isStorageMeta } from '@xyo-network/payload-model'\n\nexport const isHydratedBoundWitness = (\n value: unknown,\n): value is HydratedBoundWitness => {\n return (\n Array.isArray(value)\n && value.length === 2\n && isBoundWitness(value[0])\n && Array.isArray(value[1])\n && !value[1].some(item => (!isAnyPayload(item)))\n )\n}\n\nexport const isHydratedBoundWitnessWithStorageMeta = (\n value: unknown,\n): value is HydratedBoundWitnessWithStorageMeta => {\n return (\n isHydratedBoundWitness(value)\n && isStorageMeta(value[0])\n && !value[1].some(item => (!isStorageMeta(item)))\n )\n}\n\nexport const asHydratedBoundWitness = AsObjectFactory.create<HydratedBoundWitness>(\n isHydratedBoundWitness,\n)\n\nexport const asHydratedBoundWitnessWithStorageMeta = AsObjectFactory.create<HydratedBoundWitnessWithStorageMeta>(\n isHydratedBoundWitnessWithStorageMeta,\n)\n","import {\n type Address, type Hex, isAddress,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Hex | Address & { __chain: true }\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && isAddress(typedObj.chain)\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isSigned, type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\n/** @deprecated Use HydratedTransactionWithStorageMeta instead */\nexport type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\n/** @deprecated Use isHydratedTransactionWithStorageMeta instead */\nexport const isHydratedTransaction = (\n value: unknown,\n// eslint-disable-next-line sonarjs/deprecation\n): value is HydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0]) && isSigned(value[0]) && isStorageMeta(value[0])\n )\n}\n\n/** @deprecated Use asHydratedTransactionWithStorageMeta instead */\n// eslint-disable-next-line sonarjs/deprecation\nexport const asHydratedTransaction = AsObjectFactory.create<HydratedTransaction>(\n // eslint-disable-next-line sonarjs/deprecation\n isHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithHashMeta,\n} from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithHashMeta<Signed<T>>, WithHashMeta<P>[]]\n\nexport const isHydratedTransactionWithHashMeta = (\n value: unknown,\n): value is HydratedTransactionWithHashMeta => {\n return (\n isAnyHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asHydratedTransactionWithHashMeta = AsObjectFactory.create<HydratedTransactionWithHashMeta>(\n isHydratedTransactionWithHashMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is HydratedTransactionWithStorageMeta => {\n return (\n isAnyHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asHydratedTransactionWithStorageMeta = AsObjectFactory.create<HydratedTransactionWithStorageMeta>(\n isHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [Signed<T>, P[]]\n\nexport const isSignedHydratedTransaction = (\n value: unknown,\n): value is SignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isSigned(value[0])\n )\n}\n\nexport const asSignedHydratedTransaction = AsObjectFactory.create<SignedHydratedTransaction>(\n isSignedHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport type {\n Payload,\n WithHashMeta,\n} from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithHashMeta<Signed<T>>, WithHashMeta<P>[]]\n\nexport const isSignedHydratedTransactionWithHashMeta = (\n value: unknown,\n): value is SignedHydratedTransactionWithHashMeta => {\n return (\n isSignedHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asSignedHydratedTransactionWithHashMeta = AsObjectFactory.create<SignedHydratedTransactionWithHashMeta>(\n isSignedHydratedTransactionWithHashMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport type {\n Payload,\n WithStorageMeta,\n} from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isSignedHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is SignedHydratedTransactionWithStorageMeta => {\n return (\n isSignedHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asSignedHydratedTransactionWithStorageMeta = AsObjectFactory.create<SignedHydratedTransactionWithStorageMeta>(\n isSignedHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isTransactionBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isHashMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isHashMeta(value)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\n\nexport const asTransactionBoundWitnessWithHashMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashMeta)\n","import { type Hex, isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isObject } from '@xylabs/typeof'\n\nimport { type AttoXL1, isAttoXL1 } from '../xl1/index.ts'\n\nexport interface TransactionFeesBigInt {\n base: AttoXL1\n gasLimit: AttoXL1\n gasPrice: AttoXL1\n priority: AttoXL1\n}\n\nexport type TransactionFeesHex = {\n [K in keyof TransactionFeesBigInt]: Hex;\n}\n\nexport interface TransactionFeesFields {\n fees: TransactionFeesHex\n}\n\nexport const isTransactionFeesBigInt = (value: unknown): value is TransactionFeesBigInt => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesBigInt\n return (\n isAttoXL1(base)\n && isAttoXL1(gasLimit)\n && isAttoXL1(gasPrice)\n && isAttoXL1(priority)\n )\n}\n\nexport const asTransactionFeesBigInt = AsObjectFactory.create<TransactionFeesBigInt>(\n isTransactionFeesBigInt,\n)\n\nexport const isTransactionFeesHex = (value: unknown): value is TransactionFeesHex => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesHex\n return (\n isHex(base)\n && isHex(gasLimit)\n && isHex(gasPrice)\n && isHex(priority)\n )\n}\n\nexport const asTransactionFeesHex = AsObjectFactory.create<TransactionFeesHex>(\n isTransactionFeesHex,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isUnsigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type UnsignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isUnsignedHydratedTransaction = (\n value: unknown,\n): value is UnsignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isUnsigned(value[0])\n )\n}\n\nexport const asUnsignedHydratedTransaction = AsObjectFactory.create<UnsignedHydratedTransaction>(\n isUnsignedHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Unsigned } from '@xyo-network/boundwitness-model'\nimport {\n isHashMeta,\n type Payload, type WithHashMeta,\n} from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type UnsignedHydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithHashMeta<Unsigned<T>>, WithHashMeta<P>[]]\n\nexport const isUnsignedHydratedTransactionWithHashMeta = (\n value: unknown,\n): value is UnsignedHydratedTransactionWithHashMeta => {\n return (\n isSignedHydratedTransaction(value) && isHashMeta(value[0]) && !value[1].some(v => !isHashMeta(v))\n )\n}\n\nexport const asUnsignedHydratedTransactionWithHashMeta = AsObjectFactory.create<UnsignedHydratedTransactionWithHashMeta>(\n isUnsignedHydratedTransactionWithHashMeta,\n)\n","import type { Hash } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ChainId, XL1BlockNumber } from '../model/index.ts'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: XL1BlockNumber\n /** Chain id - this should be \"0\" for the genesis block */\n chain: ChainId\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hash[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isSignedBlockBoundWitness = (value: unknown): value is Signed<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value is Signed<WithStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isHashMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithHashMeta = (value: unknown): value is Signed<WithHashMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithHashMeta(value) && isSigned(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)\n\nexport const asBlockBoundWitnessWithHashMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashMeta)\nexport const asSignedBlockBoundWitnessWithHashMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashMeta)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { type Payload, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport {\n type BlockBoundWitness,\n isBlockBoundWitnessWithStorageMeta,\n} from './BlockBoundWitness.ts'\n\nexport type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedBlock = (\n value: unknown,\n): value is HydratedBlock => {\n return (\n isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedBlock = AsObjectFactory.create<HydratedBlock>(\n isHydratedBlock,\n)\n","import type { Address, EthAddress } from '@xylabs/hex'\n\n/**\n * The Zero Address is used as a marker address for various protocol operations.\n */\nexport const XYO_ZERO_ADDRESS = '0000000000000000000000000000000000000000' as const as Address\n\n/**\n * The Bridge Address is used as a marker address for bridge transactions.\n */\nexport const XYO_BRIDGE_ADDRESS = '3012193230121932301219323012193230121932' as const as Address\n\n/**\n * The Network Staking Address is used as a marker address for staking the network.\n */\nexport const XYO_NETWORK_STAKING_ADDRESS = '1969196919691969196919691969196919691969' as const as Address\n\n/**\n * The Step Reward Address is used as a marker address for step rewards.\n */\nexport const XYO_STEP_REWARD_ADDRESS = '1216197612161976121619761216197612161976' as const as Address\n\nexport const XL1_ETH_MAIN_ERC20_CONTRACT_ADDRESS = '0xf72aE3E0DA743033AbD7A407557D684c1aE66aed' as const as EthAddress\n\nexport const XL1_ETH_MAIN_SUB_GOVERNOR_ADDRESS = '0xbA296Bc5D0949C0484f08c56c30FB95CC4675A29' as const as EthAddress\n\nexport const XL1_ETH_MAIN_REWARDS_ADDRESS = '0x1a546e091FB4EFb274DC584334a28b8754c4ece7' as const as EthAddress\n\nexport const XL1_ETH_MAIN_STAKED_XYO_CHAIN_ADDRESS = '0x319e667cED10452A117472811130444dED357F26' as const as EthAddress\n\nexport const XL1_ETH_MAIN_GOVERNANCE_ADDRESS = '0x7595710956d6B14b4f2F51a8dF41379eEeC9074E' as const as EthAddress\n","// the percent of the block rewards the producer gets\nexport const defaultRewardRatio = 0.05 as const // 5.0% goes to block producer\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.nano),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.nano),\n} as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\nimport { minTransactionFees } from './minTransactionFees.ts'\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: minTransactionFees.priority,\n} as const\n","export const ELEVATE_OPCODE = 'elevate'\n","import { AsTypeFactory } from '@xylabs/object'\n\nimport { asXL1BlockNumber, type XL1BlockNumber } from '../model/index.ts'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes: XL1BlockNumber[] = [\n asXL1BlockNumber(7, true),\n asXL1BlockNumber(31, true),\n asXL1BlockNumber(211, true),\n asXL1BlockNumber(2311, true),\n asXL1BlockNumber(30_031, true),\n asXL1BlockNumber(510_511, true),\n asXL1BlockNumber(9_699_691, true),\n asXL1BlockNumber(223_092_871, true),\n asXL1BlockNumber(6_469_693_231, true),\n]\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`, { required: true })\n return StepSizes[validatedStep]\n}\n\nexport const StepRewardFractions = [\n [0n, 1n], // 0%\n [0n, 1n], // 0%\n [0n, 1n], // 0%\n [1n, 10_000n], // 0.01%\n [2n, 1000n], // 0.2%\n [3n, 100n], // 3%\n [45n, 100n], // 45%\n] as const\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","export const XL1_PROTOCOL_VERSION_MAJOR = 1 as const\nexport const XL1_PROTOCOL_VERSION_MINOR = 2 as const\nexport const XL1_PROTOCOL_VERSION_PATCH = 0 as const\nexport const XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_VERSION_MINOR}.${XL1_PROTOCOL_VERSION_PATCH}` as const\nexport const XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1_000_000 + XL1_PROTOCOL_VERSION_MINOR * 1000 + XL1_PROTOCOL_VERSION_PATCH\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumberPayload = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumberPayload = isPayloadOfSchemaType<BlockNumberPayload>(BlockNumberSchema)\nexport const asBlockNumberPayload = AsObjectFactory.create<BlockNumberPayload>(isBlockNumberPayload)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberPayloadWithSources = isPayloadOfSchemaTypeWithSources<BlockNumberPayload>(BlockNumberSchema)\nexport const asBlockNumberPayloadWithSources = AsObjectFactory.create<WithSources<BlockNumberPayload>>(isBlockNumberPayloadWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import { type Hash, isHash } from '@xylabs/hex'\nimport { isError } from '@xylabs/typeof'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport class ValidationError<TValue = Payload> extends Error {\n hash: Hash\n value: TValue\n constructor(hash: Hash, value: TValue, message?: string, cause?: unknown) {\n super(message)\n this.hash = hash\n this.name = this.constructor.name\n this.value = value\n this.cause = cause\n }\n}\n\nexport const isValidationError = <TValue = Payload>(\n error: unknown,\n): error is ValidationError<TValue> => {\n return (\n isError(error) && isHash((error as ValidationError<TValue>)?.hash) && (error as ValidationError<TValue>)?.value !== undefined\n )\n}\n","import type { HydratedBoundWitness } from '@xyo-network/archivist-model'\nimport { type BoundWitness } from '@xyo-network/boundwitness-model'\n\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BoundWitnessValidationError extends ValidationError<BoundWitness> {}\n\nexport const isBoundWitnessValidationError = (\n error: unknown,\n): error is BoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BoundWitnessValidationError.constructor.name\n )\n}\n\nexport class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {}\n\nexport const isHydratedBoundWitnessValidationError = (\n error: unknown,\n): error is HydratedBoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBoundWitnessValidationError.constructor.name\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class InBlockPayloadValidationError extends ValidationError<Payload> {\n block: HydratedBlock\n constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.block = block\n }\n}\n\nexport const isInBlockPayloadValidationError = (\n error: unknown,\n): error is InBlockPayloadValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === InBlockPayloadValidationError.constructor.name\n )\n}\n","import { type SignedHydratedTransaction } from '../../transaction/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class HydratedTransactionValidationError extends ValidationError<SignedHydratedTransaction> {}\n\nexport const isHydratedTransactionValidationError = (\n error: unknown,\n): error is HydratedTransactionValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedTransactionValidationError.constructor.name\n )\n}\n"],"mappings":";AAAO,IAAM,iBAAiB,CAAC,OAAe,SAAS,OAAyB;AAC9E,QAAM,QAAQ,QAAQ,OAAO,MAAM,MAAM;AACzC,QAAM,UAAU,QAAQ,OAAO,MAAM,MAAM;AAC3C,SAAO,CAAC,OAAO,OAAO;AACxB;;;ACFO,IAAM,yBAAyB,CACpC,OACA,SAAS,IACT,aAAa,QACb,gBAAgB,GAChB,cAAc,GACd,SAA+B,YACpB;AACX,QAAM,CAAC,OAAO,OAAO,IAAI,eAAe,OAAO,MAAM;AACrD,QAAM,kBAAkB,QAAQ,SAAS,EAAE;AAC3C,QAAM,0BAA0B,SAAS;AACzC,MAAI,UAAU,MAAM,2BAA2B,cAAc,YAAY,GAAI,QAAO,OAAO,OAAO,aAAa,GAAG,GAAG,IAAI;AAEzH,QAAM,kBAAkB,MAAM,SAAS,EAAE,EAAE;AAC3C,QAAM,2BAA2B,kBAAkB,KAAK,SAAS,kBAAkB,gBAAgB,IAAI,gBAAgB;AACvH,QAAM,uBAAuB,KAAK,IAAI,YAAY,wBAAwB;AAG1E,QAAM,iBAAiB,IAAI,KAAK,aAAa,QAAQ;AAAA,IACnD,uBAAuB;AAAA,IACvB,aAAa;AAAA,EACf,CAAC,EAAE,OAAO,KAAK;AAGf,QAAM,mBAAmB,IAAI,KAAK,aAAa,MAAM,EAClD,cAAc,GAAG,EACjB,KAAK,UAAQ,KAAK,SAAS,SAAS,GAAG,SAAS;AAGnD,MAAI,gBAAgB,QAAQ,SAAS,EAAE,SAAS,QAAQ,GAAG,EAAE,MAAM,GAAG,oBAAoB;AAE1F,SAAO,cAAc,SAAS,eAAe,cAAc,SAAS,GAAG,GAAG;AACxE,oBAAgB,cAAc,MAAM,GAAG,EAAE;AAAA,EAC3C;AAE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","z","z","z","z","z","z","z","z","assertError","z","z","assertError","assertError","isDefined","z","z","isDefined","assertError","z","z","assertError","isDefined","z","z","isDefined","assertError","z","HexZod","z","HexZod","AsObjectFactory","isPayloadOfZodType","z","z","isPayloadOfZodType","AsObjectFactory","HexZod","AsObjectFactory","isPayloadOfZodType","HexZod","isPayloadOfZodType","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","HexZod","AsObjectFactory","isPayloadOfSchemaType","z","AsObjectFactory","isPayloadOfZodType","isPayloadOfZodType","AsObjectFactory","AsObjectFactory","AsObjectFactory","isAnyPayload","isStorageMeta","AsObjectFactory","isBoundWitness","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isSigned","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isStorageMeta","isSigned","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","isHashMeta","isHashMeta","AsObjectFactory","z","isHashMeta","isHex","AsObjectFactory","isBoundWitness","isSigned","isHashMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType"]}
|
|
1
|
+
{"version":3,"sources":["../../src/amount/splitOnDecimal.ts","../../src/amount/splitOnDecimalToString.ts","../../src/amount/ShiftedBigInt.ts","../../src/amount/XL1Amount.ts","../../src/xl1/isXL1Factory.ts","../../src/xl1/xl1MaxValue.ts","../../src/xl1/XL1Units.ts","../../src/xl1/AttoXL1.ts","../../src/xl1/FemtoXL1.ts","../../src/xl1/MicroXL1.ts","../../src/xl1/MilliXL1.ts","../../src/xl1/NanoXL1.ts","../../src/xl1/PicoXL1.ts","../../src/xl1/XL1.ts","../../src/block/AllowedBlockPayload.ts","../../src/model/BlockNumber/BlockNumber.ts","../../src/model/zod/zodAsFactory.ts","../../src/model/zod/zodIsFactory.ts","../../src/model/zod/zodToFactory.ts","../../src/model/BlockNumber/Numberish.ts","../../src/model/BlockNumber/EthBlockNumber.ts","../../src/model/BlockNumber/XL1BlockNumber.ts","../../src/model/BlockRange/BlockRange.ts","../../src/model/BlockRange/EthBlockRange.ts","../../src/model/BlockRange/Range.ts","../../src/model/BlockRange/XL1BlockRange.ts","../../src/model/StepIdentity.ts","../../src/payload/elevatable/Bridge/BridgeDestinationObservation.ts","../../src/payload/elevatable/Bridge/BridgeDetails.ts","../../src/payload/elevatable/Bridge/BridgeIntent.ts","../../src/payload/elevatable/Bridge/BridgeSourceObservation.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/StepComplete.ts","../../src/payload/elevatable/Time.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/payload/StepIdentityPayload.ts","../../src/transaction/AnyHydratedTransaction.ts","../../src/isHydratedBoundWitness.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/transaction/HydratedTransaction.ts","../../src/transaction/HydratedTransactionWithHashMeta.ts","../../src/transaction/HydratedTransactionWithStorageMeta.ts","../../src/transaction/SignedHydratedTransaction.ts","../../src/transaction/SignedHydratedTransactionWithHashMeta.ts","../../src/transaction/SignedHydratedTransactionWithStorageMeta.ts","../../src/transaction/TransactionBoundWitnessDeprecated.ts","../../src/transaction/TransactionFeesFields.ts","../../src/transaction/UnsignedHydratedTransaction.ts","../../src/transaction/UnsignedHydratedTransactionWithHashMeta.ts","../../src/block/BlockBoundWitness.ts","../../src/block/HydratedBlock.ts","../../src/constants/addresses.ts","../../src/constants/defaultRewardRatio.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/OpCodes.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/constants/version.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/validation/error.ts","../../src/validation/boundwitness/error.ts","../../src/validation/payload/error.ts","../../src/validation/transaction/error.ts"],"sourcesContent":["export const splitOnDecimal = (value: bigint, places = 18): [bigint, bigint] => {\n const whole = value / BigInt(10 ** places)\n const decimal = value % BigInt(10 ** places)\n return [whole, decimal]\n}\n","import { splitOnDecimal } from './splitOnDecimal.ts'\n\nexport const splitOnDecimalToString = (\n value: bigint,\n places = 18,\n maxDecimal = places,\n maxCharacters = 9,\n minDecimals = 1,\n locale: Intl.LocalesArgument = 'en-US',\n): string => {\n const [whole, decimal] = splitOnDecimal(value, places)\n const remainderLength = decimal.toString().length\n const precedingZerosInDecimal = places - remainderLength\n if (whole === 0n && precedingZerosInDecimal >= maxDecimal && decimal !== 0n) return '< 0.'.padEnd(maxDecimal + 5, '0') + '1'\n\n const wholeCharacters = whole.toString(10).length\n const calcMaxDecimalCharacters = maxCharacters === -1 ? places : wholeCharacters > maxCharacters ? 0 : maxCharacters - wholeCharacters\n const maxDecimalCharacters = Math.min(maxDecimal, calcMaxDecimalCharacters)\n\n // Format whole number with thousand separators according to locale\n const formattedWhole = new Intl.NumberFormat(locale, {\n maximumFractionDigits: 0,\n useGrouping: true,\n }).format(whole)\n\n // Get decimal separator for the locale\n const decimalSeparator = new Intl.NumberFormat(locale)\n .formatToParts(1.1)\n .find(part => part.type === 'decimal')?.value ?? '.'\n\n // Pad decimal part to correct number of places\n let paddedDecimal = decimal.toString().padStart(places, '0').slice(0, maxDecimalCharacters)\n // remove unneeded trailing zeros (honoring minDecimals)\n while (paddedDecimal.length > minDecimals && paddedDecimal.endsWith('0')) {\n paddedDecimal = paddedDecimal.slice(0, -1)\n }\n\n return `${formattedWhole}${paddedDecimal.length > 0 ? decimalSeparator : ''}${paddedDecimal}`\n}\n","import type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts'\nimport { splitOnDecimalToString } from './splitOnDecimalToString.ts'\n\nexport class ShiftedBigInt {\n static readonly defaultConfig: ShiftedBigIntConfig = {\n places: 18,\n maxDecimal: 18,\n maxCharacters: 9,\n minDecimals: 1,\n locale: 'en-US',\n }\n\n config: ShiftedBigIntConfig\n value: bigint\n\n constructor(\n value: bigint | ShiftedBigInt,\n config: Partial<ShiftedBigIntConfig> = {},\n ) {\n this.value = typeof value === 'bigint' ? value : value.value\n this.config = {\n ...ShiftedBigInt.defaultConfig, ...(typeof value === 'bigint' ? {} : value.config), ...config,\n }\n }\n\n get locale(): Intl.LocalesArgument {\n return this.config.locale ?? 'en-US'\n }\n\n get maxCharacters(): number {\n return this.config.maxCharacters ?? 9\n }\n\n get maxDecimal(): number {\n return this.config.maxDecimal ?? this.places\n }\n\n get minDecimals(): number {\n return this.config.minDecimals ?? 1\n }\n\n get places(): number {\n return this.config.places ?? 18\n }\n\n toFullString(): string {\n return splitOnDecimalToString(\n this.value,\n this.places,\n this.places,\n Infinity,\n this.places,\n this.locale,\n )\n }\n\n toShortString(): string {\n return splitOnDecimalToString(\n this.value,\n this.places,\n this.maxDecimal,\n this.maxCharacters,\n this.minDecimals,\n this.locale,\n )\n }\n\n toString(): string {\n return this.toFullString()\n }\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport { assertEx } from '@xylabs/assert'\n\nimport {\n AttoXL1, FemtoXL1, MicroXL1, MilliXL1, NanoXL1, PicoXL1, XL1,\n XL1Places,\n} from '../xl1/index.ts'\nimport { ShiftedBigInt } from './ShiftedBigInt.ts'\nimport type { ShiftedBigIntConfig } from './ShiftedBigIntConfig.ts'\n\nconst MAX_XL1_AMOUNT = 2n ** 256n - 1n\nconst allowedPlaces = Object.values(XL1Places)\n\nexport interface XL1AmountInstance {\n value: AttoXL1\n\n to(places: bigint | number): bigint\n\n milli: MilliXL1\n\n micro: MicroXL1\n\n nano: NanoXL1\n\n pico: PicoXL1\n\n femto: FemtoXL1\n\n atto: AttoXL1\n\n xl1: XL1\n\n toString(places: number, config: Partial<ShiftedBigIntConfig>): string\n}\n\nexport class XL1Amount implements XL1AmountInstance {\n value: AttoXL1\n private locale: Intl.LocalesArgument\n\n constructor(value: bigint, locale: Intl.LocalesArgument = 'en-US') {\n this.locale = locale\n this.value = AttoXL1(value > MAX_XL1_AMOUNT ? MAX_XL1_AMOUNT : value < 0n ? 0n : value)\n }\n\n static from(value: bigint, places: bigint = XL1Places.atto) {\n assertEx(allowedPlaces.includes(places), () => `Invalid conversion places (${places} not in ${allowedPlaces})`)\n return new XL1Amount(value * 10n ** BigInt(places))\n }\n\n static fromMilli(value: MilliXL1) {\n return this.from(value, XL1Places.milli)\n }\n\n static fromMicro(value: MicroXL1) {\n return this.from(value, XL1Places.micro)\n }\n\n static fromNano(value: NanoXL1) {\n return this.from(value, XL1Places.nano)\n }\n\n static fromPico(value: PicoXL1) {\n return this.from(value, XL1Places.pico)\n }\n\n static fromFemto(value: FemtoXL1) {\n return this.from(value, XL1Places.femto)\n }\n\n static fromAtto(value: AttoXL1) {\n return this.from(value, XL1Places.atto)\n }\n\n static fromXL1(value: XL1) {\n return this.from(value, XL1Places.xl1)\n }\n\n to(places: number | bigint = XL1Places.atto) {\n return this.value / 10n ** BigInt(places)\n }\n\n get milli() {\n return MilliXL1(this.to(XL1Places.milli))\n }\n\n get micro() {\n return MicroXL1(this.to(XL1Places.micro))\n }\n\n get nano() {\n return NanoXL1(this.to(XL1Places.nano))\n }\n\n get pico() {\n return PicoXL1(this.to(XL1Places.pico))\n }\n\n get femto() {\n return FemtoXL1(this.to(XL1Places.femto))\n }\n\n get atto() {\n return AttoXL1(this.to(XL1Places.atto))\n }\n\n get xl1() {\n return XL1(this.to(XL1Places.xl1))\n }\n\n toString(places: number = Number(XL1Places.atto), config: Partial<ShiftedBigIntConfig> = {}): string {\n assertEx(allowedPlaces.includes(BigInt(places)), () => `Invalid conversion places (${places} not in ${allowedPlaces})`)\n return new ShiftedBigInt(\n this.value,\n {\n places,\n locale: this.locale,\n maxDecimal: places,\n minDecimals: 0,\n maxCharacters: places,\n ...config,\n },\n ).toShortString()\n }\n}\n","import * as z from 'zod'\n\nimport { xl1MaxValue } from './xl1MaxValue.ts'\n\nexport const isXL1Factory = <T extends bigint>(places: bigint) => (val: unknown): val is T => {\n if (typeof val !== 'bigint') return false\n return val >= 0n && val <= xl1MaxValue(places)\n}\n\nexport const XL1ZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.bigint().refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const XL1TransformZodFactory = <T extends bigint>(places: bigint, name: string) => {\n const is = isXL1Factory<T>(places)\n const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`\n return z.union([z.bigint(), z.number(), z.string(), z.boolean()]).transform(val => BigInt(val) as T).refine(\n (x) => {\n const result = is(x)\n return result\n },\n { message },\n )\n}\n\nexport const asXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1ZodFactory<T>(places, 'local')\n return (val: unknown): T => {\n const result = zod.safeParse(val)\n if (result.success) {\n return result.data as T\n }\n throw result.error\n }\n}\n\nexport const toXL1Factory = <T extends bigint>(places: bigint) => {\n const zod = XL1TransformZodFactory<T>(places, 'local')\n return (val: unknown): T | undefined => {\n const result = zod.safeParse(val)\n return result.success ? result.data as T : undefined\n }\n}\n","export const xl1MaxValue = (places: bigint) => 10n ** (32n - places) - 1n\n","type XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const AttoXL1MaxValue = xl1MaxValue(XL1Places.atto)\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' }\nexport const isAttoXL1 = isXL1Factory<AttoXL1>(XL1Places.atto)\nexport const asAttoXL1 = asXL1Factory<AttoXL1>(XL1Places.atto)\nexport const toAttoXL1 = toXL1Factory<AttoXL1>(XL1Places.atto)\n\nexport const AttoXL1 = asAttoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const FemtoXL1MaxValue = xl1MaxValue(XL1Places.femto)\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' }\nexport const isFemtoXL1 = isXL1Factory<FemtoXL1>(XL1Places.femto)\nexport const asFemtoXL1 = asXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const toFemtoXL1 = toXL1Factory<FemtoXL1>(XL1Places.femto)\n\nexport const FemtoXL1 = asFemtoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MicroXL1MaxValue = xl1MaxValue(XL1Places.micro)\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' }\nexport const isMicroXL1 = isXL1Factory<MicroXL1>(XL1Places.micro)\nexport const asMicroXL1 = asXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const toMicroXL1 = toXL1Factory<MicroXL1>(XL1Places.micro)\n\nexport const MicroXL1 = asMicroXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const MilliXL1MaxValue = xl1MaxValue(XL1Places.milli)\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' }\nexport const isMilliXL1 = isXL1Factory<MilliXL1>(XL1Places.milli)\nexport const asMilliXL1 = asXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const toMilliXL1 = toXL1Factory<MilliXL1>(XL1Places.milli)\n\nexport const MilliXL1 = asMilliXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const NanoXL1MaxValue = xl1MaxValue(XL1Places.nano)\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' }\nexport const isNanoXL1 = isXL1Factory<NanoXL1>(XL1Places.nano)\nexport const asNanoXL1 = asXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const toNanoXL1 = toXL1Factory<NanoXL1>(XL1Places.nano)\n\nexport const NanoXL1 = asNanoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const PicoXL1MaxValue = xl1MaxValue(XL1Places.pico)\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' }\nexport const isPicoXL1 = isXL1Factory<PicoXL1>(XL1Places.pico)\nexport const asPicoXL1 = asXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const toPicoXL1 = toXL1Factory<PicoXL1>(XL1Places.pico)\n\nexport const PicoXL1 = asPicoXL1\n","import {\n asXL1Factory, isXL1Factory, toXL1Factory,\n} from './isXL1Factory.ts'\nimport { xl1MaxValue } from './xl1MaxValue.ts'\nimport { XL1Places } from './XL1Units.ts'\n\nexport const XL1MaxValue = xl1MaxValue(XL1Places.xl1)\nexport type XL1 = bigint & { readonly _tag: 'XL1' }\nexport const isXL1 = isXL1Factory<XL1>(XL1Places.xl1)\nexport const asXL1 = asXL1Factory<XL1>(XL1Places.xl1)\n\nexport const toXL1 = toXL1Factory<XL1>(XL1Places.xl1)\n\nexport const XL1 = asXL1\n","import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashMeta } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\nimport z from 'zod'\n\nimport { zodIsFactory } from '../model/index.ts'\nimport type {\n BridgeDestinationObservation, BridgeIntent, BridgeSourceObservation, ChainStakeIntent, HashPayload, StepComplete, TimePayload, Transfer,\n} from '../payload/index.ts'\nimport {\n BridgeDestinationObservationSchema, BridgeIntentSchema, BridgeSourceObservationSchema, ChainStakeIntentSchema, HashSchema,\n isBridgeDestinationObservation, isBridgeIntent, isBridgeSourceObservation, isChainStakeIntent, isHashPayload, isTimePayload, isTransfer, StepCompleteSchema,\n TimeSchema, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload\n = Transfer\n | BridgeDestinationObservation\n | BridgeIntent\n | BridgeSourceObservation\n | ChainStakeIntent\n | HashPayload\n | SchemaPayload\n | StepComplete\n | TimePayload\n | TransactionBoundWitness\n\nexport const AllowedBlockPayloadSchemas = [\n BoundWitnessSchema,\n BridgeDestinationObservationSchema,\n BridgeIntentSchema,\n BridgeSourceObservationSchema,\n ChainStakeIntentSchema,\n HashSchema,\n SchemaSchema,\n StepCompleteSchema,\n TimeSchema,\n TransferSchema,\n] satisfies Schema[]\n\nexport const AllowedBlockPayloadSchemaZod = z.enum(AllowedBlockPayloadSchemas)\nexport type AllowedBlockPayloadSchema = z.infer<typeof AllowedBlockPayloadSchemaZod>\nexport const isAllowedBlockPayloadSchema = zodIsFactory<AllowedBlockPayloadSchema>(AllowedBlockPayloadSchemaZod)\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value)\n || isBridgeDestinationObservation(value)\n || isBridgeIntent(value)\n || isBridgeSourceObservation(value)\n || isChainStakeIntent(value)\n || isHashPayload(value)\n || isSchemaPayload(value)\n || isTimePayload(value)\n || isTransactionBoundWitness(value)\n}\n\nexport const isAllowedBlockPayloadWithHashMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashMeta(value)\n}\n","import { type Brand } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\nimport { NumberishZod } from './Numberish.ts'\n\nexport type BlockNumber = Brand<number, { readonly __blockNumber: true }>\n\nexport const BlockNumberZod = z.number().transform(v => v as BlockNumber)\nexport const NumberishBlockNumberZod = NumberishZod.transform(v => v as BlockNumber)\n\nexport const asBlockNumber = zodAsFactory<BlockNumber>(BlockNumberZod, 'asBlockNumber')\nexport const toBlockNumber = zodToFactory<BlockNumber>(NumberishBlockNumberZod, 'toBlockNumber')\n\nexport const BLOCK_NUMBER_ZERO = asBlockNumber(0)\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport type z from 'zod'\n\nimport type { ZodFactoryConfig } from './Config.ts'\n\nexport function zodAsFactory<T>(zod: z.ZodType<T>, name: string) {\n function asFunc(value: unknown): T | undefined\n function asFunc(value: unknown, assert: ZodFactoryConfig): T\n function asFunc(value: unknown, assert?: ZodFactoryConfig): T | undefined {\n const result = zod.safeParse(value)\n if (result.success) {\n return result.data\n }\n if (assert !== undefined) {\n let assertConfig: AssertConfig\n switch (typeof assert) {\n case 'string': {\n assertConfig = `[${name}][${value}] ${assert}`\n break\n }\n case 'object': {\n assertConfig = `[${name}][${assert.name}][${value}] ${result.error.message}`\n break\n }\n case 'boolean': {\n assertConfig = `[${name}][${value}] ${result.error.message}`\n break\n }\n case 'function': {\n assertConfig = assert(value, result.error.message)\n break\n }\n default: {\n assertConfig = true\n }\n }\n return assertError(value, assertConfig, result.error.message)\n }\n }\n\n return asFunc\n}\n","import type z from 'zod'\n\nexport function zodIsFactory<T>(zod: z.ZodType<T>) {\n return (value: unknown): value is T => zod.safeParse(value).success\n}\n","import type z from 'zod'\n\nimport { zodAsFactory } from './zodAsFactory.ts'\n\nexport function zodToFactory<T>(zod: z.ZodType<T>, name: string) {\n return zodAsFactory<T>(zod, name)\n}\n","import z from 'zod'\n\nexport const NumberishZod = z.union([z.number(), z.string(), z.bigint()])\n .transform(v => (typeof v === 'bigint' ? Number(v) : typeof v === 'string' ? Number(v) : v))\n .pipe(z.number())\n","import { type Brand } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\nimport type { BlockNumber } from './BlockNumber.ts'\nimport { NumberishBlockNumberZod } from './BlockNumber.ts'\n\nexport type EthBlockNumber = Brand<BlockNumber, { readonly __ethBlockNumber: true }>\n\nexport const EthBlockNumberZod = z.number().transform(v => v as EthBlockNumber)\nexport const NumberishEthBlockNumberZod = NumberishBlockNumberZod.transform(v => v as EthBlockNumber)\n\nexport const asEthBlockNumber = zodAsFactory<EthBlockNumber>(EthBlockNumberZod, 'asEthBlockNumber')\nexport const toEthBlockNumber = zodToFactory<EthBlockNumber>(NumberishEthBlockNumberZod, 'toEthBlockNumber')\n\nexport const ETH_BLOCK_NUMBER_ZERO = asEthBlockNumber(0)\n","import { type Brand } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\nimport type { BlockNumber } from './BlockNumber.ts'\nimport { NumberishBlockNumberZod } from './BlockNumber.ts'\n\nexport type XL1BlockNumber = Brand<BlockNumber, { readonly __xl1BlockNumber: true }>\n\nexport const XL1BlockNumberZod = z.number().transform(v => v as XL1BlockNumber)\nexport const NumberishXL1BlockNumberZod = NumberishBlockNumberZod.transform(v => v as XL1BlockNumber)\n\nexport const asXL1BlockNumber = zodAsFactory<XL1BlockNumber>(XL1BlockNumberZod, 'asXL1BlockNumber')\nexport const toXL1BlockNumber = zodToFactory<XL1BlockNumber>(NumberishXL1BlockNumberZod, 'toXL1BlockNumber')\n\nexport const XL1_BLOCK_NUMBER_ZERO = asXL1BlockNumber(0)\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport { type Brand, isDefined } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport {\n asBlockNumber,\n type BlockNumber, BlockNumberZod, NumberishBlockNumberZod,\n} from '../BlockNumber/index.ts'\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\n\nexport type BlockRange = [BlockNumber, BlockNumber]\nexport type NumberishBlockRange = [BlockNumber, BlockNumber]\n\nexport const BlockRangeZod = z.tuple([BlockNumberZod, BlockNumberZod])\nexport const NumberishBlockRangeZod = z.tuple([NumberishBlockNumberZod, NumberishBlockNumberZod])\n\nexport const asBlockRange = zodAsFactory<BlockRange>(BlockRangeZod, 'BlockRange')\nexport const toBlockRange = zodToFactory<BlockRange>(NumberishBlockRangeZod, 'BlockRange')\n\nexport type BlockRangeKey = Brand<string, { readonly __blockRangeKey: true }>\nexport const toBlockNumberKey = (range: BlockRange) => `${range[0]}|${range[1]}` as BlockRangeKey\n\nexport function fromBlockNumberKey(key: BlockRangeKey): BlockRange | undefined\nexport function fromBlockNumberKey(key: BlockRangeKey, assert: AssertConfig): BlockRange\nexport function fromBlockNumberKey(key: BlockRangeKey, assert?: AssertConfig): BlockRange | undefined {\n const [start, end] = key.split('|').map(v => asBlockNumber(Number(v)))\n const result = (isDefined(start) && isDefined(end)) ? [start, end] : undefined\n return assertError(result, assert, `Invalid BlockRangeKey: ${key}`)\n}\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport { type Brand, isDefined } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport type { EthBlockNumber } from '../BlockNumber/index.ts'\nimport {\n asEthBlockNumber,\n EthBlockNumberZod,\n NumberishEthBlockNumberZod,\n} from '../BlockNumber/index.ts'\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\n\nexport type EthBlockRange = [EthBlockNumber, EthBlockNumber]\nexport type NumberishEthBlockRange = [EthBlockNumber, EthBlockNumber]\n\nexport const EthBlockRangeZod = z.tuple([EthBlockNumberZod, EthBlockNumberZod])\nexport const NumberishEthBlockRangeZod = z.tuple([NumberishEthBlockNumberZod, NumberishEthBlockNumberZod])\n\nexport const asEthBlockRange = zodAsFactory<EthBlockRange>(EthBlockRangeZod, 'EthBlockRange')\nexport const toEthBlockRange = zodToFactory<EthBlockRange>(NumberishEthBlockRangeZod, 'EthBlockRange')\n\nexport type EthBlockRangeKey = Brand<string, { readonly __ethBlockRangeKey: true }>\nexport const toEthBlockNumberKey = (range: EthBlockRange) => `${range[0]}|${range[1]}` as EthBlockRangeKey\n\nexport function fromEthBlockNumberKey(key: EthBlockRangeKey): EthBlockRange | undefined\nexport function fromEthBlockNumberKey(key: EthBlockRangeKey, assert: AssertConfig): EthBlockRange\nexport function fromEthBlockNumberKey(key: EthBlockRangeKey, assert?: AssertConfig): EthBlockRange | undefined {\n const [start, end] = key.split('|').map(v => asEthBlockNumber(Number(v)))\n const result = (isDefined(start) && isDefined(end)) ? [start, end] : undefined\n return assertError(result, assert, `Invalid EthBlockRangeKey: ${key}`)\n}\n","import z from 'zod'\n\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '../zod/index.ts'\n\nexport const RangeZod = z.tuple([z.number(), z.number()])\n\nexport type Range = z.infer<typeof RangeZod>\n\nexport const isRange = zodIsFactory<Range>(RangeZod)\nexport const asRange = zodAsFactory<Range>(RangeZod, 'Range')\nexport const toRange = zodToFactory<Range>(RangeZod, 'Range')\n","import type { AssertConfig } from '@xylabs/hex'\nimport { assertError } from '@xylabs/hex'\nimport { type Brand, isDefined } from '@xylabs/typeof'\nimport z from 'zod'\n\nimport type { XL1BlockNumber } from '../BlockNumber/index.ts'\nimport {\n asXL1BlockNumber,\n NumberishXL1BlockNumberZod,\n XL1BlockNumberZod,\n} from '../BlockNumber/index.ts'\nimport { zodAsFactory, zodToFactory } from '../zod/index.ts'\n\nexport type XL1BlockRange = [XL1BlockNumber, XL1BlockNumber]\nexport type NumberishXL1BlockRange = [XL1BlockNumber, XL1BlockNumber]\n\nexport const XL1BlockRangeZod = z.tuple([XL1BlockNumberZod, XL1BlockNumberZod])\nexport const NumberishXL1BlockRangeZod = z.tuple([NumberishXL1BlockNumberZod, NumberishXL1BlockNumberZod])\n\nexport const asXL1BlockRange = zodAsFactory<XL1BlockRange>(XL1BlockRangeZod, 'XL1BlockRange')\nexport const toXL1BlockRange = zodToFactory<XL1BlockRange>(NumberishXL1BlockRangeZod, 'XL1BlockRange')\n\nexport type XL1BlockRangeKey = Brand<string, { readonly __xl1BlockRangeKey: true }>\nexport const toXL1BlockNumberKey = (range: XL1BlockRange) => `${range[0]}|${range[1]}` as XL1BlockRangeKey\n\nexport function fromXL1BlockNumberKey(key: XL1BlockRangeKey): XL1BlockRange | undefined\nexport function fromXL1BlockNumberKey(key: XL1BlockRangeKey, assert: AssertConfig): XL1BlockRange\nexport function fromXL1BlockNumberKey(key: XL1BlockRangeKey, assert?: AssertConfig): XL1BlockRange | undefined {\n const [start, end] = key.split('|').map(v => asXL1BlockNumber(Number(v)))\n const result = (isDefined(start) && isDefined(end)) ? [start, end] : undefined\n return assertError(result, assert, `Invalid XL1BlockRangeKey: ${key}`)\n}\n","import { type Brand, isUndefined } from '@xylabs/typeof'\nimport * as z from 'zod'\n\nimport { toXL1BlockNumber, XL1BlockNumberZod } from './BlockNumber/index.ts'\n\nexport const StepIdentityZod = z.object({\n block: XL1BlockNumberZod.describe('The block number at which the step occurs'),\n step: z.number().int().nonnegative().describe('The index of the step into the StepSize array'),\n})\nexport type StepIdentity = z.infer<typeof StepIdentityZod>\n\n/** @deprecated use StepIdentity instead */\nexport interface StepContext extends StepIdentity {}\n\n// this string is the block and the step separated by a pipe\nexport type StepIdentityString = Brand<string, { readonly __stepIdentityString: true }>\n\nfunction tryParseInt(value: string): number | undefined {\n // Prevent coercion of empty strings to 0\n if (value === '') return undefined\n // Parse number\n const num = Number(value)\n // Check if integer\n return Number.isInteger(num) ? num : undefined\n}\n\nexport const asStepIdentity = (stepIdentityString: string): StepIdentity | undefined => {\n try {\n const [blockNumberString, stepString] = stepIdentityString.split('|')\n if (isUndefined(blockNumberString) || isUndefined(stepString)) {\n return undefined\n }\n const step = tryParseInt(stepString)\n const block = toXL1BlockNumber(blockNumberString)\n if (isUndefined(block) || isUndefined(step)) {\n return undefined\n }\n\n return { block, step }\n } catch {\n return undefined\n }\n}\n","import { HexZod } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport type z from 'zod'\n\nimport { BridgeDetailsFieldsZod } from './BridgeDetails.ts'\n\nexport const BridgeDestinationObservationSchema = 'network.xyo.chain.bridge.observation.destination' as const\nexport type BridgeDestinationObservationSchema = typeof BridgeDestinationObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport const BridgeDestinationObservationFieldsZod = BridgeDetailsFieldsZod.extend({\n /**\n * Destination chain confirmation\n */\n destConfirmation: HexZod.optional().describe('Destination chain confirmation'),\n})\n\nexport type BridgeDestinationObservationFields = z.infer<typeof BridgeDestinationObservationFieldsZod>\n\n/**\n * Represents an observation that confirms a bridge action occurred on the destination chain.\n */\nexport type BridgeDestinationObservation = Payload<BridgeDestinationObservationFields, BridgeDestinationObservationSchema>\n\nexport const isBridgeDestinationObservation = isPayloadOfZodType<BridgeDestinationObservation>(\n BridgeDestinationObservationFieldsZod,\n BridgeDestinationObservationSchema,\n)\n\nexport const asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationObservation)\n","import { HexZod } from '@xylabs/hex'\nimport z from 'zod'\n\n/**\n * Represents a transfer destination\n */\nexport const BridgeDetailsDestinationFieldsZod = z.object({\n /**\n * Destination network\n */\n dest: HexZod.describe('The destination network identifier'),\n /**\n * Destination address (EOA or contract)\n */\n destAddress: HexZod.describe('The destination address (EOA or contract)'),\n /**\n * Token amount to bridge to destination\n */\n destAmount: HexZod.describe('The token amount to bridge to destination'),\n /**\n * Token being bridged to\n */\n destToken: HexZod.describe('The token being bridged to'),\n})\n\n/**\n * Represents a transfer destination\n */\nexport type BridgeDetailsDestinationFields = z.infer<typeof BridgeDetailsDestinationFieldsZod>\n\n/**\n * Represents a transfer source\n */\nexport const BridgeDetailsSourceFieldsZod = z.object({\n /**\n * Source network\n */\n src: HexZod.describe('The source network identifier'),\n\n /**\n * Source address (EOA or contract)\n */\n srcAddress: HexZod.describe('The source address (EOA or contract)'),\n /**\n * Token amount to bridge from source\n */\n srcAmount: HexZod.describe('The token amount to bridge from source'),\n /**\n * Token being bridged from\n */\n srcToken: HexZod.describe('The token being bridged from'),\n})\n\n/**\n * Represents a transfer source\n */\nexport type BridgeDetailsSourceFields = z.infer<typeof BridgeDetailsSourceFieldsZod>\n\n/**\n * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.\n */\nexport const BridgeDetailsFieldsZod = BridgeDetailsSourceFieldsZod.extend(\n BridgeDetailsDestinationFieldsZod.shape,\n)\n\n/**\n * Represents a transfer from a source chain/token/address/amount to a destination chain/token/address/amount.\n */\nexport type BridgeDetailsFields = z.infer<typeof BridgeDetailsFieldsZod>\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BridgeDetailsFieldsZod } from './BridgeDetails.ts'\n\nexport const BridgeIntentSchema = 'network.xyo.chain.bridge.intent' as const\nexport type BridgeIntentSchema = typeof BridgeIntentSchema\n\n/**\n * Represents an Address's intent to initiate a token bridge.\n */\nexport const BridgeIntentFieldsZod = BridgeDetailsFieldsZod.extend({\n /**\n * Unique identifier for replay protection\n */\n nonce: z.string().describe('Unique identifier for replay protection'),\n})\n\nexport type BridgeIntentFields = z.infer<typeof BridgeIntentFieldsZod>\n\nexport type BridgeIntent = Payload<BridgeIntentFields, BridgeIntentSchema>\n\nexport const isBridgeIntent = isPayloadOfZodType<BridgeIntent>(\n BridgeIntentFieldsZod,\n BridgeIntentSchema,\n)\n\nexport const asBridgeIntent = AsObjectFactory.create(isBridgeIntent)\n","import { HexZod } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport type z from 'zod'\n\nimport { BridgeDetailsFieldsZod } from './BridgeDetails.ts'\n\nexport const BridgeSourceObservationSchema = 'network.xyo.chain.bridge.observation.source' as const\nexport type BridgeSourceObservationSchema = typeof BridgeSourceObservationSchema\n\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport const BridgeSourceObservationFieldsZod = BridgeDetailsFieldsZod.extend({\n /**\n * Source chain confirmation\n */\n srcConfirmation: HexZod.optional().describe('Source chain confirmation'),\n})\n\nexport type BridgeSourceObservationFields = z.infer<typeof BridgeSourceObservationFieldsZod>\n/**\n * Represents an observation that confirms a bridge action occurred on the source chain.\n */\nexport type BridgeSourceObservation = Payload<BridgeSourceObservationFields, BridgeSourceObservationSchema>\n\nexport const isBridgeSourceObservation = isPayloadOfZodType<BridgeSourceObservation>(\n BridgeSourceObservationFieldsZod,\n BridgeSourceObservationSchema,\n)\n\nexport const asBridgeSourceObservation = AsObjectFactory.create(isBridgeSourceObservation)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\n\nexport const isChainStakeIntentWithStorageMeta = (x?: unknown | null): x is WithStorageMeta<ChainStakeIntent> => {\n return isChainStakeIntent(x) && isStorageMeta(x)\n}\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const StepCompleteSchema = 'network.xyo.chain.step.complete' as const\nexport type StepCompleteSchema = typeof StepCompleteSchema\n\n/* This records the completion of a step in the network - needed for network staking rewards */\n/* We will only write these for steps that are eligible for rewards Step 3 (2311) */\n\nexport interface StepCompleteFields extends FromFields {\n block: number /* The block number on the XL1 network */\n hash: Hash /* The Step Hash */\n size: number /* The size of the step */\n stakeBlock: number /* The block number on ethereum or other staking system */\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type StepComplete = Payload<StepCompleteFields, StepCompleteSchema>\n\nexport const isStepComplete = isPayloadOfSchemaType<StepComplete>(StepCompleteSchema)\n\nexport const asStepComplete = AsObjectFactory.create(isStepComplete)\n","import { HashZod } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { PayloadZodOfSchema } from './TransferPayload.ts'\n\n// xl1 = xl1 block number, epoch = epoch number, ethereum = ethereum block number\nexport type TimeDomain = 'xl1' | 'epoch' | 'ethereum'\n\nexport const TimeSchema = 'network.xyo.time' as const\nexport type TimeSchema = typeof TimeSchema\n\nexport const XL1TimeFieldsZod = z.object({\n // block number\n xl1: z.number().optional(),\n // block hash\n xl1Hash: HashZod.optional(),\n})\n\nexport const EthereumTimeFieldsZod = z.object({\n // block number\n ethereum: z.number().optional(),\n // block hash\n ethereumHash: HashZod.optional(),\n})\n\nexport const EpochTimeFieldsZod = z.object({\n // in milliseconds\n epoch: z.number(),\n})\n\nexport const TimeFieldsZod = XL1TimeFieldsZod.extend(XL1TimeFieldsZod.shape).extend(EthereumTimeFieldsZod.shape).extend(EpochTimeFieldsZod.shape)\n\nexport const TimePayloadZod = PayloadZodOfSchema(TimeSchema).extend(TimeFieldsZod.shape)\n\nexport type TimePayload = z.infer<typeof TimePayloadZod>\n\n// to prevent scaling problems, we use double the current time as a max safe epoch\nexport const isSafeEpoch = (value: unknown): value is number => {\n return typeof value === 'number' && value < 2 * Date.now()\n}\n\nexport const isTimePayload = (value: unknown): value is TimePayload => {\n return isPayloadOfSchemaType<TimePayload>(TimeSchema)(value) && isSafeEpoch(value.epoch)\n}\n\nexport const asTimePayload = AsObjectFactory.create(isTimePayload)\nexport const asTimePayloadWithStorageMeta = AsObjectFactory.create(isTimePayload)\n","import {\n type Address,\n AddressZod,\n type Hex,\n HexZod,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isPayloadOfSchemaType, PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\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<TContext extends {} = {}> extends FromFields {\n context?: TContext\n epoch: number\n // the amount that is being sent to other addresses\n transfers: Partial<Record<Address, Hex>>\n}\n\nexport const TransferFieldsZod = z.object({\n $opCodes: z.array(z.string()).optional(),\n context: z.record(z.string(), z.json()).optional(),\n epoch: z.number(),\n from: AddressZod,\n transfers: z.record(AddressZod, HexZod),\n})\n\nexport const PayloadZodOfSchema = <S extends string>(schema: S) => PayloadZod.extend({ schema: z.literal(schema) })\n\nexport const TransferZod = PayloadZodOfSchema(TransferSchema).extend(TransferFieldsZod.shape)\n\nexport type Transfer = z.infer<typeof TransferZod>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfZodType } from '@xyo-network/payload-model'\nimport type { z } from 'zod'\n\nimport { StepIdentityZod } from '../model/index.ts'\n\nexport const StepIdentitySchema = 'network.xyo.chain.step.identity' as const\nexport type StepIdentitySchema = typeof StepIdentitySchema\n\nexport type StepIdentityFields = z.infer<typeof StepIdentityZod>\n\n/**\n * A Step Identity Payload\n */\nexport type StepIdentityPayload = Payload<StepIdentityFields, StepIdentitySchema>\n\nexport const isStepIdentityPayload = isPayloadOfZodType<StepIdentityPayload>(StepIdentityZod, StepIdentitySchema)\n\nexport const asStepIdentityPayload = AsObjectFactory.create(isStepIdentityPayload)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type AnyHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isAnyHydratedTransaction = (\n value: unknown,\n): value is AnyHydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0])\n )\n}\n\nexport const asAnyHydratedTransaction = AsObjectFactory.create<AnyHydratedTransaction>(\n isAnyHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { HydratedBoundWitness, HydratedBoundWitnessWithStorageMeta } from '@xyo-network/archivist-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isAnyPayload, isStorageMeta } from '@xyo-network/payload-model'\n\nexport const isHydratedBoundWitness = (\n value: unknown,\n): value is HydratedBoundWitness => {\n return (\n Array.isArray(value)\n && value.length === 2\n && isBoundWitness(value[0])\n && Array.isArray(value[1])\n && !value[1].some(item => (!isAnyPayload(item)))\n )\n}\n\nexport const isHydratedBoundWitnessWithStorageMeta = (\n value: unknown,\n): value is HydratedBoundWitnessWithStorageMeta => {\n return (\n isHydratedBoundWitness(value)\n && isStorageMeta(value[0])\n && !value[1].some(item => (!isStorageMeta(item)))\n )\n}\n\nexport const asHydratedBoundWitness = AsObjectFactory.create<HydratedBoundWitness>(\n isHydratedBoundWitness,\n)\n\nexport const asHydratedBoundWitnessWithStorageMeta = AsObjectFactory.create<HydratedBoundWitnessWithStorageMeta>(\n isHydratedBoundWitnessWithStorageMeta,\n)\n","import {\n type Address, type Hex, isAddress,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Hex | Address & { __chain: true }\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && isAddress(typedObj.chain)\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isSigned, type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\n/** @deprecated Use HydratedTransactionWithStorageMeta instead */\nexport type HydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\n/** @deprecated Use isHydratedTransactionWithStorageMeta instead */\nexport const isHydratedTransaction = (\n value: unknown,\n// eslint-disable-next-line sonarjs/deprecation\n): value is HydratedTransaction => {\n return (\n isHydratedBoundWitness(value) && isTransactionBoundWitness(value[0]) && isSigned(value[0]) && isStorageMeta(value[0])\n )\n}\n\n/** @deprecated Use asHydratedTransactionWithStorageMeta instead */\n// eslint-disable-next-line sonarjs/deprecation\nexport const asHydratedTransaction = AsObjectFactory.create<HydratedTransaction>(\n // eslint-disable-next-line sonarjs/deprecation\n isHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithHashMeta,\n} from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithHashMeta<Signed<T>>, WithHashMeta<P>[]]\n\nexport const isHydratedTransactionWithHashMeta = (\n value: unknown,\n): value is HydratedTransactionWithHashMeta => {\n return (\n isAnyHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asHydratedTransactionWithHashMeta = AsObjectFactory.create<HydratedTransactionWithHashMeta>(\n isHydratedTransactionWithHashMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport {\n isStorageMeta, type Payload, type WithStorageMeta,\n} from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type HydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is HydratedTransactionWithStorageMeta => {\n return (\n isAnyHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asHydratedTransactionWithStorageMeta = AsObjectFactory.create<HydratedTransactionWithStorageMeta>(\n isHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [Signed<T>, P[]]\n\nexport const isSignedHydratedTransaction = (\n value: unknown,\n): value is SignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isSigned(value[0])\n )\n}\n\nexport const asSignedHydratedTransaction = AsObjectFactory.create<SignedHydratedTransaction>(\n isSignedHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport type {\n Payload,\n WithHashMeta,\n} from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithHashMeta<Signed<T>>, WithHashMeta<P>[]]\n\nexport const isSignedHydratedTransactionWithHashMeta = (\n value: unknown,\n): value is SignedHydratedTransactionWithHashMeta => {\n return (\n isSignedHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asSignedHydratedTransactionWithHashMeta = AsObjectFactory.create<SignedHydratedTransactionWithHashMeta>(\n isSignedHydratedTransactionWithHashMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { type Signed } from '@xyo-network/boundwitness-model'\nimport type {\n Payload,\n WithStorageMeta,\n} from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type SignedHydratedTransactionWithStorageMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isSignedHydratedTransactionWithStorageMeta = (\n value: unknown,\n): value is SignedHydratedTransactionWithStorageMeta => {\n return (\n isSignedHydratedTransaction(value) && isStorageMeta(value[0]) && !value[1].some(v => !isStorageMeta(v))\n )\n}\n\nexport const asSignedHydratedTransactionWithStorageMeta = AsObjectFactory.create<SignedHydratedTransactionWithStorageMeta>(\n isSignedHydratedTransactionWithStorageMeta,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isTransactionBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isHashMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<Signed<TransactionBoundWitness>> =>\n\n isSignedTransactionBoundWitness(value)\n && isHashMeta(value)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\n\nexport const asTransactionBoundWitnessWithHashMeta = AsObjectFactory.create(isTransactionBoundWitnessWithHashMeta)\n","import { type Hex, isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport { isObject } from '@xylabs/typeof'\n\nimport { type AttoXL1, isAttoXL1 } from '../xl1/index.ts'\n\nexport interface TransactionFeesBigInt {\n base: AttoXL1\n gasLimit: AttoXL1\n gasPrice: AttoXL1\n priority: AttoXL1\n}\n\nexport type TransactionFeesHex = {\n [K in keyof TransactionFeesBigInt]: Hex;\n}\n\nexport interface TransactionFeesFields {\n fees: TransactionFeesHex\n}\n\nexport const isTransactionFeesBigInt = (value: unknown): value is TransactionFeesBigInt => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesBigInt\n return (\n isAttoXL1(base)\n && isAttoXL1(gasLimit)\n && isAttoXL1(gasPrice)\n && isAttoXL1(priority)\n )\n}\n\nexport const asTransactionFeesBigInt = AsObjectFactory.create<TransactionFeesBigInt>(\n isTransactionFeesBigInt,\n)\n\nexport const isTransactionFeesHex = (value: unknown): value is TransactionFeesHex => {\n if (!isObject(value)) {\n return false\n }\n const {\n base, gasLimit, gasPrice, priority,\n } = value as TransactionFeesHex\n return (\n isHex(base)\n && isHex(gasLimit)\n && isHex(gasPrice)\n && isHex(priority)\n )\n}\n\nexport const asTransactionFeesHex = AsObjectFactory.create<TransactionFeesHex>(\n isTransactionFeesHex,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport { isUnsigned } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport { isAnyHydratedTransaction } from './AnyHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type UnsignedHydratedTransaction<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [T, P[]]\n\nexport const isUnsignedHydratedTransaction = (\n value: unknown,\n): value is UnsignedHydratedTransaction => {\n return (\n isAnyHydratedTransaction(value) && isUnsigned(value[0])\n )\n}\n\nexport const asUnsignedHydratedTransaction = AsObjectFactory.create<UnsignedHydratedTransaction>(\n isUnsignedHydratedTransaction,\n)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Unsigned } from '@xyo-network/boundwitness-model'\nimport {\n isHashMeta,\n type Payload, type WithHashMeta,\n} from '@xyo-network/payload-model'\n\nimport { isSignedHydratedTransaction } from './SignedHydratedTransaction.ts'\nimport { type TransactionBoundWitness } from './TransactionBoundWitness.ts'\n\nexport type UnsignedHydratedTransactionWithHashMeta<T extends TransactionBoundWitness = TransactionBoundWitness,\n P extends Payload = Payload> = [WithHashMeta<Unsigned<T>>, WithHashMeta<P>[]]\n\nexport const isUnsignedHydratedTransactionWithHashMeta = (\n value: unknown,\n): value is UnsignedHydratedTransactionWithHashMeta => {\n return (\n isSignedHydratedTransaction(value) && isHashMeta(value[0]) && !value[1].some(v => !isHashMeta(v))\n )\n}\n\nexport const asUnsignedHydratedTransactionWithHashMeta = AsObjectFactory.create<UnsignedHydratedTransactionWithHashMeta>(\n isUnsignedHydratedTransactionWithHashMeta,\n)\n","import type { Hash } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness, isSigned } from '@xyo-network/boundwitness-model'\nimport type { WithHashMeta, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashMeta, isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ChainId, XL1BlockNumber } from '../model/index.ts'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: XL1BlockNumber\n /** Chain id - this should be \"0\" for the genesis block */\n chain: ChainId\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hash[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isSignedBlockBoundWitness = (value: unknown): value is Signed<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithStorageMeta = (value: unknown): value is Signed<WithStorageMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithStorageMeta(value) && isSigned(value)\n}\n\nexport const isBlockBoundWitnessWithHashMeta = (value: unknown): value is WithHashMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isHashMeta(value)\n}\n\nexport const isSignedBlockBoundWitnessWithHashMeta = (value: unknown): value is Signed<WithHashMeta<BlockBoundWitness>> => {\n return isBlockBoundWitnessWithHashMeta(value) && isSigned(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asSignedBlockBoundWitness = AsObjectFactory.create(isSignedBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithStorageMeta)\n\nexport const asBlockBoundWitnessWithHashMeta = AsObjectFactory.create(isBlockBoundWitnessWithHashMeta)\nexport const asSignedBlockBoundWitnessWithHashMeta = AsObjectFactory.create(isSignedBlockBoundWitnessWithHashMeta)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Signed } from '@xyo-network/boundwitness-model'\nimport { type Payload, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport { isHydratedBoundWitness } from '../isHydratedBoundWitness.ts'\nimport {\n type BlockBoundWitness,\n isBlockBoundWitnessWithStorageMeta,\n} from './BlockBoundWitness.ts'\n\nexport type HydratedBlock<T extends BlockBoundWitness = BlockBoundWitness,\n P extends Payload = Payload> = [WithStorageMeta<Signed<T>>, WithStorageMeta<P>[]]\n\nexport const isHydratedBlock = (\n value: unknown,\n): value is HydratedBlock => {\n return (\n isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0])\n )\n}\n\nexport const asHydratedBlock = AsObjectFactory.create<HydratedBlock>(\n isHydratedBlock,\n)\n","import type { Address, EthAddress } from '@xylabs/hex'\n\n/**\n * The Zero Address is used as a marker address for various protocol operations.\n */\nexport const XYO_ZERO_ADDRESS = '0000000000000000000000000000000000000000' as const as Address\n\n/**\n * The Bridge Address is used as a marker address for bridge transactions.\n */\nexport const XYO_BRIDGE_ADDRESS = '3012193230121932301219323012193230121932' as const as Address\n\n/**\n * The Network Staking Address is used as a marker address for staking the network.\n */\nexport const XYO_NETWORK_STAKING_ADDRESS = '1969196919691969196919691969196919691969' as const as Address\n\n/**\n * The Step Reward Address is used as a marker address for step rewards.\n */\nexport const XYO_STEP_REWARD_ADDRESS = '1216197612161976121619761216197612161976' as const as Address\n\nexport const XL1_ETH_MAIN_ERC20_CONTRACT_ADDRESS = '0xf72aE3E0DA743033AbD7A407557D684c1aE66aed' as const as EthAddress\n\nexport const XL1_ETH_MAIN_SUB_GOVERNOR_ADDRESS = '0xbA296Bc5D0949C0484f08c56c30FB95CC4675A29' as const as EthAddress\n\nexport const XL1_ETH_MAIN_REWARDS_ADDRESS = '0x1a546e091FB4EFb274DC584334a28b8754c4ece7' as const as EthAddress\n\nexport const XL1_ETH_MAIN_STAKED_XYO_CHAIN_ADDRESS = '0x319e667cED10452A117472811130444dED357F26' as const as EthAddress\n\nexport const XL1_ETH_MAIN_GOVERNANCE_ADDRESS = '0x7595710956d6B14b4f2F51a8dF41379eEeC9074E' as const as EthAddress\n","// the percent of the block rewards the producer gets\nexport const defaultRewardRatio = 0.05 as const // 5.0% goes to block producer\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.nano),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.nano),\n} as const\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\nimport { minTransactionFees } from './minTransactionFees.ts'\n\nexport const defaultTransactionFees: TransactionFeesBigInt = {\n base: minTransactionFees.base,\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.nano),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.nano),\n priority: minTransactionFees.priority,\n} as const\n","export const ELEVATE_OPCODE = 'elevate'\n","import { AsTypeFactory } from '@xylabs/object'\n\nimport { asXL1BlockNumber, type XL1BlockNumber } from '../model/index.ts'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes: XL1BlockNumber[] = [\n asXL1BlockNumber(7, true),\n asXL1BlockNumber(31, true),\n asXL1BlockNumber(211, true),\n asXL1BlockNumber(2311, true),\n asXL1BlockNumber(30_031, true),\n asXL1BlockNumber(510_511, true),\n asXL1BlockNumber(9_699_691, true),\n asXL1BlockNumber(223_092_871, true),\n asXL1BlockNumber(6_469_693_231, true),\n]\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`, { required: true })\n return StepSizes[validatedStep]\n}\n\nexport const StepRewardFractions = [\n [0n, 1n], // 0%\n [0n, 1n], // 0%\n [0n, 1n], // 0%\n [1n, 10_000n], // 0.01%\n [2n, 1000n], // 0.2%\n [3n, 100n], // 3%\n [45n, 100n], // 45%\n] as const\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","export const XL1_PROTOCOL_VERSION_MAJOR = 1 as const\nexport const XL1_PROTOCOL_VERSION_MINOR = 2 as const\nexport const XL1_PROTOCOL_VERSION_PATCH = 0 as const\nexport const XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_VERSION_MINOR}.${XL1_PROTOCOL_VERSION_PATCH}` as const\nexport const XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1_000_000 + XL1_PROTOCOL_VERSION_MINOR * 1000 + XL1_PROTOCOL_VERSION_PATCH\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumberPayload = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumberPayload = isPayloadOfSchemaType<BlockNumberPayload>(BlockNumberSchema)\nexport const asBlockNumberPayload = AsObjectFactory.create<BlockNumberPayload>(isBlockNumberPayload)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberPayloadWithSources = isPayloadOfSchemaTypeWithSources<BlockNumberPayload>(BlockNumberSchema)\nexport const asBlockNumberPayloadWithSources = AsObjectFactory.create<WithSources<BlockNumberPayload>>(isBlockNumberPayloadWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import { type Hash, isHash } from '@xylabs/hex'\nimport { isError } from '@xylabs/typeof'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport class ValidationError<TValue = Payload> extends Error {\n hash: Hash\n value: TValue\n constructor(hash: Hash, value: TValue, message?: string, cause?: unknown) {\n super(message)\n this.hash = hash\n this.name = this.constructor.name\n this.value = value\n this.cause = cause\n }\n}\n\nexport const isValidationError = <TValue = Payload>(\n error: unknown,\n): error is ValidationError<TValue> => {\n return (\n isError(error) && isHash((error as ValidationError<TValue>)?.hash) && (error as ValidationError<TValue>)?.value !== undefined\n )\n}\n","import type { HydratedBoundWitness } from '@xyo-network/archivist-model'\nimport { type BoundWitness } from '@xyo-network/boundwitness-model'\n\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class BoundWitnessValidationError extends ValidationError<BoundWitness> {}\n\nexport const isBoundWitnessValidationError = (\n error: unknown,\n): error is BoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === BoundWitnessValidationError.constructor.name\n )\n}\n\nexport class HydratedBoundWitnessValidationError extends ValidationError<HydratedBoundWitness> {}\n\nexport const isHydratedBoundWitnessValidationError = (\n error: unknown,\n): error is HydratedBoundWitnessValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedBoundWitnessValidationError.constructor.name\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport { type Payload } from '@xyo-network/payload-model'\n\nimport { type HydratedBlock } from '../../block/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class InBlockPayloadValidationError extends ValidationError<Payload> {\n block: HydratedBlock\n constructor(hash: Hash, block: HydratedBlock, value: Payload, message?: string, cause?: unknown) {\n super(hash, value, message, cause)\n this.block = block\n }\n}\n\nexport const isInBlockPayloadValidationError = (\n error: unknown,\n): error is InBlockPayloadValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === InBlockPayloadValidationError.constructor.name\n )\n}\n","import { type SignedHydratedTransaction } from '../../transaction/index.ts'\nimport { isValidationError, ValidationError } from '../error.ts'\n\nexport class HydratedTransactionValidationError extends ValidationError<SignedHydratedTransaction> {}\n\nexport const isHydratedTransactionValidationError = (\n error: unknown,\n): error is HydratedTransactionValidationError => {\n if (!isValidationError(error)) return false\n return (\n error.name === HydratedTransactionValidationError.constructor.name\n )\n}\n"],"mappings":";AAAO,IAAM,iBAAiB,CAAC,OAAe,SAAS,OAAyB;AAC9E,QAAM,QAAQ,QAAQ,OAAO,MAAM,MAAM;AACzC,QAAM,UAAU,QAAQ,OAAO,MAAM,MAAM;AAC3C,SAAO,CAAC,OAAO,OAAO;AACxB;;;ACFO,IAAM,yBAAyB,CACpC,OACA,SAAS,IACT,aAAa,QACb,gBAAgB,GAChB,cAAc,GACd,SAA+B,YACpB;AACX,QAAM,CAAC,OAAO,OAAO,IAAI,eAAe,OAAO,MAAM;AACrD,QAAM,kBAAkB,QAAQ,SAAS,EAAE;AAC3C,QAAM,0BAA0B,SAAS;AACzC,MAAI,UAAU,MAAM,2BAA2B,cAAc,YAAY,GAAI,QAAO,OAAO,OAAO,aAAa,GAAG,GAAG,IAAI;AAEzH,QAAM,kBAAkB,MAAM,SAAS,EAAE,EAAE;AAC3C,QAAM,2BAA2B,kBAAkB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AA,EACA;AAAA,EACA,YAAY,MAAY,OAAe,SAAkB,OAAiB;AACxE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO,KAAK,YAAY;AAC7B,SAAK,QAAQ;AACb,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,IAAM,oBAAoB,CAC/B,UACqC;AACrC,SACE,QAAQ,KAAK,KAAK,OAAQ,OAAmC,IAAI,KAAM,OAAmC,UAAU;AAExH;;;ACjBO,IAAM,8BAAN,cAA0C,gBAA8B;AAAC;AAEzE,IAAM,gCAAgC,CAC3C,UACyC;AACzC,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,4BAA4B,YAAY;AAE3D;AAEO,IAAM,sCAAN,cAAkD,gBAAsC;AAAC;AAEzF,IAAM,wCAAwC,CACnD,UACiD;AACjD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,oCAAoC,YAAY;AAEnE;;;ACnBO,IAAM,gCAAN,cAA4C,gBAAyB;AAAA,EAC1E;AAAA,EACA,YAAY,MAAY,OAAsB,OAAgB,SAAkB,OAAiB;AAC/F,UAAM,MAAM,OAAO,SAAS,KAAK;AACjC,SAAK,QAAQ;AAAA,EACf;AACF;AAEO,IAAM,kCAAkC,CAC7C,UAC2C;AAC3C,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,8BAA8B,YAAY;AAE7D;;;AClBO,IAAM,qCAAN,cAAiD,gBAA2C;AAAC;AAE7F,IAAM,uCAAuC,CAClD,UACgD;AAChD,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO;AACtC,SACE,MAAM,SAAS,mCAAmC,YAAY;AAElE;","names":["isHashMeta","z","z","z","z","z","z","z","z","assertError","z","z","assertError","assertError","isDefined","z","z","isDefined","assertError","z","z","assertError","isDefined","z","z","isDefined","assertError","z","HexZod","z","HexZod","AsObjectFactory","isPayloadOfZodType","z","z","isPayloadOfZodType","AsObjectFactory","HexZod","AsObjectFactory","isPayloadOfZodType","HexZod","isPayloadOfZodType","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","z","HexZod","AsObjectFactory","isPayloadOfSchemaType","z","z","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isPayloadOfZodType","isPayloadOfZodType","AsObjectFactory","AsObjectFactory","AsObjectFactory","isAnyPayload","isStorageMeta","AsObjectFactory","isBoundWitness","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isSigned","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isStorageMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","isSigned","isStorageMeta","isSigned","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","AsObjectFactory","isHashMeta","isHashMeta","AsObjectFactory","z","isHashMeta","isHex","AsObjectFactory","isBoundWitness","isSigned","isHashMeta","isStorageMeta","AsObjectFactory","AsObjectFactory","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType"]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { type Brand } from '@xylabs/typeof';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { type XL1BlockNumber } from './BlockNumber/index.ts';
|
|
4
3
|
export declare const StepIdentityZod: z.ZodObject<{
|
|
5
|
-
block: z.ZodNumber
|
|
4
|
+
block: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("./BlockNumber/XL1BlockNumber.ts").XL1BlockNumber, number>>;
|
|
6
5
|
step: z.ZodNumber;
|
|
7
6
|
}, z.core.$strip>;
|
|
8
|
-
export
|
|
9
|
-
block: XL1BlockNumber;
|
|
10
|
-
step: number;
|
|
11
|
-
}
|
|
7
|
+
export type StepIdentity = z.infer<typeof StepIdentityZod>;
|
|
12
8
|
/** @deprecated use StepIdentity instead */
|
|
13
9
|
export interface StepContext extends StepIdentity {
|
|
14
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIdentity.d.ts","sourceRoot":"","sources":["../../../src/model/StepIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"StepIdentity.d.ts","sourceRoot":"","sources":["../../../src/model/StepIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,eAAO,MAAM,eAAe;;;iBAG1B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE1D,2CAA2C;AAC3C,MAAM,WAAW,WAAY,SAAQ,YAAY;CAAG;AAGpD,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAWvF,eAAO,MAAM,cAAc,GAAI,oBAAoB,MAAM,KAAG,YAAY,GAAG,SAgB1E,CAAA"}
|
|
@@ -1,22 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
1
|
+
import z from 'zod';
|
|
3
2
|
export type TimeDomain = 'xl1' | 'epoch' | 'ethereum';
|
|
4
3
|
export declare const TimeSchema: "network.xyo.time";
|
|
5
4
|
export type TimeSchema = typeof TimeSchema;
|
|
6
|
-
export
|
|
7
|
-
xl1
|
|
8
|
-
xl1Hash
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
ethereum
|
|
12
|
-
ethereumHash
|
|
13
|
-
}
|
|
14
|
-
export
|
|
15
|
-
epoch:
|
|
16
|
-
}
|
|
17
|
-
export
|
|
5
|
+
export declare const XL1TimeFieldsZod: z.ZodObject<{
|
|
6
|
+
xl1: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
xl1Hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
8
|
+
}, z.z.core.$strip>;
|
|
9
|
+
export declare const EthereumTimeFieldsZod: z.ZodObject<{
|
|
10
|
+
ethereum: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
ethereumHash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
12
|
+
}, z.z.core.$strip>;
|
|
13
|
+
export declare const EpochTimeFieldsZod: z.ZodObject<{
|
|
14
|
+
epoch: z.ZodNumber;
|
|
15
|
+
}, z.z.core.$strip>;
|
|
16
|
+
export declare const TimeFieldsZod: z.ZodObject<{
|
|
17
|
+
xl1: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
xl1Hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
19
|
+
ethereum: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
ethereumHash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
21
|
+
epoch: z.ZodNumber;
|
|
22
|
+
}, z.z.core.$strip>;
|
|
23
|
+
export declare const TimePayloadZod: z.ZodObject<{
|
|
24
|
+
schema: z.ZodLiteral<"network.xyo.time">;
|
|
25
|
+
xl1: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
xl1Hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
27
|
+
ethereum: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
ethereumHash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
29
|
+
epoch: z.ZodNumber;
|
|
30
|
+
}, z.z.core.$strip>;
|
|
31
|
+
export type TimePayload = z.infer<typeof TimePayloadZod>;
|
|
18
32
|
export declare const isSafeEpoch: (value: unknown) => value is number;
|
|
19
33
|
export declare const isTimePayload: (value: unknown) => value is TimePayload;
|
|
20
|
-
export declare const asTimePayload: import("@xylabs/object").AsTypeFunction<
|
|
21
|
-
|
|
34
|
+
export declare const asTimePayload: import("@xylabs/object").AsTypeFunction<{
|
|
35
|
+
schema: "network.xyo.time";
|
|
36
|
+
epoch: number;
|
|
37
|
+
xl1?: number | undefined;
|
|
38
|
+
xl1Hash?: import("@xylabs/hex").Hash | undefined;
|
|
39
|
+
ethereum?: number | undefined;
|
|
40
|
+
ethereumHash?: import("@xylabs/hex").Hash | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const asTimePayloadWithStorageMeta: import("@xylabs/object").AsTypeFunction<{
|
|
43
|
+
schema: "network.xyo.time";
|
|
44
|
+
epoch: number;
|
|
45
|
+
xl1?: number | undefined;
|
|
46
|
+
xl1Hash?: import("@xylabs/hex").Hash | undefined;
|
|
47
|
+
ethereum?: number | undefined;
|
|
48
|
+
ethereumHash?: import("@xylabs/hex").Hash | undefined;
|
|
49
|
+
}>;
|
|
22
50
|
//# sourceMappingURL=Time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/Time.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/Time.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,KAAK,CAAA;AAKnB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAA;AAErD,eAAO,MAAM,UAAU,EAAG,kBAA2B,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAA;AAE1C,eAAO,MAAM,gBAAgB;;;mBAK3B,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;mBAKhC,CAAA;AAEF,eAAO,MAAM,kBAAkB;;mBAG7B,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;mBAAuH,CAAA;AAEjJ,eAAO,MAAM,cAAc;;;;;;;mBAA6D,CAAA;AAExF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAGxD,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAErD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,WAEvD,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;EAAwC,CAAA;AAClE,eAAO,MAAM,4BAA4B;;;;;;;EAAwC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { type Brand, isUndefined } from '@xylabs/typeof'
|
|
2
2
|
import * as z from 'zod'
|
|
3
3
|
|
|
4
|
-
import { toXL1BlockNumber,
|
|
4
|
+
import { toXL1BlockNumber, XL1BlockNumberZod } from './BlockNumber/index.ts'
|
|
5
5
|
|
|
6
6
|
export const StepIdentityZod = z.object({
|
|
7
|
-
block:
|
|
8
|
-
step: z.number().int().nonnegative(),
|
|
7
|
+
block: XL1BlockNumberZod.describe('The block number at which the step occurs'),
|
|
8
|
+
step: z.number().int().nonnegative().describe('The index of the step into the StepSize array'),
|
|
9
9
|
})
|
|
10
|
-
|
|
11
|
-
export interface StepIdentity {
|
|
12
|
-
block: XL1BlockNumber
|
|
13
|
-
// the index of the step into the StepSize array
|
|
14
|
-
step: number
|
|
15
|
-
}
|
|
10
|
+
export type StepIdentity = z.infer<typeof StepIdentityZod>
|
|
16
11
|
|
|
17
12
|
/** @deprecated use StepIdentity instead */
|
|
18
13
|
export interface StepContext extends StepIdentity {}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HashZod } from '@xylabs/hex'
|
|
2
2
|
import { AsObjectFactory } from '@xylabs/object'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
3
|
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
4
|
+
import z from 'zod'
|
|
5
|
+
|
|
6
|
+
import { PayloadZodOfSchema } from './TransferPayload.ts'
|
|
5
7
|
|
|
6
8
|
// xl1 = xl1 block number, epoch = epoch number, ethereum = ethereum block number
|
|
7
9
|
export type TimeDomain = 'xl1' | 'epoch' | 'ethereum'
|
|
@@ -9,26 +11,30 @@ export type TimeDomain = 'xl1' | 'epoch' | 'ethereum'
|
|
|
9
11
|
export const TimeSchema = 'network.xyo.time' as const
|
|
10
12
|
export type TimeSchema = typeof TimeSchema
|
|
11
13
|
|
|
12
|
-
export
|
|
14
|
+
export const XL1TimeFieldsZod = z.object({
|
|
13
15
|
// block number
|
|
14
|
-
xl1
|
|
16
|
+
xl1: z.number().optional(),
|
|
15
17
|
// block hash
|
|
16
|
-
xl1Hash
|
|
17
|
-
}
|
|
18
|
+
xl1Hash: HashZod.optional(),
|
|
19
|
+
})
|
|
18
20
|
|
|
19
|
-
export
|
|
21
|
+
export const EthereumTimeFieldsZod = z.object({
|
|
20
22
|
// block number
|
|
21
|
-
ethereum
|
|
23
|
+
ethereum: z.number().optional(),
|
|
22
24
|
// block hash
|
|
23
|
-
ethereumHash
|
|
24
|
-
}
|
|
25
|
+
ethereumHash: HashZod.optional(),
|
|
26
|
+
})
|
|
25
27
|
|
|
26
|
-
export
|
|
28
|
+
export const EpochTimeFieldsZod = z.object({
|
|
27
29
|
// in milliseconds
|
|
28
|
-
epoch: number
|
|
29
|
-
}
|
|
30
|
+
epoch: z.number(),
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
export const TimeFieldsZod = XL1TimeFieldsZod.extend(XL1TimeFieldsZod.shape).extend(EthereumTimeFieldsZod.shape).extend(EpochTimeFieldsZod.shape)
|
|
34
|
+
|
|
35
|
+
export const TimePayloadZod = PayloadZodOfSchema(TimeSchema).extend(TimeFieldsZod.shape)
|
|
30
36
|
|
|
31
|
-
export type TimePayload =
|
|
37
|
+
export type TimePayload = z.infer<typeof TimePayloadZod>
|
|
32
38
|
|
|
33
39
|
// to prevent scaling problems, we use double the current time as a max safe epoch
|
|
34
40
|
export const isSafeEpoch = (value: unknown): value is number => {
|