File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2205,6 +2205,15 @@ NativeScript:
2205
2205
- name : timelock_expiry
2206
2206
tag : 5
2207
2207
value : TimelockExpiry
2208
+ extra_methods : |
2209
+ hash(): ScriptHash {
2210
+ const thisBytes = this.to_bytes();
2211
+ let bytes = new Uint8Array(thisBytes.length + 1);
2212
+ bytes[0] = 0;
2213
+ bytes.set(thisBytes, 1);
2214
+ let hash_bytes = cdlCrypto.blake2b224(bytes);
2215
+ return new ScriptHash(hash_bytes);
2216
+ }
2208
2217
2209
2218
ScriptPubkey :
2210
2219
type : newtype
Original file line number Diff line number Diff line change @@ -8726,6 +8726,15 @@ export class NativeScript {
8726
8726
clone ( path : string [ ] ) : NativeScript {
8727
8727
return NativeScript . from_bytes ( this . to_bytes ( ) , path ) ;
8728
8728
}
8729
+
8730
+ hash ( ) : ScriptHash {
8731
+ const thisBytes = this . to_bytes ( ) ;
8732
+ let bytes = new Uint8Array ( thisBytes . length + 1 ) ;
8733
+ bytes [ 0 ] = 0 ;
8734
+ bytes . set ( thisBytes , 1 ) ;
8735
+ let hash_bytes = cdlCrypto . blake2b224 ( bytes ) ;
8736
+ return new ScriptHash ( hash_bytes ) ;
8737
+ }
8729
8738
}
8730
8739
8731
8740
export class NativeScriptRefInput {
You can’t perform that action at this time.
0 commit comments