@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.
@@ -1 +1 @@
1
- export declare const version = "1.0.117";
1
+ export declare const version = "1.0.118";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.117';
1
+ export const version = '1.0.118';
@@ -5,6 +5,7 @@ export declare class Map<K, V> {
5
5
  get size(): i32;
6
6
  keys(): K[];
7
7
  values(): V[];
8
+ entires(): [K, V][];
8
9
  set(key: K, value: V): void;
9
10
  indexOf(key: K): i32;
10
11
  get(key: K): V | undefined;
@@ -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 (error) {
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 (error) {
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 (error) {
103
- console.log(error);
104
- }
101
+ catch { }
105
102
  return null;
106
103
  }
107
104
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/transaction",
3
3
  "type": "module",
4
- "version": "1.0.117",
4
+ "version": "1.0.118",
5
5
  "author": "BlobMaster41",
6
6
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
7
7
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.117';
1
+ export const version = '1.0.118';
@@ -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 (error) {
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 (error) {
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 (error) {
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
  }