Skip to content

Commit d5cc29a

Browse files
Merge pull request #35 from no-witness-labs/feat/upgrade-modules-6
feat: upgrade modules
2 parents 7952dbe + dee3e66 commit d5cc29a

33 files changed

+1278
-2660
lines changed

docs/components/search.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ export default function DefaultSearchDialog(props: SharedProps) {
2828
// the site lives under a subpath (e.g. /evolution-sdk). Set
2929
// NEXT_PUBLIC_BASE_PATH=/evolution-sdk in CI so the client requests the
3030
// correct static search JSON. Falls back to empty string for local dev.
31-
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? ''
32-
const normalizedBase = basePath.endsWith('/') && basePath.length > 1 ? basePath.slice(0, -1) : basePath
31+
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? ""
32+
const normalizedBase = basePath.endsWith("/") && basePath.length > 1 ? basePath.slice(0, -1) : basePath
3333
const apiFrom = `${normalizedBase}/api/search`
3434

3535
const { search, setSearch, query } = useDocsSearch({
3636
type: "static",
3737
initOrama,
3838
locale,
39-
from: apiFrom,
39+
from: apiFrom
4040
})
4141

4242
return (

docs/content/docs/modules/Data.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ parent: Modules
6666
- [ByteArray (type alias)](#bytearray-type-alias)
6767
- [CDDLSchema](#cddlschema)
6868
- [Int (type alias)](#int-type-alias)
69+
- [equals](#equals)
6970

7071
---
7172

@@ -742,3 +743,14 @@ export declare const CDDLSchema: Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>
742743
```ts
743744
export type Int = typeof IntSchema.Type
744745
```
746+
747+
## equals
748+
749+
Deep structural equality for Plutus Data values.
750+
Handles maps, lists, ints, bytes, and constrs.
751+
752+
**Signature**
753+
754+
```ts
755+
export declare const equals: (a: Data, b: Data) => boolean
756+
```

docs/content/docs/modules/DatumOption.mdx

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ parent: Modules
3434
- [DatumHash (class)](#datumhash-class)
3535
- [toString (method)](#tostring-method)
3636
- [[Symbol.for("nodejs.util.inspect.custom")] (method)](#symbolfornodejsutilinspectcustom-method)
37-
- [DatumOptionCDDLSchema](#datumoptioncddlschema)
3837
- [DatumOptionSchema](#datumoptionschema)
3938
- [FromCBORBytes](#fromcborbytes-1)
4039
- [FromCBORHex](#fromcborhex-1)
@@ -45,6 +44,7 @@ parent: Modules
4544
- [testing](#testing)
4645
- [arbitrary](#arbitrary)
4746
- [utils](#utils)
47+
- [CDDLSchema](#cddlschema)
4848
- [DatumHashFromBytes](#datumhashfrombytes)
4949
- [datumHashArbitrary](#datumhasharbitrary)
5050
- [inlineDatumArbitrary](#inlinedatumarbitrary)
@@ -243,36 +243,6 @@ toString(): string
243243
[Symbol.for("nodejs.util.inspect.custom")](): string
244244
```
245245

246-
## DatumOptionCDDLSchema
247-
248-
CDDL schema for DatumOption.
249-
datum_option = [0, Bytes32] / [1, #6.24(bytes)]
250-
251-
Where:
252-
253-
- [0, Bytes32] represents a datum hash (tag 0 with 32-byte hash)
254-
- [1, #6.24(bytes)] represents inline data (tag 1 with CBOR tag 24 containing plutus data as bytes)
255-
256-
**Signature**
257-
258-
```ts
259-
export declare const DatumOptionCDDLSchema: Schema.transformOrFail<
260-
Schema.Union<
261-
[
262-
Schema.Tuple2<Schema.Literal<[0n]>, typeof Schema.Uint8ArrayFromSelf>,
263-
Schema.Tuple2<
264-
Schema.Literal<[1n]>,
265-
Schema.TaggedStruct<"Tag", { tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }>
266-
>
267-
]
268-
>,
269-
Schema.SchemaClass<DatumHash | InlineDatum, DatumHash | InlineDatum, never>,
270-
never
271-
>
272-
```
273-
274-
Added in v2.0.0
275-
276246
## DatumOptionSchema
277247

278248
Schema for DatumOption representing optional datum information in transaction outputs.
@@ -366,6 +336,12 @@ Added in v2.0.0
366336
## FromCDDL
367337

368338
CDDL schema for DatumOption.
339+
datum_option = [0, Bytes32] / [1, #6.24(bytes)]
340+
341+
Where:
342+
343+
- [0, Bytes32] represents a datum hash (tag 0 with 32-byte hash)
344+
- [1, #6.24(bytes)] represents inline data (tag 1 with CBOR tag 24 containing plutus data as bytes)
369345

370346
**Signature**
371347

@@ -432,6 +408,22 @@ Added in v2.0.0
432408

433409
# utils
434410

411+
## CDDLSchema
412+
413+
**Signature**
414+
415+
```ts
416+
export declare const CDDLSchema: Schema.Union<
417+
[
418+
Schema.Tuple2<Schema.Literal<[0n]>, typeof Schema.Uint8ArrayFromSelf>,
419+
Schema.Tuple2<
420+
Schema.Literal<[1n]>,
421+
Schema.TaggedStruct<"Tag", { tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }>
422+
>
423+
]
424+
>
425+
```
426+
435427
## DatumHashFromBytes
436428

437429
**Signature**

docs/content/docs/modules/KeyHash.mdx

Lines changed: 79 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ parent: Modules
1010

1111
<h2 className="text-delta">Table of contents</h2>
1212

13+
- [arbitrary](#arbitrary)
14+
- [arbitrary](#arbitrary-1)
1315
- [constructors](#constructors)
16+
- [fromPrivateKey](#fromprivatekey)
17+
- [fromVKey](#fromvkey)
1418
- [make](#make)
15-
- [effect](#effect)
19+
- [either](#either)
1620
- [Either (namespace)](#either-namespace)
17-
- [encoding](#encoding)
21+
- [encoding/decoding](#encodingdecoding)
22+
- [fromBytes](#frombytes)
23+
- [fromHex](#fromhex)
1824
- [toBytes](#tobytes)
1925
- [toHex](#tohex)
2026
- [equality](#equality)
@@ -25,25 +31,55 @@ parent: Modules
2531
- [KeyHash (class)](#keyhash-class)
2632
- [toJSON (method)](#tojson-method)
2733
- [toString (method)](#tostring-method)
28-
- [parsing](#parsing)
29-
- [fromBytes](#frombytes)
30-
- [fromHex](#fromhex)
31-
- [schemas](#schemas)
34+
- [transformer](#transformer)
3235
- [FromBytes](#frombytes-1)
3336
- [FromHex](#fromhex-1)
34-
- [testing](#testing)
35-
- [arbitrary](#arbitrary)
36-
- [utils](#utils)
37-
- [fromPrivateKey](#fromprivatekey)
38-
- [fromVKey](#fromvkey)
3937

4038
---
4139

40+
# arbitrary
41+
42+
## arbitrary
43+
44+
FastCheck arbitrary for generating random KeyHash instances.
45+
46+
**Signature**
47+
48+
```ts
49+
export declare const arbitrary: FastCheck.Arbitrary<KeyHash>
50+
```
51+
52+
Added in v2.0.0
53+
4254
# constructors
4355
56+
## fromPrivateKey
57+
58+
Create a KeyHash from a PrivateKey
59+
60+
**Signature**
61+
62+
```ts
63+
export declare const fromPrivateKey: (privateKey: PrivateKey) => KeyHash
64+
```
65+
66+
Added in v2.0.0
67+
68+
## fromVKey
69+
70+
Create a KeyHash from a VKey
71+
72+
**Signature**
73+
74+
```ts
75+
export declare const fromVKey: (vkey: VKey.VKey) => KeyHash
76+
```
77+
78+
Added in v2.0.0
79+
4480
## make
4581
46-
Smart constructor for KeyHash that validates and applies branding.
82+
Smart constructor for KeyHash
4783
4884
**Signature**
4985
@@ -53,15 +89,39 @@ export declare const make: (props: { readonly hash: any }, options?: Schema.Make
5389
5490
Added in v2.0.0
5591
56-
# effect
92+
# either
5793
5894
## Either (namespace)
5995
60-
Effect-based error handling variants for functions that can fail.
96+
Either-based error handling variants for functions that can fail.
6197
6298
Added in v2.0.0
6399
64-
# encoding
100+
# encoding/decoding
101+
102+
## fromBytes
103+
104+
Decode a KeyHash from raw bytes.
105+
106+
**Signature**
107+
108+
```ts
109+
export declare const fromBytes: (input: any) => KeyHash
110+
```
111+
112+
Added in v2.0.0
113+
114+
## fromHex
115+
116+
Decode a KeyHash from a hex string.
117+
118+
**Signature**
119+
120+
```ts
121+
export declare const fromHex: (input: string) => KeyHash
122+
```
123+
124+
Added in v2.0.0
65125
66126
## toBytes
67127
@@ -119,16 +179,14 @@ Added in v2.0.0
119179

120180
## KeyHash (class)
121181

122-
KeyHash as a TaggedClass (breaking change from branded hex string).
182+
KeyHash
183+
184+
CDDL:
123185

124186
```
125187
addr_keyhash = hash28
126188
```
127189

128-
Follows CIP-0019 binary representation.
129-
130-
Stores raw 28-byte value for performance.
131-
132190
**Signature**
133191

134192
```ts
@@ -153,35 +211,7 @@ toJSON(): string
153211
toString(): string
154212
```
155213

156-
# parsing
157-
158-
## fromBytes
159-
160-
Parse a KeyHash from raw bytes.
161-
Expects exactly 28 bytes.
162-
163-
**Signature**
164-
165-
```ts
166-
export declare const fromBytes: (input: any) => KeyHash
167-
```
168-
169-
Added in v2.0.0
170-
171-
## fromHex
172-
173-
Parse a KeyHash from a hex string.
174-
Expects exactly 56 hex characters (28 bytes).
175-
176-
**Signature**
177-
178-
```ts
179-
export declare const fromHex: (input: string) => KeyHash
180-
```
181-
182-
Added in v2.0.0
183-
184-
# schemas
214+
# transformer
185215

186216
## FromBytes
187217

@@ -209,42 +239,3 @@ export declare const FromHex: Schema.transform<
209239
```
210240

211241
Added in v2.0.0
212-
213-
# testing
214-
215-
## arbitrary
216-
217-
FastCheck arbitrary for generating random KeyHash instances.
218-
Used for property-based testing to generate valid test data.
219-
220-
**Signature**
221-
222-
```ts
223-
export declare const arbitrary: FastCheck.Arbitrary<KeyHash>
224-
```
225-
226-
Added in v2.0.0
227-
228-
# utils
229-
230-
## fromPrivateKey
231-
232-
Create a KeyHash from a PrivateKey (sync version that throws KeyHashError).
233-
All errors are normalized to KeyHashError with contextual information.
234-
235-
**Signature**
236-
237-
```ts
238-
export declare const fromPrivateKey: (privateKey: PrivateKey) => KeyHash
239-
```
240-
241-
## fromVKey
242-
243-
Create a KeyHash from a VKey (sync version that throws KeyHashError).
244-
All errors are normalized to KeyHashError with contextual information.
245-
246-
**Signature**
247-
248-
```ts
249-
export declare const fromVKey: (vkey: VKey.VKey) => KeyHash
250-
```

docs/content/docs/modules/ScriptRef.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ parent: Modules
3939
- [ScriptRef (class)](#scriptref-class)
4040
- [toJSON (method)](#tojson-method)
4141
- [toString (method)](#tostring-method)
42+
- [utils](#utils)
43+
- [CDDLSchema](#cddlschema)
4244

4345
---
4446

@@ -344,3 +346,16 @@ toJSON(): string
344346
```ts
345347
toString(): string
346348
```
349+
350+
# utils
351+
352+
## CDDLSchema
353+
354+
**Signature**
355+
356+
```ts
357+
export declare const CDDLSchema: Schema.TaggedStruct<
358+
"Tag",
359+
{ tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }
360+
>
361+
```

0 commit comments

Comments
 (0)