Releases: CashScript/cashscript
Releases · CashScript/cashscript
v0.10.2
cashc compiler
- ✨ Add support for using underscores in numeric literals to improve readability, e.g.
1_000_000
. - ✨ Add support for using scientific notation in numeric literals, e.g.
1e6
or1E6
.
CashScript SDK
- 🐛 Fix fee calculation when using
SignatureAlgorithm.ECDSA
. - 🛠️ Clean up dependencies.
v0.10.1
v0.10.0
In this version we added proper debugging support for transactions and integration with the BitAuth IDE.
Thanks mainnet_pat for the initiative and significant contributions!
cashc compiler
- ✨ Add
console.log()
statements for debugging. - ✨ Extend
require()
statements to allow custom error messages for debugging. - 🛠️ Update artifact format to allow for new debugging features.
- 🛠️ Update dependencies to new major versions.
CashScript SDK
- ✨ Add support for transaction evaluation and debugging using libauth templates.
transaction.debug()
&transaction.bitauthUri()
- Output BitAuth IDE URI for debugging when transaction is rejected.
- ✨ Add
MockNetworkProvider
to simulate network interaction for debugging and testing.- Add
randomUtxo()
,randomToken()
andrandomNft()
functions to generate dummy UTXOs for testing.
- Add
- ✨ Add CashScript Jest utilities for automated testing.
expect(transaction).toLog(message)
expect(transaction).toFailRequire()
expect(transaction).toFailRequireWith(message)
- 🐛 Fix bug with type exports.
- 🛠️ Update visibility of several classes.
- Make
artifact
,networkProvider
,addressType
andencodedConstructorArgs
public onContract
class. - Make
contract
,abiFunction
,encodedFunctionArgs
,inputs
andoutputs
public onTransaction
class. - Make
networkProvider
,inputs
andoutputs
public onTransactionBuilder
class. - Make
privateKey
public onSignatureTemplate
class and addgetSignatureAlgorithm()
method.
- Make
- 🛠️ Improve some error messages.
- 🛠️ Add new
FailedRequireError
,FailedTransactionEvaluationError
andFailedTransactionError
classes. - 💥 BREAKING: Remove exported transaction error
Reason
enum +FailedTimeCheckError
andFailedSigCheckError
classes in favour of the new error classes. - 💥 BREAKING: Remove all deprecated references to
meep
includingmeep
strings from errors andtransaction.meep()
. - 💥 BREAKING: Separate the
Argument
type intoFunctionArgument
andConstructorArgument
and renameencodeArgument
toencodeFunctionArgument
.
https://twitter.com/CashScriptBCH/status/1833454128426615174
v0.9.3
v0.9.2
CashScript SDK
- 🐛 Fix bug where UTXOs would be needlessly retrieved from the network during
build()
calls. - 🐛 Fix off-by-one fee calculation error with transactions that have many outputs.
- 🐛 Fix bug where no error was thrown when invalid NFT commitment or token category were provided.
- 🛠️ Export all interfaces from CashScript's
interfaces.ts
. - 🛠️ Merge duplicate code between Transaction.ts and TransactionBuilder.ts
v0.9.1
v0.9.0
CashScript SDK
- ✨ Add new advanced
TransactionBuilder
class that allows combining UTXOs from multiple different smart contracts and P2PKH UTXOs in a single transaction. - 🛠️ Deprecate all
meep
functionality. Meep has been unmaintained for years and does not support many new CashScript features. Meep functionality will be removed in a future release.
v0.8.2
v0.8.1
v0.8.0
require()
to import cashscript
or cashc
.
This release also contains several breaking changes, please refer to the migration notes for more information.
cashc compiler
- ✨ Add support for the new CashTokens introspection functionality (
tokenCategory
,nftCommitment
andtokenAmount
for both in- and outputs). - ✨ Add
LockingBytecodeP2SH32
to generate the new P2SH32 standard locking script. - 🐛 Fix optimisation bug that caused
OP_0NOTEQUAL
to be applied to non-integer values. - 💥 BREAKING: Move to Pure ESM.
- 💥 BREAKING: Rename
LockingBytecodeP2SH
toLockingBytecodeP2SH20
- but it is recommended to change over to the new P2SH32 for security reasons.
CashScript SDK
- ✨ Add support for CashTokens.
.to()
now takes atoken
parameter that can be used to send CashTokens.- UTXOs that are retrieved with
contract.getUtxos()
include atoken
field if they are token UTXOs. - UTXOs that are passed into
.from()
can also include thistoken
field to send tokens. - Add
.withoutTokenChange()
to disable automatic token change outputs. - Note that only the
ElectrumNetworkProvider
supports CashTokens at this time. - Note that NFTs do not support automatic UTXO selection
- ✨ Add
contract.tokenAddress
to get the token-enabled address of a contract. - ✨ Add
fromP2PKH()
to add P2PKH inputs to a smart contract transaction.- Note: this was in the SDK before as
experimentalFromP2PKH()
. It has now been released as an official feature.
- Note: this was in the SDK before as
- 💥 BREAKING: Move to Pure ESM.
- 💥 BREAKING: Remove
"testnet"
&"staging"
network options. - 💥 BREAKING:
contract.address
returnsp2sh32
address by default, this can be configured to bep2sh20
on contract initialization. - 💥 BREAKING: Move the configuration of the network provider to an options object on contract initialization.
- 💥 BREAKING: Use
bigint
rather thannumber
for all instances of "script numbers" (e.g. function arguments) and satoshi amounts. - 💥 BREAKING: Replace
contract.getRedeemScriptHex()
withcontract.bytecode
. - 💥 BREAKING: Remove
BitboxNetworkProvider
. - 💥 BREAKING: All signature templates use
SIGHASH_ALL | SIGHASH_UTXOS
now, this new default can be overwritten in the constructor of theSignatureTemplate
.