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/.babelrc
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"sourceType": "module",
|
|
3
|
-
"presets": [
|
|
4
|
-
"@babel/preset-react",
|
|
5
|
-
"@babel/preset-env"
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
{
|
|
2
|
+
"sourceType": "module",
|
|
3
|
+
"presets": [
|
|
4
|
+
"@babel/preset-react",
|
|
5
|
+
"@babel/preset-env",
|
|
6
|
+
"@babel/preset-typescript"
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: ''
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
**Describe the bug**
|
|
11
|
-
A clear and concise description of what the bug is.
|
|
12
|
-
|
|
13
|
-
**To Reproduce**
|
|
14
|
-
Steps to reproduce the behavior:
|
|
15
|
-
1. Go to '...'
|
|
16
|
-
2. Click on '....'
|
|
17
|
-
3. Scroll down to '....'
|
|
18
|
-
4. See error
|
|
19
|
-
|
|
20
|
-
**Expected behavior**
|
|
21
|
-
A clear and concise description of what you expected to happen.
|
|
22
|
-
|
|
23
|
-
**Screenshots**
|
|
24
|
-
If applicable, add screenshots to help explain your problem.
|
|
25
|
-
|
|
26
|
-
**Desktop (please complete the following information):**
|
|
27
|
-
- OS: [e.g. iOS]
|
|
28
|
-
- Browser [e.g. chrome, safari]
|
|
29
|
-
- Version [e.g. 22]
|
|
30
|
-
|
|
31
|
-
**Smartphone (please complete the following information):**
|
|
32
|
-
- Device: [e.g. iPhone6]
|
|
33
|
-
- OS: [e.g. iOS8.1]
|
|
34
|
-
- Browser [e.g. stock browser, safari]
|
|
35
|
-
- Version [e.g. 22]
|
|
36
|
-
|
|
37
|
-
**Additional context**
|
|
38
|
-
Add any other context about the problem here.
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: ''
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
**Is your feature request related to a problem? Please describe.**
|
|
11
|
-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
-
|
|
13
|
-
**Describe the solution you'd like**
|
|
14
|
-
A clear and concise description of what you want to happen.
|
|
15
|
-
|
|
16
|
-
**Describe alternatives you've considered**
|
|
17
|
-
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
-
|
|
19
|
-
**Additional context**
|
|
20
|
-
Add any other context or screenshots about the feature request here.
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: CI for OP_NET
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build_and_publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '20.x'
|
|
24
|
+
registry-url: 'https://registry.npmjs.org'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: yarn install
|
|
28
|
+
|
|
29
|
+
- name: Build the project
|
|
30
|
+
run: yarn build
|
|
31
|
+
|
|
32
|
+
- name: Build browser assets
|
|
33
|
+
run: yarn browserBuild
|
|
34
|
+
|
|
35
|
+
- name: Publish to npm
|
|
36
|
+
run: npm publish --provenance --access public
|
|
37
|
+
env:
|
|
38
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
39
|
+
|
|
40
|
+
- name: Create GitHub Release
|
|
41
|
+
uses: actions/create-release@v1
|
|
42
|
+
with:
|
|
43
|
+
tag_name: ${{ github.ref_name }}
|
|
44
|
+
release_name: Release ${{ github.ref_name }}
|
|
45
|
+
body: |
|
|
46
|
+
Automated release for OP_NET.
|
|
47
|
+
env:
|
|
48
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/.prettierrc.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"printWidth": 100,
|
|
3
|
-
"trailingComma": "all",
|
|
4
|
-
"tabWidth": 4,
|
|
5
|
-
"semi": true,
|
|
6
|
-
"singleQuote": true,
|
|
7
|
-
"quoteProps": "as-needed",
|
|
8
|
-
"bracketSpacing": true,
|
|
9
|
-
"bracketSameLine": true,
|
|
10
|
-
"arrowParens": "always",
|
|
11
|
-
"singleAttributePerLine": true
|
|
1
|
+
{
|
|
2
|
+
"printWidth": 100,
|
|
3
|
+
"trailingComma": "all",
|
|
4
|
+
"tabWidth": 4,
|
|
5
|
+
"semi": true,
|
|
6
|
+
"singleQuote": true,
|
|
7
|
+
"quoteProps": "as-needed",
|
|
8
|
+
"bracketSpacing": true,
|
|
9
|
+
"bracketSameLine": true,
|
|
10
|
+
"arrowParens": "always",
|
|
11
|
+
"singleAttributePerLine": true
|
|
12
12
|
}
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
# Contributing Guidelines
|
|
2
|
-
|
|
3
|
-
Thank you for considering contributing to our project! Please take a moment to
|
|
4
|
-
review the following guidelines before submitting your contribution.
|
|
5
|
-
|
|
6
|
-
## Pull Requests
|
|
7
|
-
|
|
8
|
-
When submitting a pull request, please make sure to follow these guidelines:
|
|
9
|
-
|
|
10
|
-
### Before You Begin
|
|
11
|
-
|
|
12
|
-
1. **Fork the repository**: If you haven't already, fork the repository to your
|
|
13
|
-
GitHub account.
|
|
14
|
-
|
|
15
|
-
2. **Create a new branch**: Create a new branch for your feature or bug fix.
|
|
16
|
-
This helps keep the main branch clean and makes it easier to review your
|
|
17
|
-
changes.
|
|
18
|
-
|
|
19
|
-
3. **Ensure your code is up-to-date**: Before starting work, make sure your
|
|
20
|
-
forked repository is up-to-date with the latest changes from the main
|
|
21
|
-
repository.
|
|
22
|
-
|
|
23
|
-
### Making Changes
|
|
24
|
-
|
|
25
|
-
1. **Follow coding conventions**: Make sure your code follows the existing
|
|
26
|
-
coding style and conventions used in the project.
|
|
27
|
-
|
|
28
|
-
2. **Write descriptive commit messages**: Write clear and descriptive commit
|
|
29
|
-
messages that explain the purpose of your changes.
|
|
30
|
-
|
|
31
|
-
3. **Test your changes**: Before submitting your pull request, make sure to test
|
|
32
|
-
your changes thoroughly to ensure they work as expected.
|
|
33
|
-
|
|
34
|
-
### Submitting the Pull Request
|
|
35
|
-
|
|
36
|
-
1. **Create a descriptive title**: Use a clear and descriptive title for your
|
|
37
|
-
pull request that summarizes the purpose of your changes.
|
|
38
|
-
|
|
39
|
-
2. **Provide a detailed description**: Include a detailed description of the
|
|
40
|
-
changes you've made and any relevant context that reviewers should know.
|
|
41
|
-
|
|
42
|
-
3. **Link related issues**: If your pull request addresses a specific issue,
|
|
43
|
-
make sure to reference it in the description using GitHub's issue linking
|
|
44
|
-
syntax (`#issue_number`).
|
|
45
|
-
|
|
46
|
-
4. **Review and address feedback**: Be responsive to any feedback or comments
|
|
47
|
-
you receive on your pull request and make any necessary changes.
|
|
48
|
-
|
|
49
|
-
## Issues
|
|
50
|
-
|
|
51
|
-
When submitting an issue, please provide as much information as possible to help
|
|
52
|
-
us understand and address the problem. Follow these guidelines when creating an
|
|
53
|
-
issue:
|
|
54
|
-
|
|
55
|
-
1. **Use a descriptive title**: Use a clear and descriptive title that
|
|
56
|
-
summarizes the issue you're experiencing.
|
|
57
|
-
|
|
58
|
-
2. **Provide detailed steps to reproduce**: Include detailed steps to reproduce
|
|
59
|
-
the issue, including any relevant code or configuration.
|
|
60
|
-
|
|
61
|
-
3. **Include relevant information**: Provide any relevant information such as
|
|
62
|
-
error messages, screenshots, or logs that can help diagnose the problem.
|
|
63
|
-
|
|
64
|
-
4. **Specify your environment**: If the issue is related to a specific
|
|
65
|
-
environment (e.g., operating system, browser), please specify it in your
|
|
66
|
-
issue description.
|
|
67
|
-
|
|
68
|
-
5. **Check for existing issues**: Before submitting a new issue, please check if
|
|
69
|
-
a similar issue has already been reported to avoid duplicates.
|
|
70
|
-
|
|
71
|
-
Thank you for your contributions!
|
|
1
|
+
# Contributing Guidelines
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to our project! Please take a moment to
|
|
4
|
+
review the following guidelines before submitting your contribution.
|
|
5
|
+
|
|
6
|
+
## Pull Requests
|
|
7
|
+
|
|
8
|
+
When submitting a pull request, please make sure to follow these guidelines:
|
|
9
|
+
|
|
10
|
+
### Before You Begin
|
|
11
|
+
|
|
12
|
+
1. **Fork the repository**: If you haven't already, fork the repository to your
|
|
13
|
+
GitHub account.
|
|
14
|
+
|
|
15
|
+
2. **Create a new branch**: Create a new branch for your feature or bug fix.
|
|
16
|
+
This helps keep the main branch clean and makes it easier to review your
|
|
17
|
+
changes.
|
|
18
|
+
|
|
19
|
+
3. **Ensure your code is up-to-date**: Before starting work, make sure your
|
|
20
|
+
forked repository is up-to-date with the latest changes from the main
|
|
21
|
+
repository.
|
|
22
|
+
|
|
23
|
+
### Making Changes
|
|
24
|
+
|
|
25
|
+
1. **Follow coding conventions**: Make sure your code follows the existing
|
|
26
|
+
coding style and conventions used in the project.
|
|
27
|
+
|
|
28
|
+
2. **Write descriptive commit messages**: Write clear and descriptive commit
|
|
29
|
+
messages that explain the purpose of your changes.
|
|
30
|
+
|
|
31
|
+
3. **Test your changes**: Before submitting your pull request, make sure to test
|
|
32
|
+
your changes thoroughly to ensure they work as expected.
|
|
33
|
+
|
|
34
|
+
### Submitting the Pull Request
|
|
35
|
+
|
|
36
|
+
1. **Create a descriptive title**: Use a clear and descriptive title for your
|
|
37
|
+
pull request that summarizes the purpose of your changes.
|
|
38
|
+
|
|
39
|
+
2. **Provide a detailed description**: Include a detailed description of the
|
|
40
|
+
changes you've made and any relevant context that reviewers should know.
|
|
41
|
+
|
|
42
|
+
3. **Link related issues**: If your pull request addresses a specific issue,
|
|
43
|
+
make sure to reference it in the description using GitHub's issue linking
|
|
44
|
+
syntax (`#issue_number`).
|
|
45
|
+
|
|
46
|
+
4. **Review and address feedback**: Be responsive to any feedback or comments
|
|
47
|
+
you receive on your pull request and make any necessary changes.
|
|
48
|
+
|
|
49
|
+
## Issues
|
|
50
|
+
|
|
51
|
+
When submitting an issue, please provide as much information as possible to help
|
|
52
|
+
us understand and address the problem. Follow these guidelines when creating an
|
|
53
|
+
issue:
|
|
54
|
+
|
|
55
|
+
1. **Use a descriptive title**: Use a clear and descriptive title that
|
|
56
|
+
summarizes the issue you're experiencing.
|
|
57
|
+
|
|
58
|
+
2. **Provide detailed steps to reproduce**: Include detailed steps to reproduce
|
|
59
|
+
the issue, including any relevant code or configuration.
|
|
60
|
+
|
|
61
|
+
3. **Include relevant information**: Provide any relevant information such as
|
|
62
|
+
error messages, screenshots, or logs that can help diagnose the problem.
|
|
63
|
+
|
|
64
|
+
4. **Specify your environment**: If the issue is related to a specific
|
|
65
|
+
environment (e.g., operating system, browser), please specify it in your
|
|
66
|
+
issue description.
|
|
67
|
+
|
|
68
|
+
5. **Check for existing issues**: Before submitting a new issue, please check if
|
|
69
|
+
a similar issue has already been reported to avoid duplicates.
|
|
70
|
+
|
|
71
|
+
Thank you for your contributions!
|
package/LICENSE.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024-2025 to the user BlobMaster41 on GitHub
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
6
|
-
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
7
|
-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
-
persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
11
|
-
Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
14
|
-
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
15
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
16
|
-
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 to the user BlobMaster41 on GitHub
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
6
|
+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
7
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
+
persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
11
|
+
Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
14
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
15
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
16
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,93 +1,96 @@
|
|
|
1
|
-
# OP_NET - Smart Contracts on Bitcoin L1
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-
|
|
10
|
-
[](https://github.com/prettier/prettier)
|
|
11
|
-
|
|
12
|
-
## Introduction
|
|
13
|
-
|
|
14
|
-
A complete, compact and simple library for the Bitcoin ecosystem, written in
|
|
15
|
-
TypeScript. This library is designed to be easy to use and understand, while
|
|
16
|
-
providing a comprehensive set of functions for creating, reading and
|
|
17
|
-
manipulating Bitcoin transactions. This library is designed to be able to
|
|
18
|
-
manipulate anything related to BSI (Bitcoin Smart Inscription), smart contracts,
|
|
19
|
-
and other Bitcoin-related technologies.
|
|
20
|
-
|
|
21
|
-
## Getting Started
|
|
22
|
-
|
|
23
|
-
### Prerequisites
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
### Installation
|
|
29
|
-
|
|
30
|
-
```shell
|
|
31
|
-
npm i opnet
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Documentation
|
|
35
|
-
|
|
36
|
-
Documentation available at [https://dev.opnet.org](https://dev.opnet.org) or in
|
|
37
|
-
the `docs/` directory of the repository.
|
|
38
|
-
|
|
39
|
-
#### Development
|
|
40
|
-
|
|
41
|
-
1. Clone the repository:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
2. Navigate to the repository directory:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
3. Install the required dependencies:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## Example
|
|
55
|
-
|
|
56
|
-
Calling a contract function from typescript/javascript is as simple as the following code:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const balanceExample = await contract.balanceOf(
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
if ('error' in balanceExample) throw new Error('Error in fetching balance');
|
|
74
|
-
console.log('MOTO Balance:', balanceExample.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
You can
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
# OP_NET - Smart Contracts on Bitcoin L1
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
[](https://github.com/prettier/prettier)
|
|
11
|
+
|
|
12
|
+
## Introduction
|
|
13
|
+
|
|
14
|
+
A complete, compact and simple library for the Bitcoin ecosystem, written in
|
|
15
|
+
TypeScript. This library is designed to be easy to use and understand, while
|
|
16
|
+
providing a comprehensive set of functions for creating, reading and
|
|
17
|
+
manipulating Bitcoin transactions. This library is designed to be able to
|
|
18
|
+
manipulate anything related to BSI (Bitcoin Smart Inscription), smart contracts,
|
|
19
|
+
and other Bitcoin-related technologies.
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
|
|
25
|
+
- Node.js version 16.x or higher
|
|
26
|
+
- npm (Node Package Manager)
|
|
27
|
+
|
|
28
|
+
### Installation
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
npm i opnet
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Documentation
|
|
35
|
+
|
|
36
|
+
Documentation available at [https://dev.opnet.org](https://dev.opnet.org) or in
|
|
37
|
+
the `docs/` directory of the repository.
|
|
38
|
+
|
|
39
|
+
#### Development
|
|
40
|
+
|
|
41
|
+
1. Clone the repository:
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/btc-vision/opnet.git
|
|
44
|
+
```
|
|
45
|
+
2. Navigate to the repository directory:
|
|
46
|
+
```bash
|
|
47
|
+
cd opnet
|
|
48
|
+
```
|
|
49
|
+
3. Install the required dependencies:
|
|
50
|
+
```bash
|
|
51
|
+
npm i
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Example
|
|
55
|
+
|
|
56
|
+
Calling a contract function from typescript/javascript is as simple as the following code:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { getContract, IOP_20Contract, JSONRpcProvider, OP_20_ABI } from 'opnet';
|
|
60
|
+
|
|
61
|
+
async function main() {
|
|
62
|
+
const provider: JSONRpcProvider = new JSONRpcProvider('https://testnet.opnet.org');
|
|
63
|
+
const contract: IOP_20Contract = getContract<IOP_20Contract>(
|
|
64
|
+
'tb1q4tyhf8hpu04qjj3qaag20knun0spctultxzakw', // MOTO Contract
|
|
65
|
+
OP_20_ABI,
|
|
66
|
+
provider,
|
|
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.decoded[0]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
main().catch(console.error);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
A bunch more documentation will be available soon.
|
|
82
|
+
|
|
83
|
+
You can get the calldata generated by doing balanceExample.calldata and generate your transaction based on that.
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
## Contribution
|
|
87
|
+
|
|
88
|
+
Contributions are welcome! Please read through the `CONTRIBUTING.md` file for
|
|
89
|
+
guidelines on how to submit issues, feature requests, and pull requests. We
|
|
90
|
+
appreciate your input and encourage you to help us improve OP_NET.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
This project is open source and available under the [MIT License](LICENSE). If
|
|
95
|
+
you have any suggestions or contributions, please feel free to submit a pull
|
|
96
|
+
request.
|