opnet 1.0.43 → 1.0.45

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 (352) hide show
  1. package/.gitattributes +2 -2
  2. package/.idea/codeStyles/Project.xml +0 -53
  3. package/.idea/inspectionProfiles/Project_Default.xml +0 -1
  4. package/.idea/modules.xml +1 -1
  5. package/.idea/opnet.iml +2 -3
  6. package/README.md +29 -0
  7. package/browser/_version.d.ts +1 -1
  8. package/browser/generator/WrappedGenerationParameters.d.ts +9 -9
  9. package/browser/index.js +1 -1
  10. package/browser/scripts/ITestContract.d.ts +22 -22
  11. package/browser/scripts/test.d.ts +1 -1
  12. package/browser/scripts/testContract.d.ts +1 -1
  13. package/browser/transactions/DeploymentTransaction.d.ts +16 -16
  14. package/browser/transactions/GenericTransaction.d.ts +6 -6
  15. package/browser/transactions/InteractionTransaction.d.ts +15 -15
  16. package/browser/transactions/TransactionInput.d.ts +16 -16
  17. package/browser/transactions/TransactionOutput.d.ts +19 -19
  18. package/browser/transactions/TransactionReceipt.d.ts +11 -11
  19. package/build/_version.d.ts +1 -1
  20. package/build/_version.js +1 -1
  21. package/build/abi/shared/json/MOTOSWAP_POOL_ABI.js +1 -1
  22. package/build/contracts/Contract.js +0 -3
  23. package/build/scripts/testMethods.js +5 -2
  24. package/cjs/_version.d.ts +1 -1
  25. package/cjs/_version.js +1 -1
  26. package/cjs/abi/shared/json/MOTOSWAP_POOL_ABI.js +1 -1
  27. package/cjs/abi/shared/json/MOTOSWAP_ROUTER_ABI.js +3 -3
  28. package/cjs/abi/shared/json/OP_20_ABI.js +11 -0
  29. package/cjs/contracts/Contract.js +0 -3
  30. package/cjs/scripts/block.js +15 -0
  31. package/cjs/scripts/testMethods.js +9 -2
  32. package/docs/assets/highlight.css +15 -8
  33. package/docs/classes/AbstractRpcProvider.html +117 -117
  34. package/docs/classes/BaseContract.html +100 -100
  35. package/docs/classes/BitcoinAddress.html +92 -92
  36. package/docs/classes/BitcoinInterface.html +92 -92
  37. package/docs/classes/BitcoinUtils.html +92 -92
  38. package/docs/classes/Block.html +93 -93
  39. package/docs/classes/CallResult.html +92 -92
  40. package/docs/classes/ContractData.html +92 -92
  41. package/docs/classes/DeploymentTransaction.html +114 -114
  42. package/docs/classes/GenericTransaction.html +104 -104
  43. package/docs/classes/IBaseContract.html +100 -100
  44. package/docs/classes/InteractionTransaction.html +111 -111
  45. package/docs/classes/JSONRpcProvider.html +117 -117
  46. package/docs/classes/OPNetEvent.html +92 -92
  47. package/docs/classes/StoredValue.html +92 -92
  48. package/docs/classes/TransactionBase.html +104 -104
  49. package/docs/classes/TransactionInput.html +92 -92
  50. package/docs/classes/TransactionOutput.html +92 -92
  51. package/docs/classes/TransactionParser.html +92 -92
  52. package/docs/classes/TransactionReceipt.html +97 -97
  53. package/docs/classes/UTXO.html +92 -92
  54. package/docs/classes/UnwrapTransaction.html +116 -116
  55. package/docs/classes/WebSocketRpcProvider.html +117 -117
  56. package/docs/classes/WrapTransaction.html +118 -118
  57. package/docs/enums/ABIDataTypes.html +90 -90
  58. package/docs/enums/BitcoinAbiTypes.html +92 -92
  59. package/docs/enums/GenerateTarget.html +92 -92
  60. package/docs/enums/JSONRPCErrorCode.html +92 -92
  61. package/docs/enums/JSONRPCErrorHttpCodes.html +92 -92
  62. package/docs/enums/JSONRpcMethods.html +99 -99
  63. package/docs/enums/OPNetTransactionTypes.html +92 -92
  64. package/docs/functions/getContract.html +92 -92
  65. package/docs/hierarchy.html +90 -90
  66. package/docs/index.html +98 -91
  67. package/docs/interfaces/BaseContractProperties.html +92 -92
  68. package/docs/interfaces/BitcoinAbiValue.html +93 -93
  69. package/docs/interfaces/BitcoinInterfaceAbiBase.html +92 -92
  70. package/docs/interfaces/BroadcastedTransaction.html +96 -96
  71. package/docs/interfaces/ContractEvents.html +91 -91
  72. package/docs/interfaces/EventBaseData.html +92 -92
  73. package/docs/interfaces/FunctionBaseData.html +92 -92
  74. package/docs/interfaces/IAccessList.html +91 -91
  75. package/docs/interfaces/IAccessListItem.html +91 -91
  76. package/docs/interfaces/IBlock.html +93 -93
  77. package/docs/interfaces/IBlockCommon.html +93 -93
  78. package/docs/interfaces/IBlockWitness.html +92 -92
  79. package/docs/interfaces/IBlockWitnessAPI.html +92 -92
  80. package/docs/interfaces/ICallRequestError.html +92 -92
  81. package/docs/interfaces/ICallResultData.html +92 -92
  82. package/docs/interfaces/ICommonTransaction.html +106 -106
  83. package/docs/interfaces/IContract.html +92 -92
  84. package/docs/interfaces/IDecodedEvent.html +92 -92
  85. package/docs/interfaces/IDeploymentTransaction.html +113 -113
  86. package/docs/interfaces/IGenericTransaction.html +103 -103
  87. package/docs/interfaces/IInteractionTransaction.html +110 -110
  88. package/docs/interfaces/IMotoContract.html +93 -93
  89. package/docs/interfaces/IMotoswapFactoryContract.html +94 -94
  90. package/docs/interfaces/IMotoswapPoolContract.html +100 -100
  91. package/docs/interfaces/IMotoswapRouterContract.html +102 -102
  92. package/docs/interfaces/IOP_20Contract.html +93 -93
  93. package/docs/interfaces/IOP_NETContract.html +92 -92
  94. package/docs/interfaces/IRawContract.html +92 -92
  95. package/docs/interfaces/IRawContractEvents.html +91 -91
  96. package/docs/interfaces/IStackingContract.html +92 -92
  97. package/docs/interfaces/IStorageValue.html +92 -92
  98. package/docs/interfaces/ITransactionBase.html +103 -103
  99. package/docs/interfaces/ITransactionInput.html +92 -92
  100. package/docs/interfaces/ITransactionOutput.html +92 -92
  101. package/docs/interfaces/ITransactionReceipt.html +95 -95
  102. package/docs/interfaces/IUTXO.html +92 -92
  103. package/docs/interfaces/IUnwrapTransaction.html +115 -115
  104. package/docs/interfaces/IWBTCContract.html +94 -94
  105. package/docs/interfaces/IWrapTransaction.html +117 -117
  106. package/docs/interfaces/JSONRpc2Request.html +92 -92
  107. package/docs/interfaces/JSONRpc2ResponseError.html +92 -92
  108. package/docs/interfaces/JSONRpc2ResponseResult.html +92 -92
  109. package/docs/interfaces/JSONRpc2ResultData.html +91 -91
  110. package/docs/interfaces/JSONRpcErrorData.html +91 -91
  111. package/docs/interfaces/JSONRpcParams.html +91 -91
  112. package/docs/interfaces/JSONRpcResultError.html +92 -92
  113. package/docs/interfaces/MergedOP_20AndStackingContract.html +92 -92
  114. package/docs/interfaces/NetEventDocument.html +95 -95
  115. package/docs/interfaces/ParsedPartialWBTCUTXODocument.html +92 -92
  116. package/docs/interfaces/PartialWBTCUTXODocument.html +92 -92
  117. package/docs/interfaces/ReorgInformation.html +92 -92
  118. package/docs/interfaces/UsedUTXO.html +92 -92
  119. package/docs/modules.html +90 -90
  120. package/docs/types/BaseContractProperty.html +91 -91
  121. package/docs/types/BigNumberish.html +91 -91
  122. package/docs/types/BitcoinAddressLike.html +91 -91
  123. package/docs/types/BitcoinInterfaceAbi.html +91 -91
  124. package/docs/types/BlockHeaderChecksumProof.html +91 -91
  125. package/docs/types/BlockTag.html +91 -91
  126. package/docs/types/BlockWitnesses.html +91 -91
  127. package/docs/types/ContractDecodedObjectResult.html +91 -91
  128. package/docs/types/DecodedCallResult.html +91 -91
  129. package/docs/types/DecodedOutput.html +91 -91
  130. package/docs/types/GenerationParameters.html +91 -91
  131. package/docs/types/ICallResult.html +91 -91
  132. package/docs/types/ITransaction.html +91 -91
  133. package/docs/types/InteractionType.html +91 -91
  134. package/docs/types/JSONRpc2RequestParams.html +91 -91
  135. package/docs/types/JSONRpc2Result.html +91 -91
  136. package/docs/types/JSONRpcId.html +91 -91
  137. package/docs/types/JsonRpcCallResult.html +91 -91
  138. package/docs/types/JsonRpcError.html +91 -91
  139. package/docs/types/JsonRpcPayload.html +91 -91
  140. package/docs/types/JsonRpcResult.html +91 -91
  141. package/docs/types/Numeric.html +91 -91
  142. package/docs/types/PointerLike.html +91 -91
  143. package/docs/types/RawContractEvents.html +91 -91
  144. package/docs/types/UTXOs.html +91 -91
  145. package/docs/variables/MOTOSWAP_ROUTER_ABI.html +91 -91
  146. package/docs/variables/MOTO_TOKEN_ABI.html +91 -91
  147. package/docs/variables/MotoSwapFactoryAbi.html +91 -91
  148. package/docs/variables/MotoSwapFactoryEvents.html +91 -91
  149. package/docs/variables/MotoSwapPoolEvents.html +91 -91
  150. package/docs/variables/MotoswapPoolAbi.html +91 -91
  151. package/docs/variables/OP20Events.html +91 -91
  152. package/docs/variables/OP_20_ABI.html +91 -91
  153. package/docs/variables/OP_NET_ABI.html +91 -91
  154. package/docs/variables/STAKING_ABI.html +91 -91
  155. package/docs/variables/StackingEvents.html +91 -91
  156. package/docs/variables/WBTCEvents.html +91 -91
  157. package/docs/variables/WBTC_ABI.html +91 -91
  158. package/docs/variables/version.html +91 -91
  159. package/jest.config.ts +51 -51
  160. package/package.json +2 -2
  161. package/src/_version.ts +1 -1
  162. package/src/abi/BaseContractProperty.ts +8 -8
  163. package/src/abi/BitcoinAbiTypes.ts +9 -9
  164. package/src/abi/BitcoinInterface.ts +78 -78
  165. package/src/abi/interfaces/BaseContractProperties.ts +10 -10
  166. package/src/abi/interfaces/BitcoinAbiValue.ts +18 -18
  167. package/src/abi/interfaces/BitcoinInterfaceAbi.ts +26 -26
  168. package/src/abi/shared/interfaces/IMotoContract.ts +17 -17
  169. package/src/abi/shared/interfaces/IMotoswapFactoryContract.ts +27 -27
  170. package/src/abi/shared/interfaces/IMotoswapPoolContract.ts +71 -71
  171. package/src/abi/shared/interfaces/IMotoswapRouterContract.ts +100 -100
  172. package/src/abi/shared/interfaces/IOP_20Contract.ts +61 -61
  173. package/src/abi/shared/interfaces/IOP_NETContract.ts +15 -15
  174. package/src/abi/shared/interfaces/IStackingContract.ts +24 -24
  175. package/src/abi/shared/interfaces/IWBTCContract.ts +34 -34
  176. package/src/abi/shared/json/MOTOSWAP_FACTORY_ABI.ts +83 -83
  177. package/src/abi/shared/json/MOTOSWAP_POOL_ABI.ts +299 -299
  178. package/src/abi/shared/json/MOTOSWAP_ROUTER_ABI.ts +291 -291
  179. package/src/abi/shared/json/MOTO_TOKEN_ABI.ts +29 -29
  180. package/src/abi/shared/json/OP_20_ABI.ts +282 -282
  181. package/src/abi/shared/json/OP_NET_ABI.ts +37 -37
  182. package/src/abi/shared/json/STAKING_ABI.ts +140 -140
  183. package/src/abi/shared/json/WBTC_ABI.ts +73 -73
  184. package/src/bitcoin/BitcoinAddress.ts +133 -133
  185. package/src/bitcoin/UTXOs.ts +28 -28
  186. package/src/bitcoin/interfaces/IUTXO.ts +12 -12
  187. package/src/block/Block.ts +71 -71
  188. package/src/block/interfaces/BlockWitness.ts +14 -14
  189. package/src/block/interfaces/IBlock.ts +46 -46
  190. package/src/common/CommonTypes.ts +23 -23
  191. package/src/contracts/CallResult.ts +51 -51
  192. package/src/contracts/Contract.ts +596 -595
  193. package/src/contracts/ContractData.ts +54 -54
  194. package/src/contracts/OPNetEvent.ts +33 -33
  195. package/src/contracts/interfaces/IAccessList.ts +17 -17
  196. package/src/contracts/interfaces/ICallResult.ts +30 -30
  197. package/src/contracts/interfaces/IContract.ts +21 -21
  198. package/src/contracts/interfaces/IRawContract.ts +21 -21
  199. package/src/crypto/crypto-browser.js +71 -71
  200. package/src/index.ts +4 -4
  201. package/src/interfaces/opnet/OPNetTransactionTypes.ts +12 -12
  202. package/src/opnet.ts +106 -106
  203. package/src/providers/AbstractRpcProvider.ts +600 -600
  204. package/src/providers/JSONRpcProvider.ts +59 -59
  205. package/src/providers/WebsocketRpcProvider.ts +36 -36
  206. package/src/providers/interfaces/Generate.ts +7 -7
  207. package/src/providers/interfaces/JSONRpc.ts +14 -14
  208. package/src/providers/interfaces/JSONRpcMethods.ts +32 -32
  209. package/src/providers/interfaces/JSONRpcParams.ts +3 -3
  210. package/src/providers/interfaces/JSONRpcResult.ts +61 -61
  211. package/src/providers/interfaces/ReorgInformation.ts +6 -6
  212. package/src/storage/StoredValue.ts +35 -35
  213. package/src/storage/interfaces/IStorageValue.ts +14 -14
  214. package/src/transactions/Transaction.ts +84 -84
  215. package/src/transactions/TransactionParser.ts +58 -58
  216. package/src/transactions/decoders/DeploymentTransaction.ts +48 -48
  217. package/src/transactions/decoders/GenericTransaction.ts +19 -19
  218. package/src/transactions/decoders/InteractionTransaction.ts +61 -61
  219. package/src/transactions/decoders/UnwrapTransaction.ts +69 -69
  220. package/src/transactions/decoders/WrapTransaction.ts +69 -69
  221. package/src/transactions/interfaces/BroadcastedTransaction.ts +24 -24
  222. package/src/transactions/interfaces/ITransaction.ts +79 -79
  223. package/src/transactions/interfaces/ITransactionReceipt.ts +55 -55
  224. package/src/transactions/interfaces/transactions/ICommonTransaction.ts +19 -19
  225. package/src/transactions/interfaces/transactions/IDeploymentTransaction.ts +50 -50
  226. package/src/transactions/interfaces/transactions/IInteractionTransaction.ts +50 -50
  227. package/src/transactions/interfaces/transactions/IUnwrapTransaction.ts +59 -59
  228. package/src/transactions/interfaces/transactions/IWrapTransaction.ts +43 -43
  229. package/src/transactions/metadata/TransactionInput.ts +39 -39
  230. package/src/transactions/metadata/TransactionOutput.ts +41 -41
  231. package/src/transactions/metadata/TransactionReceipt.ts +93 -93
  232. package/src/utils/BitcoinUtils.ts +22 -22
  233. package/webpack.config.js +71 -71
  234. package/.idea/bsc.iml +0 -14
  235. package/.idea/bsi-binary.iml +0 -14
  236. package/.idea/markdown.xml +0 -7
  237. package/.idea/motoswap.iml +0 -12
  238. package/.idea/prettier.xml +0 -7
  239. package/build/abi/BitcoinInterfaceAbi.d.ts +0 -3
  240. package/build/abi/enums/ParamTypes.d.ts +0 -0
  241. package/build/abi/enums/ParamTypes.js +0 -1
  242. package/build/abi/interface/BitcoinInterface.d.ts +0 -6
  243. package/build/abi/interface/BitcoinInterface.js +0 -12
  244. package/build/abi/interface/BitcoinInterfaceAbi.d.ts +0 -3
  245. package/build/abi/interface/BitcoinInterfaceAbi.js +0 -1
  246. package/build/abi/interfaces/BaseContractProperty.d.ts +0 -2
  247. package/build/abi/interfaces/BaseContractProperty.js +0 -1
  248. package/build/abi/interfaces/BitcoinAbiInput.d.ts +0 -5
  249. package/build/abi/interfaces/BitcoinAbiInput.js +0 -1
  250. package/build/abi/shared/MOTOSWAP_FACTORY_ABI.d.ts +0 -2
  251. package/build/abi/shared/MOTOSWAP_FACTORY_ABI.js +0 -68
  252. package/build/abi/shared/OP_20_ABI.d.ts +0 -2
  253. package/build/abi/shared/OP_20_ABI.js +0 -235
  254. package/build/abi/shared/OP_NET_ABI.d.ts +0 -2
  255. package/build/abi/shared/OP_NET_ABI.js +0 -31
  256. package/build/abi/shared/STAKING_ABI.d.ts +0 -2
  257. package/build/abi/shared/STAKING_ABI.js +0 -96
  258. package/build/abi/shared/WBTC_ABI.d.ts +0 -2
  259. package/build/abi/shared/WBTC_ABI.js +0 -40
  260. package/build/bitcoin/UXTOs.d.ts +0 -7
  261. package/build/bitcoin/UXTOs.js +0 -1
  262. package/build/block/index.d.ts +0 -2
  263. package/build/block/index.js +0 -1
  264. package/build/contracts/DecodedEvent.d.ts +0 -15
  265. package/build/contracts/DecodedEvent.js +0 -18
  266. package/build/contracts/IRawContract.d.ts +0 -13
  267. package/build/contracts/IRawContract.js +0 -1
  268. package/build/crypto/crypto-browser.d.ts +0 -0
  269. package/build/crypto/crypto-browser.js +0 -47
  270. package/build/generator/WrappedGenerationParameters.d.ts +0 -9
  271. package/build/generator/WrappedGenerationParameters.js +0 -14
  272. package/build/interface/BitcoinInterface.d.ts +0 -6
  273. package/build/interface/BitcoinInterface.js +0 -12
  274. package/build/interface/BitcoinInterfaceAbi.d.ts +0 -3
  275. package/build/interface/BitcoinInterfaceAbi.js +0 -1
  276. package/build/interface/Interface.d.ts +0 -2
  277. package/build/interface/Interface.js +0 -2
  278. package/build/interface.d.ts +0 -0
  279. package/build/interface.js +0 -1
  280. package/build/interfaces/Block.d.ts +0 -0
  281. package/build/interfaces/Block.js +0 -1
  282. package/build/interfaces/IBlock.d.ts +0 -0
  283. package/build/interfaces/IBlock.js +0 -1
  284. package/build/interfaces/blocks/IBlock.d.ts +0 -28
  285. package/build/interfaces/blocks/IBlock.js +0 -1
  286. package/build/interfaces/transactions/ITransaction.d.ts +0 -39
  287. package/build/interfaces/transactions/ITransaction.js +0 -1
  288. package/build/providers/index.d.ts +0 -4
  289. package/build/providers/index.js +0 -4
  290. package/build/providers/interfaces/GenerateResult.d.ts +0 -0
  291. package/build/providers/interfaces/GenerateResult.js +0 -1
  292. package/build/scripts/ITestContract.d.ts +0 -18
  293. package/build/scripts/ITestContract.js +0 -1
  294. package/build/scripts/test.d.ts +0 -1
  295. package/build/scripts/test.js +0 -24
  296. package/build/scripts/testContract.d.ts +0 -1
  297. package/build/scripts/testContract.js +0 -11
  298. package/build/storage/interfaces/IStorage.d.ts +0 -7
  299. package/build/storage/interfaces/IStorage.js +0 -1
  300. package/build/transactions/DeploymentTransaction.d.ts +0 -16
  301. package/build/transactions/DeploymentTransaction.js +0 -24
  302. package/build/transactions/GenericTransaction.d.ts +0 -6
  303. package/build/transactions/GenericTransaction.js +0 -6
  304. package/build/transactions/InteractionTransaction.d.ts +0 -15
  305. package/build/transactions/InteractionTransaction.js +0 -21
  306. package/build/transactions/TransactionInput.d.ts +0 -16
  307. package/build/transactions/TransactionInput.js +0 -14
  308. package/build/transactions/TransactionOutput.d.ts +0 -19
  309. package/build/transactions/TransactionOutput.js +0 -16
  310. package/build/transactions/TransactionReceipt.d.ts +0 -11
  311. package/build/transactions/TransactionReceipt.js +0 -53
  312. package/build/transactions/decoders/WrapInteractionTransaction.d.ts +0 -15
  313. package/build/transactions/decoders/WrapInteractionTransaction.js +0 -21
  314. package/build/transactions/index.d.ts +0 -6
  315. package/build/transactions/index.js +0 -6
  316. package/build/transactions/interfaces/IWrapTransaction.d.ts +0 -3
  317. package/build/transactions/interfaces/IWrapTransaction.js +0 -1
  318. package/build/transactions/types/DeploymentTransaction.d.ts +0 -16
  319. package/build/transactions/types/DeploymentTransaction.js +0 -24
  320. package/build/transactions/types/GenericTransaction.d.ts +0 -6
  321. package/build/transactions/types/GenericTransaction.js +0 -6
  322. package/build/transactions/types/InteractionTransaction.d.ts +0 -15
  323. package/build/transactions/types/InteractionTransaction.js +0 -21
  324. package/cjs/generator/WrappedGenerationParameters.d.ts +0 -9
  325. package/cjs/generator/WrappedGenerationParameters.js +0 -18
  326. package/cjs/interfaces/blocks/IBlock.d.ts +0 -28
  327. package/cjs/interfaces/blocks/IBlock.js +0 -2
  328. package/cjs/interfaces/transactions/ITransaction.d.ts +0 -31
  329. package/cjs/interfaces/transactions/ITransaction.js +0 -2
  330. package/cjs/scripts/ITestContract.d.ts +0 -9
  331. package/cjs/scripts/ITestContract.js +0 -48
  332. package/cjs/scripts/test.d.ts +0 -1
  333. package/cjs/scripts/test.js +0 -10
  334. package/cjs/scripts/testContract.d.ts +0 -1
  335. package/cjs/scripts/testContract.js +0 -13
  336. package/cjs/transactions/DeploymentTransaction.d.ts +0 -16
  337. package/cjs/transactions/DeploymentTransaction.js +0 -28
  338. package/cjs/transactions/GenericTransaction.d.ts +0 -6
  339. package/cjs/transactions/GenericTransaction.js +0 -10
  340. package/cjs/transactions/InteractionTransaction.d.ts +0 -15
  341. package/cjs/transactions/InteractionTransaction.js +0 -25
  342. package/cjs/transactions/TransactionInput.d.ts +0 -16
  343. package/cjs/transactions/TransactionInput.js +0 -18
  344. package/cjs/transactions/TransactionOutput.d.ts +0 -19
  345. package/cjs/transactions/TransactionOutput.js +0 -20
  346. package/cjs/transactions/TransactionReceipt.d.ts +0 -11
  347. package/cjs/transactions/TransactionReceipt.js +0 -57
  348. package/src/scripts/block.ts +0 -16
  349. package/src/scripts/testMethods.ts +0 -57
  350. package/src/scripts/testMethodsReg.ts +0 -48
  351. package/src/scripts/testWBTCContract.ts +0 -22
  352. /package/{build/abi/BitcoinInterfaceAbi.js → cjs/scripts/block.d.ts} +0 -0
