@xyo-network/xl1-protocol-sdk 1.6.6 → 1.7.0

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 (104) hide show
  1. package/dist/neutral/block/primitives/frames/spec/calculateFramesFromRange.spec.d.ts +2 -0
  2. package/dist/neutral/block/primitives/frames/spec/calculateFramesFromRange.spec.d.ts.map +1 -0
  3. package/dist/neutral/block/primitives/frames/spec/deepCalculateFramesFromRange.spec.d.ts +2 -0
  4. package/dist/neutral/block/primitives/frames/spec/deepCalculateFramesFromRange.spec.d.ts.map +1 -0
  5. package/dist/neutral/index.d.ts +339 -0
  6. package/dist/neutral/transaction/primitives/spec/transactionBlockByteCount.spec.d.ts +2 -0
  7. package/dist/neutral/transaction/primitives/spec/transactionBlockByteCount.spec.d.ts.map +1 -0
  8. package/package.json +19 -19
  9. package/dist/types/index.d.ts +0 -8
  10. /package/dist/{types → neutral}/ChainServiceCollection.d.ts +0 -0
  11. /package/dist/{types → neutral}/ChainServiceCollection.d.ts.map +0 -0
  12. /package/dist/{types → neutral}/ChainServiceCollectionV2.d.ts +0 -0
  13. /package/dist/{types → neutral}/ChainServiceCollectionV2.d.ts.map +0 -0
  14. /package/dist/{types → neutral}/SignedBigInt.d.ts +0 -0
  15. /package/dist/{types → neutral}/SignedBigInt.d.ts.map +0 -0
  16. /package/dist/{types → neutral}/block/hydrateBlock.d.ts +0 -0
  17. /package/dist/{types → neutral}/block/hydrateBlock.d.ts.map +0 -0
  18. /package/dist/{types → neutral}/block/index.d.ts +0 -0
  19. /package/dist/{types → neutral}/block/index.d.ts.map +0 -0
  20. /package/dist/{types → neutral}/block/primitives/balanceStepSummaryFromRange.d.ts +0 -0
  21. /package/dist/{types → neutral}/block/primitives/balanceStepSummaryFromRange.d.ts.map +0 -0
  22. /package/dist/{types → neutral}/block/primitives/balanceSummary.d.ts +0 -0
  23. /package/dist/{types → neutral}/block/primitives/balanceSummary.d.ts.map +0 -0
  24. /package/dist/{types → neutral}/block/primitives/frames/BlockNumberRange.d.ts +0 -0
  25. /package/dist/{types → neutral}/block/primitives/frames/BlockNumberRange.d.ts.map +0 -0
  26. /package/dist/{types → neutral}/block/primitives/frames/calculateFramesFromRange.d.ts +0 -0
  27. /package/dist/{types → neutral}/block/primitives/frames/calculateFramesFromRange.d.ts.map +0 -0
  28. /package/dist/{types → neutral}/block/primitives/frames/deepCalculateFramesFromRange.d.ts +0 -0
  29. /package/dist/{types → neutral}/block/primitives/frames/deepCalculateFramesFromRange.d.ts.map +0 -0
  30. /package/dist/{types → neutral}/block/primitives/frames/index.d.ts +0 -0
  31. /package/dist/{types → neutral}/block/primitives/frames/index.d.ts.map +0 -0
  32. /package/dist/{types → neutral}/block/primitives/hashFromBlockNumber.d.ts +0 -0
  33. /package/dist/{types → neutral}/block/primitives/hashFromBlockNumber.d.ts.map +0 -0
  34. /package/dist/{types → neutral}/block/primitives/index.d.ts +0 -0
  35. /package/dist/{types → neutral}/block/primitives/index.d.ts.map +0 -0
  36. /package/dist/{types → neutral}/block/primitives/model.d.ts +0 -0
  37. /package/dist/{types → neutral}/block/primitives/model.d.ts.map +0 -0
  38. /package/dist/{types → neutral}/block/primitives/payloads.d.ts +0 -0
  39. /package/dist/{types → neutral}/block/primitives/payloads.d.ts.map +0 -0
  40. /package/dist/{types → neutral}/index.d.ts.map +0 -0
  41. /package/dist/{types → neutral}/instances/Address.d.ts +0 -0
  42. /package/dist/{types → neutral}/instances/Address.d.ts.map +0 -0
  43. /package/dist/{types → neutral}/instances/BoundWitness.d.ts +0 -0
  44. /package/dist/{types → neutral}/instances/BoundWitness.d.ts.map +0 -0
  45. /package/dist/{types → neutral}/instances/Data.d.ts +0 -0
  46. /package/dist/{types → neutral}/instances/Data.d.ts.map +0 -0
  47. /package/dist/{types → neutral}/instances/Fees.d.ts +0 -0
  48. /package/dist/{types → neutral}/instances/Fees.d.ts.map +0 -0
  49. /package/dist/{types → neutral}/instances/HydratedBoundWitness.d.ts +0 -0
  50. /package/dist/{types → neutral}/instances/HydratedBoundWitness.d.ts.map +0 -0
  51. /package/dist/{types → neutral}/instances/Object.d.ts +0 -0
  52. /package/dist/{types → neutral}/instances/Object.d.ts.map +0 -0
  53. /package/dist/{types → neutral}/instances/Payload.d.ts +0 -0
  54. /package/dist/{types → neutral}/instances/Payload.d.ts.map +0 -0
  55. /package/dist/{types → neutral}/instances/ShiftedBigIntConfig.d.ts +0 -0
  56. /package/dist/{types → neutral}/instances/ShiftedBigIntConfig.d.ts.map +0 -0
  57. /package/dist/{types → neutral}/instances/Signature.d.ts +0 -0
  58. /package/dist/{types → neutral}/instances/Signature.d.ts.map +0 -0
  59. /package/dist/{types → neutral}/instances/XL1Amount.d.ts +0 -0
  60. /package/dist/{types → neutral}/instances/XL1Amount.d.ts.map +0 -0
  61. /package/dist/{types → neutral}/instances/block/BlockFields.d.ts +0 -0
  62. /package/dist/{types → neutral}/instances/block/BlockFields.d.ts.map +0 -0
  63. /package/dist/{types → neutral}/instances/block/HydratedBlock.d.ts +0 -0
  64. /package/dist/{types → neutral}/instances/block/HydratedBlock.d.ts.map +0 -0
  65. /package/dist/{types → neutral}/instances/block/index.d.ts +0 -0
  66. /package/dist/{types → neutral}/instances/block/index.d.ts.map +0 -0
  67. /package/dist/{types → neutral}/instances/index.d.ts +0 -0
  68. /package/dist/{types → neutral}/instances/index.d.ts.map +0 -0
  69. /package/dist/{types → neutral}/instances/modifiers/BlockWindowInstance.d.ts +0 -0
  70. /package/dist/{types → neutral}/instances/modifiers/BlockWindowInstance.d.ts.map +0 -0
  71. /package/dist/{types → neutral}/instances/modifiers/BlockWindowState.d.ts +0 -0
  72. /package/dist/{types → neutral}/instances/modifiers/BlockWindowState.d.ts.map +0 -0
  73. /package/dist/{types → neutral}/instances/modifiers/Signed.d.ts +0 -0
  74. /package/dist/{types → neutral}/instances/modifiers/Signed.d.ts.map +0 -0
  75. /package/dist/{types → neutral}/instances/modifiers/Validatable.d.ts +0 -0
  76. /package/dist/{types → neutral}/instances/modifiers/Validatable.d.ts.map +0 -0
  77. /package/dist/{types → neutral}/instances/modifiers/index.d.ts +0 -0
  78. /package/dist/{types → neutral}/instances/modifiers/index.d.ts.map +0 -0
  79. /package/dist/{types → neutral}/instances/transaction/HydratedTransaction.d.ts +0 -0
  80. /package/dist/{types → neutral}/instances/transaction/HydratedTransaction.d.ts.map +0 -0
  81. /package/dist/{types → neutral}/instances/transaction/TransactionFields.d.ts +0 -0
  82. /package/dist/{types → neutral}/instances/transaction/TransactionFields.d.ts.map +0 -0
  83. /package/dist/{types → neutral}/instances/transaction/index.d.ts +0 -0
  84. /package/dist/{types → neutral}/instances/transaction/index.d.ts.map +0 -0
  85. /package/dist/{types → neutral}/payload/index.d.ts +0 -0
  86. /package/dist/{types → neutral}/payload/index.d.ts.map +0 -0
  87. /package/dist/{types → neutral}/payload/netBalancesForPayloads.d.ts +0 -0
  88. /package/dist/{types → neutral}/payload/netBalancesForPayloads.d.ts.map +0 -0
  89. /package/dist/{types → neutral}/transaction/buildTransaction.d.ts +0 -0
  90. /package/dist/{types → neutral}/transaction/buildTransaction.d.ts.map +0 -0
  91. /package/dist/{types → neutral}/transaction/hydrateTransaction.d.ts +0 -0
  92. /package/dist/{types → neutral}/transaction/hydrateTransaction.d.ts.map +0 -0
  93. /package/dist/{types → neutral}/transaction/index.d.ts +0 -0
  94. /package/dist/{types → neutral}/transaction/index.d.ts.map +0 -0
  95. /package/dist/{types → neutral}/transaction/primitives/index.d.ts +0 -0
  96. /package/dist/{types → neutral}/transaction/primitives/index.d.ts.map +0 -0
  97. /package/dist/{types → neutral}/transaction/primitives/transactionBlockByteCount.d.ts +0 -0
  98. /package/dist/{types → neutral}/transaction/primitives/transactionBlockByteCount.d.ts.map +0 -0
  99. /package/dist/{types → neutral}/transaction/primitives/transactionElevatedPayloads.d.ts +0 -0
  100. /package/dist/{types → neutral}/transaction/primitives/transactionElevatedPayloads.d.ts.map +0 -0
  101. /package/dist/{types → neutral}/transaction/primitives/transactionOperations.d.ts +0 -0
  102. /package/dist/{types → neutral}/transaction/primitives/transactionOperations.d.ts.map +0 -0
  103. /package/dist/{types → neutral}/transaction/primitives/transactionRequiredGas.d.ts +0 -0
  104. /package/dist/{types → neutral}/transaction/primitives/transactionRequiredGas.d.ts.map +0 -0
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=calculateFramesFromRange.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateFramesFromRange.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/block/primitives/frames/spec/calculateFramesFromRange.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=deepCalculateFramesFromRange.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepCalculateFramesFromRange.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/block/primitives/frames/spec/deepCalculateFramesFromRange.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,339 @@
1
+ import { Hash, Hex, Address } from '@xylabs/hex';
2
+ import { ReadArchivist, ArchivistInstance, WriteArchivist, HydratedBoundWitness } from '@xyo-network/archivist-model';
3
+ import { WithStorageMeta, Payload, Schema, WithHashStorageMeta } from '@xyo-network/payload-model';
4
+ import { HydratedBlock, TransactionBoundWitness, PayloadRepository, AccountBalanceService, ChainContractViewer, EventingChainBlockNumberIterator, ChainStakeViewer, ChainStaker, ElectionService, BlockProducerService, BlockRewardService, StakeIntentService, AccountBalanceServiceV2, PendingTransactionsService, AttoXL1, MilliXL1, MicroXL1, NanoXL1, PicoXL1, FemtoXL1, AllowedBlockPayload, HydratedTransaction, TransactionFeesBigInt } from '@xyo-network/xl1-protocol';
5
+ import * as _xylabs_object_model from '@xylabs/object-model';
6
+ import { EmptyObject } from '@xylabs/object';
7
+ import { WalletInstance } from '@xyo-network/wallet-model';
8
+ import { Promisable } from '@xylabs/promise';
9
+ import { BoundWitness } from '@xyo-network/boundwitness-model';
10
+ import { AccountInstance } from '@xyo-network/account-model';
11
+
12
+ declare function allHashesPresent(hashes: Hash[], payloads: WithStorageMeta<Payload>[]): boolean;
13
+ declare const tryHydrateBlock: (archivist: ReadArchivist, hash: Hash, maxDepth?: number) => Promise<HydratedBlock | undefined>;
14
+ declare const hydrateBlock: (archivist: ReadArchivist, hash: Hash, maxDepth?: number, minDepth?: number) => Promise<HydratedBlock>;
15
+ declare const flattenHydratedBlock: (hydratedBlock: HydratedBlock) => WithStorageMeta<Payload>[];
16
+ declare const flattenHydratedBlocks: (hydratedBlocks: HydratedBlock[]) => WithStorageMeta<Payload>[];
17
+ declare const transactionsFromHydratedBlock: (block: HydratedBlock) => WithStorageMeta<TransactionBoundWitness>[];
18
+ declare const blockPayloadsFromHydratedBlock: (block: HydratedBlock) => WithStorageMeta<Payload>[];
19
+
20
+ type BlockNumberRange = [number, number];
21
+
22
+ interface NegativeBigInt {
23
+ negative: Hex;
24
+ }
25
+ interface PositiveBigInt {
26
+ positive: Hex;
27
+ }
28
+ type SignedBigInt = NegativeBigInt | PositiveBigInt;
29
+ declare const isNegativeBigInt: (value: unknown) => value is NegativeBigInt;
30
+ declare const isPositiveBigInt: (value: unknown) => value is PositiveBigInt;
31
+ declare const parseSignedBigInt: (value: SignedBigInt) => bigint;
32
+ declare const toSignedBigInt: (value: bigint) => SignedBigInt;
33
+ declare const toPositiveBigInt: (value: unknown) => PositiveBigInt;
34
+
35
+ declare const StepSummarySchema: Schema;
36
+ type StepSummarySchema = typeof StepSummarySchema;
37
+ interface StepSummaryFields {
38
+ hash: Hash;
39
+ stepSize: number;
40
+ }
41
+ interface ChainWindow {
42
+ depth: number;
43
+ head: Hash;
44
+ }
45
+ type StepSummary<TAdditionalFields extends EmptyObject | void = void, TSchema extends Schema | void = void> = Payload<TAdditionalFields extends void ? StepSummaryFields : TAdditionalFields & StepSummaryFields, TSchema extends void ? StepSummarySchema : TSchema>;
46
+ declare const BalancesStepSummarySchema: Schema;
47
+ type BalancesStepSummarySchema = typeof BalancesStepSummarySchema;
48
+ type BalancesStepSummary = StepSummary<{
49
+ balances: Record<Address, SignedBigInt>;
50
+ }, BalancesStepSummarySchema>;
51
+ /**
52
+ * Identity function for determining if an object is an BalancesStepSummary
53
+ */
54
+ declare const isBalancesStepSummary: (x?: unknown | null) => x is BalancesStepSummary;
55
+ declare const asBalancesStepSummary: _xylabs_object_model.AsTypeFunction<BalancesStepSummary>;
56
+ /**
57
+ * Identity function for determining if an object is an BalancesStepSummary with Storage Meta
58
+ */
59
+ declare const isBalancesStepSummaryWithStorageMeta: (value: unknown) => value is WithStorageMeta<BalancesStepSummary>;
60
+ declare const asBalancesStepSummaryWithStorageMeta: _xylabs_object_model.AsTypeFunction<WithStorageMeta<BalancesStepSummary>>;
61
+
62
+ interface ChainContext {
63
+ chainArchivist: ReadArchivist;
64
+ head: Hash;
65
+ windowSize?: number;
66
+ }
67
+ interface ChainSummaryContext<T extends Payload> extends ChainContext {
68
+ summaryRepository: PayloadRepository<Hash, T>;
69
+ }
70
+ interface BalanceStepSummaryContext extends ChainSummaryContext<BalancesStepSummary> {
71
+ }
72
+
73
+ declare function balanceStepSummaryFromRange(context: BalanceStepSummaryContext, range: BlockNumberRange): Promise<WithStorageMeta<BalancesStepSummary>>;
74
+
75
+ declare function balanceSummary(context: BalanceStepSummaryContext): Promise<Partial<Record<Address, bigint>>>;
76
+
77
+ declare function calculateFramesFromRange(range: BlockNumberRange, step: number): [
78
+ BlockNumberRange[],
79
+ BlockNumberRange[]
80
+ ];
81
+
82
+ declare function deepCalculateFramesFromRange(range: BlockNumberRange, startingStep?: number): BlockNumberRange[];
83
+
84
+ declare function hashFromBlockNumber(context: ChainContext, blockNumber: number): Promise<Hash>;
85
+
86
+ interface ChainServiceCollection {
87
+ /**
88
+ * The account which is used to sign transactions
89
+ */
90
+ account: WalletInstance;
91
+ /**
92
+ * Services for working with account balances
93
+ */
94
+ balanceService: AccountBalanceService;
95
+ /**
96
+ * The archivist which the chain data is stored in
97
+ */
98
+ chainArchivist: ArchivistInstance;
99
+ /**
100
+ * Service for viewing codified chain information
101
+ * from a contract
102
+ */
103
+ chainContractViewer: ChainContractViewer;
104
+ /**
105
+ * The chain iterator
106
+ */
107
+ chainIterator?: EventingChainBlockNumberIterator;
108
+ /**
109
+ * Service for viewing stake information
110
+ */
111
+ chainStakeViewer: ChainStakeViewer;
112
+ /**
113
+ * Service for staking
114
+ */
115
+ chainStaker: ChainStaker;
116
+ /**
117
+ * The archivist which the chain submissions are stored in
118
+ */
119
+ chainSubmissionsArchivistWrite: WriteArchivist;
120
+ /**
121
+ * Service for determining leader election
122
+ */
123
+ electionService: ElectionService;
124
+ /**
125
+ * The archivist which the pending transactions are stored
126
+ * as bundled transactions
127
+ */
128
+ pendingBundledTransactionsArchivistWrite: ArchivistInstance;
129
+ /**
130
+ * The block producer service
131
+ */
132
+ producer: BlockProducerService;
133
+ /**
134
+ * Service response for calculating block rewards
135
+ */
136
+ rewardService: BlockRewardService;
137
+ /**
138
+ * Services for working with staked intents
139
+ */
140
+ stakeIntentService: StakeIntentService;
141
+ }
142
+
143
+ interface ChainServiceCollectionV2 {
144
+ /**
145
+ * The account which is used to sign transactions
146
+ */
147
+ account: WalletInstance;
148
+ /**
149
+ * Services for working with account balances
150
+ */
151
+ balanceService: AccountBalanceServiceV2;
152
+ /**
153
+ * The archivist which the chain data is stored in
154
+ */
155
+ chainArchivist: ArchivistInstance;
156
+ /**
157
+ * Service for viewing codified chain information
158
+ * from a contract
159
+ */
160
+ chainContractViewer: ChainContractViewer;
161
+ /**
162
+ * The chain iterator
163
+ */
164
+ chainIterator?: EventingChainBlockNumberIterator;
165
+ /**
166
+ * Service for viewing stake information
167
+ */
168
+ chainStakeViewer: ChainStakeViewer;
169
+ /**
170
+ * Service for staking
171
+ */
172
+ chainStaker: ChainStaker;
173
+ /**
174
+ * The archivist which the chain submissions are stored in
175
+ */
176
+ chainSubmissionsArchivistWrite: WriteArchivist;
177
+ /**
178
+ * Service for determining leader election
179
+ */
180
+ electionService: ElectionService;
181
+ /**
182
+ * The archivist which the pending transactions are stored
183
+ * as bundled transactions
184
+ */
185
+ pendingBundledTransactionsArchivistWrite: ArchivistInstance;
186
+ /**
187
+ * Service for managing pending transactions
188
+ */
189
+ pendingTransactionsService: PendingTransactionsService;
190
+ /**
191
+ * The block producer service
192
+ */
193
+ producer: BlockProducerService;
194
+ /**
195
+ * Service response for calculating block rewards
196
+ */
197
+ rewardService: BlockRewardService;
198
+ /**
199
+ * Services for working with staked intents
200
+ */
201
+ stakeIntentService: StakeIntentService;
202
+ }
203
+
204
+ interface BlockWindowInstance {
205
+ count: number;
206
+ numberRange: [number, number];
207
+ range: [Hash, Hash];
208
+ }
209
+
210
+ interface BlockWindowStateInstance {
211
+ blockWindow: BlockWindowInstance;
212
+ }
213
+
214
+ interface ValidatableInstance {
215
+ validate(): Promisable<Error[]>;
216
+ }
217
+
218
+ interface ShiftedBigIntConfig {
219
+ locale: Intl.LocalesArgument;
220
+ maxCharacters: number;
221
+ maxDecimal: number;
222
+ minDecimals: number;
223
+ places: number;
224
+ }
225
+
226
+ interface XL1AmountInstance {
227
+ value: AttoXL1;
228
+ to(places: bigint | number): bigint;
229
+ milli: MilliXL1;
230
+ micro: MicroXL1;
231
+ nano: NanoXL1;
232
+ pico: PicoXL1;
233
+ femto: FemtoXL1;
234
+ atto: AttoXL1;
235
+ toString(places: number, config: Partial<ShiftedBigIntConfig>): string;
236
+ }
237
+
238
+ interface AddressInstance extends ValidatableInstance {
239
+ address: Address;
240
+ }
241
+ interface AddressStateInstance extends AddressInstance, BlockWindowStateInstance {
242
+ balance(): Promisable<[XL1AmountInstance, BlockWindowInstance]>;
243
+ }
244
+
245
+ interface DataInstance<T> {
246
+ data: T;
247
+ }
248
+
249
+ interface HydratedBoundWitnessInstance<T extends HydratedBoundWitness = HydratedBoundWitness> extends ValidatableInstance, DataInstance<T> {
250
+ boundWitness: T[0];
251
+ payloadCount: number;
252
+ payloads: T[1][number][];
253
+ payload(index: number): T[1][number] | undefined;
254
+ }
255
+
256
+ interface SignatureInstance extends ValidatableInstance {
257
+ address: Address;
258
+ hash: Hash;
259
+ signature: Hex;
260
+ }
261
+
262
+ interface SignedInstance {
263
+ signatureCount: number;
264
+ signatures: SignatureInstance[];
265
+ signature(index: number): SignatureInstance | undefined;
266
+ }
267
+
268
+ interface TransactionFeesInstance extends ValidatableInstance {
269
+ base: bigint;
270
+ gasLimit: bigint;
271
+ gasPrice: bigint;
272
+ priority: bigint;
273
+ }
274
+
275
+ interface TransactionFieldsInstance<TBlockPayload extends AllowedBlockPayload = AllowedBlockPayload> {
276
+ elevatedPayloadCount: number;
277
+ elevatedPayloads: WithStorageMeta<TBlockPayload>[];
278
+ externalPayloads: Record<Hash, Schema | Payload>;
279
+ fees: TransactionFeesInstance;
280
+ privateExternalPayloads: Record<Hash, Schema>;
281
+ publicExternalPayloads: Payload[];
282
+ elevatedPayload(index: number): TBlockPayload | undefined;
283
+ reward(): bigint;
284
+ }
285
+
286
+ interface HydratedTransactionInstance<T extends HydratedTransaction = HydratedTransaction, TElevatedPayload extends AllowedBlockPayload = AllowedBlockPayload> extends TransactionFieldsInstance<T[1][number] & TElevatedPayload>, HydratedBoundWitnessInstance<T>, SignedInstance {
287
+ }
288
+
289
+ interface BlockFieldsInstance<TTransactionResult> {
290
+ reward: bigint;
291
+ signatureCount: number;
292
+ signatures: SignatureInstance[];
293
+ transactionCount: number;
294
+ transactions: TTransactionResult[];
295
+ signature(index: number): SignatureInstance | undefined;
296
+ transaction(index: number): TTransactionResult | undefined;
297
+ }
298
+
299
+ interface HydratedBlockInstance<T extends HydratedBlock = HydratedBlock> extends BlockFieldsInstance<HydratedTransactionInstance>, HydratedBoundWitnessInstance<T>, SignedInstance {
300
+ }
301
+
302
+ interface ObjectInstance<T extends EmptyObject = EmptyObject> extends DataInstance<T> {
303
+ }
304
+
305
+ interface PayloadInstance<TPayload extends Payload = Payload> extends ObjectInstance<TPayload>, ValidatableInstance {
306
+ }
307
+
308
+ interface BoundWitnessInstance<TBoundWitness extends BoundWitness = BoundWitness, TPayload extends Payload = Payload> extends PayloadInstance<TBoundWitness> {
309
+ payloadCount: number;
310
+ payloads: PayloadInstance<TPayload>[];
311
+ payload(index: number): PayloadInstance<TPayload> | undefined;
312
+ }
313
+
314
+ declare const netBalancesForPayloads: (payloads: Payload[]) => Record<Lowercase<string>, bigint>;
315
+
316
+ declare function buildTransaction(chain: Address, elevatedPayloads: AllowedBlockPayload[], additionalPayloads: Payload[], signer: AccountInstance | AccountInstance[], nbf: number, exp: number, from?: Address, fees?: TransactionFeesBigInt): Promise<HydratedTransaction>;
317
+
318
+ declare const tryHydrateTransaction: (archivist: ReadArchivist, hash: Hash) => Promise<HydratedTransaction | undefined>;
319
+ declare const hydrateTransaction: (archivist: ReadArchivist, hash: Hash) => Promise<HydratedTransaction>;
320
+ declare const flattenHydratedTransaction: (hydratedTransaction: HydratedTransaction) => Payload[];
321
+ declare const flattenHydratedTransactions: (hydratedTransactions: HydratedTransaction[]) => Payload[];
322
+ declare const tryHydrateElevatedTransaction: (archivist: ReadArchivist, hash: Hash) => Promise<HydratedTransaction | undefined>;
323
+ declare const hydrateElevatedTransaction: (archivist: ReadArchivist, hash: Hash) => Promise<HydratedTransaction>;
324
+
325
+ /** The number of bytes that a transaction and its payloads will take up in a block */
326
+ declare function transactionBlockByteCount([transaction, payloads]: HydratedTransaction): number;
327
+
328
+ declare function transactionElevatedPayloadHashes(transaction: TransactionBoundWitness): Hash[];
329
+ declare function transactionElevatedPayloads([transaction, payloads]: HydratedTransaction): WithHashStorageMeta<Payload>[];
330
+
331
+ declare function crackOperation(operation: string): [string, string[]];
332
+ declare function crackOperations(operations: string[]): [string, string[]][];
333
+
334
+ /** The required gas for the byte storage on the block chain for a transaction */
335
+ declare function transactionBytesRequiredGas([transaction, payloads]: HydratedTransaction): AttoXL1;
336
+ declare function transactionRequiredGas(hydratedTransaction: HydratedTransaction): AttoXL1;
337
+
338
+ export { BalancesStepSummarySchema, StepSummarySchema, allHashesPresent, asBalancesStepSummary, asBalancesStepSummaryWithStorageMeta, balanceStepSummaryFromRange, balanceSummary, blockPayloadsFromHydratedBlock, buildTransaction, calculateFramesFromRange, crackOperation, crackOperations, deepCalculateFramesFromRange, flattenHydratedBlock, flattenHydratedBlocks, flattenHydratedTransaction, flattenHydratedTransactions, hashFromBlockNumber, hydrateBlock, hydrateElevatedTransaction, hydrateTransaction, isBalancesStepSummary, isBalancesStepSummaryWithStorageMeta, isNegativeBigInt, isPositiveBigInt, netBalancesForPayloads, parseSignedBigInt, toPositiveBigInt, toSignedBigInt, transactionBlockByteCount, transactionBytesRequiredGas, transactionElevatedPayloadHashes, transactionElevatedPayloads, transactionRequiredGas, transactionsFromHydratedBlock, tryHydrateBlock, tryHydrateElevatedTransaction, tryHydrateTransaction };
339
+ export type { AddressInstance, AddressStateInstance, BalanceStepSummaryContext, BalancesStepSummary, BlockNumberRange, BlockWindowInstance, BlockWindowStateInstance, BoundWitnessInstance, ChainContext, ChainServiceCollection, ChainServiceCollectionV2, ChainSummaryContext, ChainWindow, DataInstance, HydratedBlockInstance, HydratedTransactionInstance, NegativeBigInt, ObjectInstance, PayloadInstance, PositiveBigInt, ShiftedBigIntConfig, SignatureInstance, SignedBigInt, SignedInstance, StepSummary, StepSummaryFields, TransactionFeesInstance, ValidatableInstance, XL1AmountInstance };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=transactionBlockByteCount.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionBlockByteCount.spec.d.ts","sourceRoot":"","sources":["../../../../../src/transaction/primitives/spec/transactionBlockByteCount.spec.ts"],"names":[],"mappings":""}
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-sdk",
4
- "version": "1.6.6",
4
+ "version": "1.7.0",
5
5
  "description": "XYO Layer One SDK Protocol",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -22,37 +22,37 @@
