opnet 1.0.21 → 1.0.22

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 (205) hide show
  1. package/browser/_version.d.ts +1 -1
  2. package/browser/contracts/ContractData.d.ts +5 -3
  3. package/browser/contracts/interfaces/IRawContract.d.ts +5 -3
  4. package/browser/index.js +1 -1
  5. package/browser/index.js.LICENSE.txt +2 -0
  6. package/browser/interfaces/opnet/OPNetTransactionTypes.d.ts +4 -1
  7. package/browser/opnet.d.ts +11 -6
  8. package/browser/providers/AbstractRpcProvider.d.ts +1 -1
  9. package/browser/scripts/testMethodsReg.d.ts +1 -0
  10. package/browser/transactions/Transaction.d.ts +4 -3
  11. package/browser/transactions/decoders/DeploymentTransaction.d.ts +17 -0
  12. package/browser/transactions/decoders/GenericTransaction.d.ts +6 -0
  13. package/browser/transactions/decoders/InteractionTransaction.d.ts +15 -0
  14. package/browser/transactions/decoders/WrapTransaction.d.ts +15 -0
  15. package/browser/transactions/interfaces/ITransaction.d.ts +8 -27
  16. package/browser/transactions/interfaces/transactions/ICommonTransaction.d.ts +7 -0
  17. package/browser/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +13 -0
  18. package/browser/transactions/interfaces/transactions/IInteractionTransaction.d.ts +14 -0
  19. package/browser/transactions/interfaces/transactions/IWrapTransaction.d.ts +10 -0
  20. package/browser/transactions/metadata/TransactionInput.d.ts +16 -0
  21. package/browser/transactions/metadata/TransactionOutput.d.ts +19 -0
  22. package/browser/transactions/metadata/TransactionReceipt.d.ts +11 -0
  23. package/build/_version.d.ts +1 -1
  24. package/build/_version.js +1 -1
  25. package/build/contracts/ContractData.d.ts +5 -3
  26. package/build/contracts/ContractData.js +2 -0
  27. package/build/contracts/interfaces/IRawContract.d.ts +5 -3
  28. package/build/interfaces/opnet/OPNetTransactionTypes.d.ts +4 -1
  29. package/build/interfaces/opnet/OPNetTransactionTypes.js +2 -0
  30. package/build/opnet.d.ts +11 -6
  31. package/build/opnet.js +11 -6
  32. package/build/providers/AbstractRpcProvider.d.ts +1 -1
  33. package/build/providers/AbstractRpcProvider.js +1 -1
  34. package/build/scripts/testMethods.js +1 -1
  35. package/build/scripts/testMethodsReg.d.ts +1 -0
  36. package/build/scripts/testMethodsReg.js +10 -0
  37. package/build/transactions/Transaction.d.ts +4 -3
  38. package/build/transactions/Transaction.js +5 -3
  39. package/build/transactions/TransactionParser.js +8 -4
  40. package/build/transactions/decoders/DeploymentTransaction.d.ts +17 -0
  41. package/build/transactions/decoders/DeploymentTransaction.js +26 -0
  42. package/build/transactions/decoders/GenericTransaction.d.ts +6 -0
  43. package/build/transactions/decoders/GenericTransaction.js +6 -0
  44. package/build/transactions/decoders/InteractionTransaction.d.ts +15 -0
  45. package/build/transactions/decoders/InteractionTransaction.js +21 -0
  46. package/build/transactions/decoders/WrapInteractionTransaction.d.ts +15 -0
  47. package/build/transactions/decoders/WrapInteractionTransaction.js +21 -0
  48. package/build/transactions/decoders/WrapTransaction.d.ts +15 -0
  49. package/build/transactions/decoders/WrapTransaction.js +30 -0
  50. package/build/transactions/interfaces/ITransaction.d.ts +8 -27
  51. package/build/transactions/interfaces/IWrapTransaction.d.ts +3 -0
  52. package/build/transactions/interfaces/IWrapTransaction.js +1 -0
  53. package/build/transactions/interfaces/transactions/ICommonTransaction.d.ts +7 -0
  54. package/build/transactions/interfaces/transactions/ICommonTransaction.js +1 -0
  55. package/build/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +13 -0
  56. package/build/transactions/interfaces/transactions/IDeploymentTransaction.js +1 -0
  57. package/build/transactions/interfaces/transactions/IInteractionTransaction.d.ts +14 -0
  58. package/build/transactions/interfaces/transactions/IInteractionTransaction.js +1 -0
  59. package/build/transactions/interfaces/transactions/IWrapTransaction.d.ts +10 -0
  60. package/build/transactions/interfaces/transactions/IWrapTransaction.js +1 -0
  61. package/build/transactions/metadata/TransactionInput.d.ts +16 -0
  62. package/build/transactions/metadata/TransactionInput.js +14 -0
  63. package/build/transactions/metadata/TransactionOutput.d.ts +19 -0
  64. package/build/transactions/metadata/TransactionOutput.js +16 -0
  65. package/build/transactions/metadata/TransactionReceipt.d.ts +11 -0
  66. package/build/transactions/metadata/TransactionReceipt.js +53 -0
  67. package/build/transactions/types/DeploymentTransaction.d.ts +16 -0
  68. package/build/transactions/types/DeploymentTransaction.js +24 -0
  69. package/build/transactions/types/GenericTransaction.d.ts +6 -0
  70. package/build/transactions/types/GenericTransaction.js +6 -0
  71. package/build/transactions/types/InteractionTransaction.d.ts +15 -0
  72. package/build/transactions/types/InteractionTransaction.js +21 -0
  73. package/cjs/_version.d.ts +1 -1
  74. package/cjs/_version.js +1 -1
  75. package/cjs/block/interfaces/BlockWitness.d.ts +11 -0
  76. package/cjs/block/interfaces/BlockWitness.js +2 -0
  77. package/cjs/contracts/Contract.d.ts +3 -1
  78. package/cjs/contracts/Contract.js +18 -12
  79. package/cjs/contracts/interfaces/IContract.d.ts +3 -1
  80. package/cjs/generator/WrappedGenerationParameters.d.ts +9 -0
  81. package/cjs/generator/WrappedGenerationParameters.js +18 -0
  82. package/cjs/opnet.d.ts +6 -1
  83. package/cjs/opnet.js +6 -1
  84. package/cjs/providers/AbstractRpcProvider.d.ts +8 -0
  85. package/cjs/providers/AbstractRpcProvider.js +63 -0
  86. package/cjs/providers/interfaces/Generate.d.ts +19 -0
  87. package/cjs/providers/interfaces/Generate.js +7 -0
  88. package/cjs/providers/interfaces/ReorgInformation.d.ts +5 -0
  89. package/cjs/providers/interfaces/ReorgInformation.js +2 -0
  90. package/cjs/scripts/ITestContract.d.ts +2 -2
  91. package/cjs/scripts/ITestContract.js +2 -2
  92. package/cjs/scripts/testContract.js +1 -1
  93. package/cjs/scripts/testMethods.js +8 -15
  94. package/cjs/transactions/TransactionReceipt.d.ts +3 -3
  95. package/cjs/transactions/TransactionReceipt.js +35 -16
  96. package/cjs/transactions/interfaces/BroadcastedTransaction.d.ts +7 -0
  97. package/cjs/transactions/interfaces/BroadcastedTransaction.js +2 -0
  98. package/cjs/transactions/interfaces/ITransaction.d.ts +2 -3
  99. package/cjs/transactions/interfaces/ITransactionReceipt.d.ts +9 -1
  100. package/docs/assets/navigation.js +1 -1
  101. package/docs/assets/search.js +1 -1
  102. package/docs/classes/AbstractRpcProvider.html +18 -18
  103. package/docs/classes/BaseContract.html +7 -7
  104. package/docs/classes/BitcoinAddress.html +2 -2
  105. package/docs/classes/BitcoinInterface.html +2 -2
  106. package/docs/classes/BitcoinUtils.html +2 -2
  107. package/docs/classes/Block.html +3 -3
  108. package/docs/classes/CallResult.html +2 -2
  109. package/docs/classes/ContractData.html +3 -2
  110. package/docs/classes/DeploymentTransaction.html +26 -22
  111. package/docs/classes/GenericTransaction.html +15 -13
  112. package/docs/classes/IBaseContract.html +7 -7
  113. package/docs/classes/InteractionTransaction.html +22 -20
  114. package/docs/classes/JSONRpcProvider.html +17 -17
  115. package/docs/classes/OPNetEvent.html +2 -2
  116. package/docs/classes/StoredValue.html +2 -2
  117. package/docs/classes/TransactionBase.html +15 -13
  118. package/docs/classes/TransactionInput.html +2 -2
  119. package/docs/classes/TransactionOutput.html +2 -2
  120. package/docs/classes/TransactionParser.html +2 -2
  121. package/docs/classes/TransactionReceipt.html +7 -7
  122. package/docs/classes/UTXO.html +2 -2
  123. package/docs/classes/WebSocketRpcProvider.html +17 -17
  124. package/docs/classes/WrapTransaction.html +229 -0
  125. package/docs/classes/WrappedGeneration.html +7 -7
  126. package/docs/enums/BitcoinAbiTypes.html +2 -2
  127. package/docs/enums/GenerateTarget.html +2 -2
  128. package/docs/enums/OPNetTransactionTypes.html +4 -2
  129. package/docs/functions/getContract.html +1 -1
  130. package/docs/hierarchy.html +1 -1
  131. package/docs/interfaces/BaseContractProperties.html +2 -2
  132. package/docs/interfaces/BitcoinAbiValue.html +3 -3
  133. package/docs/interfaces/BitcoinInterfaceAbiBase.html +2 -2
  134. package/docs/interfaces/BroadcastedTransaction.html +6 -6
  135. package/docs/interfaces/ContractEvents.html +1 -1
  136. package/docs/interfaces/EventBaseData.html +2 -2
  137. package/docs/interfaces/FunctionBaseData.html +2 -2
  138. package/docs/interfaces/GenerationConstraints.html +7 -7
  139. package/docs/interfaces/IAccessList.html +1 -1
  140. package/docs/interfaces/IAccessListItem.html +1 -1
  141. package/docs/interfaces/IBlock.html +3 -3
  142. package/docs/interfaces/IBlockCommon.html +3 -3
  143. package/docs/interfaces/IBlockWitness.html +2 -2
  144. package/docs/interfaces/IBlockWitnessAPI.html +2 -2
  145. package/docs/interfaces/ICallRequestError.html +2 -2
  146. package/docs/interfaces/ICallResultData.html +2 -2
  147. package/docs/interfaces/ICommonTransaction.html +17 -15
  148. package/docs/interfaces/IContract.html +2 -2
  149. package/docs/interfaces/IDecodedEvent.html +2 -2
  150. package/docs/interfaces/IDeploymentTransaction.html +26 -22
  151. package/docs/interfaces/IGenericTransaction.html +14 -12
  152. package/docs/interfaces/IInteractionTransaction.html +22 -20
  153. package/docs/interfaces/IRawContract.html +3 -2
  154. package/docs/interfaces/IRawContractEvents.html +1 -1
  155. package/docs/interfaces/IStorageValue.html +2 -2
  156. package/docs/interfaces/ITransactionBase.html +14 -12
  157. package/docs/interfaces/ITransactionInput.html +2 -2
  158. package/docs/interfaces/ITransactionOutput.html +2 -2
  159. package/docs/interfaces/ITransactionReceipt.html +5 -5
  160. package/docs/interfaces/IUTXO.html +2 -2
  161. package/docs/interfaces/IWrapTransaction.html +228 -0
  162. package/docs/interfaces/NetEventDocument.html +5 -5
  163. package/docs/interfaces/ReorgInformation.html +2 -2
  164. package/docs/interfaces/WrappedGenerationParameters.html +6 -6
  165. package/docs/modules.html +3 -0
  166. package/docs/types/BaseContractProperty.html +1 -1
  167. package/docs/types/BitcoinAddressLike.html +1 -1
  168. package/docs/types/BitcoinInterfaceAbi.html +1 -1
  169. package/docs/types/BlockHeaderChecksumProof.html +1 -1
  170. package/docs/types/BlockWitnesses.html +1 -1
  171. package/docs/types/ContractDecodedObjectResult.html +1 -1
  172. package/docs/types/DecodedCallResult.html +1 -1
  173. package/docs/types/DecodedOutput.html +1 -1
  174. package/docs/types/GenerationParameters.html +1 -1
  175. package/docs/types/ICallResult.html +1 -1
  176. package/docs/types/ITransaction.html +2 -2
  177. package/docs/types/InteractionType.html +174 -0
  178. package/docs/types/PointerLike.html +1 -1
  179. package/docs/types/RawContractEvents.html +1 -1
  180. package/docs/types/UTXOs.html +1 -1
  181. package/docs/variables/version.html +1 -1
  182. package/package.json +6 -5
  183. package/src/_version.ts +1 -1
  184. package/src/contracts/ContractData.ts +11 -3
  185. package/src/contracts/interfaces/IRawContract.ts +7 -3
  186. package/src/interfaces/opnet/OPNetTransactionTypes.ts +7 -0
  187. package/src/opnet.ts +13 -6
  188. package/src/providers/AbstractRpcProvider.ts +1 -1
  189. package/src/scripts/testMethods.ts +54 -54
  190. package/src/scripts/testMethodsReg.ts +20 -0
  191. package/src/transactions/Transaction.ts +10 -3
  192. package/src/transactions/TransactionParser.ts +13 -10
  193. package/src/transactions/{DeploymentTransaction.ts → decoders/DeploymentTransaction.ts} +6 -3
  194. package/src/transactions/{GenericTransaction.ts → decoders/GenericTransaction.ts} +3 -3
  195. package/src/transactions/{InteractionTransaction.ts → decoders/InteractionTransaction.ts} +4 -4
  196. package/src/transactions/decoders/WrapTransaction.ts +69 -0
  197. package/src/transactions/interfaces/ITransaction.ts +16 -107
  198. package/src/transactions/interfaces/transactions/ICommonTransaction.ts +19 -0
  199. package/src/transactions/interfaces/transactions/IDeploymentTransaction.ts +50 -0
  200. package/src/transactions/interfaces/transactions/IInteractionTransaction.ts +50 -0
  201. package/src/transactions/interfaces/transactions/IWrapTransaction.ts +43 -0
  202. package/src/transactions/{TransactionReceipt.ts → metadata/TransactionReceipt.ts} +1 -1
  203. package/tsconfig.webpack.json +8 -0
  204. /package/src/transactions/{TransactionInput.ts → metadata/TransactionInput.ts} +0 -0
  205. /package/src/transactions/{TransactionOutput.ts → metadata/TransactionOutput.ts} +0 -0
