Skip to content

Releases: CashScript/cashscript

v0.13.1

11 Jun 09:11

Choose a tag to compare

cashc compiler

  • ✨ Allow custom CashScriptErrorListener to be passed to the compiler.
  • 🐛 Fix missing location data in tuple assignment errors.

CashScript SDK

  • ✨ In the MockNetworkProvider, addUtxo() now returns the added UTXO.

v0.12.2

11 Jun 09:07

Choose a tag to compare

cashc compiler

  • ✨ Backport from v0.13.1: allow custom CashScriptErrorListener to be passed to the compiler.
  • 🐛 Backport from v0.13.1: fix missing location data in tuple assignment errors.

v0.13.0

26 May 08:53
a346166

Choose a tag to compare

This release contains several breaking changes, please refer to the migration notes for more information.

cashc compiler

  • ✨ Add support for for, while and do-while loops.
  • ✨ Add support for compound assignment operators (+=, -=) and increment/decrement operators (++, --).
  • ✨ Add support for bitwise and arithmetic shift operators (<<, >>) and bitwise inversion (~).
  • ✨ Add fingerprint field to artifact to allow for fingerprinting of the contract bytecode.
  • ✨ Add unsafe_bool() and unsafe_int() casting for semantic-only casts.
  • ✨ Add support for narrowing bytes types after x.length == N and checks in require or if statements.
  • 🛠️ BREAKING: Automatically inject require(tx.time >= tx.locktime) when a function uses tx.locktime without a tx.time check in scope, ensuring the spending input is non-final so nLockTime is enforced. This can be disabled with the enforceLocktimeGuard: false compiler option (CLI: --skip-enforce-locktime-guard).
  • 🛠️ BREAKING: Function parameter types are now strictly enforced (bounded bytes and boolean values). This can be disabled with the enforceFunctionParameterTypes: false compiler option (CLI: --skip-enforce-function-parameter-types).
  • 🐛 Fix issue where casting bytes larger than bytes8 to int was not allowed.
  • 🐛 Fix issue where empty bytecode contracts were not properly compiled.
  • 🐛 BREAKING: Fix issue where bool() casting did not change the value of the argument.
  • 💥 BREAKING: Rename bytes4(int) and bytes(int, 4) to toPaddedBytes(int, 4).
  • 💥 BREAKING: Rename bytes4(bytes) to unsafe_bytes4(bytes).
  • 🐎 Add optimisations for negated number comparisons and boolean comparisons.

CashScript SDK

  • ✨ Add support for loops in debug tooling.
  • ✨ Add support for p2s contract type.
  • ✨ Add addBchChangeOutputIfNeeded() method to TransactionBuilder class.
  • ✨ Add addTokenChangeOutputIfNeeded() method to TransactionBuilder class for adding a fungible token change output for a specific category.
  • ✨ Add getTransactionSize method to TransactionBuilder class.
  • ✨ Add lockingBytecode property to Contract class.
  • ✨ Add getUtxosForLockingBytecode() method to ElectrumNetworkProvider class and MockNetworkProvider interface.
  • ✨ In the MockNetworkProvider, addUtxo() now also allows UTXOs to be added by locking bytecode.
  • ✨ Add gatherBchUtxos() and gatherFungibleTokenUtxos() functions to the SDK for gathering UTXOs.
  • ✨ Add specific network error classes to standardise error handling in network providers.
  • ✨ Add TSDoc strings for all public classes and methods.
  • 🐛 Fix issue where FailedTransactionError would not show underlying error if BitAuth URI generation failed.
  • 💥 BREAKING: Remove BitcoinRpcNetworkProvider and FullStackNetworkProvider from the SDK.
  • 🛠️ BREAKING: Rename addressType option on Contract constructor to contractType.
  • 🛠️ BREAKING: Remove undocumented redeemScript property from Contract class.
  • 🛠️ BREAKING: Remove undocumented buildLibauthTransaction() method from TransactionBuilder class.
  • 🛠️ Update default VM target to BCH_2026_05.
  • 🛠️ Improve validation when adding outputs to a transaction.
  • 🛠️ Improve package size by tidying up dependencies.

