@helios-lang/effect 0.1.5 → 0.1.6

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 (109) hide show
  1. package/bun.lock +60 -0
  2. package/package.json +1 -1
  3. package/tsconfig.build.tsbuildinfo +1 -0
  4. package/tsconfig.check.tsbuildinfo +1 -0
  5. package/tsconfig.tsbuildinfo +1 -0
  6. package/types/Address.d.ts +5 -0
  7. package/types/Address.d.ts.map +1 -0
  8. package/types/Bech32.d.ts +30 -0
  9. package/types/Bech32.d.ts.map +1 -0
  10. package/types/Cbor.d.ts +430 -0
  11. package/types/Cbor.d.ts.map +1 -0
  12. package/types/Ledger/Address.d.ts +109 -0
  13. package/types/Ledger/Address.d.ts.map +1 -0
  14. package/types/Ledger/AssetClass.d.ts +101 -0
  15. package/types/Ledger/AssetClass.d.ts.map +1 -0
  16. package/types/Ledger/Assets.d.ts +70 -0
  17. package/types/Ledger/Assets.d.ts.map +1 -0
  18. package/types/Ledger/Credential.d.ts +26 -0
  19. package/types/Ledger/Credential.d.ts.map +1 -0
  20. package/types/Ledger/DatumHash.d.ts +40 -0
  21. package/types/Ledger/DatumHash.d.ts.map +1 -0
  22. package/types/Ledger/IsMainnet.d.ts +6 -0
  23. package/types/Ledger/IsMainnet.d.ts.map +1 -0
  24. package/types/Ledger/MintingPolicy.d.ts +39 -0
  25. package/types/Ledger/MintingPolicy.d.ts.map +1 -0
  26. package/{src/Ledger/NetworkParams.ts → types/Ledger/NetworkParams.d.ts} +24 -26
  27. package/types/Ledger/NetworkParams.d.ts.map +1 -0
  28. package/types/Ledger/PubKeyHash.d.ts +40 -0
  29. package/types/Ledger/PubKeyHash.d.ts.map +1 -0
  30. package/types/Ledger/TxId.d.ts +10 -0
  31. package/types/Ledger/TxId.d.ts.map +1 -0
  32. package/types/Ledger/TxInput.d.ts +55 -0
  33. package/types/Ledger/TxInput.d.ts.map +1 -0
  34. package/types/Ledger/TxOutput.d.ts +63 -0
  35. package/types/Ledger/TxOutput.d.ts.map +1 -0
  36. package/types/Ledger/TxOutputDatum.d.ts +41 -0
  37. package/types/Ledger/TxOutputDatum.d.ts.map +1 -0
  38. package/types/Ledger/TxOutputId.d.ts +14 -0
  39. package/types/Ledger/TxOutputId.d.ts.map +1 -0
  40. package/types/Ledger/ValidatorHash.d.ts +40 -0
  41. package/types/Ledger/ValidatorHash.d.ts.map +1 -0
  42. package/types/Ledger/index.d.ts +16 -0
  43. package/types/Ledger/index.d.ts.map +1 -0
  44. package/types/Uplc/Cek.d.ts +72 -0
  45. package/types/Uplc/Cek.d.ts.map +1 -0
  46. package/types/Uplc/Data.d.ts +530 -0
  47. package/types/Uplc/Data.d.ts.map +1 -0
  48. package/types/Uplc/DataSchema.d.ts +227 -0
  49. package/types/Uplc/DataSchema.d.ts.map +1 -0
  50. package/types/Uplc/Primitive.d.ts +26 -0
  51. package/types/Uplc/Primitive.d.ts.map +1 -0
  52. package/types/Uplc/index.d.ts +3 -0
  53. package/types/Uplc/index.d.ts.map +1 -0
  54. package/types/index.d.ts +5 -0
  55. package/types/index.d.ts.map +1 -0
  56. package/types/internal/Base32.d.ts +49 -0
  57. package/types/internal/Base32.d.ts.map +1 -0
  58. package/types/internal/BigEndian.d.ts +22 -0
  59. package/types/internal/BigEndian.d.ts.map +1 -0
  60. package/types/internal/Bits.d.ts +123 -0
  61. package/types/internal/Bits.d.ts.map +1 -0
  62. package/types/internal/Bytes.d.ts +88 -0
  63. package/types/internal/Bytes.d.ts.map +1 -0
  64. package/types/internal/Flat.d.ts +71 -0
  65. package/types/internal/Flat.d.ts.map +1 -0
  66. package/types/internal/Float.d.ts +38 -0
  67. package/types/internal/Float.d.ts.map +1 -0
  68. package/types/internal/Utf8.d.ts +24 -0
  69. package/types/internal/Utf8.d.ts.map +1 -0
  70. package/src/Bech32.test.ts +0 -117
  71. package/src/Bech32.ts +0 -198
  72. package/src/Cbor.test.ts +0 -1610
  73. package/src/Cbor.ts +0 -1704
  74. package/src/Ledger/Address.ts +0 -248
  75. package/src/Ledger/AssetClass.ts +0 -90
  76. package/src/Ledger/Assets.ts +0 -164
  77. package/src/Ledger/Credential.ts +0 -29
  78. package/src/Ledger/DatumHash.ts +0 -36
  79. package/src/Ledger/IsMainnet.ts +0 -6
  80. package/src/Ledger/MintingPolicy.ts +0 -57
  81. package/src/Ledger/PubKeyHash.ts +0 -36
  82. package/src/Ledger/TxId.ts +0 -31
  83. package/src/Ledger/TxInput.test.ts +0 -21
  84. package/src/Ledger/TxInput.ts +0 -66
  85. package/src/Ledger/TxOutput.ts +0 -166
  86. package/src/Ledger/TxOutputDatum.ts +0 -64
  87. package/src/Ledger/TxOutputId.ts +0 -63
  88. package/src/Ledger/ValidatorHash.ts +0 -36
  89. package/src/Ledger/index.ts +0 -15
  90. package/src/Uplc/Cek.ts +0 -92
  91. package/src/Uplc/Data.test.ts +0 -321
  92. package/src/Uplc/Data.ts +0 -657
  93. package/src/Uplc/Primitive.ts +0 -56
  94. package/src/Uplc/index.ts +0 -2
  95. package/src/index.ts +0 -4
  96. package/src/internal/Base32.test.ts +0 -219
  97. package/src/internal/Base32.ts +0 -341
  98. package/src/internal/BigEndian.test.ts +0 -79
  99. package/src/internal/BigEndian.ts +0 -67
  100. package/src/internal/Bits.test.ts +0 -300
  101. package/src/internal/Bits.ts +0 -398
  102. package/src/internal/Bytes.test.ts +0 -369
  103. package/src/internal/Bytes.ts +0 -343
  104. package/src/internal/Flat.test.ts +0 -29
  105. package/src/internal/Flat.ts +0 -387
  106. package/src/internal/Float.test.ts +0 -51
  107. package/src/internal/Float.ts +0 -190
  108. package/src/internal/Utf8.test.ts +0 -69
  109. package/src/internal/Utf8.ts +0 -58
