Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .changeset/deep-beds-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@evolution-sdk/evolution": patch
---

Separate DatumOption into dedicated DatumHash and InlineDatum modules.

- Add `DatumHash` module with `fromHex`, `toHex`, `fromBytes`, `toBytes` functions
- Add `InlineDatum` module for inline plutus data
- Refactor `DatumOption` to import from new modules (union type preserved)
- Fix `BlockfrostUTxO` schema to include `address` field
- Update all provider implementations to use new module imports
2 changes: 1 addition & 1 deletion docs/content/docs/modules/DRep.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: DRep.ts
nav_order: 49
nav_order: 50
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/modules/DRepCredential.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: DRepCredential.ts
nav_order: 50
nav_order: 51
parent: Modules
---

Expand Down
207 changes: 207 additions & 0 deletions docs/content/docs/modules/DatumHash.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
---
title: DatumHash.ts
nav_order: 47
parent: Modules
---

## DatumHash overview

---

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

- [encoding](#encoding)
- [toBytes](#tobytes)
- [toHex](#tohex)
- [parsing](#parsing)
- [fromBytes](#frombytes)
- [fromHex](#fromhex)
- [predicates](#predicates)
- [isDatumHash](#isdatumhash)
- [schemas](#schemas)
- [DatumHash (class)](#datumhash-class)
- [toJSON (method)](#tojson-method)
- [toString (method)](#tostring-method)
- [[Inspectable.NodeInspectSymbol] (method)](#inspectablenodeinspectsymbol-method)
- [[Equal.symbol] (method)](#equalsymbol-method)
- [[Hash.symbol] (method)](#hashsymbol-method)
- [FromBytes](#frombytes-1)
- [FromHex](#fromhex-1)
- [testing](#testing)
- [arbitrary](#arbitrary)

---

# encoding

## toBytes

Encode DatumHash to bytes.

**Signature**

```ts
export declare const toBytes: (a: DatumHash, overrideOptions?: ParseOptions) => Uint8Array
```

Added in v2.0.0

## toHex

Encode DatumHash to hex string.

**Signature**

```ts
export declare const toHex: (a: DatumHash, overrideOptions?: ParseOptions) => string
```

Added in v2.0.0

# parsing

## fromBytes

Parse DatumHash from bytes.

**Signature**

```ts
export declare const fromBytes: (i: Uint8Array, overrideOptions?: ParseOptions) => DatumHash
```

Added in v2.0.0

## fromHex

Parse DatumHash from hex string.

**Signature**

```ts
export declare const fromHex: (i: string, overrideOptions?: ParseOptions) => DatumHash
```

Added in v2.0.0

# predicates

## isDatumHash

Type guard to check if a value is a DatumHash.

**Signature**

```ts
export declare const isDatumHash: (u: unknown, overrideOptions?: ParseOptions | number) => u is DatumHash
```

Added in v2.0.0

# schemas

## DatumHash (class)

Schema for DatumHash representing a reference to datum data stored elsewhere via its hash.

**Signature**

```ts
export declare class DatumHash
```

Added in v2.0.0

### toJSON (method)

**Signature**

```ts
toJSON()
```

Added in v2.0.0

### toString (method)

**Signature**

```ts
toString(): string
```

Added in v2.0.0

### [Inspectable.NodeInspectSymbol] (method)

**Signature**

```ts
[Inspectable.NodeInspectSymbol](): unknown
```

Added in v2.0.0

### [Equal.symbol] (method)

**Signature**

```ts
[Equal.symbol](that: unknown): boolean
```

Added in v2.0.0

### [Hash.symbol] (method)

**Signature**

```ts
[Hash.symbol](): number
```

Added in v2.0.0

## FromBytes

Schema for transforming bytes to DatumHash.

**Signature**

```ts
export declare const FromBytes: Schema.transform<
Schema.SchemaClass<Uint8Array, Uint8Array, never>,
Schema.SchemaClass<DatumHash, DatumHash, never>
>
```

Added in v2.0.0

## FromHex

Schema for transforming hex string to DatumHash.

**Signature**

```ts
export declare const FromHex: Schema.transform<
Schema.filter<Schema.Schema<Uint8Array, string, never>>,
Schema.transform<Schema.SchemaClass<Uint8Array, Uint8Array, never>, Schema.SchemaClass<DatumHash, DatumHash, never>>
>
```

Added in v2.0.0

# testing

## arbitrary

FastCheck arbitrary for generating random DatumHash instances.

**Signature**

```ts
export declare const arbitrary: FastCheck.Arbitrary<DatumHash>
```

Added in v2.0.0
Loading