@btc-vision/transaction 1.0.117 → 1.0.118
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/deterministic/Map.d.ts +1 -0
- package/browser/index.js +1 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/deterministic/Map.d.ts +1 -0
- package/build/deterministic/Map.js +7 -0
- package/build/keypair/AddressVerificator.js +3 -6
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/deterministic/Map.ts +8 -0
- package/src/keypair/AddressVerificator.ts +3 -9
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.118";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.118';
|
|
@@ -12,6 +12,13 @@ export class Map {
|
|
|
12
12
|
values() {
|
|
13
13
|
return this._values;
|
|
14
14
|
}
|
|
15
|
+
entires() {
|
|
16
|
+
const result = [];
|
|
17
|
+
for (let i = 0; i < this._keys.length; i++) {
|
|
18
|
+
result.push([this._keys[i], this._values[i]]);
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
15
22
|
set(key, value) {
|
|
16
23
|
const index = this.indexOf(key);
|
|
17
24
|
if (index == -1) {
|
|
@@ -68,7 +68,7 @@ export class AddressVerificator {
|
|
|
68
68
|
return true;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
catch
|
|
71
|
+
catch {
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
return false;
|
|
@@ -86,8 +86,7 @@ export class AddressVerificator {
|
|
|
86
86
|
return AddressTypes.P2SH_OR_P2SH_P2WPKH;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
catch
|
|
90
|
-
}
|
|
89
|
+
catch { }
|
|
91
90
|
try {
|
|
92
91
|
const decodedBech32 = address.fromBech32(addy);
|
|
93
92
|
if (decodedBech32.prefix === network.bech32) {
|
|
@@ -99,9 +98,7 @@ export class AddressVerificator {
|
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
|
-
catch
|
|
103
|
-
console.log(error);
|
|
104
|
-
}
|
|
101
|
+
catch { }
|
|
105
102
|
return null;
|
|
106
103
|
}
|
|
107
104
|
}
|
package/package.json
CHANGED
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.118';
|
package/src/deterministic/Map.ts
CHANGED
|
@@ -15,6 +15,14 @@ export class Map<K, V> {
|
|
|
15
15
|
public values(): V[] {
|
|
16
16
|
return this._values;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
public entires(): [K, V][] {
|
|
20
|
+
const result: [K, V][] = [];
|
|
21
|
+
for (let i: i32 = 0; i < this._keys.length; i++) {
|
|
22
|
+
result.push([this._keys[i], this._values[i]]);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
18
26
|
|
|
19
27
|
public set(key: K, value: V): void {
|
|
20
28
|
const index: i32 = this.indexOf(key);
|
|
@@ -118,8 +118,7 @@ export class AddressVerificator {
|
|
|
118
118
|
|
|
119
119
|
return true;
|
|
120
120
|
}
|
|
121
|
-
} catch
|
|
122
|
-
// If any error occurs (invalid public key, etc.), return false
|
|
121
|
+
} catch {
|
|
123
122
|
return false;
|
|
124
123
|
}
|
|
125
124
|
|
|
@@ -156,9 +155,7 @@ export class AddressVerificator {
|
|
|
156
155
|
// P2SH: Could be P2SH (general) or P2SH-P2WPKH (wrapped SegWit)
|
|
157
156
|
return AddressTypes.P2SH_OR_P2SH_P2WPKH;
|
|
158
157
|
}
|
|
159
|
-
} catch
|
|
160
|
-
// Ignore errors from Base58 decoding, it could be a Bech32 address
|
|
161
|
-
}
|
|
158
|
+
} catch {}
|
|
162
159
|
|
|
163
160
|
try {
|
|
164
161
|
// Try to decode as a Bech32 or Bech32m address (P2WPKH or P2TR)
|
|
@@ -174,10 +171,7 @@ export class AddressVerificator {
|
|
|
174
171
|
return AddressTypes.P2TR;
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
|
-
} catch
|
|
178
|
-
console.log(error);
|
|
179
|
-
// Ignore errors from Bech32/Bech32m decoding
|
|
180
|
-
}
|
|
174
|
+
} catch {}
|
|
181
175
|
|
|
182
176
|
return null; // Not a valid or recognized Bitcoin address type
|
|
183
177
|
}
|