@@ -0,0 +1,72 @@
1
+ /**
2
+ * The context that terms and frames need to operate.
3
+ */
4
+ export interface Context {
5
+ readonly cost: CostTracker;
6
+ print(message: string, site?: Site): void;
7
+ popLastMessage(): string | undefined;
8
+ }
9
+ export interface Cost {
10
+ readonly cpu: bigint;
11
+ readonly mem: bigint;
12
+ }
13
+ export type CostBreakdown = {
14
+ [name: string]: Cost & {
15
+ count: number;
16
+ };
17
+ };
18
+ export interface CostModel {
19
+ readonly applyTerm: Cost;
20
+ readonly builtinTerm: Cost;
21
+ readonly caseTerm: Cost;
22
+ readonly constTerm: Cost;
23
+ readonly constrTerm: Cost;
24
+ readonly delayTerm: Cost;
25
+ readonly forceTerm: Cost;
26
+ readonly lambdaTerm: Cost;
27
+ readonly startupCost: Cost;
28
+ readonly varTerm: Cost;
29
+ readonly builtins: Record<string, (argSizes: number[]) => Cost>;
30
+ }
31
+ export interface CostTracker {
32
+ readonly cost: Cost;
33
+ readonly costModel: CostModel;
34
+ readonly breakdown: CostBreakdown;
35
+ incrApplyCost(): void;
36
+ incrBuiltinCost(): void;
37
+ incrCaseCost(): void;
38
+ incrConstCost(): void;
39
+ incrConstrCost(): void;
40
+ incrDelayCost(): void;
41
+ incrForceCost(): void;
42
+ incrLambdaCost(): void;
43
+ incrStartupCost(): void;
44
+ incrVarCost(): void;
45
+ incrArgSizesCost(name: string, argSizes: bigint[]): void;
46
+ }
47
+ /**
48
+ * Instantiate a `Machine` with {@link makeCekMachine}.
49
+ */
50
+ /**
51
+ * TODO: rename to CEKResult
52
+ * @typedef {{
53
+ * result: Either<
54
+ * {
55
+ * error: string
56
+ * callSites: CallSiteInfo[]
57
+ * },
58
+ * string | UplcValue
59
+ * >
60
+ * cost: Cost
61
+ * logs: {message: string, site?: Site}[]
62
+ * breakdown: CostBreakdown
63
+ * }} CekResult
64
+ * Return value is optional and can be omitted if the UplcValue doesn't suffice to contain it (eg. lambda functions).
65
+ */
66
+ export interface Site {
67
+ readonly file: string;
68
+ readonly line: number;
69
+ readonly column: number;
70
+ readonly description: string | undefined;
71
+ }
72
+ //# sourceMappingURL=Cek.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cek.d.ts","sourceRoot":"","sources":["../../src/Uplc/Cek.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH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AAA;IACvB,YAAY,IAAI,IAAI,CAAA;IACpB,aAAa,IAAI,IAAI,CAAA;IACrB,cAAc,IAAI,IAAI,CAAA;IACtB,aAAa,IAAI,IAAI,CAAA;IACrB,aAAa,IAAI,IAAI,CAAA;IACrB,cAAc,IAAI,IAAI,CAAA;IACtB,eAAe,IAAI,IAAI,CAAA;IACvB,WAAW,IAAI,IAAI,CAAA;IACnB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CACzD;AAED;;GAEG;AASH;;;;;;;;;;;;;;;GAeG;AAQH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;CACzC"}
@@ -0,0 +1,530 @@
1
+ import { Schema } from "effect";
2
+ import * as Bytes from "../internal/Bytes.js";
3
+ import * as Cbor from "../Cbor.js";
4
+ export declare const ByteArrayDataFromJSON: Schema.Struct<{
5
+ bytes: Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>;
6
+ }>;
7
+ export type ByteArrayData = Schema.Schema.Type<typeof ByteArrayDataFromJSON>;
8
+ export type ByteArrayDataJSON = Schema.Schema.Encoded<typeof ByteArrayDataFromJSON>;
9
+ export declare function makeByteArrayData(bytes: string | number[] | Uint8Array): ByteArrayData;
10
+ /**
11
+ * No need to serialize
12
+ *
13
+ * Cannot used Branded types due Schema issues.
14
+ */
15
+ export declare const IntDataFromJSON: Schema.Struct<{
16
+ int: typeof Schema.BigIntFromNumber;
17
+ }>;
18
+ export type IntData = Schema.Schema.Type<typeof IntDataFromJSON>;
19
+ export type IntDataJSON = Schema.Schema.Encoded<typeof IntDataFromJSON>;
20
+ export declare function makeIntData(value: number | bigint): IntData;
21
+ export declare const ListDataFromJSON: Schema.Struct<{
22
+ list: Schema.Array$<Schema.suspend<Data, DataJSON, never>>;
23
+ }>;
24
+ /**
25
+ * Must be defined explicitly to avoid circular reference problems
26
+ */
27
+ export type ListData = {
28
+ readonly list: ReadonlyArray<Data>;
29
+ };
30
+ export type ListDataJSON = {
31
+ readonly list: ReadonlyArray<DataJSON>;
32
+ };
33
+ export declare function makeListData(items: Data[]): ListData;
34
+ export declare const MapDataFromJSON: Schema.Struct<{
35
+ map: Schema.Array$<Schema.Struct<{
36
+ k: Schema.suspend<Data, DataJSON, never>;
37
+ v: Schema.suspend<Data, DataJSON, never>;
38
+ }>>;
39
+ }>;
40
+ /**
41
+ * Must be defined explicitly to avoid circular reference problems
42
+ */
43
+ export type MapData = {
44
+ readonly map: ReadonlyArray<{
45
+ readonly k: Data;
46
+ readonly v: Data;
47
+ }>;
48
+ };
49
+ export type MapDataJSON = {
50
+ readonly map: ReadonlyArray<{
51
+ readonly k: DataJSON;
52
+ readonly v: DataJSON;
53
+ }>;
54
+ };
55
+ export declare function makeMapData(entries: [Data, Data][]): MapData;
56
+ export declare const ConstrDataFromJSON: Schema.Struct<{
57
+ constructor: typeof Schema.Number;
58
+ fields: Schema.Array$<Schema.suspend<Data, DataJSON, never>>;
59
+ }>;
60
+ /**
61
+ * Must be defined explicitly to avoid circular reference problems
62
+ */
63
+ export type ConstrData = {
64
+ readonly constructor: number;
65
+ readonly fields: ReadonlyArray<Data>;
66
+ };
67
+ export type ConstrDataJSON = {
68
+ readonly constructor: number;
69
+ readonly fields: ReadonlyArray<DataJSON>;
70
+ };
71
+ export declare function makeConstrData(tag: bigint | number, fields: Data[]): ConstrData;
72
+ export declare const DataFromJSON: Schema.Union<[Schema.Struct<{
73
+ bytes: Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>;
74
+ }>, Schema.Struct<{
75
+ int: typeof Schema.BigIntFromNumber;
76
+ }>, Schema.Struct<{
77
+ list: Schema.Array$<Schema.suspend<Data, DataJSON, never>>;
78
+ }>, Schema.Struct<{
79
+ map: Schema.Array$<Schema.Struct<{
80
+ k: Schema.suspend<Data, DataJSON, never>;
81
+ v: Schema.suspend<Data, DataJSON, never>;
82
+ }>>;
83
+ }>, Schema.Struct<{
84
+ constructor: typeof Schema.Number;
85
+ fields: Schema.Array$<Schema.suspend<Data, DataJSON, never>>;
86
+ }>]>;
87
+ export declare const Data: Schema.SchemaClass<{
88
+ readonly bytes: Uint8Array<ArrayBufferLike>;
89
+ } | {
90
+ readonly int: bigint;
91
+ } | {
92
+ readonly list: readonly Data[];
93
+ } | {
94
+ readonly map: readonly {
95
+ readonly k: Data;
96
+ readonly v: Data;
97
+ }[];
98
+ } | {
99
+ readonly fields: readonly Data[];
100
+ readonly constructor: number;
101
+ }, {
102
+ readonly bytes: Uint8Array<ArrayBufferLike>;
103
+ } | {
104
+ readonly int: bigint;
105
+ } | {
106
+ readonly list: readonly Data[];
107
+ } | {
108
+ readonly map: readonly {
109
+ readonly k: Data;
110
+ readonly v: Data;
111
+ }[];
112
+ } | {
113
+ readonly fields: readonly Data[];
114
+ readonly constructor: number;
115
+ }, never>;
116
+ /**
117
+ * Must be defined explicitly to avoid circular reference problems
118
+ */
119
+ export type Data = ByteArrayData | ConstrData | IntData | ListData | MapData;
120
+ export type DataJSON = ByteArrayDataJSON | ConstrDataJSON | IntDataJSON | ListDataJSON | MapDataJSON;
121
+ /**
122
+ * Simple recursive CBOR decoder
123
+ * @param bytes
124
+ * @returns
125
+ */
126
+ export declare const decode: (bytes: Bytes.BytesLike) => Cbor.DecodeEffect<Data>;
127
+ /**
128
+ * Simple recursive CBOR encoder
129
+ * @param data
130
+ * @returns
131
+ */
132
+ export declare function encode(data: Data): number[];
133
+ export declare const NODE_MEM_SIZE = 4;
134
+ /**
135
+ * Simple recursive algorithm
136
+ * @param data
137
+ * @returns
138
+ */
139
+ export declare function memSize(data: Data): number;
140
+ /**
141
+ * Calculates the mem size of a byte array without the DATA_NODE overhead.
142
+ * @param bytes
143
+ * @returns
144
+ */
145
+ export declare function calcBytesMemSize(bytes: string | readonly number[] | Uint8Array): number;
146
+ /**
147
+ * Calculate the mem size of a integer (without the DATA_NODE overhead)
148
+ * @param value
149
+ * @returns
150
+ */
151
+ export declare function calcIntMemSize(value: bigint): number;
152
+ /**
153
+ * Math.log2 truncates, but we need a rounding down version
154
+ * @param x positive number
155
+ * @returns
156
+ */
157
+ export declare function log2i(x: bigint): number;
158
+ declare const BigInt$: Schema.transformOrFail<Schema.SchemaClass<{
159
+ readonly bytes: Uint8Array<ArrayBufferLike>;
160
+ } | {
161
+ readonly int: bigint;
162
+ } | {
163
+ readonly list: readonly Data[];
164
+ } | {
165
+ readonly map: readonly {
166
+ readonly k: Data;
167
+ readonly v: Data;
168
+ }[];
169
+ } | {
170
+ readonly fields: readonly Data[];
171
+ readonly constructor: number;
172
+ }, {
173
+ readonly bytes: Uint8Array<ArrayBufferLike>;
174
+ } | {
175
+ readonly int: bigint;
176
+ } | {
177
+ readonly list: readonly Data[];
178
+ } | {
179
+ readonly map: readonly {
180
+ readonly k: Data;
181
+ readonly v: Data;
182
+ }[];
183
+ } | {
184
+ readonly fields: readonly Data[];
185
+ readonly constructor: number;
186
+ }, never>, typeof Schema.BigIntFromSelf, never>;
187
+ export { BigInt$ as BigInt };
188
+ export declare const Int: Schema.transformOrFail<Schema.SchemaClass<{
189
+ readonly bytes: Uint8Array<ArrayBufferLike>;
190
+ } | {
191
+ readonly int: bigint;
192
+ } | {
193
+ readonly list: readonly Data[];
194
+ } | {
195
+ readonly map: readonly {
196
+ readonly k: Data;
197
+ readonly v: Data;
198
+ }[];
199
+ } | {
200
+ readonly fields: readonly Data[];
201
+ readonly constructor: number;
202
+ }, {
203
+ readonly bytes: Uint8Array<ArrayBufferLike>;
204
+ } | {
205
+ readonly int: bigint;
206
+ } | {
207
+ readonly list: readonly Data[];
208
+ } | {
209
+ readonly map: readonly {
210
+ readonly k: Data;
211
+ readonly v: Data;
212
+ }[];
213
+ } | {
214
+ readonly fields: readonly Data[];
215
+ readonly constructor: number;
216
+ }, never>, typeof Schema.Int, never>;
217
+ export declare const ByteArray: Schema.transformOrFail<Schema.SchemaClass<{
218
+ readonly bytes: Uint8Array<ArrayBufferLike>;
219
+ } | {
220
+ readonly int: bigint;
221
+ } | {
222
+ readonly list: readonly Data[];
223
+ } | {
224
+ readonly map: readonly {
225
+ readonly k: Data;
226
+ readonly v: Data;
227
+ }[];
228
+ } | {
229
+ readonly fields: readonly Data[];
230
+ readonly constructor: number;
231
+ }, {
232
+ readonly bytes: Uint8Array<ArrayBufferLike>;
233
+ } | {
234
+ readonly int: bigint;
235
+ } | {
236
+ readonly list: readonly Data[];
237
+ } | {
238
+ readonly map: readonly {
239
+ readonly k: Data;
240
+ readonly v: Data;
241
+ }[];
242
+ } | {
243
+ readonly fields: readonly Data[];
244
+ readonly constructor: number;
245
+ }, never>, typeof Schema.Uint8ArrayFromSelf, never>;
246
+ export declare const Hex: Schema.transformOrFail<Schema.SchemaClass<{
247
+ readonly bytes: Uint8Array<ArrayBufferLike>;
248
+ } | {
249
+ readonly int: bigint;
250
+ } | {
251
+ readonly list: readonly Data[];
252
+ } | {
253
+ readonly map: readonly {
254
+ readonly k: Data;
255
+ readonly v: Data;
256
+ }[];
257
+ } | {
258
+ readonly fields: readonly Data[];
259
+ readonly constructor: number;
260
+ }, {
261
+ readonly bytes: Uint8Array<ArrayBufferLike>;
262
+ } | {
263
+ readonly int: bigint;
264
+ } | {
265
+ readonly list: readonly Data[];
266
+ } | {
267
+ readonly map: readonly {
268
+ readonly k: Data;
269
+ readonly v: Data;
270
+ }[];
271
+ } | {
272
+ readonly fields: readonly Data[];
273
+ readonly constructor: number;
274
+ }, never>, typeof Schema.String, never>;
275
+ export declare const Option: <SomeType>(someSchema: Schema.Schema<SomeType, Schema.Schema.Encoded<typeof Data>>) => Schema.transformOrFail<Schema.SchemaClass<{
276
+ readonly bytes: Uint8Array<ArrayBufferLike>;
277
+ } | {
278
+ readonly int: bigint;
279
+ } | {
280
+ readonly list: readonly Data[];
281
+ } | {
282
+ readonly map: readonly {
283
+ readonly k: Data;
284
+ readonly v: Data;
285
+ }[];
286
+ } | {
287
+ readonly fields: readonly Data[];
288
+ readonly constructor: number;
289
+ }, {
290
+ readonly bytes: Uint8Array<ArrayBufferLike>;
291
+ } | {
292
+ readonly int: bigint;
293
+ } | {
294
+ readonly list: readonly Data[];
295
+ } | {
296
+ readonly map: readonly {
297
+ readonly k: Data;
298
+ readonly v: Data;
299
+ }[];
300
+ } | {
301
+ readonly fields: readonly Data[];
302
+ readonly constructor: number;
303
+ }, never>, Schema.Option<Schema.Schema<SomeType, {
304
+ readonly bytes: Uint8Array<ArrayBufferLike>;
305
+ } | {
306
+ readonly int: bigint;
307
+ } | {
308
+ readonly list: readonly Data[];
309
+ } | {
310
+ readonly map: readonly {
311
+ readonly k: Data;
312
+ readonly v: Data;
313
+ }[];
314
+ } | {
315
+ readonly fields: readonly Data[];
316
+ readonly constructor: number;
317
+ }, never>>, never>;
318
+ declare const String$: Schema.transformOrFail<Schema.SchemaClass<{
319
+ readonly bytes: Uint8Array<ArrayBufferLike>;
320
+ } | {
321
+ readonly int: bigint;
322
+ } | {
323
+ readonly list: readonly Data[];
324
+ } | {
325
+ readonly map: readonly {
326
+ readonly k: Data;
327
+ readonly v: Data;
328
+ }[];
329
+ } | {
330
+ readonly fields: readonly Data[];
331
+ readonly constructor: number;
332
+ }, {
333
+ readonly bytes: Uint8Array<ArrayBufferLike>;
334
+ } | {
335
+ readonly int: bigint;
336
+ } | {
337
+ readonly list: readonly Data[];
338
+ } | {
339
+ readonly map: readonly {
340
+ readonly k: Data;
341
+ readonly v: Data;
342
+ }[];
343
+ } | {
344
+ readonly fields: readonly Data[];
345
+ readonly constructor: number;
346
+ }, never>, typeof Schema.String, never>;
347
+ export { String$ as String };
348
+ declare const Array$: <ItemType>(itemSchema: Schema.Schema<ItemType, Schema.Schema.Encoded<typeof Data>>) => Schema.transformOrFail<Schema.SchemaClass<{
349
+ readonly bytes: Uint8Array<ArrayBufferLike>;
350
+ } | {
351
+ readonly int: bigint;
352
+ } | {
353
+ readonly list: readonly Data[];
354
+ } | {
355
+ readonly map: readonly {
356
+ readonly k: Data;
357
+ readonly v: Data;
358
+ }[];
359
+ } | {
360
+ readonly fields: readonly Data[];
361
+ readonly constructor: number;
362
+ }, {
363
+ readonly bytes: Uint8Array<ArrayBufferLike>;
364
+ } | {
365
+ readonly int: bigint;
366
+ } | {
367
+ readonly list: readonly Data[];
368
+ } | {
369
+ readonly map: readonly {
370
+ readonly k: Data;
371
+ readonly v: Data;
372
+ }[];
373
+ } | {
374
+ readonly fields: readonly Data[];
375
+ readonly constructor: number;
376
+ }, never>, Schema.Array$<Schema.Schema<ItemType, {
377
+ readonly bytes: Uint8Array<ArrayBufferLike>;
378
+ } | {
379
+ readonly int: bigint;
380
+ } | {
381
+ readonly list: readonly Data[];
382
+ } | {
383
+ readonly map: readonly {
384
+ readonly k: Data;
385
+ readonly v: Data;
386
+ }[];
387
+ } | {
388
+ readonly fields: readonly Data[];
389
+ readonly constructor: number;
390
+ }, never>>, never>;
391
+ export { Array$ as Array };
392
+ export declare const PairArray: <KeyType, ValueType>(keySchema: Schema.Schema<KeyType, Schema.Schema.Encoded<typeof Data>>, valueSchema: Schema.Schema<ValueType, Schema.Schema.Encoded<typeof Data>>) => Schema.transformOrFail<Schema.SchemaClass<{
393
+ readonly bytes: Uint8Array<ArrayBufferLike>;
394
+ } | {
395
+ readonly int: bigint;
396
+ } | {
397
+ readonly list: readonly Data[];
398
+ } | {
399
+ readonly map: readonly {
400
+ readonly k: Data;
401
+ readonly v: Data;
402
+ }[];
403
+ } | {
404
+ readonly fields: readonly Data[];
405
+ readonly constructor: number;
406
+ }, {
407
+ readonly bytes: Uint8Array<ArrayBufferLike>;
408
+ } | {
409
+ readonly int: bigint;
410
+ } | {
411
+ readonly list: readonly Data[];
412
+ } | {
413
+ readonly map: readonly {
414
+ readonly k: Data;
415
+ readonly v: Data;
416
+ }[];
417
+ } | {
418
+ readonly fields: readonly Data[];
419
+ readonly constructor: number;
420
+ }, never>, Schema.Array$<Schema.Tuple2<Schema.Schema<KeyType, {
421
+ readonly bytes: Uint8Array<ArrayBufferLike>;
422
+ } | {
423
+ readonly int: bigint;
424
+ } | {
425
+ readonly list: readonly Data[];
426
+ } | {
427
+ readonly map: readonly {
428
+ readonly k: Data;
429
+ readonly v: Data;
430
+ }[];
431
+ } | {
432
+ readonly fields: readonly Data[];
433
+ readonly constructor: number;
434
+ }, never>, Schema.Schema<ValueType, {
435
+ readonly bytes: Uint8Array<ArrayBufferLike>;
436
+ } | {
437
+ readonly int: bigint;
438
+ } | {
439
+ readonly list: readonly Data[];
440
+ } | {
441
+ readonly map: readonly {
442
+ readonly k: Data;
443
+ readonly v: Data;
444
+ }[];
445
+ } | {
446
+ readonly fields: readonly Data[];
447
+ readonly constructor: number;
448
+ }, never>>>, never>;
449
+ export declare const Struct: <FieldTypes extends {
450
+ [fieldName: string]: Schema.Schema<any, Data>;
451
+ }>(fields: FieldTypes) => Schema.transformOrFail<Schema.SchemaClass<{
452
+ readonly bytes: Uint8Array<ArrayBufferLike>;
453
+ } | {
454
+ readonly int: bigint;
455
+ } | {
456
+ readonly list: readonly Data[];
457
+ } | {
458
+ readonly map: readonly {
459
+ readonly k: Data;
460
+ readonly v: Data;
461
+ }[];
462
+ } | {
463
+ readonly fields: readonly Data[];
464
+ readonly constructor: number;
465
+ }, {
466
+ readonly bytes: Uint8Array<ArrayBufferLike>;
467
+ } | {
468
+ readonly int: bigint;
469
+ } | {
470
+ readonly list: readonly Data[];
471
+ } | {
472
+ readonly map: readonly {
473
+ readonly k: Data;
474
+ readonly v: Data;
475
+ }[];
476
+ } | {
477
+ readonly fields: readonly Data[];
478
+ readonly constructor: number;
479
+ }, never>, Schema.Struct<FieldTypes>, never>;
480
+ export declare const EnumVariant: <FieldTypes extends {
481
+ [fieldName: string]: Schema.Schema<any, Data>;
482
+ }>(tag: number | bigint, fields: FieldTypes) => Schema.transformOrFail<Schema.SchemaClass<{
483
+ readonly bytes: Uint8Array<ArrayBufferLike>;
484
+ } | {
485
+ readonly int: bigint;
486
+ } | {
487
+ readonly list: readonly Data[];
488
+ } | {
489
+ readonly map: readonly {
490
+ readonly k: Data;
491
+ readonly v: Data;
492
+ }[];
493
+ } | {
494
+ readonly fields: readonly Data[];
495
+ readonly constructor: number;
496
+ }, {
497
+ readonly bytes: Uint8Array<ArrayBufferLike>;
498
+ } | {
499
+ readonly int: bigint;
500
+ } | {
501
+ readonly list: readonly Data[];
502
+ } | {
503
+ readonly map: readonly {
504
+ readonly k: Data;
505
+ readonly v: Data;
506
+ }[];
507
+ } | {
508
+ readonly fields: readonly Data[];
509
+ readonly constructor: number;
510
+ }, never>, Schema.Struct<FieldTypes>, never>;
511
+ type EnumUnionTypeInternal<VariantName, VariantTypes extends {
512
+ [variantName: string]: {
513
+ [fieldName: string]: Schema.Schema<any, Data>;
514
+ };
515
+ }> = VariantName extends string ? {
516
+ _tag: VariantName;
517
+ } & {
518
+ [FieldName in keyof VariantTypes[VariantName]]: Schema.Schema.Type<VariantTypes[VariantName][FieldName]>;
519
+ } : never;
520
+ type EnumUnionType<VariantTypes extends {
521
+ [variantName: string]: {
522
+ [fieldName: string]: Schema.Schema<any, Data>;
523
+ };
524
+ }> = EnumUnionTypeInternal<keyof VariantTypes, VariantTypes>;
525
+ export declare const Enum: <VariantTypes extends {
526
+ [variantName: string]: {
527
+ [fieldName: string]: Schema.Schema<any, Data>;
528
+ };
529
+ }>(variants: VariantTypes) => Schema.Schema<EnumUnionType<VariantTypes>, Data>;
530
+ //# sourceMappingURL=Data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../src/Uplc/Data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC9D,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAE7C,OAAO,KAAK,IAAI,M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