@xyo-network/xl1-protocol 1.4.22 → 1.4.24

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.
Files changed (38) hide show
  1. package/dist/neutral/index.mjs +9 -4
  2. package/dist/neutral/index.mjs.map +1 -1
  3. package/dist/types/constants/StepSizes.d.ts +3 -1
  4. package/dist/types/constants/StepSizes.d.ts.map +1 -1
  5. package/dist/types/services/AccountBalanceService.d.ts +2 -1
  6. package/dist/types/services/AccountBalanceService.d.ts.map +1 -1
  7. package/dist/types/services/{BlockProducer.d.ts → BlockProducerService.d.ts} +3 -2
  8. package/dist/types/services/BlockProducerService.d.ts.map +1 -0
  9. package/dist/types/services/{BlockReward.d.ts → BlockRewardService.d.ts} +1 -1
  10. package/dist/types/services/BlockRewardService.d.ts.map +1 -0
  11. package/dist/types/services/ChainServiceCollection.d.ts +4 -4
  12. package/dist/types/services/ChainServiceCollection.d.ts.map +1 -1
  13. package/dist/types/services/Service.d.ts +1 -5
  14. package/dist/types/services/Service.d.ts.map +1 -1
  15. package/dist/types/services/{stakeIntent → StakeIntentService}/ChainIndexingServiceStateSchema.d.ts +0 -1
  16. package/dist/types/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts.map +1 -0
  17. package/dist/types/services/{stakeIntent → StakeIntentService}/StakeIntentService.d.ts +2 -1
  18. package/dist/types/services/StakeIntentService/StakeIntentService.d.ts.map +1 -0
  19. package/dist/types/services/StakeIntentService/index.d.ts.map +1 -0
  20. package/dist/types/services/index.d.ts +3 -3
  21. package/dist/types/services/index.d.ts.map +1 -1
  22. package/package.json +1 -2
  23. package/src/constants/StepSizes.ts +10 -1
  24. package/src/services/AccountBalanceService.ts +3 -1
  25. package/src/services/{BlockProducer.ts → BlockProducerService.ts} +2 -1
  26. package/src/services/ChainServiceCollection.ts +4 -4
  27. package/src/services/Service.ts +1 -6
  28. package/src/services/{stakeIntent → StakeIntentService}/ChainIndexingServiceStateSchema.ts +0 -3
  29. package/src/services/{stakeIntent → StakeIntentService}/StakeIntentService.ts +2 -1
  30. package/src/services/index.ts +3 -3
  31. package/dist/types/services/BlockProducer.d.ts.map +0 -1
  32. package/dist/types/services/BlockReward.d.ts.map +0 -1
  33. package/dist/types/services/stakeIntent/ChainIndexingServiceStateSchema.d.ts.map +0 -1
  34. package/dist/types/services/stakeIntent/StakeIntentService.d.ts.map +0 -1
  35. package/dist/types/services/stakeIntent/index.d.ts.map +0 -1
  36. /package/dist/types/services/{stakeIntent → StakeIntentService}/index.d.ts +0 -0
  37. /package/src/services/{BlockReward.ts → BlockRewardService.ts} +0 -0
  38. /package/src/services/{stakeIntent → StakeIntentService}/index.ts +0 -0