package/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -2,8 +2,6 @@
2
2
  <code_scheme name="Project" version="173">
3
3
  <HTMLCodeStyleSettings>
4
4
  <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- <option name="HTML_QUOTE_STYLE" value="Single" />
6
- <option name="HTML_ENFORCE_QUOTES" value="true" />
7
5
  </HTMLCodeStyleSettings>
8
6
  <JSCodeStyleSettings version="0">
9
7
  <option name="FORCE_SEMICOLON_STYLE" value="true" />
@@ -13,22 +11,15 @@
13
11
  <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
14
12
  <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
15
13
  <option name="SPACES_WITHIN_IMPORTS" value="true" />
16
- <option name="IMPORT_SORT_MODULE_NAME" value="true" />
17
14
  </JSCodeStyleSettings>
18
- <Markdown>
19
- <option name="KEEP_LINE_BREAKS_INSIDE_TEXT_BLOCKS" value="false" />
20
- </Markdown>
21
15
  <TypeScriptCodeStyleSettings version="0">
22
16
  <option name="FORCE_SEMICOLON_STYLE" value="true" />
23
17
  <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
24
18
  <option name="USE_DOUBLE_QUOTES" value="false" />
25
19
  <option name="FORCE_QUOTE_STYlE" value="true" />
26
20
  <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
