|
| 1 | +--- |
| 2 | +title: DatumHash.ts |
| 3 | +nav_order: 47 |
| 4 | +parent: Modules |
| 5 | +--- |
| 6 | + |
| 7 | +## DatumHash overview |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +<h2 className="text-delta">Table of contents</h2> |
| 12 | + |
| 13 | +- [encoding](#encoding) |
| 14 | + - [toBytes](#tobytes) |
| 15 | + - [toHex](#tohex) |
| 16 | +- [parsing](#parsing) |
| 17 | + - [fromBytes](#frombytes) |
| 18 | + - [fromHex](#fromhex) |
| 19 | +- [predicates](#predicates) |
| 20 | + - [isDatumHash](#isdatumhash) |
| 21 | +- [schemas](#schemas) |
| 22 | + - [DatumHash (class)](#datumhash-class) |
| 23 | + - [toJSON (method)](#tojson-method) |
| 24 | + - [toString (method)](#tostring-method) |
| 25 | + - [[Inspectable.NodeInspectSymbol] (method)](#inspectablenodeinspectsymbol-method) |
| 26 | + - [[Equal.symbol] (method)](#equalsymbol-method) |
| 27 | + - [[Hash.symbol] (method)](#hashsymbol-method) |
| 28 | + - [FromBytes](#frombytes-1) |
| 29 | + - [FromHex](#fromhex-1) |
| 30 | +- [testing](#testing) |
| 31 | + - [arbitrary](#arbitrary) |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +# encoding |
| 36 | + |
| 37 | +## toBytes |
| 38 | + |
| 39 | +Encode DatumHash to bytes. |
| 40 | + |
| 41 | +**Signature** |
| 42 | + |
| 43 | +```ts |
| 44 | +export declare const toBytes: (a: DatumHash, overrideOptions?: ParseOptions) => Uint8Array |
| 45 | +``` |
| 46 | +
|
| 47 | +Added in v2.0.0 |
| 48 | +
|
| 49 | +## toHex |
| 50 | +
|
| 51 | +Encode DatumHash to hex string. |
| 52 | +
|
| 53 | +**Signature** |
| 54 | +
|
| 55 | +```ts |
| 56 | +export declare const toHex: (a: DatumHash, overrideOptions?: ParseOptions) => string |
| 57 | +``` |
| 58 | +
|
| 59 | +Added in v2.0.0 |
| 60 | +
|
| 61 | +# parsing |
| 62 | +
|
| 63 | +## fromBytes |
| 64 | +
|
| 65 | +Parse DatumHash from bytes. |
| 66 | +
|
| 67 | +**Signature** |
| 68 | +
|
| 69 | +```ts |
| 70 | +export declare const fromBytes: (i: Uint8Array, overrideOptions?: ParseOptions) => DatumHash |
| 71 | +``` |
| 72 | +
|
| 73 | +Added in v2.0.0 |
| 74 | +
|
| 75 | +## fromHex |
| 76 | +
|
| 77 | +Parse DatumHash from hex string. |
| 78 | +
|
| 79 | +**Signature** |
| 80 | +
|
| 81 | +```ts |
| 82 | +export declare const fromHex: (i: string, overrideOptions?: ParseOptions) => DatumHash |
| 83 | +``` |
| 84 | +
|
| 85 | +Added in v2.0.0 |
| 86 | +
|
| 87 | +# predicates |
| 88 | +
|
| 89 | +## isDatumHash |
| 90 | +
|
| 91 | +Type guard to check if a value is a DatumHash. |
| 92 | +
|
| 93 | +**Signature** |
| 94 | +
|
| 95 | +```ts |
| 96 | +export declare const isDatumHash: (u: unknown, overrideOptions?: ParseOptions | number) => u is DatumHash |
| 97 | +``` |
| 98 | +
|
| 99 | +Added in v2.0.0 |
| 100 | +
|
| 101 | +# schemas |
| 102 | +
|
| 103 | +## DatumHash (class) |
| 104 | +
|
| 105 | +Schema for DatumHash representing a reference to datum data stored elsewhere via its hash. |
| 106 | +
|
| 107 | +**Signature** |
| 108 | +
|
| 109 | +```ts |
| 110 | +export declare class DatumHash |
| 111 | +``` |
| 112 | + |
| 113 | +Added in v2.0.0 |
| 114 | + |
| 115 | +### toJSON (method) |
| 116 | + |
| 117 | +**Signature** |
| 118 | + |
| 119 | +```ts |
| 120 | +toJSON() |
| 121 | +``` |
| 122 | + |
| 123 | +Added in v2.0.0 |
| 124 | + |
| 125 | +### toString (method) |
| 126 | + |
| 127 | +**Signature** |
| 128 | + |
| 129 | +```ts |
| 130 | +toString(): string |
| 131 | +``` |
| 132 | + |
| 133 | +Added in v2.0.0 |
| 134 | + |
| 135 | +### [Inspectable.NodeInspectSymbol] (method) |
| 136 | + |
| 137 | +**Signature** |
| 138 | + |
| 139 | +```ts |
| 140 | +[Inspectable.NodeInspectSymbol](): unknown |
| 141 | +``` |
| 142 | + |
| 143 | +Added in v2.0.0 |
| 144 | + |
| 145 | +### [Equal.symbol] (method) |
| 146 | + |
| 147 | +**Signature** |
| 148 | + |
| 149 | +```ts |
| 150 | +[Equal.symbol](that: unknown): boolean |
| 151 | +``` |
| 152 | + |
| 153 | +Added in v2.0.0 |
| 154 | + |
| 155 | +### [Hash.symbol] (method) |
| 156 | + |
| 157 | +**Signature** |
| 158 | + |
| 159 | +```ts |
| 160 | +[Hash.symbol](): number |
| 161 | +``` |
| 162 | + |
| 163 | +Added in v2.0.0 |
| 164 | + |
| 165 | +## FromBytes |
| 166 | + |
| 167 | +Schema for transforming bytes to DatumHash. |
| 168 | + |
| 169 | +**Signature** |
| 170 | + |
| 171 | +```ts |
| 172 | +export declare const FromBytes: Schema.transform< |
| 173 | + Schema.SchemaClass<Uint8Array, Uint8Array, never>, |
| 174 | + Schema.SchemaClass<DatumHash, DatumHash, never> |
| 175 | +> |
| 176 | +``` |
| 177 | + |
| 178 | +Added in v2.0.0 |
| 179 | + |
| 180 | +## FromHex |
| 181 | + |
| 182 | +Schema for transforming hex string to DatumHash. |
| 183 | + |
| 184 | +**Signature** |
| 185 | + |
| 186 | +```ts |
| 187 | +export declare const FromHex: Schema.transform< |
| 188 | + Schema.filter<Schema.Schema<Uint8Array, string, never>>, |
| 189 | + Schema.transform<Schema.SchemaClass<Uint8Array, Uint8Array, never>, Schema.SchemaClass<DatumHash, DatumHash, never>> |
| 190 | +> |
| 191 | +``` |
| 192 | + |
| 193 | +Added in v2.0.0 |
| 194 | + |
| 195 | +# testing |
| 196 | + |
| 197 | +## arbitrary |
| 198 | + |
| 199 | +FastCheck arbitrary for generating random DatumHash instances. |
| 200 | + |
| 201 | +**Signature** |
| 202 | + |
| 203 | +```ts |
| 204 | +export declare const arbitrary: FastCheck.Arbitrary<DatumHash> |
| 205 | +``` |
| 206 | + |
| 207 | +Added in v2.0.0 |
0 commit comments