22
22
  "type": "module",
23
23
  "exports": {
24
24
  ".": {
25
- "types": "./dist/types/index.d.ts",
25
+ "types": "./dist/neutral/index.d.ts",
26
26
  "default": "./dist/neutral/index.mjs"
27
27
  },
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "module": "./dist/neutral/index.mjs",
31
- "types": "./dist/types/index.d.ts",
31
+ "types": "./dist/neutral/index.d.ts",
32
32
  "scripts": {
33
33
  "deploy": "echo Deploy not allowed!",
34
34
  "deploy3": "echo Deploy3 not allowed!"
35
35
  },
36
36
  "dependencies": {
37
- "@xylabs/array": "^4.13.5",
38
- "@xylabs/assert": "^4.13.5",
39
- "@xylabs/hex": "^4.13.5",
40
- "@xylabs/object": "^4.13.5",
41
- "@xylabs/promise": "^4.13.5",
42
- "@xylabs/typeof": "^4.13.5",
43
- "@xyo-network/account-model": "^4.0.3",
44
- "@xyo-network/archivist-model": "^4.0.3",
45
- "@xyo-network/boundwitness-builder": "^4.0.3",
46
- "@xyo-network/boundwitness-model": "^4.0.3",
47
- "@xyo-network/payload-builder": "^4.0.3",
48
- "@xyo-network/payload-model": "^4.0.3",
49
- "@xyo-network/wallet-model": "^4.0.3",
50
- "@xyo-network/xl1-protocol": "^1.6.2"
37
+ "@xylabs/array": "^4.13.15",
38
+ "@xylabs/assert": "^4.13.15",
39
+ "@xylabs/hex": "^4.13.15",
40
+ "@xylabs/object": "^4.13.15",
41
+ "@xylabs/promise": "^4.13.15",
42
+ "@xylabs/typeof": "^4.13.15",
43
+ "@xyo-network/account-model": "^4.1.1",
44
+ "@xyo-network/archivist-model": "^4.1.1",
45
+ "@xyo-network/boundwitness-builder": "^4.1.1",
46
+ "@xyo-network/boundwitness-model": "^4.1.1",
47
+ "@xyo-network/payload-builder": "^4.1.1",
48
+ "@xyo-network/payload-model": "^4.1.1",
49
+ "@xyo-network/wallet-model": "^4.1.1",
50
+ "@xyo-network/xl1-protocol": "^1.6.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^24.0.13",
54
- "@xylabs/ts-scripts-yarn3": "^6.5.18",
55
- "@xylabs/tsconfig": "^6.5.18",
54
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
55
+ "@xylabs/tsconfig": "^7.0.0-rc.23",
56
56
  "knip": "^5.61.3",
57
57
  "typescript": "^5.8.3",
58
58
  "vitest": "^3.2.4"
@@ -1,8 +0,0 @@
1
- export * from './block/index.ts';
2
- export * from './ChainServiceCollection.ts';
3
- export * from './ChainServiceCollectionV2.ts';
4
- export * from './instances/index.ts';
5
- export * from './payload/index.ts';
6
- export * from './SignedBigInt.ts';
7
- export * from './transaction/index.ts';
8
- //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes