@ckb-ccc/core 0.0.4-alpha.11 → 0.0.4-alpha.12

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.
@@ -39,7 +39,6 @@ export class SignerBtcPublicKeyReadonly extends SignerBtc {
39
39
  async isConnected() {
40
40
  return true;
41
41
  }
42
- ;
43
42
  /**
44
43
  * Gets the Bitcoin account associated with the signer.
45
44
  *
@@ -38,7 +38,6 @@ export class SignerCkbScriptReadonly extends Signer {
38
38
  async isConnected() {
39
39
  return true;
40
40
  }
41
- ;
42
41
  /**
43
42
  * Gets the internal address for the script.
44
43
  *
@@ -42,7 +42,6 @@ export class SignerEvmAddressReadonly extends SignerEvm {
42
42
  async isConnected() {
43
43
  return true;
44
44
  }
45
- ;
46
45
  /**
47
46
  * Gets the EVM account associated with the signer.
48
47
  *
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/signer/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,WAAW,EACX,eAAe,EAEhB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,GAAG,EAAW,MAAM,QAAQ,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CAuCzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CA6BtB"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/signer/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,WAAW,EACX,eAAe,EAEhB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,GAAG,EAAW,MAAM,QAAQ,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CAuCzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CA+BtB"}
@@ -81,8 +81,9 @@ export async function prepareSighashAllWitness(txLike, scriptLike, lockLen, clie
81
81
  if (position === -1) {
82
82
  return tx;
83
83
  }
84
- const witness = tx.witnesses[position]
85
- ? WitnessArgs.fromBytes(tx.witnesses[position])
84
+ const rawWitness = tx.witnesses[position];
85
+ const witness = (rawWitness ?? "0x") !== "0x"
86
+ ? WitnessArgs.fromBytes(rawWitness)
86
87
  : WitnessArgs.from({});
87
88
  witness.lock = hexFrom(Array.from(new Array(lockLen), () => 0));
88
89
  tx.witnesses[position] = hexFrom(witness.toBytes());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckb-ccc/core",
3
- "version": "0.0.4-alpha.11",
3
+ "version": "0.0.4-alpha.12",
4
4
  "description": "Common Chains Connector Core",
5
5
  "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
6
  "license": "MIT",
@@ -47,5 +47,5 @@
47
47
  "buffer": "^6.0.3",
48
48
  "cross-fetch": "^4.0.0"
49
49
  },
50
- "gitHead": "db0297c0753349e2650d2845f42f546316078d5d"
50
+ "gitHead": "270afe883a672affe1d9058a843c21255e870e3c"
51
51
  }
@@ -49,7 +49,7 @@ export class SignerBtcPublicKeyReadonly extends SignerBtc {
49
49
  */
50
50
  async isConnected(): Promise<boolean> {
51
51
  return true;
52
- };
52
+ }
53
53
 
54
54
  /**
55
55
  * Gets the Bitcoin account associated with the signer.
@@ -45,7 +45,7 @@ export class SignerCkbScriptReadonly extends Signer {
45
45
  */
46
46
  async isConnected(): Promise<boolean> {
47
47
  return true;
48
- };
48
+ }
49
49
 
50
50
  /**
51
51
  * Gets the internal address for the script.
@@ -50,7 +50,7 @@ export class SignerEvmAddressReadonly extends SignerEvm {
50
50
  */
51
51
  async isConnected(): Promise<boolean> {
52
52
  return true;
53
- };
53
+ }
54
54
 
55
55
  /**
56
56
  * Gets the EVM account associated with the signer.
@@ -112,9 +112,11 @@ export async function prepareSighashAllWitness(
112
112
  return tx;
113
113
  }
114
114
 
115
- const witness = tx.witnesses[position]
116
- ? WitnessArgs.fromBytes(tx.witnesses[position])
117
- : WitnessArgs.from({});
115
+ const rawWitness = tx.witnesses[position];
116
+ const witness =
117
+ (rawWitness ?? "0x") !== "0x"
118
+ ? WitnessArgs.fromBytes(rawWitness)
119
+ : WitnessArgs.from({});
118
120
  witness.lock = hexFrom(Array.from(new Array(lockLen), () => 0));
119
121
  tx.witnesses[position] = hexFrom(witness.toBytes());
120
122