@btc-vision/transaction 1.7.1 → 1.7.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/index.js +1 -1
- package/browser/src/buffer/BinaryReader.d.ts +2 -2
- package/browser/src/deterministic/AddressMap.d.ts +12 -5
- package/browser/src/deterministic/AddressSet.d.ts +2 -1
- package/browser/src/deterministic/DeterministicMap.d.ts +1 -1
- package/browser/src/keypair/Address.d.ts +4 -0
- package/browser/src/utils/lengths.d.ts +15 -16
- package/build/buffer/BinaryReader.d.ts +2 -2
- package/build/deterministic/AddressMap.d.ts +12 -5
- package/build/deterministic/AddressMap.js +51 -33
- package/build/deterministic/AddressSet.d.ts +2 -1
- package/build/deterministic/AddressSet.js +17 -21
- package/build/deterministic/DeterministicMap.d.ts +1 -1
- package/build/deterministic/DeterministicMap.js +15 -15
- package/build/keypair/Address.d.ts +4 -0
- package/build/keypair/Address.js +46 -2
- package/build/utils/lengths.d.ts +15 -16
- package/build/utils/lengths.js +1 -1
- package/documentation/quantum-support/02-mnemonic-and-wallet.md +22 -10
- package/package.json +1 -1
- package/src/buffer/BinaryReader.ts +3 -3
- package/src/buffer/BinaryWriter.ts +2 -2
- package/src/deterministic/AddressMap.ts +64 -37
- package/src/deterministic/AddressSet.ts +20 -26
- package/src/deterministic/DeterministicMap.ts +16 -13
- package/src/keypair/Address.ts +136 -0
- package/src/utils/lengths.ts +15 -17
- package/browser/src/deterministic/Map.d.ts +0 -15
- package/build/deterministic/Map.d.ts +0 -15
- package/build/deterministic/Map.js +0 -63
- package/src/deterministic/Map.ts +0 -74
package/src/deterministic/Map.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { i32 } from '../utils/types.js';
|
|
2
|
-
|
|
3
|
-
export class Map<K, V> {
|
|
4
|
-
protected _keys: K[] = [];
|
|
5
|
-
protected _values: V[] = [];
|
|
6
|
-
|
|
7
|
-
public get size(): i32 {
|
|
8
|
-
return this._keys.length;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public keys(): K[] {
|
|
12
|
-
return this._keys;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public values(): V[] {
|
|
16
|
-
return this._values;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public entries(): [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
|
-
}
|
|
26
|
-
|
|
27
|
-
public set(key: K, value: V): void {
|
|
28
|
-
const index: i32 = this.indexOf(key);
|
|
29
|
-
if (index == -1) {
|
|
30
|
-
this._keys.push(key);
|
|
31
|
-
this._values.push(value);
|
|
32
|
-
} else {
|
|
33
|
-
this._values[index] = value;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public indexOf(key: K): i32 {
|
|
38
|
-
for (let i: i32 = 0; i < this._keys.length; i++) {
|
|
39
|
-
if (this._keys[i] == key) {
|
|
40
|
-
return i;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return -1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public get(key: K): V | undefined {
|
|
48
|
-
const index: i32 = this.indexOf(key);
|
|
49
|
-
if (index == -1) {
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
return this._values[index];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public has(key: K): boolean {
|
|
56
|
-
return this.indexOf(key) != -1;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public delete(key: K): boolean {
|
|
60
|
-
const index: i32 = this.indexOf(key);
|
|
61
|
-
if (index == -1) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
this._keys.splice(index, 1);
|
|
66
|
-
this._values.splice(index, 1);
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public clear(): void {
|
|
71
|
-
this._keys = [];
|
|
72
|
-
this._values = [];
|
|
73
|
-
}
|
|
74
|
-
}
|