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
.