27
- <option name="USE_EXPLICIT_JS_EXTENSION" value="TRUE" />
28
- <option name="VAR_DECLARATION_WRAP" value="5" />
29
21
  <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
30
22
  <option name="SPACES_WITHIN_IMPORTS" value="true" />
31
- <option name="IMPORT_SORT_MODULE_NAME" value="true" />
32
23
  </TypeScriptCodeStyleSettings>
33
24
  <VueCodeStyleSettings>
34
25
  <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
@@ -40,54 +31,10 @@
40
31
  <option name="CONTINUATION_INDENT_SIZE" value="4" />
41
32
  </indentOptions>
42
33
  </codeStyleSettings>
43
- <codeStyleSettings language="JSON">
44
- <indentOptions>
45
- <option name="INDENT_SIZE" value="4" />
46
- </indentOptions>
47
- </codeStyleSettings>
48
34
  <codeStyleSettings language="JavaScript">
49
- <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
50
- <option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
51
- <option name="CALL_PARAMETERS_WRAP" value="5" />
52
- <option name="PREFER_PARAMETERS_WRAP" value="true" />
53
- <option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
54
- <option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
55
- <option name="METHOD_PARAMETERS_WRAP" value="5" />
56
- <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
57
- <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
58
- <option name="BINARY_OPERATION_WRAP" value="5" />
59
35
  <option name="SOFT_MARGINS" value="100" />
