Skip to content

Commit bc4c082

Browse files
committed
docs: add docs
1 parent cd1a07d commit bc4c082

File tree

100 files changed

+454
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+454
-132
lines changed

docs/content/docs/modules/core/Mint.mdx

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ parent: Modules
1919
- [encoding](#encoding)
2020
- [toCBORBytes](#tocborbytes)
2121
- [toCBORHex](#tocborhex)
22+
- [lookup](#lookup)
23+
- [getAssetsByPolicyHex](#getassetsbypolicyhex)
24+
- [getByHex](#getbyhex)
2225
- [model](#model)
2326
- [Mint (class)](#mint-class)
2427
- [toJSON (method)](#tojson-method)
@@ -42,11 +45,11 @@ parent: Modules
4245
- [get](#get)
4346
- [insert](#insert)
4447
- [policyCount](#policycount)
48+
- [removeAsset](#removeasset)
4549
- [removePolicy](#removepolicy)
4650
- [utils](#utils)
4751
- [AssetMap (type alias)](#assetmap-type-alias)
4852
- [CDDLSchema](#cddlschema)
49-
- [removeAsset](#removeasset)
5053

5154
---
5255

@@ -134,6 +137,41 @@ export declare const toCBORHex: (mint: Mint, options?: CBOR.CodecOptions) => str
134137
135138
Added in v2.0.0
136139
140+
# lookup
141+
142+
## getAssetsByPolicyHex
143+
144+
Get the asset map for a specific policy by hex string.
145+
Uses content-based equality (Equal.equals) to find matching PolicyId.
146+
147+
**Signature**
148+
149+
```ts
150+
export declare const getAssetsByPolicyHex: (
151+
mint: Mint,
152+
policyIdHex: string
153+
) => Map<AssetName.AssetName, NonZeroInt64.NonZeroInt64> | undefined
154+
```
155+
156+
Added in v2.0.0
157+
158+
## getByHex
159+
160+
Get an asset amount by policy ID hex and asset name hex strings.
161+
Convenience function for tests and lookups using hex strings.
162+
163+
**Signature**
164+
165+
```ts
166+
export declare const getByHex: (
167+
mint: Mint,
168+
policyIdHex: string,
169+
assetNameHex: string
170+
) => NonZeroInt64.NonZeroInt64 | undefined
171+
```
172+
173+
Added in v2.0.0
174+
137175
# model
138176
139177
## Mint (class)
@@ -393,6 +431,7 @@ Added in v2.0.0
393431
## get
394432
395433
Get the amount for a specific policy and asset.
434+
Uses content-based equality (Equal.equals) to find matching PolicyId and AssetName.
396435
397436
**Signature**
398437
@@ -409,6 +448,8 @@ Added in v2.0.0
409448
## insert
410449
411450
Add or update an asset in the Mint.
451+
Uses content-based equality (Equal.equals) to find matching PolicyId and AssetName
452+
since JavaScript Maps use reference equality by default.
412453
413454
**Signature**
414455
@@ -435,9 +476,23 @@ export declare const policyCount: (mint: Mint) => number
435476
436477
Added in v2.0.0
437478
438-
## removePolicy
479+
## removeAsset
439480
440481
Remove an asset from the Mint.
482+
Uses content-based equality (Equal.equals) to find matching PolicyId and AssetName.
483+
484+
**Signature**
485+
486+
```ts
487+
export declare const removeAsset: (mint: Mint, policyId: PolicyId.PolicyId, assetName: AssetName.AssetName) => Mint
488+
```
489+
490+
Added in v2.0.0
491+
492+
## removePolicy
493+
494+
Remove a policy from the Mint.
495+
Uses content-based equality (Equal.equals) to find matching PolicyId.
441496
442497
**Signature**
443498
@@ -467,11 +522,3 @@ export declare const CDDLSchema: Schema.MapFromSelf<
467522
Schema.MapFromSelf<typeof Schema.Uint8ArrayFromSelf, typeof Schema.BigIntFromSelf>
468523
>
469524
```
470-
471-
## removeAsset
472-
473-
**Signature**
474-
475-
```ts
476-
export declare const removeAsset: (mint: Mint, policyId: PolicyId.PolicyId, assetName: AssetName.AssetName) => Mint
477-
```

docs/content/docs/modules/core/NativeScripts.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ parent: Modules
4141
- [NativeScriptVariants](#nativescriptvariants)
4242
- [testing](#testing)
4343
- [arbitrary](#arbitrary)
44+
- [utilities](#utilities)
45+
- [countRequiredSigners](#countrequiredsigners)
4446
- [utils](#utils)
4547
- [CDDLSchema](#cddlschema)
4648
- [FromCBORBytes](#fromcborbytes-1)
@@ -349,6 +351,29 @@ export declare const arbitrary: FastCheck.Arbitrary<NativeScript>
349351

350352
Added in v2.0.0
351353

354+
# utilities
355+
356+
## countRequiredSigners
357+
358+
Count the maximum number of key hashes (signers) required to satisfy a native script.
359+
This is used for fee calculation to ensure the fake witness set has the correct size.
360+
361+
Algorithm:
362+
363+
- ScriptPubKey: 1 signer required
364+
- ScriptAll: sum of all nested scripts (all must be satisfied)
365+
- ScriptAny: maximum of nested scripts (pessimistic - assume most expensive path)
366+
- ScriptNOfK: sum of top N most expensive nested scripts
367+
- InvalidBefore/InvalidHereafter: 0 signers (time-based only)
368+
369+
**Signature**
370+
371+
```ts
372+
export declare const countRequiredSigners: (script: NativeScriptVariants) => number
373+
```
374+
375+
Added in v2.0.0
376+
352377
# utils
353378

354379
## CDDLSchema

docs/content/docs/modules/sdk/Credential.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/Credential.ts
3-
nav_order: 175
3+
nav_order: 176
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/Datum.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/Datum.ts
3-
nav_order: 176
3+
nav_order: 177
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/Delegation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/Delegation.ts
3-
nav_order: 177
3+
nav_order: 178
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/EvalRedeemer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/EvalRedeemer.ts
3-
nav_order: 178
3+
nav_order: 179
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/Network.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/Network.ts
3-
nav_order: 179
3+
nav_order: 180
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/OutRef.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/OutRef.ts
3-
nav_order: 180
3+
nav_order: 181
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/PolicyId.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/PolicyId.ts
3-
nav_order: 181
3+
nav_order: 182
44
parent: Modules
55
---
66

docs/content/docs/modules/sdk/PoolParams.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: sdk/PoolParams.ts
3-
nav_order: 182
3+
nav_order: 183
44
parent: Modules
55
---
66

0 commit comments

Comments
 (0)