opnet 1.0.43 → 1.0.44

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 (347) 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/scripts/testMethods.js +5 -2
  22. package/cjs/_version.d.ts +1 -1
  23. package/cjs/_version.js +1 -1
  24. package/cjs/abi/shared/json/MOTOSWAP_ROUTER_ABI.js +3 -3
  25. package/cjs/abi/shared/json/OP_20_ABI.js +11 -0
  26. package/cjs/scripts/block.js +15 -0
  27. package/cjs/scripts/testMethods.js +9 -2
  28. package/docs/classes/AbstractRpcProvider.html +112 -112
  29. package/docs/classes/BaseContract.html +100 -100
  30. package/docs/classes/BitcoinAddress.html +92 -92
  31. package/docs/classes/BitcoinInterface.html +92 -92
  32. package/docs/classes/BitcoinUtils.html +92 -92
  33. package/docs/classes/Block.html +93 -93
  34. package/docs/classes/CallResult.html +92 -92
  35. package/docs/classes/ContractData.html +92 -92
  36. package/docs/classes/DeploymentTransaction.html +114 -114
  37. package/docs/classes/GenericTransaction.html +104 -104
  38. package/docs/classes/IBaseContract.html +100 -100
  39. package/docs/classes/InteractionTransaction.html +111 -111
  40. package/docs/classes/JSONRpcProvider.html +112 -112
  41. package/docs/classes/OPNetEvent.html +92 -92
  42. package/docs/classes/StoredValue.html +92 -92
  43. package/docs/classes/TransactionBase.html +104 -104
  44. package/docs/classes/TransactionInput.html +92 -92
  45. package/docs/classes/TransactionOutput.html +92 -92
  46. package/docs/classes/TransactionParser.html +92 -92
  47. package/docs/classes/TransactionReceipt.html +97 -97
  48. package/docs/classes/UTXO.html +92 -92
  49. package/docs/classes/UnwrapTransaction.html +116 -116
  50. package/docs/classes/WebSocketRpcProvider.html +112 -112
  51. package/docs/classes/WrapTransaction.html +118 -118
  52. package/docs/enums/ABIDataTypes.html +90 -90
  53. package/docs/enums/BitcoinAbiTypes.html +92 -92
  54. package/docs/enums/GenerateTarget.html +92 -92
  55. package/docs/enums/JSONRPCErrorCode.html +92 -92
  56. package/docs/enums/JSONRPCErrorHttpCodes.html +92 -92
  57. package/docs/enums/JSONRpcMethods.html +99 -99
  58. package/docs/enums/OPNetTransactionTypes.html +92 -92
  59. package/docs/functions/getContract.html +91 -91
  60. package/docs/hierarchy.html +90 -90
  61. package/docs/index.html +90 -90
  62. package/docs/interfaces/BaseContractProperties.html +92 -92
  63. package/docs/interfaces/BitcoinAbiValue.html +93 -93
  64. package/docs/interfaces/BitcoinInterfaceAbiBase.html +92 -92
  65. package/docs/interfaces/BroadcastedTransaction.html +96 -96
  66. package/docs/interfaces/ContractEvents.html +91 -91
  67. package/docs/interfaces/EventBaseData.html +92 -92
  68. package/docs/interfaces/FunctionBaseData.html +92 -92
  69. package/docs/interfaces/IAccessList.html +91 -91
  70. package/docs/interfaces/IAccessListItem.html +91 -91
  71. package/docs/interfaces/IBlock.html +93 -93
  72. package/docs/interfaces/IBlockCommon.html +93 -93
  73. package/docs/interfaces/IBlockWitness.html +92 -92
  74. package/docs/interfaces/IBlockWitnessAPI.html +92 -92
  75. package/docs/interfaces/ICallRequestError.html +92 -92
  76. package/docs/interfaces/ICallResultData.html +92 -92
  77. package/docs/interfaces/ICommonTransaction.html +106 -106
  78. package/docs/interfaces/IContract.html +92 -92
  79. package/docs/interfaces/IDecodedEvent.html +92 -92
  80. package/docs/interfaces/IDeploymentTransaction.html +113 -113
  81. package/docs/interfaces/IGenericTransaction.html +103 -103
  82. package/docs/interfaces/IInteractionTransaction.html +110 -110
  83. package/docs/interfaces/IMotoContract.html +93 -93
  84. package/docs/interfaces/IMotoswapFactoryContract.html +94 -94
  85. package/docs/interfaces/IMotoswapPoolContract.html +100 -100
  86. package/docs/interfaces/IMotoswapRouterContract.html +102 -102
  87. package/docs/interfaces/IOP_20Contract.html +92 -92
  88. package/docs/interfaces/IOP_NETContract.html +92 -92
  89. package/docs/interfaces/IRawContract.html +92 -92
  90. package/docs/interfaces/IRawContractEvents.html +91 -91
  91. package/docs/interfaces/IStackingContract.html +92 -92
  92. package/docs/interfaces/IStorageValue.html +92 -92
  93. package/docs/interfaces/ITransactionBase.html +103 -103
  94. package/docs/interfaces/ITransactionInput.html +92 -92
  95. package/docs/interfaces/ITransactionOutput.html +92 -92
  96. package/docs/interfaces/ITransactionReceipt.html +95 -95
  97. package/docs/interfaces/IUTXO.html +92 -92
  98. package/docs/interfaces/IUnwrapTransaction.html +115 -115
  99. package/docs/interfaces/IWBTCContract.html +94 -94
  100. package/docs/interfaces/IWrapTransaction.html +117 -117
  101. package/docs/interfaces/JSONRpc2Request.html +92 -92
  102. package/docs/interfaces/JSONRpc2ResponseError.html +92 -92
  103. package/docs/interfaces/JSONRpc2ResponseResult.html +92 -92
  104. package/docs/interfaces/JSONRpc2ResultData.html +91 -91
  105. package/docs/interfaces/JSONRpcErrorData.html +91 -91
  106. package/docs/interfaces/JSONRpcParams.html +91 -91
  107. package/docs/interfaces/JSONRpcResultError.html +92 -92
  108. package/docs/interfaces/MergedOP_20AndStackingContract.html +92 -92
  109. package/docs/interfaces/NetEventDocument.html +95 -95
  110. package/docs/interfaces/ParsedPartialWBTCUTXODocument.html +92 -92
  111. package/docs/interfaces/PartialWBTCUTXODocument.html +92 -92
  112. package/docs/interfaces/ReorgInformation.html +92 -92
  113. package/docs/interfaces/UsedUTXO.html +92 -92
  114. package/docs/modules.html +90 -90
  115. package/docs/types/BaseContractProperty.html +91 -91
  116. package/docs/types/BigNumberish.html +91 -91
  117. package/docs/types/BitcoinAddressLike.html +91 -91
  118. package/docs/types/BitcoinInterfaceAbi.html +91 -91
  119. package/docs/types/BlockHeaderChecksumProof.html +91 -91
  120. package/docs/types/BlockTag.html +91 -91
  121. package/docs/types/BlockWitnesses.html +91 -91
  122. package/docs/types/ContractDecodedObjectResult.html +91 -91
  123. package/docs/types/DecodedCallResult.html +91 -91
  124. package/docs/types/DecodedOutput.html +91 -91
  125. package/docs/types/GenerationParameters.html +91 -91
  126. package/docs/types/ICallResult.html +91 -91
  127. package/docs/types/ITransaction.html +91 -91
  128. package/docs/types/InteractionType.html +91 -91
  129. package/docs/types/JSONRpc2RequestParams.html +91 -91
  130. package/docs/types/JSONRpc2Result.html +91 -91
  131. package/docs/types/JSONRpcId.html +91 -91
  132. package/docs/types/JsonRpcCallResult.html +91 -91
  133. package/docs/types/JsonRpcError.html +91 -91
  134. package/docs/types/JsonRpcPayload.html +91 -91
  135. package/docs/types/JsonRpcResult.html +91 -91
  136. package/docs/types/Numeric.html +91 -91
  137. package/docs/types/PointerLike.html +91 -91
  138. package/docs/types/RawContractEvents.html +91 -91
  139. package/docs/types/UTXOs.html +91 -91
  140. package/docs/variables/MOTOSWAP_ROUTER_ABI.html +91 -91
  141. package/docs/variables/MOTO_TOKEN_ABI.html +91 -91
  142. package/docs/variables/MotoSwapFactoryAbi.html +91 -91
  143. package/docs/variables/MotoSwapFactoryEvents.html +91 -91
  144. package/docs/variables/MotoSwapPoolEvents.html +91 -91
  145. package/docs/variables/MotoswapPoolAbi.html +91 -91
  146. package/docs/variables/OP20Events.html +91 -91
  147. package/docs/variables/OP_20_ABI.html +91 -91
  148. package/docs/variables/OP_NET_ABI.html +91 -91
  149. package/docs/variables/STAKING_ABI.html +91 -91
  150. package/docs/variables/StackingEvents.html +91 -91
  151. package/docs/variables/WBTCEvents.html +91 -91
  152. package/docs/variables/WBTC_ABI.html +91 -91
  153. package/docs/variables/version.html +91 -91
  154. package/jest.config.ts +51 -51
  155. package/package.json +2 -2
  156. package/src/_version.ts +1 -1
  157. package/src/abi/BaseContractProperty.ts +8 -8
  158. package/src/abi/BitcoinAbiTypes.ts +9 -9
  159. package/src/abi/BitcoinInterface.ts +78 -78
  160. package/src/abi/interfaces/BaseContractProperties.ts +10 -10
  161. package/src/abi/interfaces/BitcoinAbiValue.ts +18 -18
  162. package/src/abi/interfaces/BitcoinInterfaceAbi.ts +26 -26
  163. package/src/abi/shared/interfaces/IMotoContract.ts +17 -17
  164. package/src/abi/shared/interfaces/IMotoswapFactoryContract.ts +27 -27
  165. package/src/abi/shared/interfaces/IMotoswapPoolContract.ts +71 -71
  166. package/src/abi/shared/interfaces/IMotoswapRouterContract.ts +100 -100
  167. package/src/abi/shared/interfaces/IOP_20Contract.ts +61 -61
  168. package/src/abi/shared/interfaces/IOP_NETContract.ts +15 -15
  169. package/src/abi/shared/interfaces/IStackingContract.ts +24 -24
  170. package/src/abi/shared/interfaces/IWBTCContract.ts +34 -34
  171. package/src/abi/shared/json/MOTOSWAP_FACTORY_ABI.ts +83 -83
  172. package/src/abi/shared/json/MOTOSWAP_POOL_ABI.ts +299 -299
  173. package/src/abi/shared/json/MOTOSWAP_ROUTER_ABI.ts +291 -291
  174. package/src/abi/shared/json/MOTO_TOKEN_ABI.ts +29 -29
  175. package/src/abi/shared/json/OP_20_ABI.ts +282 -282
  176. package/src/abi/shared/json/OP_NET_ABI.ts +37 -37
  177. package/src/abi/shared/json/STAKING_ABI.ts +140 -140
  178. package/src/abi/shared/json/WBTC_ABI.ts +73 -73
  179. package/src/bitcoin/BitcoinAddress.ts +133 -133
  180. package/src/bitcoin/UTXOs.ts +28 -28
  181. package/src/bitcoin/interfaces/IUTXO.ts +12 -12
  182. package/src/block/Block.ts +71 -71
  183. package/src/block/interfaces/BlockWitness.ts +14 -14
  184. package/src/block/interfaces/IBlock.ts +46 -46
  185. package/src/common/CommonTypes.ts +23 -23
  186. package/src/contracts/CallResult.ts +51 -51
  187. package/src/contracts/Contract.ts +595 -595
  188. package/src/contracts/ContractData.ts +54 -54
  189. package/src/contracts/OPNetEvent.ts +33 -33
  190. package/src/contracts/interfaces/IAccessList.ts +17 -17
  191. package/src/contracts/interfaces/ICallResult.ts +30 -30
  192. package/src/contracts/interfaces/IContract.ts +21 -21
  193. package/src/contracts/interfaces/IRawContract.ts +21 -21
  194. package/src/crypto/crypto-browser.js +71 -71
  195. package/src/index.ts +4 -4
  196. package/src/interfaces/opnet/OPNetTransactionTypes.ts +12 -12
  197. package/src/opnet.ts +106 -106
  198. package/src/providers/AbstractRpcProvider.ts +600 -600
  199. package/src/providers/JSONRpcProvider.ts +59 -59
  200. package/src/providers/WebsocketRpcProvider.ts +36 -36
  201. package/src/providers/interfaces/Generate.ts +7 -7
  202. package/src/providers/interfaces/JSONRpc.ts +14 -14
  203. package/src/providers/interfaces/JSONRpcMethods.ts +32 -32
  204. package/src/providers/interfaces/JSONRpcParams.ts +3 -3
  205. package/src/providers/interfaces/JSONRpcResult.ts +61 -61
  206. package/src/providers/interfaces/ReorgInformation.ts +6 -6
  207. package/src/storage/StoredValue.ts +35 -35
  208. package/src/storage/interfaces/IStorageValue.ts +14 -14
  209. package/src/transactions/Transaction.ts +84 -84
  210. package/src/transactions/TransactionParser.ts +58 -58
  211. package/src/transactions/decoders/DeploymentTransaction.ts +48 -48
  212. package/src/transactions/decoders/GenericTransaction.ts +19 -19
  213. package/src/transactions/decoders/InteractionTransaction.ts +61 -61
  214. package/src/transactions/decoders/UnwrapTransaction.ts +69 -69
  215. package/src/transactions/decoders/WrapTransaction.ts +69 -69
  216. package/src/transactions/interfaces/BroadcastedTransaction.ts +24 -24
  217. package/src/transactions/interfaces/ITransaction.ts +79 -79
  218. package/src/transactions/interfaces/ITransactionReceipt.ts +55 -55
  219. package/src/transactions/interfaces/transactions/ICommonTransaction.ts +19 -19
  220. package/src/transactions/interfaces/transactions/IDeploymentTransaction.ts +50 -50
  221. package/src/transactions/interfaces/transactions/IInteractionTransaction.ts +50 -50
  222. package/src/transactions/interfaces/transactions/IUnwrapTransaction.ts +59 -59
  223. package/src/transactions/interfaces/transactions/IWrapTransaction.ts +43 -43
  224. package/src/transactions/metadata/TransactionInput.ts +39 -39
  225. package/src/transactions/metadata/TransactionOutput.ts +41 -41
  226. package/src/transactions/metadata/TransactionReceipt.ts +93 -93
  227. package/src/utils/BitcoinUtils.ts +22 -22
  228. package/webpack.config.js +71 -71
  229. package/.idea/bsc.iml +0 -14
  230. package/.idea/bsi-binary.iml +0 -14
  231. package/.idea/markdown.xml +0 -7
  232. package/.idea/motoswap.iml +0 -12
  233. package/.idea/prettier.xml +0 -7
  234. package/build/abi/BitcoinInterfaceAbi.d.ts +0 -3
  235. package/build/abi/enums/ParamTypes.d.ts +0 -0
  236. package/build/abi/enums/ParamTypes.js +0 -1
  237. package/build/abi/interface/BitcoinInterface.d.ts +0 -6
  238. package/build/abi/interface/BitcoinInterface.js +0 -12
  239. package/build/abi/interface/BitcoinInterfaceAbi.d.ts +0 -3
  240. package/build/abi/interface/BitcoinInterfaceAbi.js +0 -1
  241. package/build/abi/interfaces/BaseContractProperty.d.ts +0 -2
  242. package/build/abi/interfaces/BaseContractProperty.js +0 -1
  243. package/build/abi/interfaces/BitcoinAbiInput.d.ts +0 -5
  244. package/build/abi/interfaces/BitcoinAbiInput.js +0 -1
  245. package/build/abi/shared/MOTOSWAP_FACTORY_ABI.d.ts +0 -2
  246. package/build/abi/shared/MOTOSWAP_FACTORY_ABI.js +0 -68
  247. package/build/abi/shared/OP_20_ABI.d.ts +0 -2
  248. package/build/abi/shared/OP_20_ABI.js +0 -235
  249. package/build/abi/shared/OP_NET_ABI.d.ts +0 -2
  250. package/build/abi/shared/OP_NET_ABI.js +0 -31
  251. package/build/abi/shared/STAKING_ABI.d.ts +0 -2
  252. package/build/abi/shared/STAKING_ABI.js +0 -96
  253. package/build/abi/shared/WBTC_ABI.d.ts +0 -2
  254. package/build/abi/shared/WBTC_ABI.js +0 -40
  255. package/build/bitcoin/UXTOs.d.ts +0 -7
  256. package/build/bitcoin/UXTOs.js +0 -1
  257. package/build/block/index.d.ts +0 -2
  258. package/build/block/index.js +0 -1
  259. package/build/contracts/DecodedEvent.d.ts +0 -15
  260. package/build/contracts/DecodedEvent.js +0 -18
  261. package/build/contracts/IRawContract.d.ts +0 -13
  262. package/build/contracts/IRawContract.js +0 -1
  263. package/build/crypto/crypto-browser.d.ts +0 -0
  264. package/build/crypto/crypto-browser.js +0 -47
  265. package/build/generator/WrappedGenerationParameters.d.ts +0 -9
  266. package/build/generator/WrappedGenerationParameters.js +0 -14
  267. package/build/interface/BitcoinInterface.d.ts +0 -6
  268. package/build/interface/BitcoinInterface.js +0 -12
  269. package/build/interface/BitcoinInterfaceAbi.d.ts +0 -3
  270. package/build/interface/BitcoinInterfaceAbi.js +0 -1
  271. package/build/interface/Interface.d.ts +0 -2
  272. package/build/interface/Interface.js +0 -2
  273. package/build/interface.d.ts +0 -0
  274. package/build/interface.js +0 -1
  275. package/build/interfaces/Block.d.ts +0 -0
  276. package/build/interfaces/Block.js +0 -1
  277. package/build/interfaces/IBlock.d.ts +0 -0
  278. package/build/interfaces/IBlock.js +0 -1
  279. package/build/interfaces/blocks/IBlock.d.ts +0 -28
  280. package/build/interfaces/blocks/IBlock.js +0 -1
  281. package/build/interfaces/transactions/ITransaction.d.ts +0 -39
  282. package/build/interfaces/transactions/ITransaction.js +0 -1
  283. package/build/providers/index.d.ts +0 -4
  284. package/build/providers/index.js +0 -4
  285. package/build/providers/interfaces/GenerateResult.d.ts +0 -0
  286. package/build/providers/interfaces/GenerateResult.js +0 -1
  287. package/build/scripts/ITestContract.d.ts +0 -18
  288. package/build/scripts/ITestContract.js +0 -1
  289. package/build/scripts/test.d.ts +0 -1
  290. package/build/scripts/test.js +0 -24
  291. package/build/scripts/testContract.d.ts +0 -1
  292. package/build/scripts/testContract.js +0 -11
  293. package/build/storage/interfaces/IStorage.d.ts +0 -7
  294. package/build/storage/interfaces/IStorage.js +0 -1
  295. package/build/transactions/DeploymentTransaction.d.ts +0 -16
  296. package/build/transactions/DeploymentTransaction.js +0 -24
  297. package/build/transactions/GenericTransaction.d.ts +0 -6
  298. package/build/transactions/GenericTransaction.js +0 -6
  299. package/build/transactions/InteractionTransaction.d.ts +0 -15
  300. package/build/transactions/InteractionTransaction.js +0 -21
  301. package/build/transactions/TransactionInput.d.ts +0 -16
  302. package/build/transactions/TransactionInput.js +0 -14
  303. package/build/transactions/TransactionOutput.d.ts +0 -19
  304. package/build/transactions/TransactionOutput.js +0 -16
  305. package/build/transactions/TransactionReceipt.d.ts +0 -11
  306. package/build/transactions/TransactionReceipt.js +0 -53
  307. package/build/transactions/decoders/WrapInteractionTransaction.d.ts +0 -15
  308. package/build/transactions/decoders/WrapInteractionTransaction.js +0 -21
  309. package/build/transactions/index.d.ts +0 -6
  310. package/build/transactions/index.js +0 -6
  311. package/build/transactions/interfaces/IWrapTransaction.d.ts +0 -3
  312. package/build/transactions/interfaces/IWrapTransaction.js +0 -1
  313. package/build/transactions/types/DeploymentTransaction.d.ts +0 -16
  314. package/build/transactions/types/DeploymentTransaction.js +0 -24
  315. package/build/transactions/types/GenericTransaction.d.ts +0 -6
  316. package/build/transactions/types/GenericTransaction.js +0 -6
  317. package/build/transactions/types/InteractionTransaction.d.ts +0 -15
  318. package/build/transactions/types/InteractionTransaction.js +0 -21
  319. package/cjs/generator/WrappedGenerationParameters.d.ts +0 -9
  320. package/cjs/generator/WrappedGenerationParameters.js +0 -18
  321. package/cjs/interfaces/blocks/IBlock.d.ts +0 -28
  322. package/cjs/interfaces/blocks/IBlock.js +0 -2
  323. package/cjs/interfaces/transactions/ITransaction.d.ts +0 -31
  324. package/cjs/interfaces/transactions/ITransaction.js +0 -2
  325. package/cjs/scripts/ITestContract.d.ts +0 -9
  326. package/cjs/scripts/ITestContract.js +0 -48
  327. package/cjs/scripts/test.d.ts +0 -1
  328. package/cjs/scripts/test.js +0 -10
  329. package/cjs/scripts/testContract.d.ts +0 -1
  330. package/cjs/scripts/testContract.js +0 -13
  331. package/cjs/transactions/DeploymentTransaction.d.ts +0 -16
  332. package/cjs/transactions/DeploymentTransaction.js +0 -28
  333. package/cjs/transactions/GenericTransaction.d.ts +0 -6
  334. package/cjs/transactions/GenericTransaction.js +0 -10
  335. package/cjs/transactions/InteractionTransaction.d.ts +0 -15
  336. package/cjs/transactions/InteractionTransaction.js +0 -25
  337. package/cjs/transactions/TransactionInput.d.ts +0 -16
  338. package/cjs/transactions/TransactionInput.js +0 -18
  339. package/cjs/transactions/TransactionOutput.d.ts +0 -19
  340. package/cjs/transactions/TransactionOutput.js +0 -20
  341. package/cjs/transactions/TransactionReceipt.d.ts +0 -11
  342. package/cjs/transactions/TransactionReceipt.js +0 -57
  343. package/src/scripts/block.ts +0 -16
  344. package/src/scripts/testMethods.ts +0 -57
  345. package/src/scripts/testMethodsReg.ts +0 -48
  346. package/src/scripts/testWBTCContract.ts +0 -22
  347. /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.44";
@@ -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
+ }