@btc-vision/transaction 1.2.0 → 1.2.2
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/browser/_version.d.ts +1 -1
- package/browser/index.js +1 -1
- package/browser/transaction/ContractAddress.d.ts +1 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/generators/builders/CalldataGenerator.js +1 -1
- package/build/generators/builders/LegacyCalldataGenerator.js +1 -1
- package/build/transaction/ContractAddress.d.ts +1 -0
- package/build/transaction/ContractAddress.js +4 -1
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/generators/builders/CalldataGenerator.ts +1 -5
- package/src/generators/builders/LegacyCalldataGenerator.ts +1 -5
- package/src/transaction/ContractAddress.ts +5 -1
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.2.2";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.2.2';
|
|
@@ -34,7 +34,7 @@ export class CalldataGenerator extends Generator {
|
|
|
34
34
|
let compiledData = [
|
|
35
35
|
this.senderFirstByte,
|
|
36
36
|
opcodes.OP_TOALTSTACK,
|
|
37
|
-
|
|
37
|
+
this.xSenderPubKey,
|
|
38
38
|
opcodes.OP_CHECKSIGVERIFY,
|
|
39
39
|
this.contractSaltPubKey,
|
|
40
40
|
opcodes.OP_CHECKSIGVERIFY,
|
|
@@ -30,7 +30,7 @@ export class LegacyCalldataGenerator extends Generator {
|
|
|
30
30
|
if (!dataChunks.length)
|
|
31
31
|
throw new Error('No data chunks found');
|
|
32
32
|
let compiledData = [
|
|
33
|
-
|
|
33
|
+
this.senderPubKey,
|
|
34
34
|
opcodes.OP_CHECKSIGVERIFY,
|
|
35
35
|
contractSecret,
|
|
36
36
|
opcodes.OP_TOALTSTACK,
|
|
@@ -4,9 +4,12 @@ class ContractAddressBase {
|
|
|
4
4
|
this.deriver = new Secp256k1PointDeriver();
|
|
5
5
|
}
|
|
6
6
|
generateHybridKeyFromHash(input) {
|
|
7
|
-
const p = this.deriver.findOrDeriveValidPoint(input, false);
|
|
7
|
+
const p = this.deriver.findOrDeriveValidPoint(this.cloneBuffer(input), false);
|
|
8
8
|
const y = this.deriver.getCanonicalY(p.y1, p.y2);
|
|
9
9
|
return Buffer.from(this.deriver.getHybridPublicKey(p.x, y));
|
|
10
10
|
}
|
|
11
|
+
cloneBuffer(buffer) {
|
|
12
|
+
return Buffer.from(buffer);
|
|
13
|
+
}
|
|
11
14
|
}
|
|
12
15
|
export const ContractAddress = new ContractAddressBase();
|
package/package.json
CHANGED
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.2.2';
|
|
@@ -78,11 +78,7 @@ export class CalldataGenerator extends Generator {
|
|
|
78
78
|
this.senderFirstByte,
|
|
79
79
|
opcodes.OP_TOALTSTACK,
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
'060373626d317ae8788ce3280b491068610d840c23ecb64c14075bbb9f670af52c6c4bc8c9ae26ed8f9831e3da372fbd26eaa48e9b788d1692b9d6f18393c58fc4',
|
|
83
|
-
'hex',
|
|
84
|
-
),
|
|
85
|
-
//this.xSenderPubKey,
|
|
81
|
+
this.xSenderPubKey,
|
|
86
82
|
opcodes.OP_CHECKSIGVERIFY,
|
|
87
83
|
|
|
88
84
|
this.contractSaltPubKey,
|
|
@@ -69,11 +69,7 @@ export class LegacyCalldataGenerator extends Generator {
|
|
|
69
69
|
if (!dataChunks.length) throw new Error('No data chunks found');
|
|
70
70
|
|
|
71
71
|
let compiledData = [
|
|
72
|
-
|
|
73
|
-
Buffer.from(
|
|
74
|
-
'060373626d317ae8788ce3280b491068610d840c23ecb64c14075bbb9f670af52c6c4bc8c9ae26ed8f9831e3da372fbd26eaa48e9b788d1692b9d6f18393c58fc4',
|
|
75
|
-
'hex',
|
|
76
|
-
),
|
|
72
|
+
this.senderPubKey,
|
|
77
73
|
opcodes.OP_CHECKSIGVERIFY,
|
|
78
74
|
|
|
79
75
|
contractSecret,
|
|
@@ -4,10 +4,14 @@ class ContractAddressBase {
|
|
|
4
4
|
private readonly deriver: Secp256k1PointDeriver = new Secp256k1PointDeriver();
|
|
5
5
|
|
|
6
6
|
public generateHybridKeyFromHash(input: Buffer): Buffer {
|
|
7
|
-
const p = this.deriver.findOrDeriveValidPoint(input, false);
|
|
7
|
+
const p = this.deriver.findOrDeriveValidPoint(this.cloneBuffer(input), false);
|
|
8
8
|
const y = this.deriver.getCanonicalY(p.y1, p.y2);
|
|
9
9
|
return Buffer.from(this.deriver.getHybridPublicKey(p.x, y));
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
private cloneBuffer(buffer: Buffer): Buffer {
|
|
13
|
+
return Buffer.from(buffer);
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export const ContractAddress = new ContractAddressBase();
|