Testing Suite

  • 🛠️ Add README.md to help guide users on how to use the testing suite.
  • 🛠️ Compile all contracts in the contracts/ directory and save the artifacts in the artifacts/ directory.
  • 🛠️ Compile TS artifacts as well as JSON artifacts.
  • 🛠️ Add key management utilities for testing.

v0.12.1

11 Dec 11:58
e2e12ba

Choose a tag to compare

CashScript SDK

  • ✨ Add Vitest extensions for automated testing (PR by @hereje)

v0.12.0

02 Oct 10:01

Choose a tag to compare

CashScript SDK

  • ✨ Add getVmResourceUsage method to TransactionBuilder.
  • ✨ Add maximumFeeSatsPerByte and allowImplicitFungibleTokenBurn options to TransactionBuilder constructor.
  • ✨ Add a configurable vmTarget option to MockNetworkProvider.
  • ✨ Add support for ECDSA signatures in contract unlockers for sig and datasig parameters.
  • ✨ Add signMessageHash() method to SignatureTemplate to allow for signing of non-transaction messages.
  • 💥 BREAKING: Remove deprecated "old" transaction builder (contract.functions).
  • 💥 BREAKING: Make provider a required option in Contract constructor.
  • 💥 BREAKING: Set updateUtxoSet to true by default for MockNetworkProvider.
  • 💥 BREAKING: No longer seed the MockNetworkProvider with any test UTXOs.
  • 💥 BREAKING: Replace setMaxFee() method on TransactionBuilder with maximumFeeSatoshis option.
  • 💥 BREAKING: Rename bitauthUri() method on TransactionBuilder to getBitauthUri() for consistency.
  • 🛠️ Improve libauth template generation.
  • 🐛 Fix bug where SignatureTemplate would not accept private key hex strings as a signer.

v0.11.5

29 Aug 10:00

Choose a tag to compare

CashScript SDK

  • ✨ Include input index in console.log statements for debugging.
  • ✨ Improve type inference for function and constructor arguments in the Contract class.
  • 🛠️ Replace redundant dependencies.
  • 🐛 Remove accidental dependency inclusion of @types/node.

v0.11.4

06 Aug 14:51
d878d06

Choose a tag to compare

CashScript SDK

  • ✨ Add updateUtxoSet option to MockNetworkProvider to allow for updating the UTXO set after a transaction is sent (PR by @mainnet-pat).
  • 🐛 Fix bug where sending P2PKH-only transactions would throw No placeholder scenario ID or script ID found (PR by @mainnet-pat).

v0.11.3

23 Jul 14:16

Choose a tag to compare

cashc compiler

  • ✨ Add .slice(start, end) operator for bytes and strings.
  • ✨ Add bounded bytes typing and bounds checking for .split() (includes checking for negative indices).
  • 🐎 Add optimisation for .slice(0, x) and .slice(x, y.length) (also applies to .split(0)[1]).
  • 🐛 Disallow incorrect bounded bytes typing when using .split().

CashScript SDK

  • 🐛 Fix bug with where ElectrumNetworkProvider would disconnect in browser on visibility change of the page.

v0.11.2

10 Jul 08:25

Choose a tag to compare

CashScript SDK

  • 🐛 Fix bug with new generateWcTransactionObject() throwing when using placeholderP2PKHUnlocker()

v0.11.1

08 Jul 09:26

Choose a tag to compare

CashScript SDK

  • ✨ Add generateWcTransactionObject() method to TransactionBuilder to generate a WcTransactionObject that can be used to sign a transaction with a WalletConnect client.
  • ✨ Add placeholderSignature(), placeholderPublicKey() and placeholderP2PKHUnlocker() helper functions to the SDK for WalletConnect usage.

https://x.com/CashScriptBCH/status/1942513305420968238