@@ -165,7 +165,8 @@ var defaultTransactionFees = {
165
165
 
166
166
  // src/constants/StepSizes.ts
167
167
  import { AsTypeFactory } from "@xylabs/object";
168
- var StepSizes = [10, 105, 1103, 11576, 121551, 1276282, 13400956];
168
+ var StepSizes = [10, 105, 1103, 11576, 121551, 1276282, 13400956, 223092871, 6469693231];
169
+ var StepSizesV2 = [7, 31, 211, 2311, 30031, 510511, 9699691, 223092871, 6469693231];
169
170
  function isValidStep(step) {
170
171
  if (typeof step === "number" && Number.isInteger(step)) {
171
172
  return step >= 0 && step < StepSizes.length;
@@ -177,6 +178,10 @@ function stepSize(step) {
177
178
  const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`);
178
179
  return StepSizes[validatedStep];
179
180
  }
181
+ function stepSizeV2(step) {
182
+ const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizesV2.length - 1}`);
183
+ return StepSizesV2[validatedStep];
184
+ }
180
185
 
181
186
  // src/constants/TransactionGasCosts.ts
182
187
  var TransactionGasCosts = {
@@ -224,7 +229,7 @@ import { isPayloadOfSchemaType as isPayloadOfSchemaType9 } from "@xyo-network/pa
224
229
  var ChainInformationPayloadSchema = "network.xyo.chain.information";
225
230
  var isChainInformationPayload = isPayloadOfSchemaType9(ChainInformationPayloadSchema);
226
231
 
227
- // src/services/stakeIntent/ChainIndexingServiceStateSchema.ts
232
+ // src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts
228
233
  import { AsObjectFactory as AsObjectFactory9 } from "@xylabs/object";
229
234
  import { isPayloadOfSchemaType as isPayloadOfSchemaType10, isStorageMeta as isStorageMeta3 } from "@xyo-network/payload-model";
230
235
  var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
@@ -234,7 +239,6 @@ var isChainIndexingServiceState = (payload) => {
234
239
  var asChainIndexingServiceState = AsObjectFactory9.create(isChainIndexingServiceState);
235
240
  var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta3(value);
236
241
  var asChainIndexingServiceStateWithStorageMeta = AsObjectFactory9.create(isChainIndexingServiceStateWithStorageMeta);
237
- var asOptionalChainIndexingServiceStateWithStorageMeta = AsObjectFactory9.createOptional(isChainIndexingServiceStateWithStorageMeta);
238
242
  export {
239
243
  AllowedBlockPayloadSchemas,
240
244
  AtomicBoundWitnessSchema,
@@ -254,6 +258,7 @@ export {
254
258
  NetworkStatusSchema,
255
259
  PicoXL1,
256
260
  StepSizes,
261
+ StepSizesV2,
257
262
  TransactionGasCosts,
258
263
  TransferSchema,
259
264
  XL1,
@@ -276,7 +281,6 @@ export {
276
281
  asOptionalBlockBoundWitnessWithStorageMeta,
277
282
  asOptionalBlockNumber,
278
283
  asOptionalBlockNumberWithSources,
279
- asOptionalChainIndexingServiceStateWithStorageMeta,
280
284
  asOptionalChainStakeIntent,
281
285
  asOptionalHashPayload,
282
286
  asOptionalTransactionBoundWitness,
@@ -314,6 +318,7 @@ export {
314
318
  isValidStep,
315
319
  minTransactionFees,
316
320
  stepSize,
321
+ stepSizeV2,
317
322
  xl1ConvertFactor
318
323
  };
319
324
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/AtomicBoundWitness.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/HydratedBoundWitnessPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/xl1/XL1.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const AtomicBoundWitnessSchema = 'network.xyo.boundwitness.atomic' as const\nexport type AtomicBoundWitnessSchema = typeof AtomicBoundWitnessSchema\n\nexport interface AtomicBoundWitnessFields<TBoundWitness extends BoundWitness = BoundWitness> {\n bw: TBoundWitness\n}\n\nexport type AtomicBoundWitness = Payload<AtomicBoundWitnessFields, AtomicBoundWitnessSchema>\n\nexport const isAtomicBoundWitness = isPayloadOfSchemaType<AtomicBoundWitness>(AtomicBoundWitnessSchema)\n\nexport const asAtomicBoundWitness = AsObjectFactory.create(isAtomicBoundWitness)\nexport const asOptionalAtomicBoundWitness = AsObjectFactory.createOptional(isAtomicBoundWitness)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Partial<Record<Address, Hex>>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isPayloadOfSchemaType, type Payload } from '@xyo-network/payload-model'\n\nexport const HydratedBoundWitnessSchema = 'network.xyo.boundwitness.hydrated'\nexport type HydratedBoundWitnessSchema = typeof HydratedBoundWitnessSchema\n\nexport type HydratedBoundWitnessPayload = Payload<{\n bw: BoundWitness\n payloads: Payload[]\n},\n HydratedBoundWitnessSchema>\n\nexport const isHydratedBoundWitnessPayload = isPayloadOfSchemaType<HydratedBoundWitnessPayload>(HydratedBoundWitnessSchema)\nexport const asHydratedBoundWitnessPayload = AsObjectFactory.createOptional<HydratedBoundWitnessPayload>(isHydratedBoundWitnessPayload)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\nexport type TypingFunc<T extends bigint> = (value: bigint) => T\n\nexport const XL1: TypingFunc<XL1> = (value: bigint): XL1 => value as XL1\nexport const MilliXL1: TypingFunc<MilliXL1> = (value: bigint): MilliXL1 => value as MilliXL1\nexport const MicroXL1: TypingFunc<MicroXL1> = (value: bigint): MicroXL1 => value as MicroXL1\nexport const NanoXL1: TypingFunc<NanoXL1> = (value: bigint): NanoXL1 => value as NanoXL1\nexport const PicoXL1: TypingFunc<PicoXL1> = (value: bigint): PicoXL1 => value as PicoXL1\nexport const FemtoXL1: TypingFunc<FemtoXL1> = (value: bigint): FemtoXL1 => value as FemtoXL1\nexport const AttoXL1: TypingFunc<AttoXL1> = (value: bigint): AttoXL1 => value as AttoXL1\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.micro),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.micro),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.micro),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.micro),\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.micro),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.micro),\n priority: minTransactionFees.priority,\n} as const\n","import { AsTypeFactory } from '@xylabs/object'\n\nexport const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956] as const\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`)\n return StepSizes[validatedStep]\n}\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n\nexport const asOptionalChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAGhC,SAAS,6BAA6B;AAE/B,IAAM,2BAA2B;A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A,EACE,yBAAAC;AAAA,EACA;AAAA,OACK;AAEA,IAAM,oBAAoB;AAqB1B,IAAM,gBAAgBA,uBAAmC,iBAAiB;AAC1E,IAAM,gBAAgBD,iBAAgB,OAAoB,aAAa;AACvE,IAAM,wBAAwBA,iBAAgB,eAA4B,aAAa;AAKvF,IAAM,2BAA2B,iCAA8C,iBAAiB;AAChG,IAAM,2BAA2BA,iBAAgB,OAAiC,wBAAwB;AAC1G,IAAM,mCAAmCA,iBAAgB,eAAyC,wBAAwB;;;ACrCjI,SAAS,yBAAAE,8BAA6B;AAE/B,IAAM,sBAAsB;AAmB5B,IAAM,kBAAkBA,uBAAqC,mBAAmB;;;ACpBvF,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,mCAAmC;AAYzC,IAAM,+BAA+BA,uBAAkD,gCAAgC;;;ACf9H,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,gCAAgC;AAgBtC,IAAM,4BAA4BA,uBAA+C,6BAA6B;;;ACjBrH,SAAS,mBAAAC,wBAAuB;AAEhC,SAAS,yBAAAC,yBAAuB,iBAAAC,sBAAqB;AAiB9C,IAAM,kCAAkC;AAWxC,IAAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,wBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;AAExG,IAAM,qDACXA,iBAAgB,eAA2D,0CAA0C;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
1
+ {"version":3,"sources":["../../src/block/AllowedBlockPayload.ts","../../src/payload/AtomicBoundWitness.ts","../../src/payload/elevatable/ChainStakeIntent.ts","../../src/payload/elevatable/Executable.ts","../../src/payload/elevatable/Hash.ts","../../src/payload/elevatable/TransferPayload.ts","../../src/transaction/HydratedBoundWitnessPayload.ts","../../src/transaction/TransactionBoundWitness.ts","../../src/block/BlockBoundWitness.ts","../../src/xl1/XL1.ts","../../src/constants/minTransactionFees.ts","../../src/constants/defaultTransactionFees.ts","../../src/constants/StepSizes.ts","../../src/constants/TransactionGasCosts.ts","../../src/fields/BlockNumber.ts","../../src/network/Status.ts","../../src/services/Chain/ChainIdentification.ts","../../src/services/Chain/ChainInformation.ts","../../src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts"],"sourcesContent":["import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport type { Schema, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isHashStorageMeta, isSchema } from '@xyo-network/payload-model'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { isSchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin'\n\nimport type {\n ChainStakeIntent, HashPayload, Transfer,\n} from '../payload/index.ts'\nimport {\n ChainStakeIntentSchema, HashSchema, isChainStakeIntent, isHashPayload, isTransfer, TransferSchema,\n} from '../payload/index.ts'\nimport { isTransactionBoundWitness, type TransactionBoundWitness } from '../transaction/index.ts'\n\nexport type AllowedBlockPayload = Transfer | ChainStakeIntent | SchemaPayload | TransactionBoundWitness | HashPayload\nexport const AllowedBlockPayloadSchemas: Schema[] = [TransferSchema, ChainStakeIntentSchema, SchemaSchema, BoundWitnessSchema, HashSchema]\nexport type AllowedBlockPayloadSchema = typeof AllowedBlockPayloadSchemas[number]\n\nexport const isAllowedBlockPayloadSchema = (value: unknown): value is AllowedBlockPayloadSchema => {\n return isSchema(value) && AllowedBlockPayloadSchemas.includes(value)\n}\n\nexport const isAllowedBlockPayload = (value: unknown): value is AllowedBlockPayload => {\n return isTransfer(value) || isChainStakeIntent(value) || isSchemaPayload(value) || isTransactionBoundWitness(value) || isHashPayload(value)\n}\n\nexport const isAllowedBlockPayloadWithHashStorageMeta = (value: unknown): value is WithStorageMeta<AllowedBlockPayload> => {\n return isAllowedBlockPayload(value) && isHashStorageMeta(value)\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const AtomicBoundWitnessSchema = 'network.xyo.boundwitness.atomic' as const\nexport type AtomicBoundWitnessSchema = typeof AtomicBoundWitnessSchema\n\nexport interface AtomicBoundWitnessFields<TBoundWitness extends BoundWitness = BoundWitness> {\n bw: TBoundWitness\n}\n\nexport type AtomicBoundWitness = Payload<AtomicBoundWitnessFields, AtomicBoundWitnessSchema>\n\nexport const isAtomicBoundWitness = isPayloadOfSchemaType<AtomicBoundWitness>(AtomicBoundWitnessSchema)\n\nexport const asAtomicBoundWitness = AsObjectFactory.create(isAtomicBoundWitness)\nexport const asOptionalAtomicBoundWitness = AsObjectFactory.createOptional(isAtomicBoundWitness)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../../fields/index.ts'\nimport type { FromFields } from './Executable.ts'\n\nexport const ChainStakeIntentSchema = 'network.xyo.chain.stake.intent' as const\nexport type ChainStakeIntentSchema = typeof ChainStakeIntentSchema\n\nexport type Intent = 'producer' // | 'bank'\n\nexport interface ChainStakeIntentFields extends BlockDuration, FromFields {\n /*\n * The intent of the staking\n */\n intent: Intent\n}\n\nexport type ChainStakeIntent = Payload<ChainStakeIntentFields, ChainStakeIntentSchema>\n\nexport const isChainStakeIntent = (x?: unknown | null): x is ChainStakeIntent => {\n return isPayloadOfSchemaType<ChainStakeIntent>(ChainStakeIntentSchema)(x)\n && asNonNegativeInteger(x.nbf) !== undefined\n && asNonNegativeInteger(x.exp) !== undefined\n}\nexport const asChainStakeIntent = AsObjectFactory.create(isChainStakeIntent)\nexport const asOptionalChainStakeIntent = AsObjectFactory.createOptional(isChainStakeIntent)\n\nconst asNonNegativeInteger = (num: number) => {\n return (Number.isInteger(num) && num >= 0) ? num : undefined\n}\n","import type { Address } from '@xylabs/hex'\nimport type { EmptyObject } from '@xylabs/object'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\nexport interface FromFields {\n // the address that is treated as the source of this action\n from: Address\n}\n\nexport const hasFrom = (value: unknown): value is FromFields => {\n return (value as FromFields).from !== undefined\n}\n\nexport interface ExecutableFields {\n script: string[]\n}\n\nexport type Executable<T extends EmptyObject = EmptyObject> = T & ExecutableFields\nexport type OptionalExecutable<T extends EmptyObject = EmptyObject> = T & Partial<ExecutableFields>\n\nexport const isExecutable = <T extends EmptyObject>(value: T | undefined): value is Executable<T> => {\n return isAnyPayload(value) && Array.isArray((value as unknown as ExecutableFields).script)\n}\n\nexport const asExecutable = <T extends EmptyObject>(value: T | undefined): Executable<T> | undefined => {\n return isExecutable(value)\n ? value as unknown as Executable<T>\n : undefined\n}\n","import type { Hash } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const HashSchema = 'network.xyo.hash' as const\nexport type HashSchema = typeof HashSchema\n\nexport interface HashFields {\n hash: Hash\n}\n\nexport type HashPayload = Payload<HashFields, HashSchema>\n\nexport const isHashPayload = isPayloadOfSchemaType<HashPayload>(HashSchema)\n\nexport const asHashPayload = AsObjectFactory.create(isHashPayload)\nexport const asHashPayloadWithStorageMeta = AsObjectFactory.create(isHashPayload)\nexport const asOptionalHashPayload = AsObjectFactory.createOptional(isHashPayload)\n","import type {\n Address,\n Hex,\n} from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { FromFields } from './Executable.ts'\n\nexport const TransferSchema = 'network.xyo.transfer' as const\nexport type TransferSchema = typeof TransferSchema\n\nexport interface TransferFields extends FromFields {\n epoch: number\n // the amount that is being sent to another address\n transfers: Partial<Record<Address, Hex>>\n}\n\n// if this payload is included in a boundwitness, it needs to be available for inspection to be included in block\nexport type Transfer = Payload<TransferFields, TransferSchema>\n\nexport const isTransfer = isPayloadOfSchemaType<Transfer>(TransferSchema)\n\nexport const asTransfer = AsObjectFactory.create(isTransfer)\nexport const asOptionalTransfer = AsObjectFactory.createOptional(isTransfer)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isPayloadOfSchemaType, type Payload } from '@xyo-network/payload-model'\n\nexport const HydratedBoundWitnessSchema = 'network.xyo.boundwitness.hydrated'\nexport type HydratedBoundWitnessSchema = typeof HydratedBoundWitnessSchema\n\nexport type HydratedBoundWitnessPayload = Payload<{\n bw: BoundWitness\n payloads: Payload[]\n},\n HydratedBoundWitnessSchema>\n\nexport const isHydratedBoundWitnessPayload = isPayloadOfSchemaType<HydratedBoundWitnessPayload>(HydratedBoundWitnessSchema)\nexport const asHydratedBoundWitnessPayload = AsObjectFactory.createOptional<HydratedBoundWitnessPayload>(isHydratedBoundWitnessPayload)\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness, Signed } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport type { BlockDuration } from '../fields/index.ts'\nimport type { FromFields, OptionalExecutable } from '../payload/index.ts'\nimport type { TransactionFeesFields } from './TransactionFeesFields.ts'\n\nexport interface TransactionBoundWitnessFields extends BlockDuration, TransactionFeesFields {\n chain: Address\n}\n\nexport type TransactionBoundWitness = BoundWitness<TransactionBoundWitnessFields & OptionalExecutable & FromFields>\n\nexport const isTransactionBoundWitness = (value: unknown): value is TransactionBoundWitness => {\n const typedObj = value as TransactionBoundWitness\n return isBoundWitness(value)\n && typedObj.chain !== undefined\n && typedObj.fees !== undefined\n && typedObj.exp !== undefined\n && typedObj.nbf !== undefined\n}\n\nexport const isSignedTransactionBoundWitness = (value: unknown): value is Signed<TransactionBoundWitness> => {\n return isTransactionBoundWitness(value) && isSigned(value)\n}\n\nexport const isSigned = <T extends BoundWitness = BoundWitness>(value: unknown): value is Signed<T> =>\n isBoundWitness(value)\n && value.$signatures.length === value.addresses.length\n && value.addresses.length > 0\n\nexport const isTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<TransactionBoundWitness> =>\n isTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const isSignedTransactionBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<Signed<TransactionBoundWitness>> =>\n isSignedTransactionBoundWitness(value)\n && isStorageMeta(value)\n\nexport const asTransactionBoundWitness = AsObjectFactory.create(isTransactionBoundWitness)\nexport const asOptionalTransactionBoundWitness = AsObjectFactory.createOptional(isTransactionBoundWitness)\n\nexport const asTransactionBoundWitnessWithStorageMeta = AsObjectFactory.create(isTransactionBoundWitnessWithStorageMeta)\nexport const asOptionalTransactionBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isTransactionBoundWitnessWithStorageMeta)\n","import type { Hash, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface BlockBoundWitnessMeta {\n $epoch: number\n}\n\nexport interface BlockBoundWitnessFields {\n /** Block number */\n block: number\n /** Chain id - this should be \"0\" for the genesis block */\n chain: Hex\n /** Previous block hash if not block 0 */\n previous: Hash | null /* the previous block hash */\n /** Version of the protocol being used major * 1,000,000 + minor * 1,000 + patch */\n protocol: number\n /** Step hashes */\n step_hashes: Hex[]\n}\n\nexport type BlockBoundWitness = BoundWitness<BlockBoundWitnessFields & BlockBoundWitnessMeta>\n\nexport const isBlockBoundWitness = (value: unknown): value is BlockBoundWitness => {\n const typedObj = value as BlockBoundWitness\n return isBoundWitness(value)\n && Number.isInteger(typedObj.block)\n && isHex(typedObj.chain)\n}\n\nexport const isBlockBoundWitnessWithStorageMeta = (value: unknown): value is WithStorageMeta<BlockBoundWitness> => {\n return isBlockBoundWitness(value) && isStorageMeta(value)\n}\n\nexport const asBlockBoundWitness = AsObjectFactory.create(isBlockBoundWitness)\nexport const asOptionalBlockBoundWitness = AsObjectFactory.createOptional(isBlockBoundWitness)\n\nexport const asBlockBoundWitnessWithStorageMeta = AsObjectFactory.create(isBlockBoundWitnessWithStorageMeta)\nexport const asOptionalBlockBoundWitnessWithStorageMeta = AsObjectFactory.createOptional(isBlockBoundWitnessWithStorageMeta)\n","export type XL1 = bigint & { readonly _tag: 'XL1' } // 1e-18\nexport type MilliXL1 = bigint & { readonly _tag: 'MilliXL1' } // 1e-15 [XL1 * 1e3 = milliXL1] [milliXL1 / 1e3 = XL1]\nexport type MicroXL1 = bigint & { readonly _tag: 'MicroXL1' } // 1e-12 [XL1 * 1e6 = microXL1] [microXL1 / 1e6 = XL1]\nexport type NanoXL1 = bigint & { readonly _tag: 'NanoXL1' } // 1e-9 [XL1 * 1e9 = nanoXL1] [nanoXL1 / 1e9 = XL1]\nexport type PicoXL1 = bigint & { readonly _tag: 'PicoXL1' } // 1e-6 [XL1 * 1e12 = picoXL1] [picoXL1 / 1e12 = XL1]\nexport type FemtoXL1 = bigint & { readonly _tag: 'FemtoXL1' } // 1e-3 [XL1 * 1e15 = femtoXL1] [femtoXL1 / 1e15 = XL1]\nexport type AttoXL1 = bigint & { readonly _tag: 'AttoXL1' } // 1e-0 [XL1 * 1e18 = attoXL1] [attoXL1 / 1e18 = XL1]\n\nexport type TypingFunc<T extends bigint> = (value: bigint) => T\n\nexport const XL1: TypingFunc<XL1> = (value: bigint): XL1 => value as XL1\nexport const MilliXL1: TypingFunc<MilliXL1> = (value: bigint): MilliXL1 => value as MilliXL1\nexport const MicroXL1: TypingFunc<MicroXL1> = (value: bigint): MicroXL1 => value as MicroXL1\nexport const NanoXL1: TypingFunc<NanoXL1> = (value: bigint): NanoXL1 => value as NanoXL1\nexport const PicoXL1: TypingFunc<PicoXL1> = (value: bigint): PicoXL1 => value as PicoXL1\nexport const FemtoXL1: TypingFunc<FemtoXL1> = (value: bigint): FemtoXL1 => value as FemtoXL1\nexport const AttoXL1: TypingFunc<AttoXL1> = (value: bigint): AttoXL1 => value as AttoXL1\n\ntype XL1Units = 'xl1' | 'milli' | 'micro' | 'nano' | 'pico' | 'femto' | 'atto'\n\n/** @deprecated use XL1Places and xl1ConvertFactor(unit) instead */\nexport const XL1ConvertDict: Record<XL1Units, number> = {\n xl1: 18,\n milli: 15,\n micro: 12,\n nano: 9,\n pico: 6,\n femto: 3,\n atto: 0,\n} as const\n\nexport const XL1Places: Record<XL1Units, bigint> = {\n xl1: 18n,\n milli: 15n,\n micro: 12n,\n nano: 9n,\n pico: 6n,\n femto: 3n,\n atto: 0n,\n} as const\n\n/**\n * Convert factor by which a respective unit is multiplied to convert it to AttoXL1 or\n * by which AttoXL1 is divided to convert it to respective unit is multiplied.\n */\nexport const AttoXL1ConvertFactor: Record<XL1Units, bigint> = {\n xl1: 10n ** XL1Places.xl1,\n milli: 10n ** XL1Places.milli,\n micro: 10n ** XL1Places.micro,\n nano: 10n ** XL1Places.nano,\n pico: 10n ** XL1Places.pico,\n femto: 10n ** XL1Places.femto,\n atto: 10n ** XL1Places.atto,\n} as const\n\n/** @deprecated use AttoXL1ConvertFactor instead */\nexport function xl1ConvertFactor(unit: XL1Units) {\n return 10n ** XL1Places[unit]\n}\n","import type { TransactionFeesBigInt } from '../transaction/index.ts'\nimport { AttoXL1, AttoXL1ConvertFactor } from '../xl1/index.ts'\n\nexport const minTransactionFees: TransactionFeesBigInt = {\n base: AttoXL1(1000n * AttoXL1ConvertFactor.micro),\n gasPrice: AttoXL1(10n * AttoXL1ConvertFactor.micro),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.micro),\n priority: AttoXL1(0n * AttoXL1ConvertFactor.micro),\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.micro),\n gasLimit: AttoXL1(1_000_000n * AttoXL1ConvertFactor.micro),\n priority: minTransactionFees.priority,\n} as const\n","import { AsTypeFactory } from '@xylabs/object'\n\n// StepsV2 are primorial(n+2) + 1, where n is the index of the step size\n// primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310\n\nexport const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956, 223_092_871, 6_469_693_231] as const\nexport const StepSizesV2 = [7, 31, 211, 2311, 30_031, 510_511, 9_699_691, 223_092_871, 6_469_693_231] as const\n\nexport function isValidStep(step: unknown): step is number {\n if (typeof step === 'number' && Number.isInteger(step)) {\n return ((step >= 0) && (step < StepSizes.length))\n }\n return false\n}\n\nexport const asValidStep = AsTypeFactory.create<number>(isValidStep)\n\nexport function stepSize(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`)\n return StepSizes[validatedStep]\n}\n\nexport function stepSizeV2(step: number): number {\n const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizesV2.length - 1}`)\n return StepSizesV2[validatedStep]\n}\n","export const TransactionGasCosts = {\n /**\n * The cost of storing each character that is added to the chain\n * This includes the transaction JSON and all the elevated payloads' JSON\n */\n characterStorage: 10n,\n\n /** The cost of static validating every payload that will be included in the chain */\n payloadValidation: 1000n,\n\n /** The cost of validating each signature that will be included in the chain */\n signatureValidation: 1000n,\n\n /** The cost of validating each hash that will be included in the chain */\n hashValidation: 100n,\n\n /** The cost of validating a balance state, triggered by a Transfer payload or gas collection */\n balanceValidation: 100n,\n} as const\n\n/** Gas Calculation\n *\n * 1 Million microXL1 (mXL1) = 1 XL1\n *\n * Gas amount is calculated as follows:\n *\n * 1. Each byte in the transaction cost 10 gas\n * 2. Each payload validation in the transaction costs 1000 gas\n * 3. Each signature verification in the transaction costs 1000 gas\n * 4. Each hash validation in the transaction costs 100 gas\n * 5. Each balance validation in the transaction costs 100 gas\n * 6. Processing/Compute/Storage Cost?\n * 7. operation Costs?\n *\n * The total gas cost is calculated by multiplying the gas amount by the gas price.\n *\n * minGasPrice is initially set to 100 mXL1\n * minBase is initially set to 1000 mXL1\n * minPriority is always 0 mXL1, but can be set to increase the priority of the transaction\n *\n */\n","import type { Hex } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nexport const BlockNumberSchema = 'network.xyo.chain.block.number' as const\nexport type BlockNumberSchema = typeof BlockNumberSchema\n\nexport interface BlockNumberFields {\n /**\n * The block number\n */\n block: Hex\n /**\n * The chain id\n */\n chain?: Hex\n}\n/**\n * The number of a block\n */\nexport type BlockNumber = Payload<BlockNumberFields, BlockNumberSchema>\n\n/**\n * Identity function for determining if an object is a BlockNumber\n */\nexport const isBlockNumber = isPayloadOfSchemaType<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumber = AsObjectFactory.create<BlockNumber>(isBlockNumber)\nexport const asOptionalBlockNumber = AsObjectFactory.createOptional<BlockNumber>(isBlockNumber)\n\n/**\n * Identity function for determining if an object is a BlockNumber with sources\n */\nexport const isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources<BlockNumber>(BlockNumberSchema)\nexport const asBlockNumberWithSources = AsObjectFactory.create<WithSources<BlockNumber>>(isBlockNumberWithSources)\nexport const asOptionalBlockNumberWithSources = AsObjectFactory.createOptional<WithSources<BlockNumber>>(isBlockNumberWithSources)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const NetworkStatusSchema = 'network.xyo.chain.status' as const\nexport type NetworkStatusSchema = typeof NetworkStatusSchema\n\nexport type NetworkStatusState = 'online' | 'offline' | 'degraded' | 'unknown'\n\nexport type NetworkStatusUpdate = {\n end: number\n start: number\n update: string\n}\n\nexport interface NetworkStatusFields {\n description: string\n state: NetworkStatusState\n updates?: NetworkStatusUpdate[]\n}\n\nexport type NetworkStatus = Payload<NetworkStatusFields, NetworkStatusSchema>\n\nexport const isNetworkStatus = isPayloadOfSchemaType<NetworkStatus>(NetworkStatusSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainIdentificationPayloadSchema = 'network.xyo.chain.identification' as const\nexport type ChainIdentificationPayloadSchema = typeof ChainIdentificationPayloadSchema\n\n/**\n * Identification required to uniquely identify a chain\n */\nexport interface ChainIdentification {\n /** @field the id of the chain */\n id: Address\n}\n\nexport type ChainIdentificationPayload = Payload<ChainIdentification, ChainIdentificationPayloadSchema>\nexport const isChainIdentificationPayload = isPayloadOfSchemaType<ChainIdentificationPayload>(ChainIdentificationPayloadSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const ChainInformationPayloadSchema = 'network.xyo.chain.information' as const\nexport type ChainInformationPayloadSchema = typeof ChainInformationPayloadSchema\n\nimport type { ChainIdentification } from './ChainIdentification.ts'\n\n/**\n * Information required to produce a chain\n */\nexport interface ChainInformation extends ChainIdentification {\n // TODO: Add these fields which are currently promises on the smart contract\n // forkedAtBlockNumber: bigint\n // forkedAtHash: Hash\n // forkedChainId: Address\n}\n\nexport type ChainInformationPayload = Payload<ChainIdentification, ChainInformationPayloadSchema>\nexport const isChainInformationPayload = isPayloadOfSchemaType<ChainInformationPayload>(ChainInformationPayloadSchema)\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithStorageMeta } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'\n\nexport interface ChainIndexingServiceStateFields<T extends JsonValue = JsonValue> {\n /**\n * The hash of the last block that this service has indexing\n */\n endBlockHash: Hash\n /**\n * The hash of the block that the service started indexing. If undefined, the service is\n * assumed to have started indexing from the genesis block\n */\n startBlockHash?: Hash\n /**\n * The indexed state for the range\n */\n state: T\n}\nexport const ChainIndexingServiceStateSchema = 'network.xyo.chain.indexing.service.state' as const\nexport type ChainIndexingServiceStateSchema = typeof ChainIndexingServiceStateSchema\n\n/**\n * The result of a ChainIndexingServiceState\n */\nexport type ChainIndexingServiceState<T extends JsonValue = JsonValue> = Payload<ChainIndexingServiceStateFields<T>, ChainIndexingServiceStateSchema>\n\n/**\n * Identity functions for determining if an object is an ChainIndexingServiceState\n */\nexport const isChainIndexingServiceState = <T extends JsonValue = JsonValue>(payload?: unknown): payload is ChainIndexingServiceState<T> => {\n return isPayloadOfSchemaType<ChainIndexingServiceState<T>>(ChainIndexingServiceStateSchema)(payload)\n}\nexport const asChainIndexingServiceState = AsObjectFactory.create<ChainIndexingServiceState<JsonValue>>(isChainIndexingServiceState)\n\nexport const isChainIndexingServiceStateWithStorageMeta\n= <T extends JsonValue = JsonValue>(value: unknown): value is WithStorageMeta<ChainIndexingServiceState<T>> =>\n isChainIndexingServiceState<T>(value) && isStorageMeta(value)\n\nexport const asChainIndexingServiceStateWithStorageMeta\n= AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)\n"],"mappings":";AAAA,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,gBAAgB;AAE5C,SAAS,iBAAiB,oBAAoB;;;ACJ9C,SAAS,uBAAuB;AAGhC,SAAS,6BAA6B;AAE/B,IAAM,2BAA2B;AASjC,IAAM,uBAAuB,sBAA0C,wBAAwB;AAE/F,IAAM,uBAAuB,gBAAgB,OAAO,oBAAoB;AACxE,IAAM,+BAA+B,gBAAgB,eAAe,oBAAoB;;;ACjB/F,SAAS,mBAAAA,wBAAuB;AAEhC,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,yBAAyB;AAc/B,IAAM,qBAAqB,CAAC,MAA8C;AAC/E,SAAOA,uBAAwC,sBAAsB,EAAE,CAAC,KACnE,qBAAqB,EAAE,GAAG,MAAM,UAChC,qBAAqB,EAAE,GAAG,MAAM;AACvC;AACO,IAAM,qBAAqBD,iBAAgB,OAAO,kBAAkB;AACpE,IAAM,6BAA6BA,iBAAgB,eAAe,kBAAkB;AAE3F,IAAM,uBAAuB,CAAC,QAAgB;AAC5C,SAAQ,OAAO,UAAU,GAAG,KAAK,OAAO,IAAK,MAAM;AACrD;;;AC7BA,SAAS,oBAAoB;AAOtB,IAAM,UAAU,CAAC,UAAwC;AAC9D,SAAQ,MAAqB,SAAS;AACxC;AASO,IAAM,eAAe,CAAwB,UAAiD;AACnG,SAAO,aAAa,KAAK,KAAK,MAAM,QAAS,MAAsC,MAAM;AAC3F;AAEO,IAAM,eAAe,CAAwB,UAAoD;AACtG,SAAO,aAAa,KAAK,IACrB,QACA;AACN;;;AC3BA,SAAS,mBAAAE,wBAAuB;AAEhC,SAAS,yBAAAC,8BAA6B;AAE/B,IAAM,aAAa;AASnB,IAAM,gBAAgBA,uBAAmC,UAAU;AAEnE,IAAM,gBAAgBD,iBAAgB,OA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AAM,8BAA8B,CAAkC,YAA+D;AAC1I,SAAOD,wBAAoD,+BAA+B,EAAE,OAAO;AACrG;AACO,IAAM,8BAA8BD,iBAAgB,OAA6C,2BAA2B;AAE5H,IAAM,6CACX,CAAkC,UAClC,4BAA+B,KAAK,KAAKE,eAAc,KAAK;AAEvD,IAAM,6CACXF,iBAAgB,OAAmD,0CAA0C;","names":["AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","AsObjectFactory","AsObjectFactory","isBoundWitness","isStorageMeta","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isStorageMeta"]}
@@ -1,5 +1,7 @@
1
- export declare const StepSizes: readonly [10, 105, 1103, 11576, 121551, 1276282, 13400956];
1
+ export declare const StepSizes: readonly [10, 105, 1103, 11576, 121551, 1276282, 13400956, 223092871, 6469693231];
2
+ export declare const StepSizesV2: readonly [7, 31, 211, 2311, 30031, 510511, 9699691, 223092871, 6469693231];
2
3
  export declare function isValidStep(step: unknown): step is number;
3
4
  export declare const asValidStep: import("@xylabs/object").AsTypeFunction<number>;
4
5
  export declare function stepSize(step: number): number;
6
+ export declare function stepSizeV2(step: number): number;
5
7
  //# sourceMappingURL=StepSizes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepSizes.d.ts","sourceRoot":"","sources":["../../../src/constants/StepSizes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,4DAAmE,CAAA;AAEzF,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAKzD;AAED,eAAO,MAAM,WAAW,iDAA4C,CAAA;AAEpE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C"}
1
+ {"version":3,"file":"StepSizes.d.ts","sourceRoot":"","sources":["../../../src/constants/StepSizes.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,mFAA+F,CAAA;AACrH,eAAO,MAAM,WAAW,4EAAsF,CAAA;AAE9G,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAKzD;AAED,eAAO,MAAM,WAAW,iDAA4C,CAAA;AAEpE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C"}
@@ -1,5 +1,6 @@
1
1
  import type { Address, Hash, Hex } from '@xylabs/hex';
2
- export interface AccountBalanceService {
2
+ import type { Service } from './Service.ts';
3
+ export interface AccountBalanceService extends Service {
3
4
  getBalanceValue?: (address: Address) => bigint;
4
5
  getBalanceValues?: Record<Address, bigint>;
5
6
  getBalance(address: Address): Hex;
@@ -1 +1 @@
1
- {"version":3,"file":"AccountBalanceService.d.ts","sourceRoot":"","sources":["../../../src/services/AccountBalanceService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,IAAI,EAAE,GAAG,EACnB,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAE1C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAAA;IACjC,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC"}
1
+ {"version":3,"file":"AccountBalanceService.d.ts","sourceRoot":"","sources":["../../../src/services/AccountBalanceService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,IAAI,EAAE,GAAG,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,WAAW,qBAAsB,SAAQ,OAAO;IACpD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAE1C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAAA;IACjC,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACnC,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC"}
@@ -1,7 +1,8 @@
1
1
  import type { BlockBoundWitness, HydratedBlock } from '../block/index.ts';
2
2
  import type { Addressable } from '../fields/index.ts';
3
3
  import type { IterableRepository } from '../repository/index.ts';
4
+ import type { Service } from './Service.ts';
4
5
  export type NextBlockProducer = IterableRepository<BlockBoundWitness, HydratedBlock>;
5
- export interface BlockProducer extends Addressable, NextBlockProducer {
6
+ export interface BlockProducerService extends Addressable, NextBlockProducer, Service {
6
7
  }
7
- //# sourceMappingURL=BlockProducer.d.ts.map
8
+ //# sourceMappingURL=BlockProducerService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockProducerService.d.ts","sourceRoot":"","sources":["../../../src/services/BlockProducerService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;AAEpF,MAAM,WAAW,oBAAqB,SAAQ,WAAW,EAAE,iBAAiB,EAAE,OAAO;CAAG"}
@@ -3,4 +3,4 @@ import type { Service } from './Service.ts';
3
3
  export interface BlockRewardService extends Service {
4
4
  getRewardForBlock(block: bigint): Promisable<bigint>;
5
5
  }
6
- //# sourceMappingURL=BlockReward.d.ts.map
6
+ //# sourceMappingURL=BlockRewardService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockRewardService.d.ts","sourceRoot":"","sources":["../../../src/services/BlockRewardService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CACrD"}
@@ -2,11 +2,11 @@ import type { ArchivistInstance, WriteArchivist } from '@xyo-network/archivist-m
2
2
  import type { WalletInstance } from '@xyo-network/wallet-model';
3
3
  import type { EventingChainBlockNumberIterator } from '../iterator/index.ts';
4
4
  import type { AccountBalanceService } from './AccountBalanceService.ts';
5
- import type { BlockProducer } from './BlockProducer.ts';
6
- import type { BlockRewardService } from './BlockReward.ts';
5
+ import type { BlockProducerService } from './BlockProducerService.ts';
6
+ import type { BlockRewardService } from './BlockRewardService.ts';
7
7
  import type { ChainContractViewer, ChainInformation, ChainStaker, ChainStakeViewer } from './Chain/index.ts';
8
8
  import type { ElectionService } from './Election.ts';
9
- import type { StakeIntentService } from './stakeIntent/index.ts';
9
+ import type { StakeIntentService } from './StakeIntentService/index.ts';
10
10
  export interface ChainServiceCollection {
11
11
  account: WalletInstance;
12
12
  /**
@@ -30,7 +30,7 @@ export interface ChainServiceCollection {
30
30
  chainStaker: ChainStaker;
31
31
  chainSubmissionsArchivistWrite: WriteArchivist;
32
32
  electionService: ElectionService;
33
- producer: BlockProducer;
33
+ producer: BlockProducerService;
34
34
  rewardService: BlockRewardService;
35
35
  /**
36
36
  * Services for working with staked intents
@@ -1 +1 @@
1
- {"version":3,"file":"ChainServiceCollection.d.ts","sourceRoot":"","sources":["../../../src/services/ChainServiceCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,KAAK,EACV,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EACrE,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,WAAW,sBAAsB;IAErC,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,cAAc,EAAE,qBAAqB,CAAA;IACrC;;OAEG;IACH,cAAc,EAAE,iBAAiB,CAAA;IACjC,mBAAmB,EAAE,mBAAmB,CAAA;IACxC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC;;OAEG;IACH,aAAa,CAAC,EAAE,gCAAgC,CAAA;IAChD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,WAAW,EAAE,WAAW,CAAA;IACxB,8BAA8B,EAAE,cAAc,CAAA;IAC9C,eAAe,EAAE,eAAe,CAAA;IAChC,QAAQ,EAAE,aAAa,CAAA;IACvB,aAAa,EAAE,kBAAkB,CAAA;IACjC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAA;CACvC"}
1
+ {"version":3,"file":"ChainServiceCollection.d.ts","sourceRoot":"","sources":["../../../src/services/ChainServiceCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EACV,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EACrE,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEvE,MAAM,WAAW,sBAAsB;IAErC,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,cAAc,EAAE,qBAAqB,CAAA;IACrC;;OAEG;IACH,cAAc,EAAE,iBAAiB,CAAA;IACjC,mBAAmB,EAAE,mBAAmB,CAAA;IACxC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC;;OAEG;IACH,aAAa,CAAC,EAAE,gCAAgC,CAAA;IAChD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,WAAW,EAAE,WAAW,CAAA;IACxB,8BAA8B,EAAE,cAAc,CAAA;IAC9C,eAAe,EAAE,eAAe,CAAA;IAChC,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,aAAa,EAAE,kBAAkB,CAAA;IACjC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAA;CACvC"}
@@ -1,9 +1,5 @@
1
- import type { Meter, Tracer } from '@opentelemetry/api';
2
- import type { Logger } from '@xylabs/logger';
3
1
  export type ServiceName = Exclude<string, 'reserved-service-name-value'>;
4
2
  export interface Service {
5
- logger?: Logger;
6
- meter?: Meter;
7
- tracer?: Tracer;
3
+ name: ServiceName;
8
4
  }
9
5
  //# sourceMappingURL=Service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/services/Service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5C,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAA;AAExE,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
1
+ {"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/services/Service.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAA;AAExE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,WAAW,CAAA;CAClB"}
@@ -29,5 +29,4 @@ export declare const isChainIndexingServiceState: <T extends JsonValue = JsonVal
29
29
  export declare const asChainIndexingServiceState: import("@xylabs/object").AsTypeFunction<ChainIndexingServiceState<JsonValue>>;
30
30
  export declare const isChainIndexingServiceStateWithStorageMeta: <T extends JsonValue = JsonValue>(value: unknown) => value is WithStorageMeta<ChainIndexingServiceState<T>>;
31
31
  export declare const asChainIndexingServiceStateWithStorageMeta: import("@xylabs/object").AsTypeFunction<WithStorageMeta<ChainIndexingServiceState<JsonValue>>>;
32
- export declare const asOptionalChainIndexingServiceStateWithStorageMeta: (value: import("@xylabs/promise").AnyNonPromise) => WithStorageMeta<ChainIndexingServiceState<JsonValue>> | undefined;
33
32
  //# sourceMappingURL=ChainIndexingServiceStateSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChainIndexingServiceStateSchema.d.ts","sourceRoot":"","sources":["../../../../src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG1E,MAAM,WAAW,+BAA+B,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC9E;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,CAAA;IACrB;;OAEG;IACH,KAAK,EAAE,CAAC,CAAA;CACT;AACD,eAAO,MAAM,+BAA+B,EAAG,0CAAmD,CAAA;AAClG,MAAM,MAAM,+BAA+B,GAAG,OAAO,+BAA+B,CAAA;AAEpF;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,+BAA+B,CAAC,CAAA;AAErJ;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,UAAU,OAAO,KAAG,OAAO,IAAI,yBAAyB,CAAC,CAAC,CAEtI,CAAA;AACD,eAAO,MAAM,2BAA2B,+EAA4F,CAAA;AAEpI,eAAO,MAAM,0CAA0C,GACpD,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,OAAO,OAAO,KAAG,KAAK,IAAI,eAAe,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAC3C,CAAA;AAE/D,eAAO,MAAM,0CAA0C,gGACyD,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import type { Address } from '@xylabs/hex';
2
2
  import type { Intent } from '../../payload/index.ts';
3
- export interface StakeIntentService {
3
+ import type { Service } from '../Service.ts';
4
+ export interface StakeIntentService extends Service {
4
5
  /**
5
6
  * Gets the declared ranges for an address based on historical on-chain data
6
7
  * @param address The address to get the declared ranges for
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StakeIntentService.d.ts","sourceRoot":"","sources":["../../../../src/services/StakeIntentService/StakeIntentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IAEjD;;;;OAIG;IACH,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE7G;;;;MAIE;IACF,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAEhF;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACpF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/StakeIntentService/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,yBAAyB,CAAA"}
@@ -1,11 +1,11 @@
1
1
  export * from './AccountBalanceService.ts';
2
- export * from './BlockProducer.ts';
3
- export * from './BlockReward.ts';
2
+ export * from './BlockProducerService.ts';
3
+ export * from './BlockRewardService.ts';
4
4
  export * from './Chain/index.ts';
5
5
  export * from './ChainServiceCollection.ts';
6
6
  export * from './Election.ts';
7
7
  export * from './Params.ts';
8
8
  export * from './PendingTransactionsService.ts';
9
9
  export * from './Service.ts';
10
- export * from './stakeIntent/index.ts';
10
+ export * from './StakeIntentService/index.ts';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,cAAc,CAAA;AAC5B,cAAc,+BAA+B,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/xl1-protocol",
4
- "version": "1.4.22",
4
+ "version": "1.4.24",
5
5
  "description": "XYO Layer One Protocol",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -41,7 +41,6 @@
41
41
  "@xylabs/base": "^4.11.19",
42
42
  "@xylabs/events": "^4.11.19",
43
43
  "@xylabs/hex": "^4.11.19",
44
- "@xylabs/logger": "^4.11.19",
45
44
  "@xylabs/object": "^4.11.19",
46
45
  "@xylabs/promise": "^4.11.19",
47
46
  "@xyo-network/account-model": "^3.18.8",
@@ -1,6 +1,10 @@
1
1
  import { AsTypeFactory } from '@xylabs/object'
2
2
 
3
- export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956] as const
3
+ // StepsV2 are primorial(n+2) + 1, where n is the index of the step size
4
+ // primorial(n+2) = 2 → 2×3=6 → 6×5=30 → 30×7=210 → 210×11=2310
5
+
6
+ export const StepSizes = [10, 105, 1103, 11_576, 121_551, 1_276_282, 13_400_956, 223_092_871, 6_469_693_231] as const
7
+ export const StepSizesV2 = [7, 31, 211, 2311, 30_031, 510_511, 9_699_691, 223_092_871, 6_469_693_231] as const
4
8
 
5
9
  export function isValidStep(step: unknown): step is number {
6
10
  if (typeof step === 'number' && Number.isInteger(step)) {
@@ -15,3 +19,8 @@ export function stepSize(step: number): number {
15
19
  const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizes.length - 1}`)
