@opcat-labs/scrypt-ts-opcat 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/.templates/smart-contract/builtin-libs/TxHashPreimageUtils.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/TxHashPreimageUtils.scrypt.tpl +18 -0
- package/assets/.templates/smart-contract/builtin-libs/TxHashPreimageUtils.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/backtrace.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/backtrace.scrypt.tpl +36 -0
- package/assets/.templates/smart-contract/builtin-libs/backtrace.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/byteStringReader.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/byteStringReader.scrypt.tpl +64 -0
- package/assets/.templates/smart-contract/builtin-libs/byteStringReader.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/byteStringWriter.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/byteStringWriter.scrypt.tpl +48 -0
- package/assets/.templates/smart-contract/builtin-libs/byteStringWriter.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/contextUtils.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/contextUtils.scrypt.tpl +101 -0
- package/assets/.templates/smart-contract/builtin-libs/contextUtils.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/p2pk.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/p2pk.scrypt.tpl +7 -0
- package/assets/.templates/smart-contract/builtin-libs/p2pk.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/p2pkh.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/p2pkh.scrypt.tpl +8 -0
- package/assets/.templates/smart-contract/builtin-libs/p2pkh.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/stateLib.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/stateLib.scrypt.tpl +3 -0
- package/assets/.templates/smart-contract/builtin-libs/stateLib.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/stateUtils.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/stateUtils.scrypt.tpl +7 -0
- package/assets/.templates/smart-contract/builtin-libs/stateUtils.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/stdUtils.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/stdUtils.scrypt.tpl +89 -0
- package/assets/.templates/smart-contract/builtin-libs/stdUtils.transformer.json +7 -0
- package/assets/.templates/smart-contract/builtin-libs/txUtils.scrypt.map +1 -0
- package/assets/.templates/smart-contract/builtin-libs/txUtils.scrypt.tpl +42 -0
- package/assets/.templates/smart-contract/builtin-libs/txUtils.transformer.json +7 -0
- package/assets/.templates/smart-contract/types/structs.scrypt.map +1 -0
- package/assets/.templates/smart-contract/types/structs.scrypt.tpl +48 -0
- package/assets/.templates/smart-contract/types/structs.transformer.json +7 -0
- package/assets/smart-contract/builtin-libs/TxHashPreimageUtils.scrypt +20 -0
- package/assets/smart-contract/builtin-libs/backtrace.scrypt +38 -0
- package/assets/smart-contract/builtin-libs/byteStringReader.scrypt +66 -0
- package/assets/smart-contract/builtin-libs/byteStringWriter.scrypt +50 -0
- package/assets/smart-contract/builtin-libs/contextUtils.scrypt +103 -0
- package/assets/smart-contract/builtin-libs/p2pk.scrypt +9 -0
- package/assets/smart-contract/builtin-libs/p2pkh.scrypt +10 -0
- package/assets/smart-contract/builtin-libs/stateLib.scrypt +5 -0
- package/assets/smart-contract/builtin-libs/stateUtils.scrypt +9 -0
- package/assets/smart-contract/builtin-libs/stdUtils.scrypt +91 -0
- package/assets/smart-contract/builtin-libs/txUtils.scrypt +44 -0
- package/assets/smart-contract/types/structs.scrypt +50 -0
- package/dist/cjs/features/call.cjs +38 -0
- package/dist/cjs/features/call.js.map +1 -0
- package/dist/cjs/features/deploy.cjs +33 -0
- package/dist/cjs/features/deploy.js.map +1 -0
- package/dist/cjs/features/index.cjs +8 -0
- package/dist/cjs/features/index.js.map +1 -0
- package/dist/cjs/globalTypes.cjs +3 -0
- package/dist/cjs/globalTypes.js.map +1 -0
- package/dist/cjs/index.cjs +55 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/networks.cjs +69 -0
- package/dist/cjs/networks.js.map +1 -0
- package/dist/cjs/providers/chainProvider.cjs +3 -0
- package/dist/cjs/providers/chainProvider.js.map +1 -0
- package/dist/cjs/providers/dummyProvider.cjs +87 -0
- package/dist/cjs/providers/dummyProvider.js.map +1 -0
- package/dist/cjs/providers/index.cjs +13 -0
- package/dist/cjs/providers/index.js.map +1 -0
- package/dist/cjs/providers/mempoolProvider.cjs +207 -0
- package/dist/cjs/providers/mempoolProvider.js.map +1 -0
- package/dist/cjs/providers/rpcProvider.cjs +296 -0
- package/dist/cjs/providers/rpcProvider.js.map +1 -0
- package/dist/cjs/providers/utxoProvider.cjs +18 -0
- package/dist/cjs/providers/utxoProvider.js.map +1 -0
- package/dist/cjs/psbt/bip66.cjs +182 -0
- package/dist/cjs/psbt/bip66.js.map +1 -0
- package/dist/cjs/psbt/bufferutils.cjs +186 -0
- package/dist/cjs/psbt/bufferutils.js.map +1 -0
- package/dist/cjs/psbt/contextProvider.cjs +111 -0
- package/dist/cjs/psbt/contextProvider.js.map +1 -0
- package/dist/cjs/psbt/extPsbt.cjs +589 -0
- package/dist/cjs/psbt/extPsbt.js.map +1 -0
- package/dist/cjs/psbt/psbt.cjs +973 -0
- package/dist/cjs/psbt/psbt.js.map +1 -0
- package/dist/cjs/psbt/psbtutils.cjs +140 -0
- package/dist/cjs/psbt/psbtutils.js.map +1 -0
- package/dist/cjs/psbt/signatureutils.cjs +230 -0
- package/dist/cjs/psbt/signatureutils.js.map +1 -0
- package/dist/cjs/psbt/types.cjs +3 -0
- package/dist/cjs/psbt/types.js.map +1 -0
- package/dist/cjs/signer.cjs +3 -0
- package/dist/cjs/signer.js.map +1 -0
- package/dist/cjs/signers/defaultSigner.cjs +68 -0
- package/dist/cjs/signers/defaultSigner.js.map +1 -0
- package/dist/cjs/signers/index.cjs +8 -0
- package/dist/cjs/signers/index.js.map +1 -0
- package/dist/cjs/signers/unisatSigner.cjs +38 -0
- package/dist/cjs/signers/unisatSigner.js.map +1 -0
- package/dist/cjs/smart-contract/abi.cjs +380 -0
- package/dist/cjs/smart-contract/abi.js.map +1 -0
- package/dist/cjs/smart-contract/abiutils.cjs +183 -0
- package/dist/cjs/smart-contract/abiutils.js.map +1 -0
- package/dist/cjs/smart-contract/abstractContract.cjs +25 -0
- package/dist/cjs/smart-contract/abstractContract.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/backtrace.cjs +102 -0
- package/dist/cjs/smart-contract/builtin-libs/backtrace.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/byteStringReader.cjs +138 -0
- package/dist/cjs/smart-contract/builtin-libs/byteStringReader.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/byteStringWriter.cjs +109 -0
- package/dist/cjs/smart-contract/builtin-libs/byteStringWriter.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/contextUtils.cjs +304 -0
- package/dist/cjs/smart-contract/builtin-libs/contextUtils.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/index.cjs +18 -0
- package/dist/cjs/smart-contract/builtin-libs/index.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/p2pk.cjs +74 -0
- package/dist/cjs/smart-contract/builtin-libs/p2pk.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/p2pkh.cjs +80 -0
- package/dist/cjs/smart-contract/builtin-libs/p2pkh.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/stateLib.cjs +65 -0
- package/dist/cjs/smart-contract/builtin-libs/stateLib.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/stateUtils.cjs +42 -0
- package/dist/cjs/smart-contract/builtin-libs/stateUtils.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/stdUtils.cjs +192 -0
- package/dist/cjs/smart-contract/builtin-libs/stdUtils.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/txHashPreimageUtils.cjs +56 -0
- package/dist/cjs/smart-contract/builtin-libs/txHashPreimageUtils.js.map +1 -0
- package/dist/cjs/smart-contract/builtin-libs/txUtils.cjs +183 -0
- package/dist/cjs/smart-contract/builtin-libs/txUtils.js.map +1 -0
- package/dist/cjs/smart-contract/consts.cjs +100 -0
- package/dist/cjs/smart-contract/consts.js.map +1 -0
- package/dist/cjs/smart-contract/decorators.cjs +83 -0
- package/dist/cjs/smart-contract/decorators.js.map +1 -0
- package/dist/cjs/smart-contract/fns/assert.cjs +17 -0
- package/dist/cjs/smart-contract/fns/assert.js.map +1 -0
- package/dist/cjs/smart-contract/fns/bitwise.cjs +141 -0
- package/dist/cjs/smart-contract/fns/bitwise.js.map +1 -0
- package/dist/cjs/smart-contract/fns/byteString.cjs +106 -0
- package/dist/cjs/smart-contract/fns/byteString.js.map +1 -0
- package/dist/cjs/smart-contract/fns/equals.cjs +66 -0
- package/dist/cjs/smart-contract/fns/equals.js.map +1 -0
- package/dist/cjs/smart-contract/fns/fill.cjs +19 -0
- package/dist/cjs/smart-contract/fns/fill.js.map +1 -0
- package/dist/cjs/smart-contract/fns/hashes.cjs +81 -0
- package/dist/cjs/smart-contract/fns/hashes.js.map +1 -0
- package/dist/cjs/smart-contract/fns/index.cjs +37 -0
- package/dist/cjs/smart-contract/fns/index.js.map +1 -0
- package/dist/cjs/smart-contract/fns/math.cjs +52 -0
- package/dist/cjs/smart-contract/fns/math.js.map +1 -0
- package/dist/cjs/smart-contract/fns/pubKey2Addr.cjs +17 -0
- package/dist/cjs/smart-contract/fns/pubKey2Addr.js.map +1 -0
- package/dist/cjs/smart-contract/methods/backtraceToGenensis.cjs +41 -0
- package/dist/cjs/smart-contract/methods/backtraceToGenensis.js.map +1 -0
- package/dist/cjs/smart-contract/methods/buildOutput.cjs +41 -0
- package/dist/cjs/smart-contract/methods/buildOutput.js.map +1 -0
- package/dist/cjs/smart-contract/methods/checkCtx.cjs +58 -0
- package/dist/cjs/smart-contract/methods/checkCtx.js.map +1 -0
- package/dist/cjs/smart-contract/methods/checkInputState.cjs +16 -0
- package/dist/cjs/smart-contract/methods/checkInputState.js.map +1 -0
- package/dist/cjs/smart-contract/methods/checkInputStateHashes.cjs +16 -0
- package/dist/cjs/smart-contract/methods/checkInputStateHashes.js.map +1 -0
- package/dist/cjs/smart-contract/methods/checkSHPreimage.cjs +17 -0
- package/dist/cjs/smart-contract/methods/checkSHPreimage.js.map +1 -0
- package/dist/cjs/smart-contract/methods/checkSig.cjs +77 -0
- package/dist/cjs/smart-contract/methods/checkSig.js.map +1 -0
- package/dist/cjs/smart-contract/serializer.cjs +145 -0
- package/dist/cjs/smart-contract/serializer.js.map +1 -0
- package/dist/cjs/smart-contract/smartContract.cjs +568 -0
- package/dist/cjs/smart-contract/smartContract.js.map +1 -0
- package/dist/cjs/smart-contract/smartContractLib.cjs +46 -0
- package/dist/cjs/smart-contract/smartContractLib.js.map +1 -0
- package/dist/cjs/smart-contract/stateSerializer.cjs +134 -0
- package/dist/cjs/smart-contract/stateSerializer.js.map +1 -0
- package/dist/cjs/smart-contract/types/abi.cjs +69 -0
- package/dist/cjs/smart-contract/types/abi.js.map +1 -0
- package/dist/cjs/smart-contract/types/artifact.cjs +16 -0
- package/dist/cjs/smart-contract/types/artifact.js.map +1 -0
- package/dist/cjs/smart-contract/types/bn.cjs +117 -0
- package/dist/cjs/smart-contract/types/bn.js.map +1 -0
- package/dist/cjs/smart-contract/types/context.cjs +3 -0
- package/dist/cjs/smart-contract/types/context.js.map +1 -0
- package/dist/cjs/smart-contract/types/index.cjs +16 -0
- package/dist/cjs/smart-contract/types/index.js.map +1 -0
- package/dist/cjs/smart-contract/types/opCode.cjs +754 -0
- package/dist/cjs/smart-contract/types/opCode.js.map +1 -0
- package/dist/cjs/smart-contract/types/primitives.cjs +108 -0
- package/dist/cjs/smart-contract/types/primitives.js.map +1 -0
- package/dist/cjs/smart-contract/types/script.cjs +43 -0
- package/dist/cjs/smart-contract/types/script.js.map +1 -0
- package/dist/cjs/smart-contract/types/structs.cjs +3 -0
- package/dist/cjs/smart-contract/types/structs.js.map +1 -0
- package/dist/cjs/smart-contract/types/utils.cjs +21 -0
- package/dist/cjs/smart-contract/types/utils.js.map +1 -0
- package/dist/cjs/utils/bvm.cjs +30 -0
- package/dist/cjs/utils/bvm.js.map +1 -0
- package/dist/cjs/utils/checkIntegrity.cjs +49 -0
- package/dist/cjs/utils/checkIntegrity.js.map +1 -0
- package/dist/cjs/utils/common.cjs +228 -0
- package/dist/cjs/utils/common.js.map +1 -0
- package/dist/cjs/utils/constants.cjs +5 -0
- package/dist/cjs/utils/constants.js.map +1 -0
- package/dist/cjs/utils/index.cjs +45 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/preimage.cjs +93 -0
- package/dist/cjs/utils/preimage.js.map +1 -0
- package/dist/cjs/utils/proof.cjs +110 -0
- package/dist/cjs/utils/proof.js.map +1 -0
- package/dist/cjs/utils/script_number.cjs +107 -0
- package/dist/cjs/utils/script_number.js.map +1 -0
- package/dist/esm/features/call.js +34 -0
- package/dist/esm/features/call.js.map +1 -0
- package/dist/esm/features/deploy.js +29 -0
- package/dist/esm/features/deploy.js.map +1 -0
- package/dist/esm/features/index.js +3 -0
- package/dist/esm/features/index.js.map +1 -0
- package/dist/esm/globalTypes.js +2 -0
- package/dist/esm/globalTypes.js.map +1 -0
- package/dist/esm/index.js +23 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/networks.js +41 -0
- package/dist/esm/networks.js.map +1 -0
- package/dist/esm/providers/chainProvider.js +2 -0
- package/dist/esm/providers/chainProvider.js.map +1 -0
- package/dist/esm/providers/dummyProvider.js +60 -0
- package/dist/esm/providers/dummyProvider.js.map +1 -0
- package/dist/esm/providers/index.js +5 -0
- package/dist/esm/providers/index.js.map +1 -0
- package/dist/esm/providers/mempoolProvider.js +200 -0
- package/dist/esm/providers/mempoolProvider.js.map +1 -0
- package/dist/esm/providers/rpcProvider.js +266 -0
- package/dist/esm/providers/rpcProvider.js.map +1 -0
- package/dist/esm/providers/utxoProvider.js +13 -0
- package/dist/esm/providers/utxoProvider.js.map +1 -0
- package/dist/esm/psbt/bip66.js +175 -0
- package/dist/esm/psbt/bip66.js.map +1 -0
- package/dist/esm/psbt/bufferutils.js +156 -0
- package/dist/esm/psbt/bufferutils.js.map +1 -0
- package/dist/esm/psbt/contextProvider.js +84 -0
- package/dist/esm/psbt/contextProvider.js.map +1 -0
- package/dist/esm/psbt/extPsbt.js +562 -0
- package/dist/esm/psbt/extPsbt.js.map +1 -0
- package/dist/esm/psbt/psbt.js +945 -0
- package/dist/esm/psbt/psbt.js.map +1 -0
- package/dist/esm/psbt/psbtutils.js +110 -0
- package/dist/esm/psbt/psbtutils.js.map +1 -0
- package/dist/esm/psbt/signatureutils.js +199 -0
- package/dist/esm/psbt/signatureutils.js.map +1 -0
- package/dist/esm/psbt/types.js +2 -0
- package/dist/esm/psbt/types.js.map +1 -0
- package/dist/esm/signer.js +2 -0
- package/dist/esm/signer.js.map +1 -0
- package/dist/esm/signers/defaultSigner.js +63 -0
- package/dist/esm/signers/defaultSigner.js.map +1 -0
- package/dist/esm/signers/index.js +3 -0
- package/dist/esm/signers/index.js.map +1 -0
- package/dist/esm/signers/unisatSigner.js +34 -0
- package/dist/esm/signers/unisatSigner.js.map +1 -0
- package/dist/esm/smart-contract/abi.js +373 -0
- package/dist/esm/smart-contract/abi.js.map +1 -0
- package/dist/esm/smart-contract/abiutils.js +171 -0
- package/dist/esm/smart-contract/abiutils.js.map +1 -0
- package/dist/esm/smart-contract/abstractContract.js +21 -0
- package/dist/esm/smart-contract/abstractContract.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/backtrace.js +98 -0
- package/dist/esm/smart-contract/builtin-libs/backtrace.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/byteStringReader.js +134 -0
- package/dist/esm/smart-contract/builtin-libs/byteStringReader.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/byteStringWriter.js +105 -0
- package/dist/esm/smart-contract/builtin-libs/byteStringWriter.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/contextUtils.js +300 -0
- package/dist/esm/smart-contract/builtin-libs/contextUtils.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/index.js +8 -0
- package/dist/esm/smart-contract/builtin-libs/index.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/p2pk.js +70 -0
- package/dist/esm/smart-contract/builtin-libs/p2pk.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/p2pkh.js +76 -0
- package/dist/esm/smart-contract/builtin-libs/p2pkh.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/stateLib.js +61 -0
- package/dist/esm/smart-contract/builtin-libs/stateLib.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/stateUtils.js +38 -0
- package/dist/esm/smart-contract/builtin-libs/stateUtils.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/stdUtils.js +188 -0
- package/dist/esm/smart-contract/builtin-libs/stdUtils.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/txHashPreimageUtils.js +52 -0
- package/dist/esm/smart-contract/builtin-libs/txHashPreimageUtils.js.map +1 -0
- package/dist/esm/smart-contract/builtin-libs/txUtils.js +179 -0
- package/dist/esm/smart-contract/builtin-libs/txUtils.js.map +1 -0
- package/dist/esm/smart-contract/consts.js +97 -0
- package/dist/esm/smart-contract/consts.js.map +1 -0
- package/dist/esm/smart-contract/decorators.js +78 -0
- package/dist/esm/smart-contract/decorators.js.map +1 -0
- package/dist/esm/smart-contract/fns/assert.js +13 -0
- package/dist/esm/smart-contract/fns/assert.js.map +1 -0
- package/dist/esm/smart-contract/fns/bitwise.js +109 -0
- package/dist/esm/smart-contract/fns/bitwise.js.map +1 -0
- package/dist/esm/smart-contract/fns/byteString.js +97 -0
- package/dist/esm/smart-contract/fns/byteString.js.map +1 -0
- package/dist/esm/smart-contract/fns/equals.js +62 -0
- package/dist/esm/smart-contract/fns/equals.js.map +1 -0
- package/dist/esm/smart-contract/fns/fill.js +15 -0
- package/dist/esm/smart-contract/fns/fill.js.map +1 -0
- package/dist/esm/smart-contract/fns/hashes.js +73 -0
- package/dist/esm/smart-contract/fns/hashes.js.map +1 -0
- package/dist/esm/smart-contract/fns/index.js +9 -0
- package/dist/esm/smart-contract/fns/index.js.map +1 -0
- package/dist/esm/smart-contract/fns/math.js +45 -0
- package/dist/esm/smart-contract/fns/math.js.map +1 -0
- package/dist/esm/smart-contract/fns/pubKey2Addr.js +13 -0
- package/dist/esm/smart-contract/fns/pubKey2Addr.js.map +1 -0
- package/dist/esm/smart-contract/methods/backtraceToGenensis.js +36 -0
- package/dist/esm/smart-contract/methods/backtraceToGenensis.js.map +1 -0
- package/dist/esm/smart-contract/methods/buildOutput.js +36 -0
- package/dist/esm/smart-contract/methods/buildOutput.js.map +1 -0
- package/dist/esm/smart-contract/methods/checkCtx.js +31 -0
- package/dist/esm/smart-contract/methods/checkCtx.js.map +1 -0
- package/dist/esm/smart-contract/methods/checkInputState.js +12 -0
- package/dist/esm/smart-contract/methods/checkInputState.js.map +1 -0
- package/dist/esm/smart-contract/methods/checkInputStateHashes.js +12 -0
- package/dist/esm/smart-contract/methods/checkInputStateHashes.js.map +1 -0
- package/dist/esm/smart-contract/methods/checkSHPreimage.js +13 -0
- package/dist/esm/smart-contract/methods/checkSHPreimage.js.map +1 -0
- package/dist/esm/smart-contract/methods/checkSig.js +73 -0
- package/dist/esm/smart-contract/methods/checkSig.js.map +1 -0
- package/dist/esm/smart-contract/serializer.js +112 -0
- package/dist/esm/smart-contract/serializer.js.map +1 -0
- package/dist/esm/smart-contract/smartContract.js +564 -0
- package/dist/esm/smart-contract/smartContract.js.map +1 -0
- package/dist/esm/smart-contract/smartContractLib.js +42 -0
- package/dist/esm/smart-contract/smartContractLib.js.map +1 -0
- package/dist/esm/smart-contract/stateSerializer.js +129 -0
- package/dist/esm/smart-contract/stateSerializer.js.map +1 -0
- package/dist/esm/smart-contract/types/abi.js +63 -0
- package/dist/esm/smart-contract/types/abi.js.map +1 -0
- package/dist/esm/smart-contract/types/artifact.js +13 -0
- package/dist/esm/smart-contract/types/artifact.js.map +1 -0
- package/dist/esm/smart-contract/types/bn.js +89 -0
- package/dist/esm/smart-contract/types/bn.js.map +1 -0
- package/dist/esm/smart-contract/types/context.js +2 -0
- package/dist/esm/smart-contract/types/context.js.map +1 -0
- package/dist/esm/smart-contract/types/index.js +3 -0
- package/dist/esm/smart-contract/types/index.js.map +1 -0
- package/dist/esm/smart-contract/types/opCode.js +750 -0
- package/dist/esm/smart-contract/types/opCode.js.map +1 -0
- package/dist/esm/smart-contract/types/primitives.js +95 -0
- package/dist/esm/smart-contract/types/primitives.js.map +1 -0
- package/dist/esm/smart-contract/types/script.js +16 -0
- package/dist/esm/smart-contract/types/script.js.map +1 -0
- package/dist/esm/smart-contract/types/structs.js +2 -0
- package/dist/esm/smart-contract/types/structs.js.map +1 -0
- package/dist/esm/smart-contract/types/utils.js +17 -0
- package/dist/esm/smart-contract/types/utils.js.map +1 -0
- package/dist/esm/utils/bvm.js +26 -0
- package/dist/esm/utils/bvm.js.map +1 -0
- package/dist/esm/utils/checkIntegrity.js +41 -0
- package/dist/esm/utils/checkIntegrity.js.map +1 -0
- package/dist/esm/utils/common.js +188 -0
- package/dist/esm/utils/common.js.map +1 -0
- package/dist/esm/utils/constants.js +2 -0
- package/dist/esm/utils/constants.js.map +1 -0
- package/dist/esm/utils/index.js +7 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/preimage.js +65 -0
- package/dist/esm/utils/preimage.js.map +1 -0
- package/dist/esm/utils/proof.js +98 -0
- package/dist/esm/utils/proof.js.map +1 -0
- package/dist/esm/utils/script_number.js +79 -0
- package/dist/esm/utils/script_number.js.map +1 -0
- package/dist/types/features/call.d.ts +21 -0
- package/dist/types/features/call.d.ts.map +1 -0
- package/dist/types/features/deploy.d.ts +16 -0
- package/dist/types/features/deploy.d.ts.map +1 -0
- package/dist/types/features/index.d.ts +3 -0
- package/dist/types/features/index.d.ts.map +1 -0
- package/dist/types/globalTypes.d.ts +37 -0
- package/dist/types/globalTypes.d.ts.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/networks.d.ts +19 -0
- package/dist/types/networks.d.ts.map +1 -0
- package/dist/types/providers/chainProvider.d.ts +31 -0
- package/dist/types/providers/chainProvider.d.ts.map +1 -0
- package/dist/types/providers/dummyProvider.d.ts +23 -0
- package/dist/types/providers/dummyProvider.d.ts.map +1 -0
- package/dist/types/providers/index.d.ts +6 -0
- package/dist/types/providers/index.d.ts.map +1 -0
- package/dist/types/providers/mempoolProvider.d.ts +28 -0
- package/dist/types/providers/mempoolProvider.d.ts.map +1 -0
- package/dist/types/providers/rpcProvider.d.ts +34 -0
- package/dist/types/providers/rpcProvider.d.ts.map +1 -0
- package/dist/types/providers/utxoProvider.d.ts +43 -0
- package/dist/types/providers/utxoProvider.d.ts.map +1 -0
- package/dist/types/psbt/bip66.d.ts +28 -0
- package/dist/types/psbt/bip66.d.ts.map +1 -0
- package/dist/types/psbt/bufferutils.d.ts +47 -0
- package/dist/types/psbt/bufferutils.d.ts.map +1 -0
- package/dist/types/psbt/contextProvider.d.ts +15 -0
- package/dist/types/psbt/contextProvider.d.ts.map +1 -0
- package/dist/types/psbt/extPsbt.d.ts +131 -0
- package/dist/types/psbt/extPsbt.d.ts.map +1 -0
- package/dist/types/psbt/psbt.d.ts +194 -0
- package/dist/types/psbt/psbt.d.ts.map +1 -0
- package/dist/types/psbt/psbtutils.d.ts +37 -0
- package/dist/types/psbt/psbtutils.d.ts.map +1 -0
- package/dist/types/psbt/signatureutils.d.ts +52 -0
- package/dist/types/psbt/signatureutils.d.ts.map +1 -0
- package/dist/types/psbt/types.d.ts +63 -0
- package/dist/types/psbt/types.d.ts.map +1 -0
- package/dist/types/signer.d.ts +48 -0
- package/dist/types/signer.d.ts.map +1 -0
- package/dist/types/signers/defaultSigner.d.ts +30 -0
- package/dist/types/signers/defaultSigner.d.ts.map +1 -0
- package/dist/types/signers/index.d.ts +4 -0
- package/dist/types/signers/index.d.ts.map +1 -0
- package/dist/types/signers/unisatSigner.d.ts +32 -0
- package/dist/types/signers/unisatSigner.d.ts.map +1 -0
- package/dist/types/smart-contract/abi.d.ts +43 -0
- package/dist/types/smart-contract/abi.d.ts.map +1 -0
- package/dist/types/smart-contract/abiutils.d.ts +51 -0
- package/dist/types/smart-contract/abiutils.d.ts.map +1 -0
- package/dist/types/smart-contract/abstractContract.d.ts +115 -0
- package/dist/types/smart-contract/abstractContract.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/backtrace.d.ts +43 -0
- package/dist/types/smart-contract/builtin-libs/backtrace.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/byteStringReader.d.ts +32 -0
- package/dist/types/smart-contract/builtin-libs/byteStringReader.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/byteStringWriter.d.ts +29 -0
- package/dist/types/smart-contract/builtin-libs/byteStringWriter.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/contextUtils.d.ts +53 -0
- package/dist/types/smart-contract/builtin-libs/contextUtils.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/index.d.ts +8 -0
- package/dist/types/smart-contract/builtin-libs/index.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/p2pk.d.ts +8 -0
- package/dist/types/smart-contract/builtin-libs/p2pk.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/p2pkh.d.ts +8 -0
- package/dist/types/smart-contract/builtin-libs/p2pkh.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/stateLib.d.ts +27 -0
- package/dist/types/smart-contract/builtin-libs/stateLib.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/stateUtils.d.ts +18 -0
- package/dist/types/smart-contract/builtin-libs/stateUtils.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/stdUtils.d.ts +44 -0
- package/dist/types/smart-contract/builtin-libs/stdUtils.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/txHashPreimageUtils.d.ts +8 -0
- package/dist/types/smart-contract/builtin-libs/txHashPreimageUtils.d.ts.map +1 -0
- package/dist/types/smart-contract/builtin-libs/txUtils.d.ts +69 -0
- package/dist/types/smart-contract/builtin-libs/txUtils.d.ts.map +1 -0
- package/dist/types/smart-contract/consts.d.ts +97 -0
- package/dist/types/smart-contract/consts.d.ts.map +1 -0
- package/dist/types/smart-contract/decorators.d.ts +40 -0
- package/dist/types/smart-contract/decorators.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/assert.d.ts +8 -0
- package/dist/types/smart-contract/fns/assert.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/bitwise.d.ts +50 -0
- package/dist/types/smart-contract/fns/bitwise.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/byteString.d.ts +56 -0
- package/dist/types/smart-contract/fns/byteString.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/equals.d.ts +8 -0
- package/dist/types/smart-contract/fns/equals.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/fill.d.ts +11 -0
- package/dist/types/smart-contract/fns/fill.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/hashes.d.ts +60 -0
- package/dist/types/smart-contract/fns/hashes.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/index.d.ts +9 -0
- package/dist/types/smart-contract/fns/index.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/math.d.ts +38 -0
- package/dist/types/smart-contract/fns/math.d.ts.map +1 -0
- package/dist/types/smart-contract/fns/pubKey2Addr.d.ts +11 -0
- package/dist/types/smart-contract/fns/pubKey2Addr.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/backtraceToGenensis.d.ts +20 -0
- package/dist/types/smart-contract/methods/backtraceToGenensis.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/buildOutput.d.ts +25 -0
- package/dist/types/smart-contract/methods/buildOutput.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/checkCtx.d.ts +18 -0
- package/dist/types/smart-contract/methods/checkCtx.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/checkInputState.d.ts +9 -0
- package/dist/types/smart-contract/methods/checkInputState.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/checkInputStateHashes.d.ts +10 -0
- package/dist/types/smart-contract/methods/checkInputStateHashes.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/checkSHPreimage.d.ts +10 -0
- package/dist/types/smart-contract/methods/checkSHPreimage.d.ts.map +1 -0
- package/dist/types/smart-contract/methods/checkSig.d.ts +11 -0
- package/dist/types/smart-contract/methods/checkSig.d.ts.map +1 -0
- package/dist/types/smart-contract/serializer.d.ts +48 -0
- package/dist/types/smart-contract/serializer.d.ts.map +1 -0
- package/dist/types/smart-contract/smartContract.d.ts +274 -0
- package/dist/types/smart-contract/smartContract.d.ts.map +1 -0
- package/dist/types/smart-contract/smartContractLib.d.ts +26 -0
- package/dist/types/smart-contract/smartContractLib.d.ts.map +1 -0
- package/dist/types/smart-contract/stateSerializer.d.ts +8 -0
- package/dist/types/smart-contract/stateSerializer.d.ts.map +1 -0
- package/dist/types/smart-contract/types/abi.d.ts +55 -0
- package/dist/types/smart-contract/types/abi.d.ts.map +1 -0
- package/dist/types/smart-contract/types/artifact.d.ts +108 -0
- package/dist/types/smart-contract/types/artifact.d.ts.map +1 -0
- package/dist/types/smart-contract/types/bn.d.ts +3 -0
- package/dist/types/smart-contract/types/bn.d.ts.map +1 -0
- package/dist/types/smart-contract/types/context.d.ts +126 -0
- package/dist/types/smart-contract/types/context.d.ts.map +1 -0
- package/dist/types/smart-contract/types/index.d.ts +4 -0
- package/dist/types/smart-contract/types/index.d.ts.map +1 -0
- package/dist/types/smart-contract/types/opCode.d.ts +747 -0
- package/dist/types/smart-contract/types/opCode.d.ts.map +1 -0
- package/dist/types/smart-contract/types/primitives.d.ts +217 -0
- package/dist/types/smart-contract/types/primitives.d.ts.map +1 -0
- package/dist/types/smart-contract/types/script.d.ts +14 -0
- package/dist/types/smart-contract/types/script.d.ts.map +1 -0
- package/dist/types/smart-contract/types/structs.d.ts +206 -0
- package/dist/types/smart-contract/types/structs.d.ts.map +1 -0
- package/dist/types/smart-contract/types/utils.d.ts +5 -0
- package/dist/types/smart-contract/types/utils.d.ts.map +1 -0
- package/dist/types/utils/bvm.d.ts +9 -0
- package/dist/types/utils/bvm.d.ts.map +1 -0
- package/dist/types/utils/checkIntegrity.d.ts +46 -0
- package/dist/types/utils/checkIntegrity.d.ts.map +1 -0
- package/dist/types/utils/common.d.ts +61 -0
- package/dist/types/utils/common.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +3 -0
- package/dist/types/utils/constants.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/preimage.d.ts +31 -0
- package/dist/types/utils/preimage.d.ts.map +1 -0
- package/dist/types/utils/proof.d.ts +31 -0
- package/dist/types/utils/proof.d.ts.map +1 -0
- package/dist/types/utils/script_number.d.ts +19 -0
- package/dist/types/utils/script_number.d.ts.map +1 -0
- package/package.json +79 -0
- package/scrypt.index.json +85 -0
- package/src/smart-contract/builtin-libs/backtrace.ts +116 -0
- package/src/smart-contract/builtin-libs/byteStringReader.ts +111 -0
- package/src/smart-contract/builtin-libs/byteStringWriter.ts +86 -0
- package/src/smart-contract/builtin-libs/contextUtils.ts +270 -0
- package/src/smart-contract/builtin-libs/index.ts +7 -0
- package/src/smart-contract/builtin-libs/p2pk.ts +58 -0
- package/src/smart-contract/builtin-libs/p2pkh.ts +67 -0
- package/src/smart-contract/builtin-libs/stateLib.ts +82 -0
- package/src/smart-contract/builtin-libs/stateUtils.ts +37 -0
- package/src/smart-contract/builtin-libs/stdUtils.ts +156 -0
- package/src/smart-contract/builtin-libs/txHashPreimageUtils.ts +34 -0
- package/src/smart-contract/builtin-libs/txUtils.ts +152 -0
- package/src/smart-contract/types/structs.ts +244 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opCode.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/opCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C;;;;;GAKG;AACH,qBAAa,MAAM;IACjB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAoB;IACxD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAoB;IAC5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAoB;IAC5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAoB;IAC5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAoB;IAC1D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAoB;IAC3D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAoB;IACvD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAoB;IACpD;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SAAS,EAAE,UAAU,CAAoB;IACzD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAoB;CACjE"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Flavor } from '../../globalTypes.js';
|
|
2
|
+
/**
|
|
3
|
+
* A ByteString represents a byte array in hex format.
|
|
4
|
+
* @category Types
|
|
5
|
+
* @onchain
|
|
6
|
+
*/
|
|
7
|
+
export type ByteString = Flavor<string, 'bytes'>;
|
|
8
|
+
/**
|
|
9
|
+
* A Int32 represents a number.
|
|
10
|
+
* @category Types
|
|
11
|
+
* @onchain
|
|
12
|
+
*/
|
|
13
|
+
export type Int32 = Flavor<bigint, 'int'>;
|
|
14
|
+
export type UInt32 = Flavor<bigint, 'int'>;
|
|
15
|
+
export type UInt64 = Flavor<bigint, 'int'>;
|
|
16
|
+
export type SigHashPreimage = ByteString & {
|
|
17
|
+
__type: 'SigHashPreimage';
|
|
18
|
+
};
|
|
19
|
+
export declare function SigHashPreimage(b: ByteString): SigHashPreimage;
|
|
20
|
+
/**
|
|
21
|
+
* A Bool represents a boolean. A simple value true or false.
|
|
22
|
+
* @category Types
|
|
23
|
+
* @onchain
|
|
24
|
+
*/
|
|
25
|
+
export type Bool = Flavor<boolean, 'bool'>;
|
|
26
|
+
/**
|
|
27
|
+
* A domain specific subtype of `Int32`, representing a private key.
|
|
28
|
+
* @category Types
|
|
29
|
+
* @onchain
|
|
30
|
+
*/
|
|
31
|
+
export type PrivKey = Int32 & {
|
|
32
|
+
__type: 'PrivKey';
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Creates a `PrivKey` instance from a `Int32`.
|
|
36
|
+
* @category Global Function
|
|
37
|
+
* @onchain
|
|
38
|
+
* @param key - Input Int32.
|
|
39
|
+
* @returns - A domain specific private key representation.
|
|
40
|
+
*/
|
|
41
|
+
export declare function PrivKey(n: Int32): PrivKey;
|
|
42
|
+
/**
|
|
43
|
+
* A domain specific subtype of `ByteString`, representing a public key.
|
|
44
|
+
* @category Types
|
|
45
|
+
* @onchain
|
|
46
|
+
*/
|
|
47
|
+
export type PubKey = ByteString & {
|
|
48
|
+
__type: 'PubKey';
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Creates a `PubKey` instance from a `ByteString`.
|
|
52
|
+
* @category Global Function
|
|
53
|
+
* @onchain
|
|
54
|
+
* @param b - Input ByteString.
|
|
55
|
+
* @returns - A domain specific public key representation.
|
|
56
|
+
*/
|
|
57
|
+
export declare function PubKey(b: ByteString): PubKey;
|
|
58
|
+
/**
|
|
59
|
+
* A domain specific subtype of `ByteString`, representing a signature.
|
|
60
|
+
* @category Types
|
|
61
|
+
* @onchain
|
|
62
|
+
*/
|
|
63
|
+
export type Sig = ByteString & {
|
|
64
|
+
__type: 'Sig';
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Creates a `Sig` instance from a `ByteString`.
|
|
68
|
+
* @category Global Function
|
|
69
|
+
* @onchain
|
|
70
|
+
* @param b - Input ByteString.
|
|
71
|
+
* @returns - A domain specific digital signature representation.
|
|
72
|
+
*/
|
|
73
|
+
export declare function Sig(b: ByteString): Sig;
|
|
74
|
+
/**
|
|
75
|
+
* A domain specific subtype of `ByteString`, representing a RIPEMD-160 hash.
|
|
76
|
+
* @category Types
|
|
77
|
+
* @onchain
|
|
78
|
+
*/
|
|
79
|
+
export type Ripemd160 = ByteString & {
|
|
80
|
+
__type: 'Ripemd160';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Creates a `Ripemd160` instance from a `ByteString`.
|
|
84
|
+
* @category Global Function
|
|
85
|
+
* @onchain
|
|
86
|
+
* @param b - Input ByteString.
|
|
87
|
+
* @returns - A domain specific RIPEMD-160 hash representation.
|
|
88
|
+
*/
|
|
89
|
+
export declare function Ripemd160(b: ByteString): Ripemd160;
|
|
90
|
+
/**
|
|
91
|
+
* A domain specific subtype of `ByteString`, representing an address.
|
|
92
|
+
* @category Types
|
|
93
|
+
* @onchain
|
|
94
|
+
*/
|
|
95
|
+
export type PubKeyHash = Ripemd160;
|
|
96
|
+
/**
|
|
97
|
+
* Creates a `PubKeyHash` instance from a `ByteString`.
|
|
98
|
+
* @category Global Function
|
|
99
|
+
* @onchain
|
|
100
|
+
* @param b - Input ByteString.
|
|
101
|
+
* @returns - A domain specific address representation.
|
|
102
|
+
*/
|
|
103
|
+
export declare function PubKeyHash(b: ByteString): PubKeyHash;
|
|
104
|
+
/**
|
|
105
|
+
* A domain specific subtype of `ByteString`, representing an address.
|
|
106
|
+
* @category Types
|
|
107
|
+
* @onchain
|
|
108
|
+
*/
|
|
109
|
+
export type Addr = PubKeyHash;
|
|
110
|
+
/**
|
|
111
|
+
* Creates an `Addr` instance from a `ByteString`.
|
|
112
|
+
* @category Global Function
|
|
113
|
+
* @onchain
|
|
114
|
+
* @param b - Input ByteString.
|
|
115
|
+
* @returns - A domain specific address representation.
|
|
116
|
+
*/
|
|
117
|
+
export declare function Addr(b: ByteString): Addr;
|
|
118
|
+
/**
|
|
119
|
+
* A domain specific subtype of `ByteString`, representing a SHA-1 hash.
|
|
120
|
+
* @category Types
|
|
121
|
+
* @onchain
|
|
122
|
+
*/
|
|
123
|
+
export type Sha1 = ByteString & {
|
|
124
|
+
__type: 'Sha1';
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Creates a `Sha1` instance from a `ByteString`.
|
|
128
|
+
* @category Global Function
|
|
129
|
+
* @onchain
|
|
130
|
+
* @param b - Input ByteString.
|
|
131
|
+
* @returns - A domain specific SHA-1 hash representation.
|
|
132
|
+
*/
|
|
133
|
+
export declare function Sha1(b: ByteString): Sha1;
|
|
134
|
+
/**
|
|
135
|
+
* A domain specific subtype of `ByteString`, representing a SHA-256 hash.
|
|
136
|
+
* @category Types
|
|
137
|
+
* @onchain
|
|
138
|
+
*/
|
|
139
|
+
export type Sha256 = ByteString & {
|
|
140
|
+
__type: 'Sha256';
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Creates a `Sha256` instance from a `ByteString`.
|
|
144
|
+
* @category Global Function
|
|
145
|
+
* @onchain
|
|
146
|
+
* @param b - Input ByteString.
|
|
147
|
+
* @returns - A domain specific SHA-256 hash representation.
|
|
148
|
+
*/
|
|
149
|
+
export declare function Sha256(b: ByteString): Sha256;
|
|
150
|
+
/**
|
|
151
|
+
* An array is a fixed-size list of values of the same basic type.
|
|
152
|
+
* When you declare an array you have to declare it like this:
|
|
153
|
+
* @category Types
|
|
154
|
+
* @onchain
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* let aaa: FixedArray<bigint, 3> = [1n, 3n, 3n];
|
|
158
|
+
*
|
|
159
|
+
* let abb: FixedArray<FixedArray<bigint, 2>, 3> = [[1n, 3n], [1n, 3n], [1n, 3n]];
|
|
160
|
+
*
|
|
161
|
+
* let bbb: FixedArray<FixedArray<FixedArray<bigint, 1>, 2>, 3> = [[[1n], [1n]], [[1n], [1n]], [[1n], [1n]]];
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export type FixedArray<T, N extends number> = Array<T> & {
|
|
165
|
+
length: N;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* A domain specific subtype of `ByteString`, representing a signature hash type.
|
|
169
|
+
* @category Types
|
|
170
|
+
* @onchain
|
|
171
|
+
* ref https://github.com/bitcoin/bitcoin/blob/c288c790cd9abe91e53164aba5d975ef1e26ee3f/src/script/interpreter.h#L30-L33
|
|
172
|
+
*/
|
|
173
|
+
export declare const enum SigHashType {
|
|
174
|
+
ALL = 1,
|
|
175
|
+
NONE = 2,
|
|
176
|
+
SINGLE = 3,
|
|
177
|
+
ANYONECANPAY = 128,
|
|
178
|
+
ANYONECANPAY_ALL = 129,
|
|
179
|
+
ANYONECANPAY_NONE = 130,
|
|
180
|
+
ANYONECANPAY_SINGLE = 131
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* A domain specific subtype of `ByteString`, representing a Script word.
|
|
184
|
+
* @category Types
|
|
185
|
+
* @onchain
|
|
186
|
+
*/
|
|
187
|
+
export type OpCodeType = ByteString & {
|
|
188
|
+
__type: 'OpCodeType';
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Creates a `OpCodeType` from a `ByteString`.
|
|
192
|
+
* @category Global Function
|
|
193
|
+
* @onchain
|
|
194
|
+
* @param b - Input ByteString.
|
|
195
|
+
* @returns - A domain specific OpCodeType representation.
|
|
196
|
+
*/
|
|
197
|
+
export declare function OpCodeType(b: ByteString): OpCodeType;
|
|
198
|
+
/**
|
|
199
|
+
* @ignore
|
|
200
|
+
*/
|
|
201
|
+
export type PrimitiveTypes = Int32 | Bool | ByteString | PrivKey | PubKey | Sig | Sha256 | Sha1 | Ripemd160 | OpCodeType;
|
|
202
|
+
/**
|
|
203
|
+
* @ignore
|
|
204
|
+
*/
|
|
205
|
+
export type SubBytes = PubKey | Sig | Sha256 | Sha1 | SigHashType | Ripemd160 | OpCodeType;
|
|
206
|
+
/**
|
|
207
|
+
* @ignore
|
|
208
|
+
*/
|
|
209
|
+
export interface StructObject {
|
|
210
|
+
[key: string]: SupportedParamType;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* @ignore
|
|
214
|
+
*/
|
|
215
|
+
export type SupportedParamType = PrimitiveTypes | StructObject | SupportedParamType[];
|
|
216
|
+
export type OpcatState = StructObject | undefined;
|
|
217
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,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AAQ,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,YAAY,GAAG,kBAAkB,EAAE,CAAC;AAItF,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as opcat from '@opcat-labs/opcat';
|
|
2
|
+
/**
|
|
3
|
+
* A bitcoin transaction script. Each transaction's inputs and outputs
|
|
4
|
+
* has a script that is evaluated to validate it's spending.
|
|
5
|
+
*
|
|
6
|
+
* See https://en.bitcoin.it/wiki/Script
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
* @param {Uint8Array} from data to populate script
|
|
10
|
+
*/
|
|
11
|
+
export declare class Script extends opcat.Script {
|
|
12
|
+
constructor(rawBytes: Uint8Array);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/script.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAA;AAC1C;;;;;;;;GAQG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,MAAM;gBAC1B,QAAQ,EAAE,UAAU;CAGjC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { ByteString, Int32, UInt32, UInt64 } from './primitives.js';
|
|
2
|
+
/**
|
|
3
|
+
* The structure used to refer to a particular transaction output
|
|
4
|
+
* @category Types
|
|
5
|
+
* @onchain
|
|
6
|
+
*/
|
|
7
|
+
export type Outpoint = {
|
|
8
|
+
/**
|
|
9
|
+
* The transaction hash, which is the reverse order of bytes of the `txId`.
|
|
10
|
+
*/
|
|
11
|
+
txHash: ByteString;
|
|
12
|
+
/**
|
|
13
|
+
* The index of the output in the transaction.
|
|
14
|
+
*/
|
|
15
|
+
outputIndex: UInt32;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A structure representing a transaction output
|
|
19
|
+
* @category Types
|
|
20
|
+
* @onchain
|
|
21
|
+
*/
|
|
22
|
+
export type TxOut = {
|
|
23
|
+
scriptHash: ByteString;
|
|
24
|
+
dataHash: ByteString;
|
|
25
|
+
satoshis: UInt64;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A structure representing the transaction input, excluding witnesses
|
|
29
|
+
* @category Types
|
|
30
|
+
* @onchain
|
|
31
|
+
*/
|
|
32
|
+
export type TxIn = {
|
|
33
|
+
/**
|
|
34
|
+
* 32 bytes.
|
|
35
|
+
* input's prevout transaction hash
|
|
36
|
+
*/
|
|
37
|
+
prevTxHash: ByteString;
|
|
38
|
+
/**
|
|
39
|
+
* 4 bytes little endian.
|
|
40
|
+
* input's prevout output index
|
|
41
|
+
*/
|
|
42
|
+
prevOutputIndex: UInt32;
|
|
43
|
+
/**
|
|
44
|
+
* 4 bytes little endian.
|
|
45
|
+
* input's sequence number
|
|
46
|
+
*/
|
|
47
|
+
sequence: UInt32;
|
|
48
|
+
/**
|
|
49
|
+
* 32 bytes.
|
|
50
|
+
* input's unlocking script hash
|
|
51
|
+
*/
|
|
52
|
+
scriptHash: ByteString;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* transaction digest for signature verification, @see {@link https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#signature-validation-rules | BIP341}
|
|
56
|
+
* @category Types
|
|
57
|
+
* @onchain
|
|
58
|
+
*/
|
|
59
|
+
export type SHPreimage = {
|
|
60
|
+
/**
|
|
61
|
+
* 4 bytes.
|
|
62
|
+
* version number of the transaction
|
|
63
|
+
*/
|
|
64
|
+
nVersion: ByteString;
|
|
65
|
+
/**
|
|
66
|
+
* 32 bytes.
|
|
67
|
+
* hash256(Prevouts)
|
|
68
|
+
*/
|
|
69
|
+
hashPrevouts: ByteString;
|
|
70
|
+
/**
|
|
71
|
+
* 32 bytes.
|
|
72
|
+
* current input's prevout script hash
|
|
73
|
+
*/
|
|
74
|
+
spentScriptHash: ByteString;
|
|
75
|
+
/**
|
|
76
|
+
* 32 bytes.
|
|
77
|
+
* current input's prevout data hash
|
|
78
|
+
*/
|
|
79
|
+
spentDataHash: ByteString;
|
|
80
|
+
/**
|
|
81
|
+
* 8 bytes little endian. spent amount;
|
|
82
|
+
*/
|
|
83
|
+
value: UInt64;
|
|
84
|
+
/**
|
|
85
|
+
* 4 bytes little endian.
|
|
86
|
+
*/
|
|
87
|
+
nSequence: ByteString;
|
|
88
|
+
/**
|
|
89
|
+
* 32 bytes.
|
|
90
|
+
* hash256(SpentAmounts)
|
|
91
|
+
*/
|
|
92
|
+
hashSpentAmounts: ByteString;
|
|
93
|
+
/**
|
|
94
|
+
* 32 bytes.
|
|
95
|
+
* hash256(SpentScriptHashes)
|
|
96
|
+
*/
|
|
97
|
+
hashSpentScriptHashes: ByteString;
|
|
98
|
+
/**
|
|
99
|
+
* 32 bytes.
|
|
100
|
+
* hash256(SpentDataHashes)
|
|
101
|
+
*/
|
|
102
|
+
hashSpentDataHashes: ByteString;
|
|
103
|
+
/**
|
|
104
|
+
* 32 bytes.
|
|
105
|
+
* hash256(SpentSequences)
|
|
106
|
+
*/
|
|
107
|
+
hashSequences: ByteString;
|
|
108
|
+
/**
|
|
109
|
+
* 32 bytes.
|
|
110
|
+
* hash256(Outputs)
|
|
111
|
+
*/
|
|
112
|
+
hashOutputs: ByteString;
|
|
113
|
+
/**
|
|
114
|
+
* 4 bytes little endian.
|
|
115
|
+
*/
|
|
116
|
+
inputIndex: UInt32;
|
|
117
|
+
/**
|
|
118
|
+
* 4 bytes little endian.
|
|
119
|
+
*/
|
|
120
|
+
nLockTime: UInt32;
|
|
121
|
+
/**
|
|
122
|
+
* 4 bytes little endian.
|
|
123
|
+
*/
|
|
124
|
+
sigHashType: UInt32;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* An bytestring refers to the outputs from previous transactions that are being spent as inputs in the current transaction.
|
|
128
|
+
* prevout = prevTxHash(32 bytes) + prevOutputIndex(4 bytes)
|
|
129
|
+
* prevouts1 + prevouts2 + ... + prevoutsN
|
|
130
|
+
* @category Types
|
|
131
|
+
* @onchain
|
|
132
|
+
*/
|
|
133
|
+
export type Prevouts = ByteString;
|
|
134
|
+
/**
|
|
135
|
+
* The context of the spent scripts.
|
|
136
|
+
* spentScriptHash = scriptHash(32 bytes)
|
|
137
|
+
* spentScriptHash1 + spentScriptHash2 + ... + spentScriptHashN
|
|
138
|
+
* @category Types
|
|
139
|
+
* @onchain
|
|
140
|
+
*/
|
|
141
|
+
export type SpentScriptHashes = ByteString;
|
|
142
|
+
/**
|
|
143
|
+
* The context of the spent data hashes.
|
|
144
|
+
* spentDataHash = dataHash(32 bytes)
|
|
145
|
+
* spentDataHash1 + spentDataHash2 + ... + spentDataHashN
|
|
146
|
+
* @category Types
|
|
147
|
+
* @onchain
|
|
148
|
+
*/
|
|
149
|
+
export type SpentDataHashes = ByteString;
|
|
150
|
+
/**
|
|
151
|
+
* The context of the spent amounts.
|
|
152
|
+
* spentAmount = amount(8 bytes)
|
|
153
|
+
* spentAmount1 + spentAmount2 + ... + spentAmountN
|
|
154
|
+
* @category Types
|
|
155
|
+
* @onchain
|
|
156
|
+
*/
|
|
157
|
+
export type SpentAmounts = ByteString;
|
|
158
|
+
/**
|
|
159
|
+
* The digest data used to calculate the Traditional Transaction ID (txid) consists of the transaction's
|
|
160
|
+
* core components (inputs, outputs) without the witness information.
|
|
161
|
+
* @category Types
|
|
162
|
+
* @onchain
|
|
163
|
+
*/
|
|
164
|
+
export type TxHashPreimage = {
|
|
165
|
+
/**
|
|
166
|
+
* 4 bytes little endian.
|
|
167
|
+
*/
|
|
168
|
+
version: ByteString;
|
|
169
|
+
/**
|
|
170
|
+
* input = prevout(36 bytes) + unlockScriptHash(32 bytes) + sequence(4 bytes)
|
|
171
|
+
* input1 + input2 + ... + inputN
|
|
172
|
+
*/
|
|
173
|
+
inputList: ByteString;
|
|
174
|
+
/**
|
|
175
|
+
* output = amount(8 bytes) + lockingScriptHash(32 bytes) + dataHash(32 bytes)
|
|
176
|
+
* output1 + output2 + ... + outputN
|
|
177
|
+
*/
|
|
178
|
+
outputList: ByteString;
|
|
179
|
+
/**
|
|
180
|
+
* 4 bytes little endian.
|
|
181
|
+
*/
|
|
182
|
+
nLockTime: ByteString;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Used for contract traceability to ensure that the spent contract comes from a unique outpoint
|
|
186
|
+
* @category Types
|
|
187
|
+
* @onchain
|
|
188
|
+
*/
|
|
189
|
+
export type BacktraceInfo = {
|
|
190
|
+
/**
|
|
191
|
+
* @type {TxIn}
|
|
192
|
+
* the traceable input in the previous transaction
|
|
193
|
+
*/
|
|
194
|
+
prevTxInput: TxIn;
|
|
195
|
+
/**
|
|
196
|
+
* @type {Int32}
|
|
197
|
+
* the index of the traceable input in the previous transaction
|
|
198
|
+
*/
|
|
199
|
+
prevTxInputIndex: Int32;
|
|
200
|
+
/**
|
|
201
|
+
* @type {TxHashPreimage}
|
|
202
|
+
* the preimage of the previous previous transaction
|
|
203
|
+
*/
|
|
204
|
+
prevPrevTxPreimage: TxHashPreimage;
|
|
205
|
+
};
|
|
206
|
+
//# sourceMappingURL=structs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IAC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M,iBAAiB,GAAG,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAItC;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,OAAO,EAAE,UAAU,CAAC;IAEpB;;;OAGG;IACH,SAAS,EAAE,UAAU,CAAC;IAEtB;;;OAGG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAIF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,WAAW,EAAE,IAAI,CAAC;IAElB;;;OAGG;IACH,gBAAgB,EAAE,KAAK,CAAC;IAExB;;;OAGG;IACH,kBAAkB,EAAE,cAAc,CAAC;CACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/smart-contract/types/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,MAAM,CAgB5E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExtPsbt } from '../psbt/extPsbt.js';
|
|
2
|
+
/**
|
|
3
|
+
* Verify that an input of `ExtPsbt` can be unlocked correctly. The extPsbt should be finalized.
|
|
4
|
+
* @param extPsbt
|
|
5
|
+
* @param inputIndex
|
|
6
|
+
* @returns true if success
|
|
7
|
+
*/
|
|
8
|
+
export declare function bvmVerify(extPsbt: ExtPsbt, inputIndex?: number): true | string;
|
|
9
|
+
//# sourceMappingURL=bvm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bvm.d.ts","sourceRoot":"","sources":["../../../src/utils/bvm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,GAAE,MAAU,GAAG,IAAI,GAAG,MAAM,CA+BjF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SmartContract } from '../smart-contract/smartContract.js';
|
|
2
|
+
import { SmartContractLib } from '../smart-contract/smartContractLib.js';
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
* The scrypt.index.json file generated by @scrypt-inc/cli-btc
|
|
6
|
+
*/
|
|
7
|
+
export type ScryptIndexJson = {
|
|
8
|
+
scryptBase: string;
|
|
9
|
+
bindings: {
|
|
10
|
+
/**
|
|
11
|
+
* The symbol of the binding, contract name or library name
|
|
12
|
+
*/
|
|
13
|
+
symbol: string;
|
|
14
|
+
/**
|
|
15
|
+
* The path of the .scrypt file
|
|
16
|
+
*/
|
|
17
|
+
path: string;
|
|
18
|
+
/**
|
|
19
|
+
* The md5 of lockingScript
|
|
20
|
+
* exist when the file is a contract
|
|
21
|
+
*/
|
|
22
|
+
md5?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The state type of the contract
|
|
25
|
+
* exist when the file is a stateful contract
|
|
26
|
+
*/
|
|
27
|
+
stateType?: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
type ContractOrLib = new (...args: any[]) => SmartContract<any> | SmartContractLib;
|
|
31
|
+
/** @ignore */
|
|
32
|
+
export declare function calcArtifactHexMD5(artifactHex: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Check the integrity of the contracts:
|
|
35
|
+
*
|
|
36
|
+
* When compiling the contract, @scrypt-inc/cli-btc will generate the scrypt.index.json file, we will use this file to check the the artifact files are consistent with the scrypt.index.json file.
|
|
37
|
+
* You should add the scrypt.index.json file to version control tools like git.
|
|
38
|
+
*
|
|
39
|
+
* @note: make sure you have call loadArtifacts() before calling this function.
|
|
40
|
+
* @ignore
|
|
41
|
+
* @param scryptIndexJson The scrypt.index.json file content generated by @scrypt-inc/cli-btc
|
|
42
|
+
* @param contractClasses The contract classes to check
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkIntegrity(scryptIndexJson: ScryptIndexJson, contractClasses: ContractOrLib[]): void;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=checkIntegrity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkIntegrity.d.ts","sourceRoot":"","sources":["../../../src/utils/checkIntegrity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE;QACR;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;;WAGG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL,CAAC;AAGF,KAAK,aAAa,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,aAAa,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC;AAEnF,cAAc;AACd,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,QA2BhG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { Transaction } from '@opcat-labs/opcat';
|
|
4
|
+
import { ByteString, FixedArray } from '../smart-contract/types/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Converts a Uint8Array to a hexadecimal string.
|
|
7
|
+
* @param {Uint8Array} bytes - The input array of bytes.
|
|
8
|
+
* @returns {string} The hexadecimal representation of the input bytes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function uint8ArrayToHex(bytes: Uint8Array): string;
|
|
11
|
+
/**
|
|
12
|
+
* Converts a hexadecimal string to a Uint8Array.
|
|
13
|
+
* @param {string} hex - The hexadecimal string.
|
|
14
|
+
* @returns {Uint8Array} The resulting Uint8Array.
|
|
15
|
+
*/
|
|
16
|
+
export declare function hexToUint8Array(hex: string): Uint8Array;
|
|
17
|
+
/**
|
|
18
|
+
* create a FixedArray and fill it with initial value
|
|
19
|
+
* @param value
|
|
20
|
+
* @param len
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function fillFixedArray<T, Length extends number>(value: T, len: Length): FixedArray<T, Length>;
|
|
24
|
+
/**
|
|
25
|
+
* create a empty ByteString
|
|
26
|
+
* @returns a empty ByteString
|
|
27
|
+
*/
|
|
28
|
+
export declare function emptyByteString(): ByteString;
|
|
29
|
+
/** @ignore */
|
|
30
|
+
export declare function requireTrue(res: boolean, message: string): void;
|
|
31
|
+
/** @ignore */
|
|
32
|
+
export declare function getTxId(input: Transaction.Input): string;
|
|
33
|
+
/**
|
|
34
|
+
* create StateHashes with empty value
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export declare function emptyStateHashes(): any;
|
|
38
|
+
/** @ignore */
|
|
39
|
+
export declare function cloneDeep<T>(obj: T, hash?: WeakMap<WeakKey, any>): T;
|
|
40
|
+
/**
|
|
41
|
+
* convert a ByteString to bigint.
|
|
42
|
+
* @param a
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
export declare function byteStringToBigInt(a: ByteString): bigint;
|
|
46
|
+
/**
|
|
47
|
+
* convert satoshi to hex in little-endian order
|
|
48
|
+
* @param value
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
export declare function satoshiToHex(value: bigint): string;
|
|
52
|
+
/**
|
|
53
|
+
* convert utf8 text to hex string
|
|
54
|
+
* @param text
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
export declare function textToHex(text: string): string;
|
|
58
|
+
export declare function duplicateFilter<T>(uniqueFn: (item: T) => any): (value: T, index: number, arr: T[]) => boolean;
|
|
59
|
+
export declare function isFinal(sequenceNumber: number): boolean;
|
|
60
|
+
export declare function toHex(val: Buffer | string | Uint8Array): string;
|
|
61
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":";;AACA,OAAO,EAAU,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,UAAU,EACV,UAAU,EACX,MAAM,kCAAkC,CAAC;AAI1C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAKvD;AAGD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,SAAS,MAAM,EACrD,KAAK,EAAE,CAAC,EACR,GAAG,EAAE,MAAM,GACV,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAIvB;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAE5C;AAID,cAAc;AACd,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAIxD;AAED,cAAc;AACd,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,GAAG,MAAM,CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,GAAG,CAGtC;AAED,cAAc;AACd,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,wBAAgB,GAAG,CAAC,CAoF5D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAYxD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,WACnC,CAAC,SAAS,MAAM,OAAO,CAAC,EAAE,aAKnD;AAID,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,WAE7C;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,eAAe,EAAE,gBAAkC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { uint8ArrayToHex, hexToUint8Array, textToHex, fillFixedArray, cloneDeep, isFinal, toHex, } from './common.js';
|
|
2
|
+
export { getValidatedHexString } from '../smart-contract/types/utils.js';
|
|
3
|
+
export { bvmVerify } from './bvm.js';
|
|
4
|
+
export { checkIntegrity, calcArtifactHexMD5 } from './checkIntegrity.js';
|
|
5
|
+
export { getBackTraceInfo } from './proof.js';
|
|
6
|
+
export * as scriptNumber from './script_number.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,SAAS,EACT,cAAc,EACd,SAAS,EACT,OAAO,EACP,KAAK,GACN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ByteString, SHPreimage } from '../smart-contract/types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Decodes a serialized SHPreimage from a Uint8Array.
|
|
4
|
+
*
|
|
5
|
+
* @param preimage - The serialized preimage data as a Uint8Array
|
|
6
|
+
* @returns The decoded SHPreimage object containing:
|
|
7
|
+
* - Version number
|
|
8
|
+
* - Hash of previous outputs
|
|
9
|
+
* - Spent script hash
|
|
10
|
+
* - Spent data hash
|
|
11
|
+
* - Spent amount
|
|
12
|
+
* - Sequence number
|
|
13
|
+
* - Hash of spent amounts
|
|
14
|
+
* - Hash of spent scripts
|
|
15
|
+
* - Hash of spent datas
|
|
16
|
+
* - Hash of sequences
|
|
17
|
+
* - Hash of outputs
|
|
18
|
+
* - Input index
|
|
19
|
+
* - Lock time
|
|
20
|
+
* - Sighash type
|
|
21
|
+
*/
|
|
22
|
+
export declare function decodeSHPreimage(preimage: Uint8Array): SHPreimage;
|
|
23
|
+
/**
|
|
24
|
+
* Encodes a SHPreimage object into a ByteString by concatenating its fields.
|
|
25
|
+
* Each field is converted to a ByteString with appropriate formatting.
|
|
26
|
+
*
|
|
27
|
+
* @param shPreimage - The SHPreimage object containing all required fields
|
|
28
|
+
* @returns The concatenated ByteString representation of the SHPreimage
|
|
29
|
+
*/
|
|
30
|
+
export declare function encodeSHPreimage(shPreimage: SHPreimage): ByteString;
|
|
31
|
+
//# sourceMappingURL=preimage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preimage.d.ts","sourceRoot":"","sources":["../../../src/utils/preimage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAiBjE;AAGD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAiBnE"}
|