@btc-vision/transaction 1.0.0 → 1.0.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.
Files changed (59) hide show
  1. package/LICENSE.md +58 -12
  2. package/README.md +8 -7
  3. package/browser/_version.d.ts +1 -1
  4. package/browser/index.js +2 -2
  5. package/browser/tests/Regtest.d.ts +3 -0
  6. package/browser/tests/test.d.ts +1 -0
  7. package/browser/transaction/builders/TransactionBuilder.d.ts +2 -1
  8. package/build/_version.d.ts +1 -1
  9. package/build/_version.js +1 -1
  10. package/build/tests/Regtest.d.ts +3 -0
  11. package/build/tests/Regtest.js +29 -0
  12. package/build/tests/test.d.ts +1 -0
  13. package/build/tests/test.js +74 -0
  14. package/build/transaction/builders/TransactionBuilder.d.ts +2 -1
  15. package/build/transaction/builders/TransactionBuilder.js +5 -3
  16. package/docs/classes/BitcoinUtils.html +182 -182
  17. package/docs/classes/CalldataGenerator.html +210 -210
  18. package/docs/classes/Compressor.html +184 -184
  19. package/docs/classes/ContractBaseMetadata.html +181 -181
  20. package/docs/classes/DeploymentGenerator.html +199 -199
  21. package/docs/classes/EcKeyPair.html +279 -279
  22. package/docs/classes/FundingTransaction.html +315 -292
  23. package/docs/classes/Generator.html +198 -198
  24. package/docs/classes/InteractionTransaction.html +387 -364
  25. package/docs/classes/TransactionBuilder.html +325 -302
  26. package/docs/classes/TransactionFactory.html +179 -179
  27. package/docs/classes/TweakedSigner.html +180 -180
  28. package/docs/classes/UTXOManager.html +186 -186
  29. package/docs/classes/Wallet.html +190 -190
  30. package/docs/classes/wBTC.html +188 -188
  31. package/docs/enums/TransactionType.html +178 -178
  32. package/docs/index.html +9 -9
  33. package/docs/interfaces/FetchUTXOParams.html +177 -177
  34. package/docs/interfaces/IFundingTransactionParameters.html +181 -181
  35. package/docs/interfaces/IInteractionParameters.html +184 -184
  36. package/docs/interfaces/ITransactionDataContractDeployment.html +183 -183
  37. package/docs/interfaces/ITransactionDataContractInteractionWrap.html +185 -185
  38. package/docs/interfaces/ITransactionParameters.html +180 -180
  39. package/docs/interfaces/IWallet.html +180 -180
  40. package/docs/interfaces/NetworkInformation.html +175 -175
  41. package/docs/interfaces/PsbtInputExtended.html +193 -193
  42. package/docs/interfaces/PsbtOutputExtendedAddress.html +182 -182
  43. package/docs/interfaces/PsbtOutputExtendedScript.html +182 -182
  44. package/docs/interfaces/RawUTXOResponse.html +177 -177
  45. package/docs/interfaces/TapLeafScript.html +176 -176
  46. package/docs/interfaces/TweakSettings.html +178 -178
  47. package/docs/interfaces/UTXO.html +177 -177
  48. package/docs/interfaces/UpdateInput.html +174 -174
  49. package/docs/types/PsbtOutputExtended.html +173 -173
  50. package/docs/variables/version.html +173 -173
  51. package/package.json +4 -4
  52. package/src/_version.ts +1 -1
  53. package/src/scripts/Regtest.ts +19 -19
  54. package/src/scripts/test.ts +98 -98
  55. package/src/tests/Regtest.ts +36 -0
  56. package/src/tests/test.ts +102 -0
  57. package/src/transaction/builders/TransactionBuilder.ts +606 -603
  58. package/tests/TransactionBuilder.test.ts +58 -58
  59. package/tsconfig.webpack.json +8 -0
package/LICENSE.md CHANGED
@@ -1,16 +1,62 @@
1
- MIT License
1
+ # Custom Software License Agreement
2
2
 
3
- Copyright (c) 2024-2025 to the user BlobMaster41 on GitHub
3
+ ## 1. Definitions
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
- documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8
- persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ - **"Licensor"** refers to the owner(s) and creator(s) of the software. The owner of the github organization "
6
+ btc-vision", "BlobMaster41".
7
+ - **"User"** refers to any person or entity that accesses or uses the software.
8
+ - **"Software"** refers to the source code, binaries, and documentation, whether in electronic or printed format, made
9
+ available by Licensor.
9
10
 