60
36
  </codeStyleSettings>
61
- <codeStyleSettings language="Markdown">
62
- <option name="RIGHT_MARGIN" value="80" />
63
- <option name="WRAP_ON_TYPING" value="1" />
64
- <option name="SOFT_MARGINS" value="80" />
65
- <indentOptions>
66
- <option name="INDENT_SIZE" value="2" />
67
- <option name="CONTINUATION_INDENT_SIZE" value="4" />
68
- <option name="TAB_SIZE" value="2" />
69
- </indentOptions>
70
- </codeStyleSettings>
71
37
  <codeStyleSettings language="TypeScript">
72
- <option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
73
- <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
74
- <option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
75
- <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
76
- <option name="CALL_PARAMETERS_WRAP" value="5" />
77
- <option name="PREFER_PARAMETERS_WRAP" value="true" />
78
- <option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
79
- <option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
80
- <option name="METHOD_PARAMETERS_WRAP" value="5" />
81
- <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
82
- <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
83
- <option name="METHOD_CALL_CHAIN_WRAP" value="5" />
84
- <option name="PARENTHESES_EXPRESSION_LPAREN_WRAP" value="true" />
85
- <option name="PARENTHESES_EXPRESSION_RPAREN_WRAP" value="true" />
86
- <option name="FOR_STATEMENT_LPAREN_ON_NEXT_LINE" value="true" />
87
- <option name="FOR_STATEMENT_RPAREN_ON_NEXT_LINE" value="true" />
88
- <option name="ARRAY_INITIALIZER_WRAP" value="5" />
89
- <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
90
- <option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
91
38
  <option name="SOFT_MARGINS" value="100" />
