@opcat-labs/scrypt-ts-opcat 3.2.0 → 3.4.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/stdUtils.scrypt.map +1 -1
- package/assets/.templates/smart-contract/builtin-libs/stdUtils.scrypt.tpl +1 -1
- package/assets/.templates/smart-contract/types/structs.scrypt.tpl +7 -1
- package/assets/smart-contract/builtin-libs/backtrace.scrypt +13 -13
- package/assets/smart-contract/builtin-libs/byteStringReader.scrypt +5 -5
- package/assets/smart-contract/builtin-libs/byteStringWriter.scrypt +6 -6
- package/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
- package/assets/smart-contract/builtin-libs/genesis.scrypt +8 -8
- package/assets/smart-contract/builtin-libs/p2pk.scrypt +1 -1
- package/assets/smart-contract/builtin-libs/p2pkh.scrypt +1 -1
- package/assets/smart-contract/builtin-libs/stateLib.scrypt +1 -1
- package/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
- package/assets/smart-contract/builtin-libs/stdUtils.scrypt +13 -13
- package/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
- package/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
- package/assets/smart-contract/types/structs.scrypt +8 -8
- package/dist/cjs/psbt/extPsbt.cjs +14 -4
- package/dist/cjs/psbt/extPsbt.js.map +1 -1
- package/dist/cjs/smart-contract/builtin-libs/stdUtils.cjs +1 -1
- package/dist/cjs/smart-contract/builtin-libs/stdUtils.js.map +1 -1
- package/dist/cjs/smart-contract/methods/buildOutput.cjs +3 -1
- package/dist/cjs/smart-contract/methods/buildOutput.js.map +1 -1
- package/dist/cjs/smart-contract/types/index.js.map +1 -1
- package/dist/esm/psbt/extPsbt.js +15 -5
- package/dist/esm/psbt/extPsbt.js.map +1 -1
- package/dist/esm/smart-contract/builtin-libs/stdUtils.js +1 -1
- package/dist/esm/smart-contract/builtin-libs/stdUtils.js.map +1 -1
- package/dist/esm/smart-contract/methods/buildOutput.js +3 -1
- package/dist/esm/smart-contract/methods/buildOutput.js.map +1 -1
- package/dist/esm/smart-contract/types/index.js.map +1 -1
- package/dist/types/psbt/extPsbt.d.ts +5 -4
- package/dist/types/psbt/extPsbt.d.ts.map +1 -1
- package/dist/types/smart-contract/methods/buildOutput.d.ts.map +1 -1
- package/dist/types/smart-contract/smartContract.d.ts +1 -1
- package/dist/types/smart-contract/smartContract.d.ts.map +1 -1
- package/dist/types/smart-contract/types/context.d.ts +2 -2
- package/dist/types/smart-contract/types/context.d.ts.map +1 -1
- package/dist/types/smart-contract/types/index.d.ts +1 -1
- package/dist/types/smart-contract/types/index.d.ts.map +1 -1
- package/dist/types/smart-contract/types/structs.d.ts +20 -1
- package/dist/types/smart-contract/types/structs.d.ts.map +1 -1
- package/package.json +2 -2
- package/scrypt.index.json +4 -0
- package/src/smart-contract/builtin-libs/stdUtils.ts +1 -1
- package/src/smart-contract/types/structs.ts +21 -1
|
@@ -189,7 +189,7 @@ export class StdUtils extends SmartContractLib {
|
|
|
189
189
|
|
|
190
190
|
if (header == toByteString('fd')) {
|
|
191
191
|
l = StdUtils.fromLEUnsigned(slice(buf, pos + 1n, pos + 3n));
|
|
192
|
-
ret = slice(buf, 3n, 3n + l);
|
|
192
|
+
ret = slice(buf, pos + 3n, pos + 3n + l);
|
|
193
193
|
nextPos = pos + 3n + l;
|
|
194
194
|
}
|
|
195
195
|
else if (header == toByteString('fe')) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ByteString, Int32, UInt32, UInt64 } from './primitives.js';
|
|
1
|
+
import { ByteString, Int32, UInt32, UInt64, Ripemd160, Sha256 } from './primitives.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The structure used to refer to a particular transaction output
|
|
@@ -241,4 +241,24 @@ export type BacktraceInfo = {
|
|
|
241
241
|
prevPrevTxPreimage: TxHashPreimage;
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
+
/**
|
|
245
|
+
* A structure representing the change output information
|
|
246
|
+
* @category Types
|
|
247
|
+
* @onchain
|
|
248
|
+
*/
|
|
249
|
+
export type ChangeInfo = {
|
|
250
|
+
/**
|
|
251
|
+
* 20 bytes. The public key hash (hash160 of public key) for P2PKH output
|
|
252
|
+
*/
|
|
253
|
+
pubkeyhash: Ripemd160;
|
|
254
|
+
/**
|
|
255
|
+
* 8 bytes. The satoshi amount for the change output
|
|
256
|
+
*/
|
|
257
|
+
satoshis: UInt64;
|
|
258
|
+
/**
|
|
259
|
+
* 32 bytes. The SHA256 hash of the output data
|
|
260
|
+
*/
|
|
261
|
+
dataHash: Sha256;
|
|
262
|
+
};
|
|
263
|
+
|
|
244
264
|
|