16
20
  return StepSizes[validatedStep]
17
21
  }
22
+
23
+ export function stepSizeV2(step: number): number {
24
+ const validatedStep = asValidStep(step, () => `Invalid step (${step}), must be an integer between 0 and ${StepSizesV2.length - 1}`)
25
+ return StepSizesV2[validatedStep]
26
+ }
@@ -2,7 +2,9 @@ import type {
2
2
  Address, Hash, Hex,
3
3
  } from '@xylabs/hex'
4
4
 
5
- export interface AccountBalanceService {
5
+ import type { Service } from './Service.ts'
6
+
7
+ export interface AccountBalanceService extends Service {
6
8
  getBalanceValue?: (address: Address) => bigint
7
9
  getBalanceValues?: Record<Address, bigint>
8
10
 
@@ -1,7 +1,8 @@
1
1
  import type { BlockBoundWitness, HydratedBlock } from '../block/index.ts'
2
2
  import type { Addressable } from '../fields/index.ts'
3
3
  import type { IterableRepository } from '../repository/index.ts'
4
+ import type { Service } from './Service.ts'
4
5
 
5
6
  export type NextBlockProducer = IterableRepository<BlockBoundWitness, HydratedBlock>
6
7
 
7
- export interface BlockProducer extends Addressable, NextBlockProducer {}
8
+ export interface BlockProducerService extends Addressable, NextBlockProducer, Service {}
@@ -3,13 +3,13 @@ import type { WalletInstance } from '@xyo-network/wallet-model'
3
3
 
4
4
  import type { EventingChainBlockNumberIterator } from '../iterator/index.ts'
5
5
  import type { AccountBalanceService } from './AccountBalanceService.ts'
6
- import type { BlockProducer } from './BlockProducer.ts'
7
- import type { BlockRewardService } from './BlockReward.ts'
6
+ import type { BlockProducerService } from './BlockProducerService.ts'
7
+ import type { BlockRewardService } from './BlockRewardService.ts'
8
8
  import type {
9
9
  ChainContractViewer, ChainInformation, ChainStaker, ChainStakeViewer,
10
10
  } from './Chain/index.ts'
11
11
  import type { ElectionService } from './Election.ts'
12
- import type { StakeIntentService } from './stakeIntent/index.ts'
12
+ import type { StakeIntentService } from './StakeIntentService/index.ts'
13
13
 
14
14
  export interface ChainServiceCollection {
15
15
 
@@ -35,7 +35,7 @@ export interface ChainServiceCollection {
35
35
  chainStaker: ChainStaker
36
36
  chainSubmissionsArchivistWrite: WriteArchivist
37
37
  electionService: ElectionService
38
- producer: BlockProducer
38
+ producer: BlockProducerService
39
39
  rewardService: BlockRewardService
40
40
  /**
41
41
  * Services for working with staked intents
@@ -1,10 +1,5 @@
1
- import type { Meter, Tracer } from '@opentelemetry/api'
2
- import type { Logger } from '@xylabs/logger'
3
-
4
1
  export type ServiceName = Exclude<string, 'reserved-service-name-value'>
5
2
 
6
3
  export interface Service {
7
- logger?: Logger
8
- meter?: Meter
9
- tracer?: Tracer
4
+ name: ServiceName
10
5
  }
@@ -41,6 +41,3 @@ export const isChainIndexingServiceStateWithStorageMeta
41
41
 
42
42
  export const asChainIndexingServiceStateWithStorageMeta
43
43
  = AsObjectFactory.create<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)
44
-
45
- export const asOptionalChainIndexingServiceStateWithStorageMeta
46
- = AsObjectFactory.createOptional<WithStorageMeta<ChainIndexingServiceState>>(isChainIndexingServiceStateWithStorageMeta)
@@ -1,8 +1,9 @@
1
1
  import type { Address } from '@xylabs/hex'
2
2
 
3
3
  import type { Intent } from '../../payload/index.ts'
4
+ import type { Service } from '../Service.ts'
4
5
 
5
- export interface StakeIntentService {
6
+ export interface StakeIntentService extends Service {
6
7
 
7
8
  /**
8
9
  * Gets the declared ranges for an address based on historical on-chain data
@@ -1,10 +1,10 @@
1
1
  export * from './AccountBalanceService.ts'
2
- export * from './BlockProducer.ts'
3
- export * from './BlockReward.ts'
2
+ export * from './BlockProducerService.ts'
3
+ export * from './BlockRewardService.ts'
4
4
  export * from './Chain/index.ts'
5
5
  export * from './ChainServiceCollection.ts'
6
6
  export * from './Election.ts'
7
7
  export * from './Params.ts'
8
8
  export * from './PendingTransactionsService.ts'
9
9
  export * from './Service.ts'
10
- export * from './stakeIntent/index.ts'
10
+ export * from './StakeIntentService/index.ts'
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockProducer.d.ts","sourceRoot":"","sources":["../../../src/services/BlockProducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;AAEpF,MAAM,WAAW,aAAc,SAAQ,WAAW,EAAE,iBAAiB;CAAG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockReward.d.ts","sourceRoot":"","sources":["../../../src/services/BlockReward.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CACrD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChainIndexingServiceStateSchema.d.ts","sourceRoot":"","sources":["../../../../src/services/stakeIntent/ChainIndexingServiceStateSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG1E,MAAM,WAAW,+BAA+B,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC9E;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,CAAA;IACrB;;OAEG;IACH,KAAK,EAAE,CAAC,CAAA;CACT;AACD,eAAO,MAAM,+BAA+B,EAAG,0CAAmD,CAAA;AAClG,MAAM,MAAM,+BAA+B,GAAG,OAAO,+BAA+B,CAAA;AAEpF;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,+BAA+B,CAAC,CAAA;AAErJ;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,UAAU,OAAO,KAAG,OAAO,IAAI,yBAAyB,CAAC,CAAC,CAEtI,CAAA;AACD,eAAO,MAAM,2BAA2B,+EAA4F,CAAA;AAEpI,eAAO,MAAM,0CAA0C,GACpD,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,OAAO,OAAO,KAAG,KAAK,IAAI,eAAe,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAC3C,CAAA;AAE/D,eAAO,MAAM,0CAA0C,gGACyD,CAAA;AAEhH,eAAO,MAAM,kDAAkD,uHACyD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StakeIntentService.d.ts","sourceRoot":"","sources":["../../../../src/services/stakeIntent/StakeIntentService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IAEjC;;;;OAIG;IACH,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE7G;;;;MAIE;IACF,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAEhF;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACpF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/stakeIntent/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,yBAAyB,CAAA"}