opnet 1.0.49 → 1.0.50
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/.babelrc +8 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -20
- package/.github/workflows/ci.yml +48 -0
- package/.prettierrc.json +11 -11
- package/CONTRIBUTING.md +71 -71
- package/LICENSE.md +16 -16
- package/README.md +96 -93
- package/STAKING.md +60 -70
- package/browser/_version.d.ts +1 -1
- package/browser/bitcoin/BitcoinAddress.d.ts +0 -1
- package/browser/contracts/CallResult.d.ts +0 -1
- package/browser/contracts/Contract.d.ts +0 -1
- package/browser/contracts/ContractData.d.ts +0 -1
- package/browser/contracts/interfaces/IContract.d.ts +0 -1
- package/browser/contracts/interfaces/IRawContract.d.ts +0 -1
- package/browser/crypto/crypto.d.ts +0 -1
- package/browser/index.js +2 -2
- package/browser/providers/AbstractRpcProvider.d.ts +47 -48
- package/browser/providers/JSONRpcProvider.d.ts +10 -10
- package/browser/storage/StoredValue.d.ts +0 -1
- package/browser/storage/interfaces/IStorageValue.d.ts +0 -1
- package/browser/transactions/decoders/DeploymentTransaction.d.ts +0 -1
- package/browser/transactions/decoders/InteractionTransaction.d.ts +0 -1
- package/browser/transactions/interfaces/ITransaction.d.ts +0 -1
- package/browser/transactions/interfaces/ITransactionReceipt.d.ts +0 -1
- package/browser/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +0 -1
- package/browser/transactions/interfaces/transactions/IInteractionTransaction.d.ts +0 -1
- package/browser/transactions/interfaces/transactions/IUnwrapTransaction.d.ts +0 -1
- package/browser/transactions/metadata/TransactionOutput.d.ts +0 -1
- package/browser/transactions/metadata/TransactionReceipt.d.ts +0 -1
- package/build/abi/BitcoinInterface.js +0 -1
- package/build/bitcoin/BitcoinAddress.d.ts +0 -1
- package/build/bitcoin/BitcoinAddress.js +30 -19
- package/build/bitcoin/UTXOs.js +0 -4
- package/build/block/Block.js +1 -19
- package/build/contracts/CallResult.d.ts +0 -1
- package/build/contracts/CallResult.js +2 -7
- package/build/contracts/Contract.d.ts +0 -1
- package/build/contracts/Contract.js +1 -6
- package/build/contracts/ContractData.d.ts +0 -1
- package/build/contracts/ContractData.js +0 -11
- package/build/contracts/OPNetEvent.js +2 -5
- package/build/contracts/interfaces/IContract.d.ts +0 -1
- package/build/contracts/interfaces/IRawContract.d.ts +0 -1
- package/build/crypto/crypto.d.ts +0 -1
- package/build/providers/AbstractRpcProvider.d.ts +0 -1
- package/build/providers/AbstractRpcProvider.js +3 -4
- package/build/providers/JSONRpcProvider.js +1 -3
- package/build/providers/WebsocketRpcProvider.js +0 -1
- package/build/storage/StoredValue.d.ts +0 -1
- package/build/storage/StoredValue.js +0 -4
- package/build/storage/interfaces/IStorageValue.d.ts +0 -1
- package/build/transactions/Transaction.js +0 -8
- package/build/transactions/decoders/DeploymentTransaction.d.ts +0 -1
- package/build/transactions/decoders/DeploymentTransaction.js +0 -10
- package/build/transactions/decoders/InteractionTransaction.d.ts +0 -1
- package/build/transactions/decoders/InteractionTransaction.js +0 -7
- package/build/transactions/decoders/UnwrapTransaction.js +0 -5
- package/build/transactions/decoders/WrapTransaction.js +0 -7
- package/build/transactions/interfaces/ITransaction.d.ts +0 -1
- package/build/transactions/interfaces/ITransactionReceipt.d.ts +0 -1
- package/build/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +0 -1
- package/build/transactions/interfaces/transactions/IInteractionTransaction.d.ts +0 -1
- package/build/transactions/interfaces/transactions/IUnwrapTransaction.d.ts +0 -1
- package/build/transactions/metadata/TransactionInput.js +1 -5
- package/build/transactions/metadata/TransactionOutput.d.ts +0 -1
- package/build/transactions/metadata/TransactionOutput.js +0 -4
- package/build/transactions/metadata/TransactionReceipt.d.ts +0 -1
- package/build/transactions/metadata/TransactionReceipt.js +0 -4
- package/cjs/package.json +3 -3
- package/docs/assets/highlight.css +92 -92
- package/docs/classes/AbstractRpcProvider.html +334 -334
- package/docs/classes/BaseContract.html +198 -198
- package/docs/classes/BitcoinAddress.html +192 -192
- package/docs/classes/BitcoinInterface.html +182 -182
- package/docs/classes/BitcoinUtils.html +182 -182
- package/docs/classes/Block.html +196 -196
- package/docs/classes/CallResult.html +185 -185
- package/docs/classes/ContractData.html +187 -187
- package/docs/classes/DeploymentTransaction.html +220 -220
- package/docs/classes/GenericTransaction.html +200 -200
- package/docs/classes/IBaseContract.html +203 -203
- package/docs/classes/InteractionTransaction.html +213 -213
- package/docs/classes/JSONRpcProvider.html +332 -332
- package/docs/classes/OPNetEvent.html +181 -181
- package/docs/classes/StoredValue.html +181 -181
- package/docs/classes/TransactionBase.html +200 -200
- package/docs/classes/TransactionInput.html +180 -180
- package/docs/classes/TransactionOutput.html +180 -180
- package/docs/classes/TransactionParser.html +177 -177
- package/docs/classes/TransactionReceipt.html +187 -187
- package/docs/classes/UTXO.html +180 -180
- package/docs/classes/UnwrapTransaction.html +224 -224
- package/docs/classes/WebSocketRpcProvider.html +329 -329
- package/docs/classes/WrapTransaction.html +228 -228
- package/docs/enums/ABIDataTypes.html +193 -193
- package/docs/enums/BitcoinAbiTypes.html +177 -177
- package/docs/enums/GenerateTarget.html +174 -174
- package/docs/enums/JSONRPCErrorCode.html +183 -183
- package/docs/enums/JSONRPCErrorHttpCodes.html +183 -183
- package/docs/enums/JSONRpcMethods.html +196 -196
- package/docs/enums/OPNetTransactionTypes.html +178 -178
- package/docs/functions/getContract.html +182 -182
- package/docs/hierarchy.html +173 -173
- package/docs/index.html +218 -218
- package/docs/interfaces/BaseContractProperties.html +180 -180
- package/docs/interfaces/BitcoinAbiValue.html +179 -179
- package/docs/interfaces/BitcoinInterfaceAbiBase.html +177 -177
- package/docs/interfaces/BroadcastedTransaction.html +183 -183
- package/docs/interfaces/ContractEvents.html +173 -173
- package/docs/interfaces/EventBaseData.html +178 -178
- package/docs/interfaces/FunctionBaseData.html +181 -181
- package/docs/interfaces/IAccessList.html +175 -175
- package/docs/interfaces/IAccessListItem.html +175 -175
- package/docs/interfaces/IBlock.html +195 -195
- package/docs/interfaces/IBlockCommon.html +194 -194
- package/docs/interfaces/IBlockWitness.html +175 -175
- package/docs/interfaces/IBlockWitnessAPI.html +177 -177
- package/docs/interfaces/ICallRequestError.html +176 -176
- package/docs/interfaces/ICallResultData.html +179 -179
- package/docs/interfaces/ICommonTransaction.html +205 -205
- package/docs/interfaces/IContract.html +180 -180
- package/docs/interfaces/IDecodedEvent.html +177 -177
- package/docs/interfaces/IDeploymentTransaction.html +219 -219
- package/docs/interfaces/IGenericTransaction.html +199 -199
- package/docs/interfaces/IInteractionTransaction.html +213 -213
- package/docs/interfaces/IMotoContract.html +196 -196
- package/docs/interfaces/IMotoswapFactoryContract.html +193 -193
- package/docs/interfaces/IMotoswapPoolContract.html +208 -208
- package/docs/interfaces/IMotoswapRouterContract.html +227 -227
- package/docs/interfaces/IOP_20Contract.html +196 -196
- package/docs/interfaces/IOP_NETContract.html +183 -183
- package/docs/interfaces/IRawContract.html +187 -187
- package/docs/interfaces/IRawContractEvents.html +173 -173
- package/docs/interfaces/IStackingContract.html +183 -183
- package/docs/interfaces/IStorageValue.html +179 -179
- package/docs/interfaces/ITransactionBase.html +199 -199
- package/docs/interfaces/ITransactionInput.html +179 -179
- package/docs/interfaces/ITransactionOutput.html +177 -177
- package/docs/interfaces/ITransactionReceipt.html +183 -183
- package/docs/interfaces/IUTXO.html +179 -179
- package/docs/interfaces/IUnwrapTransaction.html +223 -223
- package/docs/interfaces/IWBTCContract.html +209 -209
- package/docs/interfaces/IWrapTransaction.html +227 -227
- package/docs/interfaces/JSONRpc2Request.html +177 -177
- package/docs/interfaces/JSONRpc2ResponseError.html +177 -177
- package/docs/interfaces/JSONRpc2ResponseResult.html +177 -177
- package/docs/interfaces/JSONRpc2ResultData.html +173 -173
- package/docs/interfaces/JSONRpcErrorData.html +173 -173
- package/docs/interfaces/JSONRpcParams.html +173 -173
- package/docs/interfaces/JSONRpcResultError.html +176 -176
- package/docs/interfaces/MergedOP_20AndStackingContract.html +201 -201
- package/docs/interfaces/NetEventDocument.html +182 -182
- package/docs/interfaces/ParsedPartialWBTCUTXODocument.html +178 -178
- package/docs/interfaces/PartialWBTCUTXODocument.html +178 -178
- package/docs/interfaces/ReorgInformation.html +176 -176
- package/docs/interfaces/UsedUTXO.html +175 -175
- package/docs/modules.html +296 -296
- package/docs/types/BaseContractProperty.html +175 -175
- package/docs/types/BigNumberish.html +173 -173
- package/docs/types/BitcoinAddressLike.html +173 -173
- package/docs/types/BitcoinInterfaceAbi.html +173 -173
- package/docs/types/BlockHeaderChecksumProof.html +173 -173
- package/docs/types/BlockTag.html +173 -173
- package/docs/types/BlockWitnesses.html +173 -173
- package/docs/types/ContractDecodedObjectResult.html +173 -173
- package/docs/types/DecodedCallResult.html +173 -173
- package/docs/types/DecodedOutput.html +173 -173
- package/docs/types/GenerationParameters.html +173 -173
- package/docs/types/ICallResult.html +174 -174
- package/docs/types/ITransaction.html +174 -174
- package/docs/types/InteractionType.html +173 -173
- package/docs/types/JSONRpc2RequestParams.html +173 -173
- package/docs/types/JSONRpc2Result.html +173 -173
- package/docs/types/JSONRpcId.html +173 -173
- package/docs/types/JsonRpcCallResult.html +173 -173
- package/docs/types/JsonRpcError.html +173 -173
- package/docs/types/JsonRpcPayload.html +173 -173
- package/docs/types/JsonRpcResult.html +173 -173
- package/docs/types/Numeric.html +173 -173
- package/docs/types/PointerLike.html +173 -173
- package/docs/types/RawContractEvents.html +173 -173
- package/docs/types/UTXOs.html +175 -175
- package/docs/variables/MOTOSWAP_ROUTER_ABI.html +173 -173
- package/docs/variables/MOTO_TOKEN_ABI.html +173 -173
- package/docs/variables/MotoSwapFactoryAbi.html +173 -173
- package/docs/variables/MotoSwapFactoryEvents.html +173 -173
- package/docs/variables/MotoSwapPoolEvents.html +173 -173
- package/docs/variables/MotoswapPoolAbi.html +173 -173
- package/docs/variables/OP20Events.html +173 -173
- package/docs/variables/OP_20_ABI.html +173 -173
- package/docs/variables/OP_NET_ABI.html +173 -173
- package/docs/variables/STAKING_ABI.html +173 -173
- package/docs/variables/StackingEvents.html +173 -173
- package/docs/variables/WBTCEvents.html +173 -173
- package/docs/variables/WBTC_ABI.html +173 -173
- package/docs/variables/version.html +173 -173
- package/gulpfile.js +49 -120
- package/package.json +111 -109
- package/src/_version.ts +1 -1
- package/src/abi/shared/json/MOTOSWAP_POOL_ABI.ts +299 -299
- package/src/contracts/Contract.ts +600 -600
- package/src/crypto/crypto.ts +1 -1
- package/src/providers/AbstractRpcProvider.ts +602 -602
- package/src/providers/JSONRpcProvider.ts +81 -81
- package/src/serialize/BigInt.ts +15 -15
- package/tsconfig.base.json +43 -43
- package/tsconfig.json +15 -8
- package/tsconfig.webpack.json +19 -19
- package/.github/workflows/node.js.yml +0 -21
- package/.idea/bsc.iml +0 -14
- package/.idea/bsi-binary.iml +0 -14
- package/.idea/codeStyles/Project.xml +0 -101
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/markdown.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/motoswap.iml +0 -12
- package/.idea/opnet.iml +0 -17
- package/.idea/prettier.xml +0 -7
- package/.idea/vcs.xml +0 -6
- package/browser/crypto/crypto-browser.d.ts +0 -40
- package/browser/generator/WrappedGenerationParameters.d.ts +0 -9
- package/browser/scripts/ITestContract.d.ts +0 -22
- package/browser/scripts/block.d.ts +0 -1
- package/browser/scripts/test.d.ts +0 -1
- package/browser/scripts/testContract.d.ts +0 -1
- package/browser/scripts/testMethods.d.ts +0 -1
- package/browser/scripts/testMethodsReg.d.ts +0 -1
- package/browser/scripts/testWBTCContract.d.ts +0 -1
- package/browser/transactions/DeploymentTransaction.d.ts +0 -16
- package/browser/transactions/GenericTransaction.d.ts +0 -6
- package/browser/transactions/InteractionTransaction.d.ts +0 -15
- package/browser/transactions/TransactionInput.d.ts +0 -16
- package/browser/transactions/TransactionOutput.d.ts +0 -19
- package/browser/transactions/TransactionReceipt.d.ts +0 -11
- package/build/abi/BitcoinInterfaceAbi.d.ts +0 -3
- package/build/abi/BitcoinInterfaceAbi.js +0 -1
- 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/block.d.ts +0 -1
- package/build/scripts/block.js +0 -13
- 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/scripts/testMethods.d.ts +0 -1
- package/build/scripts/testMethods.js +0 -11
- package/build/scripts/testMethodsReg.d.ts +0 -1
- package/build/scripts/testMethodsReg.js +0 -8
- package/build/scripts/testWBTCContract.d.ts +0 -1
- package/build/scripts/testWBTCContract.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/_version.d.ts +0 -1
- package/cjs/_version.js +0 -4
- package/cjs/abi/BaseContractProperty.d.ts +0 -3
- package/cjs/abi/BaseContractProperty.js +0 -2
- package/cjs/abi/BitcoinAbiTypes.d.ts +0 -4
- package/cjs/abi/BitcoinAbiTypes.js +0 -8
- package/cjs/abi/BitcoinInterface.d.ts +0 -10
- package/cjs/abi/BitcoinInterface.js +0 -60
- package/cjs/abi/interfaces/BaseContractProperties.d.ts +0 -5
- package/cjs/abi/interfaces/BaseContractProperties.js +0 -2
- package/cjs/abi/interfaces/BitcoinAbiValue.d.ts +0 -5
- package/cjs/abi/interfaces/BitcoinAbiValue.js +0 -2
- package/cjs/abi/interfaces/BitcoinInterfaceAbi.d.ts +0 -16
- package/cjs/abi/interfaces/BitcoinInterfaceAbi.js +0 -2
- package/cjs/abi/shared/interfaces/IMotoContract.d.ts +0 -6
- package/cjs/abi/shared/interfaces/IMotoContract.js +0 -2
- package/cjs/abi/shared/interfaces/IMotoswapFactoryContract.d.ts +0 -7
- package/cjs/abi/shared/interfaces/IMotoswapFactoryContract.js +0 -2
- package/cjs/abi/shared/interfaces/IMotoswapPoolContract.d.ts +0 -13
- package/cjs/abi/shared/interfaces/IMotoswapPoolContract.js +0 -2
- package/cjs/abi/shared/interfaces/IMotoswapRouterContract.d.ts +0 -15
- package/cjs/abi/shared/interfaces/IMotoswapRouterContract.js +0 -2
- package/cjs/abi/shared/interfaces/IOP_20Contract.d.ts +0 -16
- package/cjs/abi/shared/interfaces/IOP_20Contract.js +0 -2
- package/cjs/abi/shared/interfaces/IOP_NETContract.d.ts +0 -7
- package/cjs/abi/shared/interfaces/IOP_NETContract.js +0 -2
- package/cjs/abi/shared/interfaces/IStackingContract.d.ts +0 -11
- package/cjs/abi/shared/interfaces/IStackingContract.js +0 -2
- package/cjs/abi/shared/interfaces/IWBTCContract.d.ts +0 -8
- package/cjs/abi/shared/interfaces/IWBTCContract.js +0 -2
- package/cjs/abi/shared/json/MOTOSWAP_FACTORY_ABI.d.ts +0 -3
- package/cjs/abi/shared/json/MOTOSWAP_FACTORY_ABI.js +0 -74
- package/cjs/abi/shared/json/MOTOSWAP_POOL_ABI.d.ts +0 -3
- package/cjs/abi/shared/json/MOTOSWAP_POOL_ABI.js +0 -280
- package/cjs/abi/shared/json/MOTOSWAP_ROUTER_ABI.d.ts +0 -2
- package/cjs/abi/shared/json/MOTOSWAP_ROUTER_ABI.js +0 -277
- package/cjs/abi/shared/json/MOTO_TOKEN_ABI.d.ts +0 -2
- package/cjs/abi/shared/json/MOTO_TOKEN_ABI.js +0 -25
- package/cjs/abi/shared/json/OP_20_ABI.d.ts +0 -3
- package/cjs/abi/shared/json/OP_20_ABI.js +0 -270
- package/cjs/abi/shared/json/OP_NET_ABI.d.ts +0 -2
- package/cjs/abi/shared/json/OP_NET_ABI.js +0 -34
- package/cjs/abi/shared/json/STAKING_ABI.d.ts +0 -3
- package/cjs/abi/shared/json/STAKING_ABI.js +0 -132
- package/cjs/abi/shared/json/WBTC_ABI.d.ts +0 -3
- package/cjs/abi/shared/json/WBTC_ABI.js +0 -60
- package/cjs/bitcoin/BitcoinAddress.d.ts +0 -20
- package/cjs/bitcoin/BitcoinAddress.js +0 -116
- package/cjs/bitcoin/UTXOs.d.ts +0 -10
- package/cjs/bitcoin/UTXOs.js +0 -16
- package/cjs/bitcoin/interfaces/IUTXO.d.ts +0 -7
- package/cjs/bitcoin/interfaces/IUTXO.js +0 -2
- package/cjs/block/Block.d.ts +0 -26
- package/cjs/block/Block.js +0 -47
- package/cjs/block/interfaces/BlockWitness.d.ts +0 -11
- package/cjs/block/interfaces/BlockWitness.js +0 -2
- package/cjs/block/interfaces/IBlock.d.ts +0 -28
- package/cjs/block/interfaces/IBlock.js +0 -2
- package/cjs/common/CommonTypes.d.ts +0 -8
- package/cjs/common/CommonTypes.js +0 -2
- package/cjs/contracts/CallResult.d.ts +0 -19
- package/cjs/contracts/CallResult.js +0 -35
- package/cjs/contracts/Contract.d.ts +0 -44
- package/cjs/contracts/Contract.js +0 -398
- package/cjs/contracts/ContractData.d.ts +0 -17
- package/cjs/contracts/ContractData.js +0 -38
- package/cjs/contracts/OPNetEvent.d.ts +0 -15
- package/cjs/contracts/OPNetEvent.js +0 -22
- package/cjs/contracts/interfaces/IAccessList.d.ts +0 -6
- package/cjs/contracts/interfaces/IAccessList.js +0 -2
- package/cjs/contracts/interfaces/ICallResult.d.ts +0 -12
- package/cjs/contracts/interfaces/ICallResult.js +0 -2
- package/cjs/contracts/interfaces/IContract.d.ts +0 -12
- package/cjs/contracts/interfaces/IContract.js +0 -2
- package/cjs/contracts/interfaces/IRawContract.d.ts +0 -15
- package/cjs/contracts/interfaces/IRawContract.js +0 -2
- package/cjs/crypto/crypto.d.ts +0 -2
- package/cjs/crypto/crypto.js +0 -8
- package/cjs/index.d.ts +0 -3
- package/cjs/index.js +0 -32
- package/cjs/interfaces/opnet/OPNetTransactionTypes.d.ts +0 -8
- package/cjs/interfaces/opnet/OPNetTransactionTypes.js +0 -11
- package/cjs/opnet.d.ts +0 -70
- package/cjs/opnet.js +0 -89
- package/cjs/providers/AbstractRpcProvider.d.ts +0 -48
- package/cjs/providers/AbstractRpcProvider.js +0 -277
- package/cjs/providers/JSONRpcProvider.d.ts +0 -10
- package/cjs/providers/JSONRpcProvider.js +0 -59
- package/cjs/providers/WebsocketRpcProvider.d.ts +0 -9
- package/cjs/providers/WebsocketRpcProvider.js +0 -27
- package/cjs/providers/interfaces/Generate.d.ts +0 -5
- package/cjs/providers/interfaces/Generate.js +0 -7
- package/cjs/providers/interfaces/JSONRpc.d.ts +0 -11
- package/cjs/providers/interfaces/JSONRpc.js +0 -2
- package/cjs/providers/interfaces/JSONRpcMethods.d.ts +0 -17
- package/cjs/providers/interfaces/JSONRpcMethods.js +0 -21
- package/cjs/providers/interfaces/JSONRpcParams.d.ts +0 -3
- package/cjs/providers/interfaces/JSONRpcParams.js +0 -2
- package/cjs/providers/interfaces/JSONRpcResult.d.ts +0 -51
- package/cjs/providers/interfaces/JSONRpcResult.js +0 -29
- package/cjs/providers/interfaces/ReorgInformation.d.ts +0 -5
- package/cjs/providers/interfaces/ReorgInformation.js +0 -2
- package/cjs/serialize/BigInt.d.ts +0 -6
- package/cjs/serialize/BigInt.js +0 -5
- package/cjs/storage/StoredValue.d.ts +0 -10
- package/cjs/storage/StoredValue.js +0 -28
- package/cjs/storage/interfaces/IStorageValue.d.ts +0 -8
- package/cjs/storage/interfaces/IStorageValue.js +0 -2
- package/cjs/transactions/Transaction.d.ts +0 -17
- package/cjs/transactions/Transaction.js +0 -33
- package/cjs/transactions/TransactionParser.d.ts +0 -7
- package/cjs/transactions/TransactionParser.js +0 -43
- package/cjs/transactions/decoders/DeploymentTransaction.d.ts +0 -17
- package/cjs/transactions/decoders/DeploymentTransaction.js +0 -30
- package/cjs/transactions/decoders/GenericTransaction.d.ts +0 -6
- package/cjs/transactions/decoders/GenericTransaction.js +0 -10
- package/cjs/transactions/decoders/InteractionTransaction.d.ts +0 -15
- package/cjs/transactions/decoders/InteractionTransaction.js +0 -25
- package/cjs/transactions/decoders/UnwrapTransaction.d.ts +0 -11
- package/cjs/transactions/decoders/UnwrapTransaction.js +0 -33
- package/cjs/transactions/decoders/WrapTransaction.d.ts +0 -15
- package/cjs/transactions/decoders/WrapTransaction.js +0 -34
- package/cjs/transactions/interfaces/BroadcastedTransaction.d.ts +0 -7
- package/cjs/transactions/interfaces/BroadcastedTransaction.js +0 -2
- package/cjs/transactions/interfaces/ITransaction.d.ts +0 -23
- package/cjs/transactions/interfaces/ITransaction.js +0 -2
- package/cjs/transactions/interfaces/ITransactionReceipt.d.ts +0 -21
- package/cjs/transactions/interfaces/ITransactionReceipt.js +0 -2
- package/cjs/transactions/interfaces/transactions/ICommonTransaction.d.ts +0 -7
- package/cjs/transactions/interfaces/transactions/ICommonTransaction.js +0 -2
- package/cjs/transactions/interfaces/transactions/IDeploymentTransaction.d.ts +0 -13
- package/cjs/transactions/interfaces/transactions/IDeploymentTransaction.js +0 -2
- package/cjs/transactions/interfaces/transactions/IInteractionTransaction.d.ts +0 -14
- package/cjs/transactions/interfaces/transactions/IInteractionTransaction.js +0 -2
- package/cjs/transactions/interfaces/transactions/IUnwrapTransaction.d.ts +0 -28
- package/cjs/transactions/interfaces/transactions/IUnwrapTransaction.js +0 -2
- package/cjs/transactions/interfaces/transactions/IWrapTransaction.d.ts +0 -10
- package/cjs/transactions/interfaces/transactions/IWrapTransaction.js +0 -2
- package/cjs/transactions/metadata/TransactionInput.d.ts +0 -16
- package/cjs/transactions/metadata/TransactionInput.js +0 -18
- package/cjs/transactions/metadata/TransactionOutput.d.ts +0 -19
- package/cjs/transactions/metadata/TransactionOutput.js +0 -20
- package/cjs/transactions/metadata/TransactionReceipt.d.ts +0 -11
- package/cjs/transactions/metadata/TransactionReceipt.js +0 -57
- package/cjs/utils/BitcoinUtils.d.ts +0 -4
- package/cjs/utils/BitcoinUtils.js +0 -14
- package/tsconfig.cjs.json +0 -9
package/docs/index.html
CHANGED
|
@@ -1,219 +1,219 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>OPNet</title><meta name="description" content="Documentation for OPNet"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><style>
|
|
2
|
-
@media (prefers-color-scheme: dark) {
|
|
3
|
-
:root {
|
|
4
|
-
--md-sys-color-primary: #fbbb45;
|
|
5
|
-
--md-sys-color-on-primary: #422c00;
|
|
6
|
-
--md-sys-color-primary-container: #5f4100;
|
|
7
|
-
--md-sys-color-on-primary-container: #ffdeab;
|
|
8
|
-
--md-sys-color-secondary: #dbc3a1;
|
|
9
|
-
--md-sys-color-on-secondary: #3c2e16;
|
|
10
|
-
--md-sys-color-secondary-container: #54442a;
|
|
11
|
-
--md-sys-color-on-secondary-container: #f8dfbb;
|
|
12
|
-
--md-sys-color-tertiary: #b4cea5;
|
|
13
|
-
--md-sys-color-on-tertiary: #213618;
|
|
14
|
-
--md-sys-color-tertiary-container: #374d2d;
|
|
15
|
-
--md-sys-color-on-tertiary-container: #d0eabf;
|
|
16
|
-
--md-sys-color-error: #ffb4ab;
|
|
17
|
-
--md-sys-color-on-error: #690005;
|
|
18
|
-
--md-sys-color-error-container: #93000a;
|
|
19
|
-
--md-sys-color-on-error-container: #ffb4ab;
|
|
20
|
-
--md-sys-color-background: #1f1b16;
|
|
21
|
-
--md-sys-color-on-background: #eae1d9;
|
|
22
|
-
--md-sys-color-surface: #1f1b16;
|
|
23
|
-
--md-sys-color-on-surface: #eae1d9;
|
|
24
|
-
--md-sys-color-surface-variant: #4e4539;
|
|
25
|
-
--md-sys-color-on-surface-variant: #d2c5b4;
|
|
26
|
-
--md-sys-color-outline: #9b8f80;
|
|
27
|
-
--md-sys-color-outline-variant: #4e4539;
|
|
28
|
-
--md-sys-color-shadow: #000000;
|
|
29
|
-
--md-sys-color-scrim: #000000;
|
|
30
|
-
--md-sys-color-inverse-surface: #eae1d9;
|
|
31
|
-
--md-sys-color-inverse-on-surface: #34302a;
|
|
32
|
-
--md-sys-color-inverse-primary: #7e5700;
|
|
33
|
-
--md-sys-color-surface-dim: #16130e;
|
|
34
|
-
--md-sys-color-surface-bright: #3d3833;
|
|
35
|
-
--md-sys-color-surface-container-lowest: #110e09;
|
|
36
|
-
--md-sys-color-surface-container-low: #1f1b16;
|
|
37
|
-
--md-sys-color-surface-container: #231f1a;
|
|
38
|
-
--md-sys-color-surface-container-high: #2d2924;
|
|
39
|
-
--md-sys-color-surface-container-highest: #38342e
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
:root[data-theme="dark"] {
|
|
43
|
-
--md-sys-color-primary: #fbbb45;
|
|
44
|
-
--md-sys-color-on-primary: #422c00;
|
|
45
|
-
--md-sys-color-primary-container: #5f4100;
|
|
46
|
-
--md-sys-color-on-primary-container: #ffdeab;
|
|
47
|
-
--md-sys-color-secondary: #dbc3a1;
|
|
48
|
-
--md-sys-color-on-secondary: #3c2e16;
|
|
49
|
-
--md-sys-color-secondary-container: #54442a;
|
|
50
|
-
--md-sys-color-on-secondary-container: #f8dfbb;
|
|
51
|
-
--md-sys-color-tertiary: #b4cea5;
|
|
52
|
-
--md-sys-color-on-tertiary: #213618;
|
|
53
|
-
--md-sys-color-tertiary-container: #374d2d;
|
|
54
|
-
--md-sys-color-on-tertiary-container: #d0eabf;
|
|
55
|
-
--md-sys-color-error: #ffb4ab;
|
|
56
|
-
--md-sys-color-on-error: #690005;
|
|
57
|
-
--md-sys-color-error-container: #93000a;
|
|
58
|
-
--md-sys-color-on-error-container: #ffb4ab;
|
|
59
|
-
--md-sys-color-background: #1f1b16;
|
|
60
|
-
--md-sys-color-on-background: #eae1d9;
|
|
61
|
-
--md-sys-color-surface: #1f1b16;
|
|
62
|
-
--md-sys-color-on-surface: #eae1d9;
|
|
63
|
-
--md-sys-color-surface-variant: #4e4539;
|
|
64
|
-
--md-sys-color-on-surface-variant: #d2c5b4;
|
|
65
|
-
--md-sys-color-outline: #9b8f80;
|
|
66
|
-
--md-sys-color-outline-variant: #4e4539;
|
|
67
|
-
--md-sys-color-shadow: #000000;
|
|
68
|
-
--md-sys-color-scrim: #000000;
|
|
69
|
-
--md-sys-color-inverse-surface: #eae1d9;
|
|
70
|
-
--md-sys-color-inverse-on-surface: #34302a;
|
|
71
|
-
--md-sys-color-inverse-primary: #7e5700;
|
|
72
|
-
--md-sys-color-surface-dim: #16130e;
|
|
73
|
-
--md-sys-color-surface-bright: #3d3833;
|
|
74
|
-
--md-sys-color-surface-container-lowest: #110e09;
|
|
75
|
-
--md-sys-color-surface-container-low: #1f1b16;
|
|
76
|
-
--md-sys-color-surface-container: #231f1a;
|
|
77
|
-
--md-sys-color-surface-container-high: #2d2924;
|
|
78
|
-
--md-sys-color-surface-container-highest: #38342e
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@media (prefers-color-scheme: light) {
|
|
82
|
-
:root {
|
|
83
|
-
--md-sys-color-primary: #7e5700;
|
|
84
|
-
--md-sys-color-on-primary: #ffffff;
|
|
85
|
-
--md-sys-color-primary-container: #ffdeab;
|
|
86
|
-
--md-sys-color-on-primary-container: #271900;
|
|
87
|
-
--md-sys-color-secondary: #6e5c3f;
|
|
88
|
-
--md-sys-color-on-secondary: #ffffff;
|
|
89
|
-
--md-sys-color-secondary-container: #f8dfbb;
|
|
90
|
-
--md-sys-color-on-secondary-container: #261904;
|
|
91
|
-
--md-sys-color-tertiary: #4e6543;
|
|
92
|
-
--md-sys-color-on-tertiary: #ffffff;
|
|
93
|
-
--md-sys-color-tertiary-container: #d0eabf;
|
|
94
|
-
--md-sys-color-on-tertiary-container: #0c2006;
|
|
95
|
-
--md-sys-color-error: #ba1a1a;
|
|
96
|
-
--md-sys-color-on-error: #ffffff;
|
|
97
|
-
--md-sys-color-error-container: #ffdad6;
|
|
98
|
-
--md-sys-color-on-error-container: #410002;
|
|
99
|
-
--md-sys-color-background: #fffbff;
|
|
100
|
-
--md-sys-color-on-background: #1f1b16;
|
|
101
|
-
--md-sys-color-surface: #fffbff;
|
|
102
|
-
--md-sys-color-on-surface: #1f1b16;
|
|
103
|
-
--md-sys-color-surface-variant: #eee0cf;
|
|
104
|
-
--md-sys-color-on-surface-variant: #4e4539;
|
|
105
|
-
--md-sys-color-outline: #807567;
|
|
106
|
-
--md-sys-color-outline-variant: #d2c5b4;
|
|
107
|
-
--md-sys-color-shadow: #000000;
|
|
108
|
-
--md-sys-color-scrim: #000000;
|
|
109
|
-
--md-sys-color-inverse-surface: #34302a;
|
|
110
|
-
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
111
|
-
--md-sys-color-inverse-primary: #fbbb45;
|
|
112
|
-
--md-sys-color-surface-dim: #e1d9d0;
|
|
113
|
-
--md-sys-color-surface-bright: #fff8f3;
|
|
114
|
-
--md-sys-color-surface-container-lowest: #ffffff;
|
|
115
|
-
--md-sys-color-surface-container-low: #fbf2e9;
|
|
116
|
-
--md-sys-color-surface-container: #f5ece4;
|
|
117
|
-
--md-sys-color-surface-container-high: #f0e7de;
|
|
118
|
-
--md-sys-color-surface-container-highest: #eae1d9
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
:root[data-theme="light"] {
|
|
122
|
-
--md-sys-color-primary: #7e5700;
|
|
123
|
-
--md-sys-color-on-primary: #ffffff;
|
|
124
|
-
--md-sys-color-primary-container: #ffdeab;
|
|
125
|
-
--md-sys-color-on-primary-container: #271900;
|
|
126
|
-
--md-sys-color-secondary: #6e5c3f;
|
|
127
|
-
--md-sys-color-on-secondary: #ffffff;
|
|
128
|
-
--md-sys-color-secondary-container: #f8dfbb;
|
|
129
|
-
--md-sys-color-on-secondary-container: #261904;
|
|
130
|
-
--md-sys-color-tertiary: #4e6543;
|
|
131
|
-
--md-sys-color-on-tertiary: #ffffff;
|
|
132
|
-
--md-sys-color-tertiary-container: #d0eabf;
|
|
133
|
-
--md-sys-color-on-tertiary-container: #0c2006;
|
|
134
|
-
--md-sys-color-error: #ba1a1a;
|
|
135
|
-
--md-sys-color-on-error: #ffffff;
|
|
136
|
-
--md-sys-color-error-container: #ffdad6;
|
|
137
|
-
--md-sys-color-on-error-container: #410002;
|
|
138
|
-
--md-sys-color-background: #fffbff;
|
|
139
|
-
--md-sys-color-on-background: #1f1b16;
|
|
140
|
-
--md-sys-color-surface: #fffbff;
|
|
141
|
-
--md-sys-color-on-surface: #1f1b16;
|
|
142
|
-
--md-sys-color-surface-variant: #eee0cf;
|
|
143
|
-
--md-sys-color-on-surface-variant: #4e4539;
|
|
144
|
-
--md-sys-color-outline: #807567;
|
|
145
|
-
--md-sys-color-outline-variant: #d2c5b4;
|
|
146
|
-
--md-sys-color-shadow: #000000;
|
|
147
|
-
--md-sys-color-scrim: #000000;
|
|
148
|
-
--md-sys-color-inverse-surface: #34302a;
|
|
149
|
-
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
150
|
-
--md-sys-color-inverse-primary: #fbbb45;
|
|
151
|
-
--md-sys-color-surface-dim: #e1d9d0;
|
|
152
|
-
--md-sys-color-surface-bright: #fff8f3;
|
|
153
|
-
--md-sys-color-surface-container-lowest: #ffffff;
|
|
154
|
-
--md-sys-color-surface-container-low: #fbf2e9;
|
|
155
|
-
--md-sys-color-surface-container: #f5ece4;
|
|
156
|
-
--md-sys-color-surface-container-high: #f0e7de;
|
|
157
|
-
--md-sys-color-surface-container-highest: #eae1d9
|
|
158
|
-
}
|
|
159
|
-
</style><link rel="stylesheet" href="assets/material-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">OPNet</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>OPNet</h2></div><div class="tsd-panel tsd-typography"><a id="md:op_net---smart-contracts-on-bitcoin-l1" class="tsd-anchor"></a><h1><a href="#md:op_net---smart-contracts-on-bitcoin-l1">OP_NET - Smart Contracts on Bitcoin L1</a></h1><p><img src="https://img.shields.io/badge/Bitcoin-000?style=for-the-badge&logo=bitcoin&logoColor=white" alt="Bitcoin">
|
|
160
|
-
<img src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript">
|
|
161
|
-
<img src="https://img.shields.io/badge/Node%20js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="NodeJS">
|
|
162
|
-
<img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="NPM">
|
|
163
|
-
<img src="https://img.shields.io/badge/GULP-%23CF4647.svg?style=for-the-badge&logo=gulp&logoColor=white" alt="Gulp">
|
|
164
|
-
<img src="https://img.shields.io/badge/ESLint-4B3263?style=for-the-badge&logo=eslint&logoColor=white" alt="ESLint"></p>
|
|
165
|
-
<p><a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square" alt="code style: prettier"></a></p>
|
|
166
|
-
<a id="md:introduction" class="tsd-anchor"></a><h2><a href="#md:introduction">Introduction</a></h2><p>A complete, compact and simple library for the Bitcoin ecosystem, written in
|
|
167
|
-
TypeScript. This library is designed to be easy to use and understand, while
|
|
168
|
-
providing a comprehensive set of functions for creating, reading and
|
|
169
|
-
manipulating Bitcoin transactions. This library is designed to be able to
|
|
170
|
-
manipulate anything related to BSI (Bitcoin Smart Inscription), smart contracts,
|
|
171
|
-
and other Bitcoin-related technologies.</p>
|
|
172
|
-
<a id="md:getting-started" class="tsd-anchor"></a><h2><a href="#md:getting-started">Getting Started</a></h2><a id="md:prerequisites" class="tsd-anchor"></a><h3><a href="#md:prerequisites">Prerequisites</a></h3><ul>
|
|
173
|
-
<li>Node.js version 16.x or higher</li>
|
|
174
|
-
<li>npm (Node Package Manager)</li>
|
|
175
|
-
</ul>
|
|
176
|
-
<a id="md:installation" class="tsd-anchor"></a><h3><a href="#md:installation">Installation</a></h3><pre><code class="language-shell"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">i</span><span class="hl-1"> </span><span class="hl-2">opnet</span>
|
|
177
|
-
</code><button>Copy</button></pre>
|
|
178
|
-
<a id="md:documentation" class="tsd-anchor"></a><h3><a href="#md:documentation">Documentation</a></h3><p>Documentation available at <a href="https://dev.opnet.org">https://dev.opnet.org</a> or in
|
|
179
|
-
the <code>docs/</code> directory of the repository.</p>
|
|
180
|
-
<a id="md:development" class="tsd-anchor"></a><h4><a href="#md:development">Development</a></h4><ol>
|
|
181
|
-
<li>Clone the repository:<pre><code class="language-bash"><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-2">clone</span><span class="hl-1"> </span><span class="hl-2">https://github.com/btc-vision/opnet.git</span>
|
|
182
|
-
</code><button>Copy</button></pre>
|
|
183
|
-
</li>
|
|
184
|
-
<li>Navigate to the repository directory:<pre><code class="language-bash"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">opnet</span>
|
|
185
|
-
</code><button>Copy</button></pre>
|
|
186
|
-
</li>
|
|
187
|
-
<li>Install the required dependencies:<pre><code class="language-bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">i</span>
|
|
188
|
-
</code><button>Copy</button></pre>
|
|
189
|
-
</li>
|
|
190
|
-
</ol>
|
|
191
|
-
<a id="md:example" class="tsd-anchor"></a><h2><a href="#md:example">Example</a></h2><p>Calling a contract function from typescript/javascript is as simple as the following code:</p>
|
|
192
|
-
<pre><code class="language-typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">getContract</span><span class="hl-1">, </span><span class="hl-4">JSONRpcProvider</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'opnet'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">senderAddress</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1"> = </span><span class="hl-2">'tb1p823gdnqvk8a90f8cu30w8ywvk29uh8txtqqnsmk6f5ktd7hlyl0q3cyz4c'</span><span class="hl-1">;</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">provider</span><span class="hl-1">: </span><span class="hl-7">JSONRpcProvider</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">JSONRpcProvider</span><span class="hl-1">(</span><span class="hl-2">'https://testnet.opnet.org'</span><span class="hl-1">);</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">contract</span><span class="hl-1">: </span><span class="hl-7">IOP_20Contract</span><span class="hl-1"> = </span><span class="hl-0">getContract</span><span class="hl-1"><</span><span class="hl-7">IOP_20Contract</span><span class="hl-1">>(</span><br/><span class="hl-1"> </span><span class="hl-2">'tb1q4tyhf8hpu04qjj3qaag20knun0spctultxzakw'</span><span class="hl-1">, </span><span class="hl-8">// MOTO Contract</span><br/><span class="hl-1"> </span><span class="hl-6">OP_20_ABI</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">provider</span><span class="hl-1">, </span><br/><span class="hl-1"> </span><span class="hl-4">sender</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">balanceExample</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">contract</span><span class="hl-1">.</span><span class="hl-0">balanceOf</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">'tb1p823gdnqvk8a90f8cu30w8ywvk29uh8txtqqnsmk6f5ktd7hlyl0q3cyz4c'</span><span class="hl-1">, </span><span class="hl-8">// Random address</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-3">if</span><span class="hl-1"> (</span><span class="hl-2">'error'</span><span class="hl-1"> </span><span class="hl-5">in</span><span class="hl-1"> </span><span class="hl-4">balanceExample</span><span class="hl-1">) </span><span class="hl-3">throw</span><span class="hl-1"> </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">Error</span><span class="hl-1">(</span><span class="hl-2">'Error in fetching balance'</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">'MOTO Balance:'</span><span class="hl-1">, </span><span class="hl-4">balanceExample</span><span class="hl-1">.</span><span class="hl-4">properties</span><span class="hl-1">);</span>
|
|
193
|
-
</code><button>Copy</button></pre>
|
|
194
|
-
<p>You can call any function of the contract by using the <code>contract</code> object. This object will encode the correct calldata based of your provided ABI and simulate the call.
|
|
195
|
-
A bunch more documentation will be available soon.</p>
|
|
196
|
-
<p>You can get the calldata generated by doing balanceExample.calldata and generate your transaction based on that.
|
|
197
|
-
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.</p>
|
|
198
|
-
<a id="md:contribution" class="tsd-anchor"></a><h2><a href="#md:contribution">Contribution</a></h2><p>Contributions are welcome! Please read through the <code>CONTRIBUTING.md</code> file for
|
|
199
|
-
guidelines on how to submit issues, feature requests, and pull requests. We
|
|
200
|
-
appreciate your input and encourage you to help us improve OP_NET.</p>
|
|
201
|
-
<a id="md:license" class="tsd-anchor"></a><h2><a href="#md:license">License</a></h2><p>This project is open source and available under the <a href="LICENSE">MIT License</a>. If
|
|
202
|
-
you have any suggestions or contributions, please feel free to submit a pull
|
|
203
|
-
request.</p>
|
|
204
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:op_net---smart-contracts-on-bitcoin-l1"><span>OP_<wbr/>NET -<wbr/> <wbr/>Smart <wbr/>Contracts on <wbr/>Bitcoin <wbr/>L1</span></a><ul><li><a href="#md:introduction"><span>Introduction</span></a></li><li><a href="#md:getting-started"><span>Getting <wbr/>Started</span></a></li><li><ul><li><a href="#md:prerequisites"><span>Prerequisites</span></a></li><li><a href="#md:installation"><span>Installation</span></a></li><li><a href="#md:documentation"><span>Documentation</span></a></li><li><ul><li><a href="#md:development"><span>Development</span></a></li></ul></li></ul></li><li><a href="#md:example"><span>Example</span></a></li><li><a href="#md:contribution"><span>Contribution</span></a></li><li><a href="#md:license"><span>License</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>OPNet</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div><script>
|
|
205
|
-
try {
|
|
206
|
-
const generateLinkElement = document.querySelector(".tsd-generator a");
|
|
207
|
-
const link = document.createElement("a");
|
|
208
|
-
Object.assign(link, {
|
|
209
|
-
href: "https://github.com/dmnsgn/typedoc-material-theme",
|
|
210
|
-
target: "_blank",
|
|
211
|
-
rel: "noreferrer",
|
|
212
|
-
innerText: "typedoc-material-theme."
|
|
213
|
-
});
|
|
214
|
-
generateLinkElement.insertAdjacentElement("afterend", link);
|
|
215
|
-
generateLinkElement.insertAdjacentText("afterend", " with ");
|
|
216
|
-
} catch (error) {
|
|
217
|
-
|
|
218
|
-
}
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>OPNet</title><meta name="description" content="Documentation for OPNet"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><style>
|
|
2
|
+
@media (prefers-color-scheme: dark) {
|
|
3
|
+
:root {
|
|
4
|
+
--md-sys-color-primary: #fbbb45;
|
|
5
|
+
--md-sys-color-on-primary: #422c00;
|
|
6
|
+
--md-sys-color-primary-container: #5f4100;
|
|
7
|
+
--md-sys-color-on-primary-container: #ffdeab;
|
|
8
|
+
--md-sys-color-secondary: #dbc3a1;
|
|
9
|
+
--md-sys-color-on-secondary: #3c2e16;
|
|
10
|
+
--md-sys-color-secondary-container: #54442a;
|
|
11
|
+
--md-sys-color-on-secondary-container: #f8dfbb;
|
|
12
|
+
--md-sys-color-tertiary: #b4cea5;
|
|
13
|
+
--md-sys-color-on-tertiary: #213618;
|
|
14
|
+
--md-sys-color-tertiary-container: #374d2d;
|
|
15
|
+
--md-sys-color-on-tertiary-container: #d0eabf;
|
|
16
|
+
--md-sys-color-error: #ffb4ab;
|
|
17
|
+
--md-sys-color-on-error: #690005;
|
|
18
|
+
--md-sys-color-error-container: #93000a;
|
|
19
|
+
--md-sys-color-on-error-container: #ffb4ab;
|
|
20
|
+
--md-sys-color-background: #1f1b16;
|
|
21
|
+
--md-sys-color-on-background: #eae1d9;
|
|
22
|
+
--md-sys-color-surface: #1f1b16;
|
|
23
|
+
--md-sys-color-on-surface: #eae1d9;
|
|
24
|
+
--md-sys-color-surface-variant: #4e4539;
|
|
25
|
+
--md-sys-color-on-surface-variant: #d2c5b4;
|
|
26
|
+
--md-sys-color-outline: #9b8f80;
|
|
27
|
+
--md-sys-color-outline-variant: #4e4539;
|
|
28
|
+
--md-sys-color-shadow: #000000;
|
|
29
|
+
--md-sys-color-scrim: #000000;
|
|
30
|
+
--md-sys-color-inverse-surface: #eae1d9;
|
|
31
|
+
--md-sys-color-inverse-on-surface: #34302a;
|
|
32
|
+
--md-sys-color-inverse-primary: #7e5700;
|
|
33
|
+
--md-sys-color-surface-dim: #16130e;
|
|
34
|
+
--md-sys-color-surface-bright: #3d3833;
|
|
35
|
+
--md-sys-color-surface-container-lowest: #110e09;
|
|
36
|
+
--md-sys-color-surface-container-low: #1f1b16;
|
|
37
|
+
--md-sys-color-surface-container: #231f1a;
|
|
38
|
+
--md-sys-color-surface-container-high: #2d2924;
|
|
39
|
+
--md-sys-color-surface-container-highest: #38342e
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
:root[data-theme="dark"] {
|
|
43
|
+
--md-sys-color-primary: #fbbb45;
|
|
44
|
+
--md-sys-color-on-primary: #422c00;
|
|
45
|
+
--md-sys-color-primary-container: #5f4100;
|
|
46
|
+
--md-sys-color-on-primary-container: #ffdeab;
|
|
47
|
+
--md-sys-color-secondary: #dbc3a1;
|
|
48
|
+
--md-sys-color-on-secondary: #3c2e16;
|
|
49
|
+
--md-sys-color-secondary-container: #54442a;
|
|
50
|
+
--md-sys-color-on-secondary-container: #f8dfbb;
|
|
51
|
+
--md-sys-color-tertiary: #b4cea5;
|
|
52
|
+
--md-sys-color-on-tertiary: #213618;
|
|
53
|
+
--md-sys-color-tertiary-container: #374d2d;
|
|
54
|
+
--md-sys-color-on-tertiary-container: #d0eabf;
|
|
55
|
+
--md-sys-color-error: #ffb4ab;
|
|
56
|
+
--md-sys-color-on-error: #690005;
|
|
57
|
+
--md-sys-color-error-container: #93000a;
|
|
58
|
+
--md-sys-color-on-error-container: #ffb4ab;
|
|
59
|
+
--md-sys-color-background: #1f1b16;
|
|
60
|
+
--md-sys-color-on-background: #eae1d9;
|
|
61
|
+
--md-sys-color-surface: #1f1b16;
|
|
62
|
+
--md-sys-color-on-surface: #eae1d9;
|
|
63
|
+
--md-sys-color-surface-variant: #4e4539;
|
|
64
|
+
--md-sys-color-on-surface-variant: #d2c5b4;
|
|
65
|
+
--md-sys-color-outline: #9b8f80;
|
|
66
|
+
--md-sys-color-outline-variant: #4e4539;
|
|
67
|
+
--md-sys-color-shadow: #000000;
|
|
68
|
+
--md-sys-color-scrim: #000000;
|
|
69
|
+
--md-sys-color-inverse-surface: #eae1d9;
|
|
70
|
+
--md-sys-color-inverse-on-surface: #34302a;
|
|
71
|
+
--md-sys-color-inverse-primary: #7e5700;
|
|
72
|
+
--md-sys-color-surface-dim: #16130e;
|
|
73
|
+
--md-sys-color-surface-bright: #3d3833;
|
|
74
|
+
--md-sys-color-surface-container-lowest: #110e09;
|
|
75
|
+
--md-sys-color-surface-container-low: #1f1b16;
|
|
76
|
+
--md-sys-color-surface-container: #231f1a;
|
|
77
|
+
--md-sys-color-surface-container-high: #2d2924;
|
|
78
|
+
--md-sys-color-surface-container-highest: #38342e
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (prefers-color-scheme: light) {
|
|
82
|
+
:root {
|
|
83
|
+
--md-sys-color-primary: #7e5700;
|
|
84
|
+
--md-sys-color-on-primary: #ffffff;
|
|
85
|
+
--md-sys-color-primary-container: #ffdeab;
|
|
86
|
+
--md-sys-color-on-primary-container: #271900;
|
|
87
|
+
--md-sys-color-secondary: #6e5c3f;
|
|
88
|
+
--md-sys-color-on-secondary: #ffffff;
|
|
89
|
+
--md-sys-color-secondary-container: #f8dfbb;
|
|
90
|
+
--md-sys-color-on-secondary-container: #261904;
|
|
91
|
+
--md-sys-color-tertiary: #4e6543;
|
|
92
|
+
--md-sys-color-on-tertiary: #ffffff;
|
|
93
|
+
--md-sys-color-tertiary-container: #d0eabf;
|
|
94
|
+
--md-sys-color-on-tertiary-container: #0c2006;
|
|
95
|
+
--md-sys-color-error: #ba1a1a;
|
|
96
|
+
--md-sys-color-on-error: #ffffff;
|
|
97
|
+
--md-sys-color-error-container: #ffdad6;
|
|
98
|
+
--md-sys-color-on-error-container: #410002;
|
|
99
|
+
--md-sys-color-background: #fffbff;
|
|
100
|
+
--md-sys-color-on-background: #1f1b16;
|
|
101
|
+
--md-sys-color-surface: #fffbff;
|
|
102
|
+
--md-sys-color-on-surface: #1f1b16;
|
|
103
|
+
--md-sys-color-surface-variant: #eee0cf;
|
|
104
|
+
--md-sys-color-on-surface-variant: #4e4539;
|
|
105
|
+
--md-sys-color-outline: #807567;
|
|
106
|
+
--md-sys-color-outline-variant: #d2c5b4;
|
|
107
|
+
--md-sys-color-shadow: #000000;
|
|
108
|
+
--md-sys-color-scrim: #000000;
|
|
109
|
+
--md-sys-color-inverse-surface: #34302a;
|
|
110
|
+
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
111
|
+
--md-sys-color-inverse-primary: #fbbb45;
|
|
112
|
+
--md-sys-color-surface-dim: #e1d9d0;
|
|
113
|
+
--md-sys-color-surface-bright: #fff8f3;
|
|
114
|
+
--md-sys-color-surface-container-lowest: #ffffff;
|
|
115
|
+
--md-sys-color-surface-container-low: #fbf2e9;
|
|
116
|
+
--md-sys-color-surface-container: #f5ece4;
|
|
117
|
+
--md-sys-color-surface-container-high: #f0e7de;
|
|
118
|
+
--md-sys-color-surface-container-highest: #eae1d9
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
:root[data-theme="light"] {
|
|
122
|
+
--md-sys-color-primary: #7e5700;
|
|
123
|
+
--md-sys-color-on-primary: #ffffff;
|
|
124
|
+
--md-sys-color-primary-container: #ffdeab;
|
|
125
|
+
--md-sys-color-on-primary-container: #271900;
|
|
126
|
+
--md-sys-color-secondary: #6e5c3f;
|
|
127
|
+
--md-sys-color-on-secondary: #ffffff;
|
|
128
|
+
--md-sys-color-secondary-container: #f8dfbb;
|
|
129
|
+
--md-sys-color-on-secondary-container: #261904;
|
|
130
|
+
--md-sys-color-tertiary: #4e6543;
|
|
131
|
+
--md-sys-color-on-tertiary: #ffffff;
|
|
132
|
+
--md-sys-color-tertiary-container: #d0eabf;
|
|
133
|
+
--md-sys-color-on-tertiary-container: #0c2006;
|
|
134
|
+
--md-sys-color-error: #ba1a1a;
|
|
135
|
+
--md-sys-color-on-error: #ffffff;
|
|
136
|
+
--md-sys-color-error-container: #ffdad6;
|
|
137
|
+
--md-sys-color-on-error-container: #410002;
|
|
138
|
+
--md-sys-color-background: #fffbff;
|
|
139
|
+
--md-sys-color-on-background: #1f1b16;
|
|
140
|
+
--md-sys-color-surface: #fffbff;
|
|
141
|
+
--md-sys-color-on-surface: #1f1b16;
|
|
142
|
+
--md-sys-color-surface-variant: #eee0cf;
|
|
143
|
+
--md-sys-color-on-surface-variant: #4e4539;
|
|
144
|
+
--md-sys-color-outline: #807567;
|
|
145
|
+
--md-sys-color-outline-variant: #d2c5b4;
|
|
146
|
+
--md-sys-color-shadow: #000000;
|
|
147
|
+
--md-sys-color-scrim: #000000;
|
|
148
|
+
--md-sys-color-inverse-surface: #34302a;
|
|
149
|
+
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
150
|
+
--md-sys-color-inverse-primary: #fbbb45;
|
|
151
|
+
--md-sys-color-surface-dim: #e1d9d0;
|
|
152
|
+
--md-sys-color-surface-bright: #fff8f3;
|
|
153
|
+
--md-sys-color-surface-container-lowest: #ffffff;
|
|
154
|
+
--md-sys-color-surface-container-low: #fbf2e9;
|
|
155
|
+
--md-sys-color-surface-container: #f5ece4;
|
|
156
|
+
--md-sys-color-surface-container-high: #f0e7de;
|
|
157
|
+
--md-sys-color-surface-container-highest: #eae1d9
|
|
158
|
+
}
|
|
159
|
+
</style><link rel="stylesheet" href="assets/material-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">OPNet</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>OPNet</h2></div><div class="tsd-panel tsd-typography"><a id="md:op_net---smart-contracts-on-bitcoin-l1" class="tsd-anchor"></a><h1><a href="#md:op_net---smart-contracts-on-bitcoin-l1">OP_NET - Smart Contracts on Bitcoin L1</a></h1><p><img src="https://img.shields.io/badge/Bitcoin-000?style=for-the-badge&logo=bitcoin&logoColor=white" alt="Bitcoin">
|
|
160
|
+
<img src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript">
|
|
161
|
+
<img src="https://img.shields.io/badge/Node%20js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="NodeJS">
|
|
162
|
+
<img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="NPM">
|
|
163
|
+
<img src="https://img.shields.io/badge/GULP-%23CF4647.svg?style=for-the-badge&logo=gulp&logoColor=white" alt="Gulp">
|
|
164
|
+
<img src="https://img.shields.io/badge/ESLint-4B3263?style=for-the-badge&logo=eslint&logoColor=white" alt="ESLint"></p>
|
|
165
|
+
<p><a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square" alt="code style: prettier"></a></p>
|
|
166
|
+
<a id="md:introduction" class="tsd-anchor"></a><h2><a href="#md:introduction">Introduction</a></h2><p>A complete, compact and simple library for the Bitcoin ecosystem, written in
|
|
167
|
+
TypeScript. This library is designed to be easy to use and understand, while
|
|
168
|
+
providing a comprehensive set of functions for creating, reading and
|
|
169
|
+
manipulating Bitcoin transactions. This library is designed to be able to
|
|
170
|
+
manipulate anything related to BSI (Bitcoin Smart Inscription), smart contracts,
|
|
171
|
+
and other Bitcoin-related technologies.</p>
|
|
172
|
+
<a id="md:getting-started" class="tsd-anchor"></a><h2><a href="#md:getting-started">Getting Started</a></h2><a id="md:prerequisites" class="tsd-anchor"></a><h3><a href="#md:prerequisites">Prerequisites</a></h3><ul>
|
|
173
|
+
<li>Node.js version 16.x or higher</li>
|
|
174
|
+
<li>npm (Node Package Manager)</li>
|
|
175
|
+
</ul>
|
|
176
|
+
<a id="md:installation" class="tsd-anchor"></a><h3><a href="#md:installation">Installation</a></h3><pre><code class="language-shell"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">i</span><span class="hl-1"> </span><span class="hl-2">opnet</span>
|
|
177
|
+
</code><button>Copy</button></pre>
|
|
178
|
+
<a id="md:documentation" class="tsd-anchor"></a><h3><a href="#md:documentation">Documentation</a></h3><p>Documentation available at <a href="https://dev.opnet.org">https://dev.opnet.org</a> or in
|
|
179
|
+
the <code>docs/</code> directory of the repository.</p>
|
|
180
|
+
<a id="md:development" class="tsd-anchor"></a><h4><a href="#md:development">Development</a></h4><ol>
|
|
181
|
+
<li>Clone the repository:<pre><code class="language-bash"><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-2">clone</span><span class="hl-1"> </span><span class="hl-2">https://github.com/btc-vision/opnet.git</span>
|
|
182
|
+
</code><button>Copy</button></pre>
|
|
183
|
+
</li>
|
|
184
|
+
<li>Navigate to the repository directory:<pre><code class="language-bash"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">opnet</span>
|
|
185
|
+
</code><button>Copy</button></pre>
|
|
186
|
+
</li>
|
|
187
|
+
<li>Install the required dependencies:<pre><code class="language-bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">i</span>
|
|
188
|
+
</code><button>Copy</button></pre>
|
|
189
|
+
</li>
|
|
190
|
+
</ol>
|
|
191
|
+
<a id="md:example" class="tsd-anchor"></a><h2><a href="#md:example">Example</a></h2><p>Calling a contract function from typescript/javascript is as simple as the following code:</p>
|
|
192
|
+
<pre><code class="language-typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">getContract</span><span class="hl-1">, </span><span class="hl-4">JSONRpcProvider</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">'opnet'</span><span class="hl-1">;</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">senderAddress</span><span class="hl-1">: </span><span class="hl-7">string</span><span class="hl-1"> = </span><span class="hl-2">'tb1p823gdnqvk8a90f8cu30w8ywvk29uh8txtqqnsmk6f5ktd7hlyl0q3cyz4c'</span><span class="hl-1">;</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">provider</span><span class="hl-1">: </span><span class="hl-7">JSONRpcProvider</span><span class="hl-1"> = </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">JSONRpcProvider</span><span class="hl-1">(</span><span class="hl-2">'https://testnet.opnet.org'</span><span class="hl-1">);</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">contract</span><span class="hl-1">: </span><span class="hl-7">IOP_20Contract</span><span class="hl-1"> = </span><span class="hl-0">getContract</span><span class="hl-1"><</span><span class="hl-7">IOP_20Contract</span><span class="hl-1">>(</span><br/><span class="hl-1"> </span><span class="hl-2">'tb1q4tyhf8hpu04qjj3qaag20knun0spctultxzakw'</span><span class="hl-1">, </span><span class="hl-8">// MOTO Contract</span><br/><span class="hl-1"> </span><span class="hl-6">OP_20_ABI</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">provider</span><span class="hl-1">, </span><br/><span class="hl-1"> </span><span class="hl-4">sender</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-6">balanceExample</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">contract</span><span class="hl-1">.</span><span class="hl-0">balanceOf</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">'tb1p823gdnqvk8a90f8cu30w8ywvk29uh8txtqqnsmk6f5ktd7hlyl0q3cyz4c'</span><span class="hl-1">, </span><span class="hl-8">// Random address</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-3">if</span><span class="hl-1"> (</span><span class="hl-2">'error'</span><span class="hl-1"> </span><span class="hl-5">in</span><span class="hl-1"> </span><span class="hl-4">balanceExample</span><span class="hl-1">) </span><span class="hl-3">throw</span><span class="hl-1"> </span><span class="hl-5">new</span><span class="hl-1"> </span><span class="hl-0">Error</span><span class="hl-1">(</span><span class="hl-2">'Error in fetching balance'</span><span class="hl-1">);</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">'MOTO Balance:'</span><span class="hl-1">, </span><span class="hl-4">balanceExample</span><span class="hl-1">.</span><span class="hl-4">properties</span><span class="hl-1">);</span>
|
|
193
|
+
</code><button>Copy</button></pre>
|
|
194
|
+
<p>You can call any function of the contract by using the <code>contract</code> object. This object will encode the correct calldata based of your provided ABI and simulate the call.
|
|
195
|
+
A bunch more documentation will be available soon.</p>
|
|
196
|
+
<p>You can get the calldata generated by doing balanceExample.calldata and generate your transaction based on that.
|
|
197
|
+
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.</p>
|
|
198
|
+
<a id="md:contribution" class="tsd-anchor"></a><h2><a href="#md:contribution">Contribution</a></h2><p>Contributions are welcome! Please read through the <code>CONTRIBUTING.md</code> file for
|
|
199
|
+
guidelines on how to submit issues, feature requests, and pull requests. We
|
|
200
|
+
appreciate your input and encourage you to help us improve OP_NET.</p>
|
|
201
|
+
<a id="md:license" class="tsd-anchor"></a><h2><a href="#md:license">License</a></h2><p>This project is open source and available under the <a href="LICENSE">MIT License</a>. If
|
|
202
|
+
you have any suggestions or contributions, please feel free to submit a pull
|
|
203
|
+
request.</p>
|
|
204
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:op_net---smart-contracts-on-bitcoin-l1"><span>OP_<wbr/>NET -<wbr/> <wbr/>Smart <wbr/>Contracts on <wbr/>Bitcoin <wbr/>L1</span></a><ul><li><a href="#md:introduction"><span>Introduction</span></a></li><li><a href="#md:getting-started"><span>Getting <wbr/>Started</span></a></li><li><ul><li><a href="#md:prerequisites"><span>Prerequisites</span></a></li><li><a href="#md:installation"><span>Installation</span></a></li><li><a href="#md:documentation"><span>Documentation</span></a></li><li><ul><li><a href="#md:development"><span>Development</span></a></li></ul></li></ul></li><li><a href="#md:example"><span>Example</span></a></li><li><a href="#md:contribution"><span>Contribution</span></a></li><li><a href="#md:license"><span>License</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>OPNet</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div><script>
|
|
205
|
+
try {
|
|
206
|
+
const generateLinkElement = document.querySelector(".tsd-generator a");
|
|
207
|
+
const link = document.createElement("a");
|
|
208
|
+
Object.assign(link, {
|
|
209
|
+
href: "https://github.com/dmnsgn/typedoc-material-theme",
|
|
210
|
+
target: "_blank",
|
|
211
|
+
rel: "noreferrer",
|
|
212
|
+
innerText: "typedoc-material-theme."
|
|
213
|
+
});
|
|
214
|
+
generateLinkElement.insertAdjacentElement("afterend", link);
|
|
215
|
+
generateLinkElement.insertAdjacentText("afterend", " with ");
|
|
216
|
+
} catch (error) {
|
|
217
|
+
|
|
218
|
+
}
|
|
219
219
|
</script></body></html>
|