Closed emergent-reasons closed 8 months ago
If this is the case, it (kinda) blocks passing the options through mainnet-js too...
Today I used patch-package to patch cashscript@0.9.1
for the project I'm working on.
Just needed the typing for ContractOptions
. I was able to get it this way with Sahid's help:
ConstructorParameters<typeof Contract>[2]
but he also mentioned this tool for submitting an easy patch (maybe).
Here is the diff that solved my problem:
diff --git a/node_modules/cashscript/dist/index.d.ts b/node_modules/cashscript/dist/index.d.ts
index 4dc79b9..f95cb4a 100644
--- a/node_modules/cashscript/dist/index.d.ts
+++ b/node_modules/cashscript/dist/index.d.ts
@@ -6,6 +6,6 @@ export { TransactionBuilder } from './TransactionBuilder.js';
export { Argument, encodeArgument } from './Argument.js';
export { Artifact, AbiFunction, AbiInput } from '@cashscript/utils';
export * as utils from '@cashscript/utils';
-export { Utxo, Recipient, SignatureAlgorithm, HashType, Network, isUtxoP2PKH, } from './interfaces.js';
+export { ContractOptions, Utxo, Recipient, SignatureAlgorithm, HashType, Network, isUtxoP2PKH, } from './interfaces.js';
export * from './Errors.js';
export { NetworkProvider, BitcoinRpcNetworkProvider, ElectrumNetworkProvider, FullStackNetworkProvider, } from './network/index.js';
This issue body was partially generated by patch-package.
Yeah we should definitely export it. Thanks for opening the issue, looks like you were able to workaround it for now. So I think we'll release a new version with this fixed next Wednesday.
We just exported this in v0.9.2.
I mean this one in the constructor: