Skip to content

Commit e8236d1

Browse files
committed
Update migration notes for v0.12
1 parent 10e5b5b commit e8236d1

File tree

2 files changed

+53
-6
lines changed

2 files changed

+53
-6
lines changed

website/docs/releases/migration-notes.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,53 @@
22
title: Migration Notes
33
---
44

5+
## v0.11 to v0.12
6+
7+
There are several breaking changes to the SDK in this release.
8+
9+
### CashScript SDK
10+
11+
#### Old Transaction Builder Removal
12+
13+
The most impactful breaking change is the removal of the deprecated 'Simple Transaction Builder'. See [below for steps to migrate to the new transaction builder](/docs/releases/migration-notes#sdk-transaction-builder).
14+
15+
#### Contract constructor
16+
Before, the `provider` option was optional in the `Contract` constructor. This is no longer the case.
17+
18+
```ts
19+
// Before: defaults to mainnet ElectrumNetworkProvider
20+
const contract = new Contract(artifact, constructorArgs);
21+
22+
// After: explicitly specify the provider
23+
const provider = new ElectrumNetworkProvider('mainnet');
24+
const contract = new Contract(artifact, constructorArgs, { provider });
25+
```
26+
27+
#### Transaction Builder Max Fee
28+
Before, the `setMaxFee()` method was used to set the maximum fee for the transaction. This was replaced with the `maximumFeeSatoshis` option in the constructor. Additionally, the `maximumFeeSatsPerByte` option was added.
29+
30+
```ts
31+
// Before: setMaxFee() was used to set the maximum fee
32+
const builder = new TransactionBuilder({ provider }).setMaxFee(1000n);
33+
34+
// After: maximumFeeSatoshis option was added to the constructor
35+
const builder = new TransactionBuilder({ provider, maximumFeeSatoshis: 1000n });
36+
```
37+
38+
#### MockNetworkProvider
39+
40+
Before, the `updateUtxoSet` option was `false` by default for the `MockNetworkProvider`. This is now `true` by default to better match real-world network behaviour.
41+
42+
```ts
43+
// Before: updateUtxoSet is false by default
44+
const provider = new MockNetworkProvider();
45+
46+
// After: updateUtxoSet is true by default, if you want to keep the old behaviour, set it to false
47+
const provider = new MockNetworkProvider({ updateUtxoSet: false });
48+
```
49+
50+
Earlier, the `MockNetworkProvider` also automatically added some test UTXOs to the provider, which is no longer the case. Make sure to add any UTXOs you need manually.
51+
552
## v0.10 to v0.11
653

754
There are several breaking changes to the compiler and SDK in this release. They are listed below in their own sections.

website/docs/releases/release-notes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ title: Release Notes
44

55
## v0.12.0
66

7-
#### CashScript SDK
8-
- :boom: **BREAKING**: Set `updateUtxoSet` to `true` by default for `MockNetworkProvider`.
9-
- :boom: **BREAKING**: Make `provider` a required option in `Contract` constructor.
10-
- :boom: **BREAKING**: Remove deprecated "old" transaction builder (`contract.functions`).
11-
- :boom: **BREAKING**: No longer seed the MockNetworkProvider with any test UTXOs.
12-
- :boom: **BREAKING**: Replace `setMaxFee()` method on `TransactionBuilder` with `TransactionBuilderOptions` on the constructor.
7+
#### CashScript SDK`TransactionBuilderOptions` on the constructor.
138
- :sparkles: Add `maximumFeeSatsPerByte` and `allowImplicitFungibleTokenBurn` options to `TransactionBuilder` constructor.
149
- :sparkles: Add a configurable `vmTarget` option to `MockNetworkProvider`.
1510
- :sparkles: Add support for ECDSA signatures in contract unlockers for `sig` and `datasig` parameters.
1611
- :sparkles: Add `signMessageHash()` method to `SignatureTemplate` to allow for signing of non-transaction messages.
12+
- :boom: **BREAKING**: Remove deprecated "old" transaction builder (`contract.functions`).
13+
- :boom: **BREAKING**: Make `provider` a required option in `Contract` constructor.
14+
- :boom: **BREAKING**: Set `updateUtxoSet` to `true` by default for `MockNetworkProvider`.
15+
- :boom: **BREAKING**: No longer seed the MockNetworkProvider with any test UTXOs.
16+
- :boom: **BREAKING**: Replace `setMaxFee()` method on `TransactionBuilder` with
1717
- :hammer_and_wrench: Improve libauth template generation.
1818
- :bug: Fix bug where `SignatureTemplate` would not accept private key hex strings as a signer.
1919

0 commit comments

Comments
 (0)