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.
- package/.gitattributes +2 -2
- package/.idea/codeStyles/Project.xml +0 -53
- package/.idea/inspectionProfiles/Project_Default.xml +0 -1
- package/.idea/modules.xml +1 -1
- package/.idea/opnet.iml +2 -3
- package/README.md +29 -0
- package/browser/_version.d.ts +1 -1
- package/browser/generator/WrappedGenerationParameters.d.ts +9 -9
- package/browser/index.js +1 -1
- package/browser/scripts/ITestContract.d.ts +22 -22
- package/browser/scripts/test.d.ts +1 -1
- package/browser/scripts/testContract.d.ts +1 -1
- package/browser/transactions/DeploymentTransaction.d.ts +16 -16
- package/browser/transactions/GenericTransaction.d.ts +6 -6
- package/browser/transactions/InteractionTransaction.d.ts +15 -15
- package/browser/transactions/TransactionInput.d.ts +16 -16
- package/browser/transactions/TransactionOutput.d.ts +19 -19
- package/browser/transactions/TransactionReceipt.d.ts +11 -11
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/scripts/testMethods.js +5 -2
- package/cjs/_version.d.ts +1 -1
- package/cjs/_version.js +1 -1
- package/cjs/abi/shared/json/MOTOSWAP_ROUTER_ABI.js +3 -3
- package/cjs/abi/shared/json/OP_20_ABI.js +11 -0
- package/cjs/scripts/block.js +15 -0
- package/cjs/scripts/testMethods.js +9 -2
- package/docs/classes/AbstractRpcProvider.html +112 -112
- package/docs/classes/BaseContract.html +100 -100
- package/docs/classes/BitcoinAddress.html +92 -92
- package/docs/classes/BitcoinInterface.html +92 -92
- package/docs/classes/BitcoinUtils.html +92 -92
- package/docs/classes/Block.html +93 -93
- package/docs/classes/CallResult.html +92 -92
- package/docs/classes/ContractData.html +92 -92
- package/docs/classes/DeploymentTransaction.html +114 -114
- package/docs/classes/GenericTransaction.html +104 -104
- package/docs/classes/IBaseContract.html +100 -100
- package/docs/classes/InteractionTransaction.html +111 -111
- package/docs/classes/JSONRpcProvider.html +112 -112
- package/docs/classes/OPNetEvent.html +92 -92
- package/docs/classes/StoredValue.html +92 -92
- package/docs/classes/TransactionBase.html +104 -104
- package/docs/classes/TransactionInput.html +92 -92
- package/docs/classes/TransactionOutput.html +92 -92
- package/docs/classes/TransactionParser.html +92 -92
- package/docs/classes/TransactionReceipt.html +97 -97
- package/docs/classes/UTXO.html +92 -92
- package/docs/classes/UnwrapTransaction.html +116 -116
- package/docs/classes/WebSocketRpcProvider.html +112 -112
- package/docs/classes/WrapTransaction.html +118 -118
- package/docs/enums/ABIDataTypes.html +90 -90
- package/docs/enums/BitcoinAbiTypes.html +92 -92
- package/docs/enums/GenerateTarget.html +92 -92
- package/docs/enums/JSONRPCErrorCode.html +92 -92
- package/docs/enums/JSONRPCErrorHttpCodes.html +92 -92
- package/docs/enums/JSONRpcMethods.html +99 -99
- package/docs/enums/OPNetTransactionTypes.html +92 -92
- package/docs/functions/getContract.html +91 -91
- package/docs/hierarchy.html +90 -90
- package/docs/index.html +90 -90
- package/docs/interfaces/BaseContractProperties.html +92 -92
- package/docs/interfaces/BitcoinAbiValue.html +93 -93
- package/docs/interfaces/BitcoinInterfaceAbiBase.html +92 -92
- package/docs/interfaces/BroadcastedTransaction.html +96 -96
- package/docs/interfaces/ContractEvents.html +91 -91
- package/docs/interfaces/EventBaseData.html +92 -92
- package/docs/interfaces/FunctionBaseData.html +92 -92
- package/docs/interfaces/IAccessList.html +91 -91
- package/docs/interfaces/IAccessListItem.html +91 -91
- package/docs/interfaces/IBlock.html +93 -93
- package/docs/interfaces/IBlockCommon.html +93 -93
- package/docs/interfaces/IBlockWitness.html +92 -92
- package/docs/interfaces/IBlockWitnessAPI.html +92 -92
- package/docs/interfaces/ICallRequestError.html +92 -92
- package/docs/interfaces/ICallResultData.html +92 -92
- package/docs/interfaces/ICommonTransaction.html +106 -106
- package/docs/interfaces/IContract.html +92 -92
- package/docs/interfaces/IDecodedEvent.html +92 -92
- package/docs/interfaces/IDeploymentTransaction.html +113 -113
- package/docs/interfaces/IGenericTransaction.html +103 -103
- package/docs/interfaces/IInteractionTransaction.html +110 -110
- package/docs/interfaces/IMotoContract.html +93 -93
- package/docs/interfaces/IMotoswapFactoryContract.html +94 -94
- package/docs/interfaces/IMotoswapPoolContract.html +100 -100
- package/docs/interfaces/IMotoswapRouterContract.html +102 -102
- package/docs/interfaces/IOP_20Contract.html +92 -92
- package/docs/interfaces/IOP_NETContract.html +92 -92
- package/docs/interfaces/IRawContract.html +92 -92
- package/docs/interfaces/IRawContractEvents.html +91 -91
- package/docs/interfaces/IStackingContract.html +92 -92
- package/docs/interfaces/IStorageValue.html +92 -92
- package/docs/interfaces/ITransactionBase.html +103 -103
- package/docs/interfaces/ITransactionInput.html +92 -92
- package/docs/interfaces/ITransactionOutput.html +92 -92
- package/docs/interfaces/ITransactionReceipt.html +95 -95
- package/docs/interfaces/IUTXO.html +92 -92
- package/docs/interfaces/IUnwrapTransaction.html +115 -115
- package/docs/interfaces/IWBTCContract.html +94 -94
- package/docs/interfaces/IWrapTransaction.html +117 -117
- package/docs/interfaces/JSONRpc2Request.html +92 -92
- package/docs/interfaces/JSONRpc2ResponseError.html +92 -92
- package/docs/interfaces/JSONRpc2ResponseResult.html +92 -92
- package/docs/interfaces/JSONRpc2ResultData.html +91 -91
- package/docs/interfaces/JSONRpcErrorData.html +91 -91
- package/docs/interfaces/JSONRpcParams.html +91 -91
- package/docs/interfaces/JSONRpcResultError.html +92 -92
- package/docs/interfaces/MergedOP_20AndStackingContract.html +92 -92
- package/docs/interfaces/NetEventDocument.html +95 -95
- package/docs/interfaces/ParsedPartialWBTCUTXODocument.html +92 -92
- package/docs/interfaces/PartialWBTCUTXODocument.html +92 -92
- package/docs/interfaces/ReorgInformation.html +92 -92
- package/docs/interfaces/UsedUTXO.html +92 -92
- package/docs/modules.html +90 -90
- package/docs/types/BaseContractProperty.html +91 -91
- package/docs/types/BigNumberish.html +91 -91
- package/docs/types/BitcoinAddressLike.html +91 -91
- package/docs/types/BitcoinInterfaceAbi.html +91 -91
- package/docs/types/BlockHeaderChecksumProof.html +91 -91
- package/docs/types/BlockTag.html +91 -91
- package/docs/types/BlockWitnesses.html +91 -91
- package/docs/types/ContractDecodedObjectResult.html +91 -91
- package/docs/types/DecodedCallResult.html +91 -91
- package/docs/types/DecodedOutput.html +91 -91
- package/docs/types/GenerationParameters.html +91 -91
- package/docs/types/ICallResult.html +91 -91
- package/docs/types/ITransaction.html +91 -91
- package/docs/types/InteractionType.html +91 -91
- package/docs/types/JSONRpc2RequestParams.html +91 -91
- package/docs/types/JSONRpc2Result.html +91 -91
- package/docs/types/JSONRpcId.html +91 -91
- package/docs/types/JsonRpcCallResult.html +91 -91
- package/docs/types/JsonRpcError.html +91 -91
- package/docs/types/JsonRpcPayload.html +91 -91
- package/docs/types/JsonRpcResult.html +91 -91
- package/docs/types/Numeric.html +91 -91
- package/docs/types/PointerLike.html +91 -91
- package/docs/types/RawContractEvents.html +91 -91
- package/docs/types/UTXOs.html +91 -91
- package/docs/variables/MOTOSWAP_ROUTER_ABI.html +91 -91
- package/docs/variables/MOTO_TOKEN_ABI.html +91 -91
- package/docs/variables/MotoSwapFactoryAbi.html +91 -91
- package/docs/variables/MotoSwapFactoryEvents.html +91 -91
- package/docs/variables/MotoSwapPoolEvents.html +91 -91
- package/docs/variables/MotoswapPoolAbi.html +91 -91
- package/docs/variables/OP20Events.html +91 -91
- package/docs/variables/OP_20_ABI.html +91 -91
- package/docs/variables/OP_NET_ABI.html +91 -91
- package/docs/variables/STAKING_ABI.html +91 -91
- package/docs/variables/StackingEvents.html +91 -91
- package/docs/variables/WBTCEvents.html +91 -91
- package/docs/variables/WBTC_ABI.html +91 -91
- package/docs/variables/version.html +91 -91
- package/jest.config.ts +51 -51
- package/package.json +2 -2
- package/src/_version.ts +1 -1
- package/src/abi/BaseContractProperty.ts +8 -8
- package/src/abi/BitcoinAbiTypes.ts +9 -9
- package/src/abi/BitcoinInterface.ts +78 -78
- package/src/abi/interfaces/BaseContractProperties.ts +10 -10
- package/src/abi/interfaces/BitcoinAbiValue.ts +18 -18
- package/src/abi/interfaces/BitcoinInterfaceAbi.ts +26 -26
- package/src/abi/shared/interfaces/IMotoContract.ts +17 -17
- package/src/abi/shared/interfaces/IMotoswapFactoryContract.ts +27 -27
- package/src/abi/shared/interfaces/IMotoswapPoolContract.ts +71 -71
- package/src/abi/shared/interfaces/IMotoswapRouterContract.ts +100 -100
- package/src/abi/shared/interfaces/IOP_20Contract.ts +61 -61
- package/src/abi/shared/interfaces/IOP_NETContract.ts +15 -15
- package/src/abi/shared/interfaces/IStackingContract.ts +24 -24
- package/src/abi/shared/interfaces/IWBTCContract.ts +34 -34
- package/src/abi/shared/json/MOTOSWAP_FACTORY_ABI.ts +83 -83
- package/src/abi/shared/json/MOTOSWAP_POOL_ABI.ts +299 -299
- package/src/abi/shared/json/MOTOSWAP_ROUTER_ABI.ts +291 -291
- package/src/abi/shared/json/MOTO_TOKEN_ABI.ts +29 -29
- package/src/abi/shared/json/OP_20_ABI.ts +282 -282
- package/src/abi/shared/json/OP_NET_ABI.ts +37 -37
- package/src/abi/shared/json/STAKING_ABI.ts +140 -140
- package/src/abi/shared/json/WBTC_ABI.ts +73 -73
- package/src/bitcoin/BitcoinAddress.ts +133 -133
- package/src/bitcoin/UTXOs.ts +28 -28
- package/src/bitcoin/interfaces/IUTXO.ts +12 -12
- package/src/block/Block.ts +71 -71
- package/src/block/interfaces/BlockWitness.ts +14 -14
- package/src/block/interfaces/IBlock.ts +46 -46
- package/src/common/CommonTypes.ts +23 -23
- package/src/contracts/CallResult.ts +51 -51
- package/src/contracts/Contract.ts +595 -595
- package/src/contracts/ContractData.ts +54 -54
- package/src/contracts/OPNetEvent.ts +33 -33
- package/src/contracts/interfaces/IAccessList.ts +17 -17
- package/src/contracts/interfaces/ICallResult.ts +30 -30
- package/src/contracts/interfaces/IContract.ts +21 -21
- package/src/contracts/interfaces/IRawContract.ts +21 -21
- package/src/crypto/crypto-browser.js +71 -71
- package/src/index.ts +4 -4
- package/src/interfaces/opnet/OPNetTransactionTypes.ts +12 -12
- package/src/opnet.ts +106 -106
- package/src/providers/AbstractRpcProvider.ts +600 -600
- package/src/providers/JSONRpcProvider.ts +59 -59
- package/src/providers/WebsocketRpcProvider.ts +36 -36
- package/src/providers/interfaces/Generate.ts +7 -7
- package/src/providers/interfaces/JSONRpc.ts +14 -14
- package/src/providers/interfaces/JSONRpcMethods.ts +32 -32
- package/src/providers/interfaces/JSONRpcParams.ts +3 -3
- package/src/providers/interfaces/JSONRpcResult.ts +61 -61
- package/src/providers/interfaces/ReorgInformation.ts +6 -6
- package/src/storage/StoredValue.ts +35 -35
- package/src/storage/interfaces/IStorageValue.ts +14 -14
- package/src/transactions/Transaction.ts +84 -84
- package/src/transactions/TransactionParser.ts +58 -58
- package/src/transactions/decoders/DeploymentTransaction.ts +48 -48
- package/src/transactions/decoders/GenericTransaction.ts +19 -19
- package/src/transactions/decoders/InteractionTransaction.ts +61 -61
- package/src/transactions/decoders/UnwrapTransaction.ts +69 -69
- package/src/transactions/decoders/WrapTransaction.ts +69 -69
- package/src/transactions/interfaces/BroadcastedTransaction.ts +24 -24
- package/src/transactions/interfaces/ITransaction.ts +79 -79
- package/src/transactions/interfaces/ITransactionReceipt.ts +55 -55
- package/src/transactions/interfaces/transactions/ICommonTransaction.ts +19 -19
- package/src/transactions/interfaces/transactions/IDeploymentTransaction.ts +50 -50
- package/src/transactions/interfaces/transactions/IInteractionTransaction.ts +50 -50
- package/src/transactions/interfaces/transactions/IUnwrapTransaction.ts +59 -59
- package/src/transactions/interfaces/transactions/IWrapTransaction.ts +43 -43
- package/src/transactions/metadata/TransactionInput.ts +39 -39
- package/src/transactions/metadata/TransactionOutput.ts +41 -41
- package/src/transactions/metadata/TransactionReceipt.ts +93 -93
- package/src/utils/BitcoinUtils.ts +22 -22
- package/webpack.config.js +71 -71
- package/.idea/bsc.iml +0 -14
- package/.idea/bsi-binary.iml +0 -14
- package/.idea/markdown.xml +0 -7
- package/.idea/motoswap.iml +0 -12
- package/.idea/prettier.xml +0 -7
- package/build/abi/BitcoinInterfaceAbi.d.ts +0 -3
- package/build/abi/enums/ParamTypes.d.ts +0 -0
- package/build/abi/enums/ParamTypes.js +0 -1
- package/build/abi/interface/BitcoinInterface.d.ts +0 -6
- package/build/abi/interface/BitcoinInterface.js +0 -12
- package/build/abi/interface/BitcoinInterfaceAbi.d.ts +0 -3
- package/build/abi/interface/BitcoinInterfaceAbi.js +0 -1
- package/build/abi/interfaces/BaseContractProperty.d.ts +0 -2
- package/build/abi/interfaces/BaseContractProperty.js +0 -1
- package/build/abi/interfaces/BitcoinAbiInput.d.ts +0 -5
- package/build/abi/interfaces/BitcoinAbiInput.js +0 -1
- package/build/abi/shared/MOTOSWAP_FACTORY_ABI.d.ts +0 -2
- package/build/abi/shared/MOTOSWAP_FACTORY_ABI.js +0 -68
- package/build/abi/shared/OP_20_ABI.d.ts +0 -2
- package/build/abi/shared/OP_20_ABI.js +0 -235
- package/build/abi/shared/OP_NET_ABI.d.ts +0 -2
- package/build/abi/shared/OP_NET_ABI.js +0 -31
- package/build/abi/shared/STAKING_ABI.d.ts +0 -2
- package/build/abi/shared/STAKING_ABI.js +0 -96
- package/build/abi/shared/WBTC_ABI.d.ts +0 -2
- package/build/abi/shared/WBTC_ABI.js +0 -40
- package/build/bitcoin/UXTOs.d.ts +0 -7
- package/build/bitcoin/UXTOs.js +0 -1
- package/build/block/index.d.ts +0 -2
- package/build/block/index.js +0 -1
- package/build/contracts/DecodedEvent.d.ts +0 -15
- package/build/contracts/DecodedEvent.js +0 -18
- package/build/contracts/IRawContract.d.ts +0 -13
- package/build/contracts/IRawContract.js +0 -1
- package/build/crypto/crypto-browser.d.ts +0 -0
- package/build/crypto/crypto-browser.js +0 -47
- package/build/generator/WrappedGenerationParameters.d.ts +0 -9
- package/build/generator/WrappedGenerationParameters.js +0 -14
- package/build/interface/BitcoinInterface.d.ts +0 -6
- package/build/interface/BitcoinInterface.js +0 -12
- package/build/interface/BitcoinInterfaceAbi.d.ts +0 -3
- package/build/interface/BitcoinInterfaceAbi.js +0 -1
- package/build/interface/Interface.d.ts +0 -2
- package/build/interface/Interface.js +0 -2
- package/build/interface.d.ts +0 -0
- package/build/interface.js +0 -1
- package/build/interfaces/Block.d.ts +0 -0
- package/build/interfaces/Block.js +0 -1
- package/build/interfaces/IBlock.d.ts +0 -0
- package/build/interfaces/IBlock.js +0 -1
- package/build/interfaces/blocks/IBlock.d.ts +0 -28
- package/build/interfaces/blocks/IBlock.js +0 -1
- package/build/interfaces/transactions/ITransaction.d.ts +0 -39
- package/build/interfaces/transactions/ITransaction.js +0 -1
- package/build/providers/index.d.ts +0 -4
- package/build/providers/index.js +0 -4
- package/build/providers/interfaces/GenerateResult.d.ts +0 -0
- package/build/providers/interfaces/GenerateResult.js +0 -1
- package/build/scripts/ITestContract.d.ts +0 -18
- package/build/scripts/ITestContract.js +0 -1
- package/build/scripts/test.d.ts +0 -1
- package/build/scripts/test.js +0 -24
- package/build/scripts/testContract.d.ts +0 -1
- package/build/scripts/testContract.js +0 -11
- package/build/storage/interfaces/IStorage.d.ts +0 -7
- package/build/storage/interfaces/IStorage.js +0 -1
- package/build/transactions/DeploymentTransaction.d.ts +0 -16
- package/build/transactions/DeploymentTransaction.js +0 -24
- package/build/transactions/GenericTransaction.d.ts +0 -6
- package/build/transactions/GenericTransaction.js +0 -6
- package/build/transactions/InteractionTransaction.d.ts +0 -15
- package/build/transactions/InteractionTransaction.js +0 -21
- package/build/transactions/TransactionInput.d.ts +0 -16
- package/build/transactions/TransactionInput.js +0 -14
- package/build/transactions/TransactionOutput.d.ts +0 -19
- package/build/transactions/TransactionOutput.js +0 -16
- package/build/transactions/TransactionReceipt.d.ts +0 -11
- package/build/transactions/TransactionReceipt.js +0 -53
- package/build/transactions/decoders/WrapInteractionTransaction.d.ts +0 -15
- package/build/transactions/decoders/WrapInteractionTransaction.js +0 -21
- package/build/transactions/index.d.ts +0 -6
- package/build/transactions/index.js +0 -6
- package/build/transactions/interfaces/IWrapTransaction.d.ts +0 -3
- package/build/transactions/interfaces/IWrapTransaction.js +0 -1
- package/build/transactions/types/DeploymentTransaction.d.ts +0 -16
- package/build/transactions/types/DeploymentTransaction.js +0 -24
- package/build/transactions/types/GenericTransaction.d.ts +0 -6
- package/build/transactions/types/GenericTransaction.js +0 -6
- package/build/transactions/types/InteractionTransaction.d.ts +0 -15
- package/build/transactions/types/InteractionTransaction.js +0 -21
- package/cjs/generator/WrappedGenerationParameters.d.ts +0 -9
- package/cjs/generator/WrappedGenerationParameters.js +0 -18
- package/cjs/interfaces/blocks/IBlock.d.ts +0 -28
- package/cjs/interfaces/blocks/IBlock.js +0 -2
- package/cjs/interfaces/transactions/ITransaction.d.ts +0 -31
- package/cjs/interfaces/transactions/ITransaction.js +0 -2
- package/cjs/scripts/ITestContract.d.ts +0 -9
- package/cjs/scripts/ITestContract.js +0 -48
- package/cjs/scripts/test.d.ts +0 -1
- package/cjs/scripts/test.js +0 -10
- package/cjs/scripts/testContract.d.ts +0 -1
- package/cjs/scripts/testContract.js +0 -13
- package/cjs/transactions/DeploymentTransaction.d.ts +0 -16
- package/cjs/transactions/DeploymentTransaction.js +0 -28
- package/cjs/transactions/GenericTransaction.d.ts +0 -6
- package/cjs/transactions/GenericTransaction.js +0 -10
- package/cjs/transactions/InteractionTransaction.d.ts +0 -15
- package/cjs/transactions/InteractionTransaction.js +0 -25
- package/cjs/transactions/TransactionInput.d.ts +0 -16
- package/cjs/transactions/TransactionInput.js +0 -18
- package/cjs/transactions/TransactionOutput.d.ts +0 -19
- package/cjs/transactions/TransactionOutput.js +0 -20
- package/cjs/transactions/TransactionReceipt.d.ts +0 -11
- package/cjs/transactions/TransactionReceipt.js +0 -57
- package/src/scripts/block.ts +0 -16
- package/src/scripts/testMethods.ts +0 -57
- package/src/scripts/testMethodsReg.ts +0 -48
- package/src/scripts/testWBTCContract.ts +0 -22
- /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/
|
|
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
|
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
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
|
+
}
|