10
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11
- Software.
11
+ ## 2. Grant of License
12
12
 
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14
- WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ This License permits User to view the Software via the repository hosting the Software ("Hosting Service"). Except as
14
+ provided in this Section, no other use of the Software is permitted. The User may not modify, copy, reproduce,
15
+ republish, upload, post, transmit, or distribute the Software in any way.
16
+
17
+ ## 3. Restrictions
18
+
19
+ - **Modification and Distribution**: User is prohibited from modifying, merging, distributing, sublicensing, and/or
20
+ selling copies of the Software.
21
+ - **Commercial Use**: User is prohibited from using the Software for any commercial purposes.
22
+ - **Reverse Engineering**: User is prohibited from reverse engineering, decompiling, or disassembling the Software.
23
+
24
+ ## 4. Termination
25
+
26
+ This License is effective until terminated by the Licensor. It will terminate immediately without notice from the
27
+ Licensor if User fails to comply with any provision of this License. Upon termination, User must destroy all copies of
28
+ the Software.
29
+
30
+ ## 5. Release to Public
31
+
32
+ This License restricts the above rights until the Software is officially released to the public by the Licensor. Upon
33
+ such release, the terms of this License may be modified by the Licensor to allow broader use rights.
34
+
35
+ ## 6. Governing Law
36
+
37
+ This License shall be governed by and construed in accordance with the laws of [Toronto, Canada]. Any legal action or
38
+ proceeding arising under this License will be brought exclusively in the courts located in [Toronto], and the parties
39
+ hereby consent to personal jurisdiction and venue therein.
40
+
41
+ ## 7. Limitation of Liability
42
+
43
+ In no event will the Licensor be liable for any damages, including, without limitation, indirect, incidental, special,
44
+ consequential, or punitive damages arising out of the use of or inability to use the Software.
45
+
46
+ ## 8. Indemnification
47
+
48
+ User agrees to indemnify, defend, and hold harmless the Licensor and its affiliates, officers, agents, employees, and
49
+ partners from any claim or demand, including reasonable attorneys' fees, made by any third party due to or arising out
50
+ of User's use of the Software, User's violation of this License, or User's violation of any rights of another.
51
+
52
+ ## 9. Breach of License
53
+
54
+ Any breach of this License will result in immediate termination of User's rights under this License. Additionally, the
55
+ Licensor reserves the right to pursue any legal action against the User in the event of a breach of this License.
56
+
57
+ ## 10. Acknowledgment
58
+
59
+ User acknowledges that they have read this License, understand it, and agree to be bound by its terms and conditions.
60
+ User also agrees that this License is the complete and exclusive statement of the agreement between the Licensor and the
61
+ User and supersedes all proposals or prior agreements, oral or written, and any other communications between the
62
+ Licensor and the User relating to the subject matter of this License.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # OPNet - Transaction Builder
1
+ # OP_NET - Transaction Builder
2
2
 
3
3
  ![Bitcoin](https://img.shields.io/badge/Bitcoin-000?style=for-the-badge&logo=bitcoin&logoColor=white)
4
4
  ![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
@@ -11,9 +11,9 @@
11
11
 
12
12
  ## Introduction
13
13
 
14
- The OPNet Transaction Builder library allows you to create and sign transactions for the OPNet network. Written in
14
+ The OP_NET Transaction Builder library allows you to create and sign transactions for the OP_NET network. Written in
15
15
  TypeScript, this library provides a comprehensive set of functions to facilitate the creation, reading, and manipulation
16
- of OPNet transactions, smart contracts, and other OPNet-related technologies.
16
+ of OP_NET transactions, smart contracts, and other OP_NET-related technologies.
17
17
 
18
18
  ## Getting Started
19
19
 
@@ -50,7 +50,7 @@ of the repository.
50
50
 
51
51
  ## Usage
52
52
 
53
- Here's a basic example of how to use the OPNet Transaction Builder library to create and sign a transaction:
53
+ Here's a basic example of how to use the OP_NET Transaction Builder library to create and sign a transaction:
54
54
  The following example demonstrates how to create a wBTC transfer transaction.
55
55
 
56
56
  ### Import Statements
@@ -70,13 +70,14 @@ import {
70
70
  import { networks } from 'bitcoinjs-lib';
71
71
  import { BitcoinRPC } from '@btc-vision/bsi-bitcoin-rpc';
72
72
  import { ABICoder, BinaryWriter } from '@btc-vision/bsi-binary';
73
+ import { BitcoinNetwork } from '@btc-vision/bsi-common';
73
74
  ```
74
75
 
75
76
  ### Setting Up configurations
76
77
 
77
78
  We must provide the necessary configurations for the network, wallet, and RPC connection:
78
79
 
79
- - The opnetNode variable is the URL of the OPNet node.
80
+ - The opnetNode variable is the URL of the OP_NET node.
80
81
  - The Testnet variable contains the wallet address, public key, and private key.
81
82
  - The config variable inside the testnet object contains the network, host, port, username, and password for the RPC
82
83
  connection.
@@ -200,12 +201,12 @@ if (!secondTxBroadcast) {
200
201
  }
201
202
  ```
202
203
 
203
- That's it! You have successfully created and broadcasted a transaction using OPNet.
204
+ That's it! You have successfully created and broadcasted a transaction using OP_NET.
204
205
 
205
206
  ## Contribution
206
207
 
207
208
  Contributions are welcome! Please read through the `CONTRIBUTING.md` file for guidelines on how to submit issues,
208
- feature requests, and pull requests. We appreciate your input and encourage you to help us improve OPNet.
209
+ feature requests, and pull requests. We appreciate your input and encourage you to help us improve OP_NET.
209
210
 
210
211
  ## License
211
212
 
@@ -1 +1 @@
1
- export declare const version = "1.0.0";
1
+ export declare const version = "1.0.2";