|
1 | 1 | # @evolution-sdk/devnet |
2 | 2 |
|
| 3 | +## 1.1.9 |
| 4 | + |
| 5 | +### Patch Changes |
| 6 | + |
| 7 | +- [#115](https://github.com/IntersectMBO/evolution-sdk/pull/115) [`0503b96`](https://github.com/IntersectMBO/evolution-sdk/commit/0503b968735bc221b3f4d005d5c97ac8a0a1c592) Thanks [@solidsnakedev](https://github.com/solidsnakedev)! - ### TxBuilder Composition API |
| 8 | + |
| 9 | + Add `compose()` and `getPrograms()` methods for modular transaction building: |
| 10 | + |
| 11 | + ```ts |
| 12 | + // Create reusable builder fragments |
| 13 | + const mintBuilder = client |
| 14 | + .newTx() |
| 15 | + .mintAssets({ policyId, assets: { tokenName: 1n }, redeemer }) |
| 16 | + .attachScript({ script: mintingPolicy }) |
| 17 | + |
| 18 | + const metadataBuilder = client.newTx().attachMetadata({ label: 674n, metadata: "Composed transaction" }) |
| 19 | + |
| 20 | + // Compose multiple builders into one transaction |
| 21 | + const tx = await client |
| 22 | + .newTx() |
| 23 | + .payToAddress({ address, assets: { lovelace: 5_000_000n } }) |
| 24 | + .compose(mintBuilder) |
| 25 | + .compose(metadataBuilder) |
| 26 | + .build() |
| 27 | + ``` |
| 28 | + |
| 29 | + **Features:** |
| 30 | + - Merge operations from multiple builders into a single transaction |
| 31 | + - Snapshot accumulated operations with `getPrograms()` for inspection |
| 32 | + - Compose builders from different client instances |
| 33 | + - Works with all builder methods (payments, validity, metadata, minting, staking, etc.) |
| 34 | + |
| 35 | + ### Fixed Validity Interval Fee Calculation Bug |
| 36 | + |
| 37 | + Fixed bug where validity interval fields (`ttl` and `validityIntervalStart`) were not included during fee calculation, causing "insufficient fee" errors when using `setValidity()`. |
| 38 | + |
| 39 | + **Root Cause**: Validity fields were being added during transaction assembly AFTER fee calculation completed, causing the actual transaction to be 3-8 bytes larger than estimated. |
| 40 | + |
| 41 | + **Fix**: Convert validity Unix times to slots BEFORE the fee calculation loop and include them in the TransactionBody during size estimation. |
| 42 | + |
| 43 | + ### Error Type Corrections |
| 44 | + |
| 45 | + Corrected error types for pure constructor functions to use `never` instead of `TransactionBuilderError`: |
| 46 | + - `makeTxOutput` - creates TransactionOutput |
| 47 | + - `txOutputToTransactionOutput` - creates TransactionOutput |
| 48 | + - `mergeAssetsIntoUTxO` - creates UTxO |
| 49 | + - `mergeAssetsIntoOutput` - creates TransactionOutput |
| 50 | + - `buildTransactionInputs` - creates and sorts TransactionInputs |
| 51 | + |
| 52 | + ### Error Message Improvements |
| 53 | + |
| 54 | + Enhanced error messages throughout the builder to include underlying error details for better debugging. |
| 55 | + |
| 56 | +- Updated dependencies [[`59b6187`](https://github.com/IntersectMBO/evolution-sdk/commit/59b6187cc9d7080ed580341d92c7845d47125c7c), [`0503b96`](https://github.com/IntersectMBO/evolution-sdk/commit/0503b968735bc221b3f4d005d5c97ac8a0a1c592)]: |
| 57 | + - @evolution-sdk/aiken-uplc@0.0.1 |
| 58 | + - @evolution-sdk/evolution@0.3.9 |
| 59 | + |
3 | 60 | ## 1.1.8 |
4 | 61 |
|
5 | 62 | ### Patch Changes |
|
0 commit comments