92
39
  </codeStyleSettings>
93
40
  <codeStyleSettings language="Vue">
@@ -2,6 +2,5 @@
2
2
  <profile version="1.0">
3
3
  <option name="myName" value="Project Default" />
4
4
  <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- <inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
6
5
  </profile>
7
6
  </component>
package/.idea/modules.xml CHANGED
@@ -2,7 +2,7 @@
2
2
  <project version="4">
3
3
  <component name="ProjectModuleManager">
4
4
  <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/OPNet.iml" filepath="$PROJECT_DIR$/.idea/OPNet.iml" />
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/opnet.iml" filepath="$PROJECT_DIR$/.idea/opnet.iml" />
6
6
  </modules>
7
7
  </component>
8
8
  </project>
package/.idea/opnet.iml CHANGED
@@ -2,13 +2,12 @@
2
2
  <module type="WEB_MODULE" version="4">
3
3
  <component name="NewModuleRootManager">
4
4
  <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
5
  <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
7
  <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ <excludeFolder url="file://$MODULE_DIR$/browser" />
8
9
  <excludeFolder url="file://$MODULE_DIR$/build" />
9
- <excludeFolder url="file://$MODULE_DIR$/packages" />
10
10
  <excludeFolder url="file://$MODULE_DIR$/cjs" />
