Skip to content

Commit 3c1210b

Browse files
Merge pull request #110 from IntersectMBO/feat/add-required-signers-and-native-scripts-as-ref
feat/add required signers and native scripts as ref
2 parents b5a47fe + e58a03e commit 3c1210b

File tree

130 files changed

+1753
-288
lines changed

Some content is hidden

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

130 files changed

+1753
-288
lines changed

.changeset/common-ways-occur.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
"@evolution-sdk/evolution": patch
3+
---
4+
5+
### Native Scripts & Multi-Sig Support
6+
7+
- **`addSigner` operation**: Add required signers to transactions for multi-sig and script validation
8+
- **Native script minting**: Full support for `ScriptAll`, `ScriptAny`, `ScriptNOfK`, `InvalidBefore`, `InvalidHereafter`
9+
- **Reference scripts**: Use native scripts via `readFrom` instead of attaching them to transactions
10+
- **Multi-sig spending**: Spend from native script addresses with multi-party signing
11+
- **Improved fee calculation**: Accurate fee estimation for transactions with native scripts and reference scripts
12+
13+
### API Changes
14+
15+
- `UTxO.scriptRef` type changed from `ScriptRef` to `Script` for better type safety
16+
- `PayToAddressParams.scriptRef` renamed to `script` for consistency
17+
- Wallet `signTx` now accepts `referenceUtxos` context for native script signer detection
18+
- Client `signTx` auto-fetches reference UTxOs when signing transactions with reference inputs

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ parent: Modules
4343
- [arbitrary](#arbitrary)
4444
- [utilities](#utilities)
4545
- [countRequiredSigners](#countrequiredsigners)
46+
- [extractKeyHashes](#extractkeyhashes)
4647
- [utils](#utils)
4748
- [CDDLSchema](#cddlschema)
4849
- [FromCBORBytes](#fromcborbytes-1)
@@ -374,6 +375,19 @@ export declare const countRequiredSigners: (script: NativeScriptVariants) => num
374375

375376
Added in v2.0.0
376377

378+
## extractKeyHashes
379+
380+
Extract all key hashes from a native script.
381+
Recursively traverses nested scripts to find all ScriptPubKey key hashes.
382+
383+
**Signature**
384+
385+
```ts
386+
export declare const extractKeyHashes: (script: NativeScriptVariants) => ReadonlyArray<Uint8Array>
387+
```
388+
389+
Added in v2.0.0
390+
377391
# utils
378392

379393
## CDDLSchema

docs/content/docs/modules/core/UTxO.mdx

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ parent: Modules
2525
- [datumOptionToSDK](#datumoptiontosdk)
2626
- [fromSDK](#fromsdk)
2727
- [fromSDKArray](#fromsdkarray)
28-
- [scriptRefFromSDK](#scriptreffromsdk)
29-
- [scriptRefToSDKHex](#scriptreftosdkhex)
28+
- [scriptFromSDK](#scriptfromsdk)
29+
- [scriptToSDK](#scripttosdk)
3030
- [toArray](#toarray)
3131
- [toSDK](#tosdk)
3232
- [toSDKArray](#tosdkarray)
@@ -37,7 +37,6 @@ parent: Modules
3737
- [UTxO (class)](#utxo-class)
3838
- [toJSON (method)](#tojson-method)
3939
- [toString (method)](#tostring-method)
40-
- [[Inspectable.NodeInspectSymbol] (method)](#inspectablenodeinspectsymbol-method)
4140
- [[Equal.symbol] (method)](#equalsymbol-method)
4241
- [[Hash.symbol] (method)](#hashsymbol-method)
4342
- [models](#models)
@@ -207,29 +206,28 @@ export declare const fromSDKArray: (
207206
208207
Added in v2.0.0
209208
210-
## scriptRefFromSDK
209+
## scriptFromSDK
211210
212-
Convert SDK Script to Core ScriptRef.
211+
Convert SDK Script to Core Script.
213212
214213
**Signature**
215214
216215
```ts
217-
export declare const scriptRefFromSDK: (
218-
script: SDKScript.Script
219-
) => Effect.Effect<ScriptRef.ScriptRef, ParseResult.ParseError>
216+
export declare const scriptFromSDK: (
217+
sdkScript: SDKScript.Script
218+
) => Effect.Effect<Script.Script, ParseResult.ParseError>
220219
```
221220
222221
Added in v2.0.0
223222
224-
## scriptRefToSDKHex
223+
## scriptToSDK
225224
226-
Convert Core ScriptRef to SDK Script type string.
227-
Note: We lose the script type information as ScriptRef only stores bytes.
225+
Convert Core Script to SDK Script.
228226
229227
**Signature**
230228
231229
```ts
232-
export declare const scriptRefToSDKHex: (scriptRef: ScriptRef.ScriptRef) => string
230+
export declare const scriptToSDK: (script: Script.Script) => SDKScript.Script
233231
```
234232
235233
Added in v2.0.0
@@ -332,14 +330,6 @@ toJSON()
332330
toString(): string
333331
```
334332

335-
### [Inspectable.NodeInspectSymbol] (method)
336-
337-
**Signature**
338-
339-
```ts
340-
[Inspectable.NodeInspectSymbol](): unknown
341-
```
342-
343333
### [Equal.symbol] (method)
344334

345335
**Signature**

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: 180
3+
nav_order: 181
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: 181
3+
nav_order: 182
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: 182
3+
nav_order: 183
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: 183
3+
nav_order: 184
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: 184
3+
nav_order: 185
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: 185
3+
nav_order: 186
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: 186
3+
nav_order: 187
44
parent: Modules
55
---
66

0 commit comments

Comments
 (0)