@btc-vision/transaction 1.7.30 → 1.8.0-alpha.1
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/AUDIT/README.md +9 -0
- package/CHANGELOG.md +5 -0
- package/README.md +62 -18
- package/SECURITY.md +71 -0
- package/browser/_version.d.ts +1 -1
- package/browser/deterministic/ExtendedAddressMap.d.ts +17 -0
- package/browser/index.js +449 -363
- package/browser/keypair/Address.d.ts +3 -1
- package/browser/mnemonic/Mnemonic.d.ts +1 -1
- package/browser/noble-curves.js +1087 -1116
- package/browser/noble-hashes.js +25 -25
- package/browser/opnet.d.ts +1 -0
- package/browser/transaction/browser/WalletNetworks.d.ts +3 -3
- package/browser/transaction/browser/types/Unisat.d.ts +4 -4
- package/browser/vendors.js +950 -911
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/deterministic/ExtendedAddressMap.d.ts +17 -0
- package/build/deterministic/ExtendedAddressMap.js +60 -0
- package/build/keypair/Address.d.ts +3 -1
- package/build/keypair/Address.js +30 -10
- package/build/mnemonic/Mnemonic.d.ts +1 -1
- package/build/mnemonic/Mnemonic.js +2 -2
- package/build/opnet.d.ts +1 -0
- package/build/opnet.js +1 -0
- package/build/transaction/browser/WalletNetworks.d.ts +3 -3
- package/build/transaction/browser/WalletNetworks.js +3 -3
- package/build/transaction/browser/extensions/UnisatSigner.js +3 -3
- package/build/transaction/browser/types/Unisat.d.ts +4 -4
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/_version.ts +1 -1
- package/src/deterministic/ExtendedAddressMap.ts +83 -0
- package/src/keypair/Address.ts +53 -9
- package/src/mnemonic/Mnemonic.ts +2 -2
- package/src/opnet.ts +1 -0
- package/src/transaction/browser/WalletNetworks.ts +3 -3
- package/src/transaction/browser/extensions/UnisatSigner.ts +3 -3
- package/src/transaction/browser/types/Unisat.ts +4 -4
- package/test/derivePath.test.ts +30 -29
package/AUDIT/README.md
ADDED
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OPNet - Transaction Builder
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
@@ -9,33 +9,53 @@
|
|
|
9
9
|
|
|
10
10
|
[](https://github.com/prettier/prettier)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Overview
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
This library is a modern and easy-to-use solution for developers looking to work with Bitcoin transactions and OP_NET
|
|
15
|
+
technologies. The OP_NET Transaction Builder library allows you to create and sign transactions for Bitcoin. Written in
|
|
15
16
|
TypeScript, this library provides a comprehensive set of functions to facilitate the creation, reading, and manipulation
|
|
16
17
|
of OP_NET transactions, smart contracts, and other OP_NET-related technologies.
|
|
17
18
|
|
|
18
19
|
You can create any sort of transaction, and you don't have to bother about managing signer types or anything
|
|
19
20
|
complicated.
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
+
## Security Audit
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://verichains.io">
|
|
26
|
+
<img src="https://raw.githubusercontent.com/btc-vision/contract-logo/refs/heads/main/public-assets/verichains.png" alt="Verichains" width="100"/>
|
|
27
|
+
</a>
|
|
28
|
+
</p>
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
<p align="center">
|
|
31
|
+
<a href="https://verichains.io">
|
|
32
|
+
<img src="https://img.shields.io/badge/Security%20Audit-Verichains-4C35E0?style=for-the-badge" alt="Audited by Verichains"/>
|
|
33
|
+
</a>
|
|
34
|
+
<a href="./SECURITY.md">
|
|
35
|
+
<img src="https://img.shields.io/badge/Security-Report-22C55E?style=for-the-badge" alt="Security Report"/>
|
|
36
|
+
</a>
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
This library has been professionally audited by [Verichains](https://verichains.io).
|
|
40
|
+
|
|
41
|
+
See [SECURITY.md](./SECURITY.md) for details.
|
|
27
42
|
|
|
28
|
-
|
|
43
|
+
## Installation
|
|
29
44
|
|
|
30
|
-
```
|
|
31
|
-
npm
|
|
45
|
+
```bash
|
|
46
|
+
npm install @btc-vision/transaction
|
|
32
47
|
```
|
|
33
48
|
|
|
34
|
-
|
|
49
|
+
## Documentation
|
|
35
50
|
|
|
36
|
-
Documentation is available
|
|
51
|
+
Documentation is available [here](./documentation/README.md) and on [docs.opnet.org](https://docs.opnet.org).
|
|
52
|
+
|
|
53
|
+
## Prerequisites
|
|
54
|
+
|
|
55
|
+
- Node.js version 24.x or higher
|
|
56
|
+
- npm (Node Package Manager)
|
|
37
57
|
|
|
38
|
-
|
|
58
|
+
## Development
|
|
39
59
|
|
|
40
60
|
1. Clone the repository:
|
|
41
61
|
```bash
|
|
@@ -47,15 +67,39 @@ Documentation is available at [docs.opnet.org](https://docs.opnet.org)
|
|
|
47
67
|
```
|
|
48
68
|
3. Install the required dependencies:
|
|
49
69
|
```bash
|
|
50
|
-
npm
|
|
70
|
+
npm install
|
|
51
71
|
```
|
|
72
|
+
4. Build the project:
|
|
73
|
+
```bash
|
|
74
|
+
npm run build
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Contributing
|
|
78
|
+
|
|
79
|
+
1. Fork the repository
|
|
80
|
+
2. Create a feature branch
|
|
81
|
+
3. Make your changes
|
|
82
|
+
4. Run tests and build
|
|
83
|
+
5. Submit a pull request
|
|
52
84
|
|
|
53
|
-
|
|
85
|
+
See the [pull request template](./.github/PULL_REQUEST_TEMPLATE.md) for requirements.
|
|
54
86
|
|
|
55
87
|
Contributions are welcome! Please read through the `CONTRIBUTING.md` file for guidelines on how to submit issues,
|
|
56
|
-
feature requests, and pull requests.
|
|
88
|
+
feature requests, and pull requests.
|
|
89
|
+
|
|
90
|
+
## Reporting Issues
|
|
91
|
+
|
|
92
|
+
- **Bugs**: Use the [bug report template](https://github.com/btc-vision/transaction/issues/new?template=bug_report.yml)
|
|
93
|
+
- **Security**: See [SECURITY.md](./SECURITY.md) - do not open public issues for vulnerabilities
|
|
57
94
|
|
|
58
95
|
## License
|
|
59
96
|
|
|
60
|
-
|
|
61
|
-
|
|
97
|
+
[Apache-2.0](./LICENSE)
|
|
98
|
+
|
|
99
|
+
## Links
|
|
100
|
+
|
|
101
|
+
- [OPNet](https://opnet.org)
|
|
102
|
+
- [Documentation](https://docs.opnet.org)
|
|
103
|
+
- [GitHub](https://github.com/btc-vision/transaction)
|
|
104
|
+
- [npm](https://www.npmjs.com/package/@btc-vision/transaction)
|
|
105
|
+
- [Verichains](https://verichains.io)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://verichains.io">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/btc-vision/contract-logo/refs/heads/main/public-assets/verichains.png" alt="Verichains" width="150"/>
|
|
6
|
+
</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://verichains.io">
|
|
11
|
+
<img src="https://img.shields.io/badge/Security%20Audit-Verichains-4C35E0?style=for-the-badge" alt="Audited by Verichains"/>
|
|
12
|
+
</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
## Audit Status
|
|
16
|
+
|
|
17
|
+
| Component | Status | Auditor |
|
|
18
|
+
|--------------------|---------|---------------------------------------|
|
|
19
|
+
| transaction | Audited | [Verichains](https://verichains.io) |
|
|
20
|
+
|
|
21
|
+
## Supported Versions
|
|
22
|
+
|
|
23
|
+
| Version | Status |
|
|
24
|
+
|---------|--------------------|
|
|
25
|
+
| 1.7.x | Supported |
|
|
26
|
+
| < 1.7 | Not supported |
|
|
27
|
+
|
|
28
|
+
## Reporting a Vulnerability
|
|
29
|
+
|
|
30
|
+
**DO NOT** open a public GitHub issue for security vulnerabilities.
|
|
31
|
+
|
|
32
|
+
Report vulnerabilities through [GitHub Security Advisories](https://github.com/btc-vision/transaction/security/advisories/new).
|
|
33
|
+
|
|
34
|
+
Include:
|
|
35
|
+
- Description of the vulnerability
|
|
36
|
+
- Affected version(s)
|
|
37
|
+
- Steps to reproduce
|
|
38
|
+
- Potential impact
|
|
39
|
+
- Suggested fix (if any)
|
|
40
|
+
|
|
41
|
+
### Response Timeline
|
|
42
|
+
|
|
43
|
+
| Action | Timeframe |
|
|
44
|
+
|--------------------------|-------------------|
|
|
45
|
+
| Initial response | 48 hours |
|
|
46
|
+
| Vulnerability assessment | 7 days |
|
|
47
|
+
| Patch development | 14-30 days |
|
|
48
|
+
| Public disclosure | After patch |
|
|
49
|
+
|
|
50
|
+
## Security Scope
|
|
51
|
+
|
|
52
|
+
### In Scope
|
|
53
|
+
|
|
54
|
+
- Transaction parsing and validation
|
|
55
|
+
- Cryptographic operations (signatures, hashing)
|
|
56
|
+
- Address handling and derivation
|
|
57
|
+
- Network communication protocols
|
|
58
|
+
- UTXO management
|
|
59
|
+
- Script parsing and execution
|
|
60
|
+
|
|
61
|
+
### Out of Scope
|
|
62
|
+
|
|
63
|
+
- Third-party dependencies (report to respective maintainers)
|
|
64
|
+
- User application logic errors
|
|
65
|
+
- Issues in development/test environments only
|
|
66
|
+
|
|
67
|
+
## Contact
|
|
68
|
+
|
|
69
|
+
- **Security Issues**: [GitHub Security Advisories](https://github.com/btc-vision/transaction/security/advisories)
|
|
70
|
+
- **General Issues**: [GitHub Issues](https://github.com/btc-vision/transaction/issues)
|
|
71
|
+
- **Website**: [opnet.org](https://opnet.org)
|
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.7.
|
|
1
|
+
export declare const version = "1.7.31";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Address } from '../keypair/Address.js';
|
|
2
|
+
export declare class ExtendedAddressMap<V> {
|
|
3
|
+
private items;
|
|
4
|
+
constructor(iterable?: ReadonlyArray<readonly [Address, V]> | null);
|
|
5
|
+
get size(): number;
|
|
6
|
+
set(key: Address, value: V): this;
|
|
7
|
+
get(key: Address): V | undefined;
|
|
8
|
+
has(key: Address): boolean;
|
|
9
|
+
delete(key: Address): boolean;
|
|
10
|
+
clear(): void;
|
|
11
|
+
indexOf(address: Address): number;
|
|
12
|
+
entries(): IterableIterator<[Address, V]>;
|
|
13
|
+
keys(): IterableIterator<Address>;
|
|
14
|
+
values(): IterableIterator<V>;
|
|
15
|
+
forEach(callback: (value: V, key: Address, map: ExtendedAddressMap<V>) => void, thisArg?: unknown): void;
|
|
16
|
+
[Symbol.iterator](): IterableIterator<[Address, V]>;
|
|
17
|
+
}
|