11
- <excludeFolder url="file://$MODULE_DIR$/browser" />
12
11
  <excludeFolder url="file://$MODULE_DIR$/docs" />
13
12
  </content>
14
13
  <orderEntry type="inheritedJdk" />
package/README.md CHANGED
@@ -51,6 +51,35 @@ the `docs/` directory of the repository.
51
51
  npm i
52
52
  ```
53
53
 
54
+ ## Example
55
+
56
+ Calling a contract function from typescript/javascript is as simple as the following code:
57
+ ```typescript
58
+ import { getContract, JSONRpcProvider } from 'opnet';
59
+
60
+ const senderAddress: string = 'tb1p823gdnqvk8a90f8cu30w8ywvk29uh8txtqqnsmk6f5ktd7hlyl0q3cyz4c';
61
+ const provider: JSONRpcProvider = new JSONRpcProvider('https://testnet.opnet.org');
62
+ const contract: IOP_20Contract = getContract<IOP_20Contract>(
63
+ 'tb1q4tyhf8hpu04qjj3qaag20knun0spctultxzakw', // MOTO Contract
64
+ OP_20_ABI,
65
+ provider,
66
+ sender
67
+ );
68
+
69
+ const balanceExample = await contract.balanceOf(
70
+ 'tb1p823gdnqvk8a90f8cu30w8ywvk29uh8txtqqnsmk6f5ktd7hlyl0q3cyz4c', // Random address
71
+ );
72
+
73
+ if ('error' in balanceExample) throw new Error('Error in fetching balance');
74
+ console.log('MOTO Balance:', balanceExample.properties);
75
+ ```
76
+
77
+ You can call any function of the contract by using the `contract` object. This object will encode the correct calldata based of your provided ABI and simulate the call.
78
+ A bunch more documentation will be available soon.
79
+
80
+ You can get the calldata generated by doing balanceExample.calldata and generate your transaction based on that.
81
+ In scenarios where you are writing data on-chain, you must specify the sender in the getContract function. This is important for the simulation to pass.
82
+
54
83
  ## Contribution
55
84
 
56
85
  Contributions are welcome! Please read through the `CONTRIBUTING.md` file for
@@ -1 +1 @@
1
- export declare const version = "1.0.43";
1
+ export declare const version = "1.0.45";
@@ -1,9 +1,9 @@
1
- import { GenerationConstraints, WrappedGenerationParameters } from '../providers/interfaces/Generate.js';
2
- export declare class WrappedGeneration implements WrappedGenerationParameters {
3
- readonly constraints: GenerationConstraints;
4
- readonly entities: string[];
5
- readonly keys: string[];
6
- readonly signature: string;
7
- readonly vault: string;
8
- constructor(params: WrappedGenerationParameters);
9
- }
1
+ import { GenerationConstraints, WrappedGenerationParameters } from '../providers/interfaces/Generate.js';
2
+ export declare class WrappedGeneration implements WrappedGenerationParameters {
3
+ readonly constraints: GenerationConstraints;
4
+ readonly entities: string[];
5
+ readonly keys: string[];
6
+ readonly signature: string;
7
+ readonly vault: string;
8
+ constructor(params: WrappedGenerationParameters);
9
+ }