@@ -0,0 +1,50 @@
1
+ import { OPNetTransactionTypes } from '../../../interfaces/opnet/OPNetTransactionTypes.js';
2
+ import { ICommonTransaction } from './ICommonTransaction.js';
3
+
4
+ /**
5
+ * @description This interface represents a deployment transaction.
6
+ * @interface IDeploymentTransaction
7
+ * @category ITransactions
8
+ */
9
+ export interface IDeploymentTransaction
10
+ extends ICommonTransaction<OPNetTransactionTypes.Deployment> {
11
+ /**
12
+ * @description The sewgit generated address of the contract. (SAFE)
13
+ */
14
+ readonly contractAddress: string;
15
+
16
+ /**
17
+ * @description The P2TR address of the contract. (COULD BE EXPLOITABLE)
18
+ */
19
+ readonly p2trAddress: string;
20
+
21
+ /**
22
+ * @description The virtual address of the contract.
23
+ */
24
+ readonly virtualAddress: string;
25
+
26
+ /**
27
+ * @description The bytecode of the contract.
28
+ */
29
+ readonly bytecode: Buffer | string;
30
+
31
+ /**
32
+ * @description The public key of the deployer.
33
+ */
34
+ readonly deployerPubKey: Buffer | string;
35
+
36
+ /**
37
+ * @description The address of the deployer. (ALWAYS TAPROOT. *This address is generated from the P2TR of the pubkey of the deployer.*)
38
+ */
39
+ readonly deployerAddress: string;
40
+
41
+ /**
42
+ * @description The seed of the contract.
43
+ */
44
+ readonly contractSeed: Buffer | string;
45
+
46
+ /**
47
+ * @description The salt verification hash of the contract.
48
+ */
49
+ readonly contractSaltHash: Buffer | string;
50
+ }
@@ -0,0 +1,50 @@
1
+ import { InteractionType } from '../../../interfaces/opnet/OPNetTransactionTypes.js';
2
+ import { ContractEvents } from '../ITransactionReceipt.js';
3
+ import { ICommonTransaction } from './ICommonTransaction.js';
4
+
5
+ /**
6
+ * @description This interface represents an interaction transaction.
7
+ * @interface IInteractionTransaction
8
+ * @category ITransactions
9
+ */
10
+ export interface IInteractionTransaction extends ICommonTransaction<InteractionType> {
11
+ /**
12
+ * @description The calldata of the transaction.
13
+ */
14
+ readonly calldata: string | Buffer;
15
+
16
+ /**
17
+ * @description The sender's public key hash.
18
+ */
19
+ readonly senderPubKeyHash: string | Buffer;
20
+
21
+ /**
22
+ * @description The contract secret.
23
+ */
24
+ readonly contractSecret: string | Buffer;
25
+
26
+ /**
27
+ * @description The interaction public key.
28
+ */
29
+ readonly interactionPubKey: string | Buffer;
30
+
31
+ /**
32
+ * @description Who sent the transaction. (ALWAYS TAPROOT. *This address is generated from the P2TR of the pubkey of the deployer.*)
33
+ */
34
+ readonly from: string;
35
+
36
+ /**
37
+ * @description If the interaction returned events, they will be stored here.
38
+ */
39
+ readonly events: ContractEvents;
40
+
41
+ /**
42
+ * @description The receipt of the transaction.
43
+ */
44
+ readonly receipt?: string | Buffer;
45
+
46
+ /**
47
+ * @description The receipt proofs of the transaction.
48
+ */
49
+ readonly receiptProofs?: string[];
50
+ }
@@ -0,0 +1,43 @@
1
+ import { IInteractionTransaction } from './IInteractionTransaction.js';
2
+
3
+ /**
4
+ * @description This interface represents a wrap transaction.
5
+ * @interface IWrapTransaction
6
+ * @category ITransactions
7
+ */
8
+ export interface IWrapTransaction extends IInteractionTransaction {
9
+ /**
10
+ * @description Was the wrapping transaction penalized due to invalid calldata?
11
+ */
12
+ readonly penalized: boolean;
13
+
14
+ /**
15
+ * @description The fees that were paid for wrapping.
16
+ */
17
+ readonly wrappingFees: bigint | string;
18
+
19
+ /**
20
+ * @description The final amount that was deposited.
21
+ */
22
+ readonly depositAmount: bigint | string;
23
+
24
+ /**
25
+ * @description The address where the deposit was made.
26
+ */
27
+ readonly depositAddress: string;
28
+
29
+ /**
30
+ * @description The vault used to store the Bitcoin.
31
+ */
32
+ readonly vault: string;
33
+
34
+ /**
35
+ * @description The vault trusted public keys used for the wrap.
36
+ */
37
+ readonly pubKeys: string[];
38
+
39
+ /**
40
+ * @description The minimum amount of signatures required for the vault.
41
+ */
42
+ readonly minimumSignatures: number;
43
+ }
@@ -4,7 +4,7 @@ import {
4
4
  ITransactionReceipt,
5
5
  NetEventDocument,
6
6
  RawContractEvents,
7
- } from './interfaces/ITransactionReceipt.js';
7
+ } from '../interfaces/ITransactionReceipt.js';
8
8
 
9
9
  /**
10
10
  * Transaction receipt
@@ -6,6 +6,14 @@
6
6
  "target": "esnext",
7
7
  "declaration": true,
8
8
  "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "strict": true,
11
+ "baseUrl": ".",
12
+ "paths": {
13
+ "@btc-vision/transaction": [
14
+ "node_modules/@btc-vision/transaction"
15
+ ]
16
+ },
9
17
  "moduleResolution": "bundler"
10
18
  }
11
19
  }