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
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ABIDataTypes } from '@btc-vision/bsi-binary';
|
|
2
|
-
import { BitcoinAbiTypes } from '../BitcoinAbiTypes.js';
|
|
3
|
-
import { OP_20_ABI } from './OP_20_ABI.js';
|
|
4
|
-
import { STAKING_ABI } from './STAKING_ABI.js';
|
|
5
|
-
export const WBTC_ABI = [
|
|
6
|
-
{
|
|
7
|
-
name: 'requestWithdrawal',
|
|
8
|
-
inputs: [
|
|
9
|
-
{
|
|
10
|
-
name: 'amount',
|
|
11
|
-
type: ABIDataTypes.UINT256,
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
outputs: [
|
|
15
|
-
{
|
|
16
|
-
name: 'success',
|
|
17
|
-
type: ABIDataTypes.BOOL,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
type: BitcoinAbiTypes.Function,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'withdrawableBalanceOf',
|
|
24
|
-
inputs: [
|
|
25
|
-
{
|
|
26
|
-
name: 'address',
|
|
27
|
-
type: ABIDataTypes.ADDRESS,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
outputs: [
|
|
31
|
-
{
|
|
32
|
-
name: 'balance',
|
|
33
|
-
type: ABIDataTypes.UINT256,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
type: BitcoinAbiTypes.Function,
|
|
37
|
-
},
|
|
38
|
-
...STAKING_ABI,
|
|
39
|
-
...OP_20_ABI,
|
|
40
|
-
];
|
package/build/bitcoin/UXTOs.d.ts
DELETED
package/build/bitcoin/UXTOs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/block/index.d.ts
DELETED
package/build/block/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Block } from './Block.js';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
2
|
-
import { DecodedCallResult } from '../common/CommonTypes.js';
|
|
3
|
-
import { ContractDecodedObjectResult, DecodedOutput } from './Contract.js';
|
|
4
|
-
export interface IDecodedEvent extends NetEvent {
|
|
5
|
-
readonly values: Array<DecodedCallResult>;
|
|
6
|
-
}
|
|
7
|
-
export declare class DecodedEvent<T extends ContractDecodedObjectResult = {}> extends NetEvent implements IDecodedEvent {
|
|
8
|
-
readonly eventType: string;
|
|
9
|
-
readonly eventDataSelector: bigint;
|
|
10
|
-
readonly eventData: Uint8Array;
|
|
11
|
-
properties: T;
|
|
12
|
-
values: Array<DecodedCallResult>;
|
|
13
|
-
constructor(eventType: string, eventDataSelector: bigint, eventData: Uint8Array);
|
|
14
|
-
setDecoded(decoded: DecodedOutput): void;
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
2
|
-
export class DecodedEvent extends NetEvent {
|
|
3
|
-
eventType;
|
|
4
|
-
eventDataSelector;
|
|
5
|
-
eventData;
|
|
6
|
-
properties = {};
|
|
7
|
-
values = [];
|
|
8
|
-
constructor(eventType, eventDataSelector, eventData) {
|
|
9
|
-
super(eventType, eventDataSelector, eventData);
|
|
10
|
-
this.eventType = eventType;
|
|
11
|
-
this.eventDataSelector = eventDataSelector;
|
|
12
|
-
this.eventData = eventData;
|
|
13
|
-
}
|
|
14
|
-
setDecoded(decoded) {
|
|
15
|
-
this.properties = Object.freeze(decoded.obj);
|
|
16
|
-
this.values.push(...decoded.values);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export interface IRawContract {
|
|
3
|
-
readonly contractAddress: string;
|
|
4
|
-
readonly virtualAddress: string;
|
|
5
|
-
readonly bytecode: Buffer | string;
|
|
6
|
-
readonly wasCompressed: boolean;
|
|
7
|
-
readonly deployedTransactionId: string;
|
|
8
|
-
readonly deployedTransactionHash: string;
|
|
9
|
-
readonly deployerPubKey: Buffer | string;
|
|
10
|
-
readonly contractSeed: Buffer | string;
|
|
11
|
-
readonly contractSaltHash: Buffer | string;
|
|
12
|
-
readonly deployerAddress: string;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { hmac } from '@noble/hashes/hmac';
|
|
2
|
-
import { pbkdf2 } from '@noble/hashes/pbkdf2';
|
|
3
|
-
import { sha256 } from '@noble/hashes/sha256';
|
|
4
|
-
import { sha512 } from '@noble/hashes/sha512';
|
|
5
|
-
import { assertArgument } from 'ethers';
|
|
6
|
-
function getGlobal() {
|
|
7
|
-
if (typeof self !== 'undefined') {
|
|
8
|
-
return self;
|
|
9
|
-
}
|
|
10
|
-
if (typeof window !== 'undefined') {
|
|
11
|
-
return window;
|
|
12
|
-
}
|
|
13
|
-
if (typeof global !== 'undefined') {
|
|
14
|
-
return global;
|
|
15
|
-
}
|
|
16
|
-
throw new Error('unable to locate global object');
|
|
17
|
-
}
|
|
18
|
-
const anyGlobal = getGlobal();
|
|
19
|
-
const crypto = anyGlobal.crypto || anyGlobal.msCrypto;
|
|
20
|
-
export function createHash(algo) {
|
|
21
|
-
switch (algo) {
|
|
22
|
-
case 'sha256':
|
|
23
|
-
return sha256.create();
|
|
24
|
-
case 'sha512':
|
|
25
|
-
return sha512.create();
|
|
26
|
-
}
|
|
27
|
-
assertArgument(false, 'invalid hashing algorithm name', 'algorithm', algo);
|
|
28
|
-
}
|
|
29
|
-
export function createHmac(_algo, key) {
|
|
30
|
-
const algo = ({ sha256, sha512 }[_algo]);
|
|
31
|
-
assertArgument(algo != null, 'invalid hmac algorithm', 'algorithm', _algo);
|
|
32
|
-
return hmac.create(algo, key);
|
|
33
|
-
}
|
|
34
|
-
export function pbkdf2Sync(password, salt, iterations, keylen, _algo) {
|
|
35
|
-
const algo = ({ sha256, sha512 }[_algo]);
|
|
36
|
-
assertArgument(algo != null, 'invalid pbkdf2 algorithm', 'algorithm', _algo);
|
|
37
|
-
return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });
|
|
38
|
-
}
|
|
39
|
-
export function randomBytes(length) {
|
|
40
|
-
assert(crypto != null, 'platform does not support secure random numbers', 'UNSUPPORTED_OPERATION', {
|
|
41
|
-
operation: 'randomBytes',
|
|
42
|
-
});
|
|
43
|
-
assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, 'invalid length', 'length', length);
|
|
44
|
-
const result = new Uint8Array(length);
|
|
45
|
-
crypto.getRandomValues(result);
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GenerationConstraints, WrappedGenerationParameters } from '../providers/interfaces/Generate.js';
|
|
2
|
-
export declare class WrappedGeneration implements WrappedGenerationParameters {
|
|
3
|
-
readonly constraints: GenerationConstraints;
|
|
4
|
-
readonly entities: string[];
|
|
5
|
-
readonly keys: string[];
|
|
6
|
-
readonly signature: string;
|
|
7
|
-
readonly vault: string;
|
|
8
|
-
constructor(params: WrappedGenerationParameters);
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class WrappedGeneration {
|
|
2
|
-
constraints;
|
|
3
|
-
entities;
|
|
4
|
-
keys;
|
|
5
|
-
signature;
|
|
6
|
-
vault;
|
|
7
|
-
constructor(params) {
|
|
8
|
-
this.constraints = params.constraints;
|
|
9
|
-
this.entities = params.entities;
|
|
10
|
-
this.keys = params.keys;
|
|
11
|
-
this.signature = params.signature;
|
|
12
|
-
this.vault = params.vault;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/interface.d.ts
DELETED
|
File without changes
|
package/build/interface.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BigNumberish } from 'ethers';
|
|
2
|
-
import { TransactionBase } from '../../transactions/Transaction.js';
|
|
3
|
-
import { OPNetTransactionTypes } from '../opnet/OPNetTransactionTypes.js';
|
|
4
|
-
import { ITransaction } from '../transactions/ITransaction.js';
|
|
5
|
-
export type BlockHeaderChecksumProof = Array<[number, string[]]>;
|
|
6
|
-
export interface IBlockCommon {
|
|
7
|
-
height: string | BigNumberish;
|
|
8
|
-
hash: string;
|
|
9
|
-
previousBlockHash: string;
|
|
10
|
-
previousBlockChecksum: string;
|
|
11
|
-
bits: string;
|
|
12
|
-
nonce: number;
|
|
13
|
-
version: number;
|
|
14
|
-
size: number;
|
|
15
|
-
txCount: number;
|
|
16
|
-
weight: number;
|
|
17
|
-
strippedSize: number;
|
|
18
|
-
time: number;
|
|
19
|
-
medianTime: number;
|
|
20
|
-
checksumRoot: string;
|
|
21
|
-
merkleRoot: string;
|
|
22
|
-
storageRoot: string;
|
|
23
|
-
receiptRoot: string;
|
|
24
|
-
checksumProofs: BlockHeaderChecksumProof;
|
|
25
|
-
}
|
|
26
|
-
export interface IBlock extends IBlockCommon {
|
|
27
|
-
transactions?: ITransaction[] | TransactionBase<OPNetTransactionTypes>[];
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
3
|
-
import { BigNumberish } from 'ethers';
|
|
4
|
-
import { ITransactionInput, TransactionInput } from '../../transactions/TransactionInput.js';
|
|
5
|
-
import { ITransactionOutput, TransactionOutput } from '../../transactions/TransactionOutput.js';
|
|
6
|
-
import { OPNetTransactionTypes } from '../opnet/OPNetTransactionTypes.js';
|
|
7
|
-
export interface ITransactionBase<T extends OPNetTransactionTypes> {
|
|
8
|
-
readonly id: string;
|
|
9
|
-
readonly hash: string;
|
|
10
|
-
readonly index: number;
|
|
11
|
-
readonly burnedBitcoin: string | BigNumberish;
|
|
12
|
-
readonly revert?: string | Buffer;
|
|
13
|
-
readonly inputs: ITransactionInput[] | TransactionInput[];
|
|
14
|
-
readonly outputs: ITransactionOutput[] | TransactionOutput[];
|
|
15
|
-
readonly OPNetType: T;
|
|
16
|
-
}
|
|
17
|
-
export interface IGenericTransaction extends ITransactionBase<OPNetTransactionTypes.Generic> {
|
|
18
|
-
}
|
|
19
|
-
export interface IDeploymentTransaction extends ITransactionBase<OPNetTransactionTypes.Deployment> {
|
|
20
|
-
readonly contractAddress: string;
|
|
21
|
-
readonly virtualAddress: string;
|
|
22
|
-
readonly bytecode: Buffer | string;
|
|
23
|
-
readonly wasCompressed: boolean;
|
|
24
|
-
readonly deployerPubKey: Buffer | string;
|
|
25
|
-
readonly deployerAddress: string;
|
|
26
|
-
readonly contractSeed: Buffer | string;
|
|
27
|
-
readonly contractSaltHash: Buffer | string;
|
|
28
|
-
}
|
|
29
|
-
export interface IInteractionTransaction extends ITransactionBase<OPNetTransactionTypes.Interaction> {
|
|
30
|
-
readonly calldata: string | Buffer;
|
|
31
|
-
readonly senderPubKeyHash: string | Buffer;
|
|
32
|
-
readonly contractSecret: string | Buffer;
|
|
33
|
-
readonly interactionPubKey: string | Buffer;
|
|
34
|
-
readonly wasCompressed: boolean;
|
|
35
|
-
readonly events: NetEvent[];
|
|
36
|
-
readonly receipt?: string | Buffer;
|
|
37
|
-
readonly receiptProofs?: string[];
|
|
38
|
-
}
|
|
39
|
-
export type ITransaction = IDeploymentTransaction | IInteractionTransaction | IGenericTransaction;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/providers/index.js
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BaseContractProperty } from '../abi/BaseContractProperty.js';
|
|
2
|
-
import { BaseContractProperties } from '../abi/interfaces/BaseContractProperties.js';
|
|
3
|
-
import { BitcoinAddressLike } from '../common/CommonTypes.js';
|
|
4
|
-
export interface WBTCContract extends BaseContractProperties {
|
|
5
|
-
balanceOf(address: BitcoinAddressLike): Promise<BaseContractProperty>;
|
|
6
|
-
owner(): Promise<BaseContractProperty>;
|
|
7
|
-
name(): Promise<BaseContractProperty>;
|
|
8
|
-
symbol(): Promise<BaseContractProperty>;
|
|
9
|
-
totalSupply(): Promise<BaseContractProperty>;
|
|
10
|
-
decimals(): Promise<BaseContractProperty>;
|
|
11
|
-
transfer(to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
|
|
12
|
-
transferFrom(from: BitcoinAddressLike, to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
|
|
13
|
-
approve(spender: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
|
|
14
|
-
allowance(owner: BitcoinAddressLike, spender: BitcoinAddressLike): Promise<BaseContractProperty>;
|
|
15
|
-
mint(to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
|
|
16
|
-
burn(to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
|
|
17
|
-
isAddressOwner(address: BitcoinAddressLike): Promise<BaseContractProperty>;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/scripts/block.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/scripts/block.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { JSONRpcProvider } from '../providers/JSONRpcProvider.js';
|
|
2
|
-
const provider = new JSONRpcProvider('http://localhost:9001');
|
|
3
|
-
for (let i = 0; i < 10; i++) {
|
|
4
|
-
(async () => {
|
|
5
|
-
try {
|
|
6
|
-
const block = await provider.getBlock(i);
|
|
7
|
-
console.log(block);
|
|
8
|
-
}
|
|
9
|
-
catch (e) {
|
|
10
|
-
console.log(e.message);
|
|
11
|
-
}
|
|
12
|
-
})();
|
|
13
|
-
}
|
package/build/scripts/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/scripts/test.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { JSONRpcProvider } from '../providers/JSONRpcProvider.js';
|
|
2
|
-
const provider = new JSONRpcProvider('https://testnet.opnet.org');
|
|
3
|
-
(async () => {
|
|
4
|
-
const blockNumber = await provider.getBlockNumber();
|
|
5
|
-
console.log('Current network height:', blockNumber);
|
|
6
|
-
const block = await provider.getBlock(2810101n, true);
|
|
7
|
-
console.log('Block ->', block.transactions[2]);
|
|
8
|
-
const balance = await provider.getBalance('tb1qcfszz8dcvsz9mcp70ezw5zy2r3ydr0cfz60d3t');
|
|
9
|
-
console.log('Balance out:', balance);
|
|
10
|
-
const utxos = await provider.getUXTOs('tb1qcfszz8dcvsz9mcp70ezw5zy2r3ydr0cfz60d3t');
|
|
11
|
-
console.log('UTXOs:', utxos);
|
|
12
|
-
const transaction = await provider.getTransaction('63e77ba9fa4262b3d4d0d9d97fa8a7359534606c3f3af096284662e3f619f374');
|
|
13
|
-
console.log('Transaction:', transaction);
|
|
14
|
-
const receipt = await provider.getTransactionReceipt('63e77ba9fa4262b3d4d0d9d97fa8a7359534606c3f3af096284662e3f619f374');
|
|
15
|
-
console.log('Receipt:', receipt);
|
|
16
|
-
const net = await provider.getNetwork();
|
|
17
|
-
console.log(net);
|
|
18
|
-
const code = await provider.getCode('tb1pth90usc4f528aqphpjrfkkdm4vy8hxnt5gps6aau2nva6pxeshtqqzlt3a');
|
|
19
|
-
console.log('Code:', code);
|
|
20
|
-
const pointerValue = await provider.getStorageAt('tb1pth90usc4f528aqphpjrfkkdm4vy8hxnt5gps6aau2nva6pxeshtqqzlt3a', 'EXLK/QhEQMI5d9DrthLvozT+UcDQ7WuSPaz7g8GV3AQ=', true);
|
|
21
|
-
console.log('Pointer value:', pointerValue);
|
|
22
|
-
const callResult = await provider.call('tb1pth90usc4f528aqphpjrfkkdm4vy8hxnt5gps6aau2nva6pxeshtqqzlt3a', '82d62f3d3133734251714a646e416463377635746e583369665971414d6f4658373956664c79000000000000000000000000000000000000000000000000000000000000');
|
|
23
|
-
console.log('Call result:', callResult);
|
|
24
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getContract } from '../contracts/Contract.js';
|
|
2
|
-
import { JSONRpcProvider } from '../providers/JSONRpcProvider.js';
|
|
3
|
-
import { wBTCAbi } from './ITestContract.js';
|
|
4
|
-
const provider = new JSONRpcProvider('https://testnet.opnet.org');
|
|
5
|
-
(async () => {
|
|
6
|
-
const contract = getContract('bcrt1pyrs3eqwnrmd4ql3nwvx66yzp0wc24xd2t9pf8699ln340pjs7f3sar3tum', wBTCAbi, provider);
|
|
7
|
-
const balanceExample = (await contract.balanceOf('bcrt1pyrs3eqwnrmd4ql3nwvx66yzp0wc24xd2t9pf8699ln340pjs7f3sar3tum'));
|
|
8
|
-
console.log('Balance:', balanceExample.decoded);
|
|
9
|
-
const owner = (await contract.owner());
|
|
10
|
-
console.log('Owner:', owner.properties);
|
|
11
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MOTO_ADDRESS_REGTEST, ROUTER_ADDRESS_REGTEST, WBTC_ADDRESS_REGTEST, } from '@btc-vision/transaction';
|
|
2
|
-
import { MOTOSWAP_ROUTER_ABI } from '../abi/shared/json/MOTOSWAP_ROUTER_ABI.js';
|
|
3
|
-
import { getContract } from '../contracts/Contract.js';
|
|
4
|
-
import { JSONRpcProvider } from '../providers/JSONRpcProvider.js';
|
|
5
|
-
const provider = new JSONRpcProvider('http://localhost:9001');
|
|
6
|
-
const routerContract = getContract(ROUTER_ADDRESS_REGTEST, MOTOSWAP_ROUTER_ABI, provider);
|
|
7
|
-
const getData = await routerContract.getAmountsOut(1000n, [
|
|
8
|
-
WBTC_ADDRESS_REGTEST,
|
|
9
|
-
MOTO_ADDRESS_REGTEST,
|
|
10
|
-
]);
|
|
11
|
-
console.log(getData);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MOTO_ADDRESS_REGTEST } from '@btc-vision/transaction';
|
|
2
|
-
import { WBTC_ABI } from '../abi/shared/json/WBTC_ABI.js';
|
|
3
|
-
import { getContract } from '../contracts/Contract.js';
|
|
4
|
-
import { JSONRpcProvider } from '../providers/JSONRpcProvider.js';
|
|
5
|
-
const provider = new JSONRpcProvider('http://localhost:9001');
|
|
6
|
-
const contract = getContract(MOTO_ADDRESS_REGTEST, WBTC_ABI, provider, 'bcrt1p2m2yz9hae5lkypuf8heh6udnt0tchmxhaftcfslqsr5vrwzh34yqgn6hs6');
|
|
7
|
-
const decimals = contract.encodeCalldata('decimals', []);
|
|
8
|
-
console.log(decimals);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OP_20_ABI } from '../abi/shared/json/OP_20_ABI.js';
|
|
2
|
-
import { getContract } from '../contracts/Contract.js';
|
|
3
|
-
import { JSONRpcProvider } from '../providers/JSONRpcProvider.js';
|
|
4
|
-
const provider = new JSONRpcProvider('https://regtest.opnet.org');
|
|
5
|
-
const contract = getContract('bcrt1qxeyh0pacdtkqmlna9n254fztp3ptadkkfu6efl', OP_20_ABI, provider);
|
|
6
|
-
const balanceExample = await contract.balanceOf('bcrt1pyrs3eqwnrmd4ql3nwvx66yzp0wc24xd2t9pf8699ln340pjs7f3sar3tum');
|
|
7
|
-
if ('error' in balanceExample)
|
|
8
|
-
throw new Error('Error in fetching balance');
|
|
9
|
-
console.log('Balance:', balanceExample.decoded);
|
|
10
|
-
const owner = (await contract.owner());
|
|
11
|
-
console.log('Owner:', owner.properties);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
|
-
import { IDeploymentTransaction } from './interfaces/ITransaction.js';
|
|
4
|
-
import { TransactionBase } from './Transaction.js';
|
|
5
|
-
export declare class DeploymentTransaction extends TransactionBase<OPNetTransactionTypes.Deployment> implements IDeploymentTransaction {
|
|
6
|
-
readonly contractAddress: string;
|
|
7
|
-
readonly virtualAddress: string;
|
|
8
|
-
readonly bytecode: Buffer;
|
|
9
|
-
readonly wasCompressed: boolean;
|
|
10
|
-
readonly deployerPubKey: Buffer;
|
|
11
|
-
readonly deployerAddress: string;
|
|
12
|
-
readonly contractSeed: Buffer;
|
|
13
|
-
readonly contractSaltHash: Buffer;
|
|
14
|
-
readonly from: string;
|
|
15
|
-
constructor(transaction: IDeploymentTransaction);
|
|
16
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TransactionBase } from './Transaction.js';
|
|
2
|
-
export class DeploymentTransaction extends TransactionBase {
|
|
3
|
-
contractAddress;
|
|
4
|
-
virtualAddress;
|
|
5
|
-
bytecode;
|
|
6
|
-
wasCompressed;
|
|
7
|
-
deployerPubKey;
|
|
8
|
-
deployerAddress;
|
|
9
|
-
contractSeed;
|
|
10
|
-
contractSaltHash;
|
|
11
|
-
from;
|
|
12
|
-
constructor(transaction) {
|
|
13
|
-
super(transaction);
|
|
14
|
-
this.from = transaction.from;
|
|
15
|
-
this.contractAddress = transaction.contractAddress;
|
|
16
|
-
this.virtualAddress = transaction.virtualAddress;
|
|
17
|
-
this.bytecode = Buffer.from(transaction.bytecode, 'base64');
|
|
18
|
-
this.wasCompressed = transaction.wasCompressed;
|
|
19
|
-
this.deployerPubKey = Buffer.from(transaction.deployerPubKey, 'base64');
|
|
20
|
-
this.deployerAddress = transaction.deployerAddress;
|
|
21
|
-
this.contractSeed = Buffer.from(transaction.contractSeed, 'base64');
|
|
22
|
-
this.contractSaltHash = Buffer.from(transaction.contractSaltHash, 'base64');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
|
|
2
|
-
import { IGenericTransaction } from './interfaces/ITransaction.js';
|
|
3
|
-
import { TransactionBase } from './Transaction.js';
|
|
4
|
-
export declare class GenericTransaction extends TransactionBase<OPNetTransactionTypes.Generic> implements IGenericTransaction {
|
|
5
|
-
constructor(transaction: IGenericTransaction);
|
|
6
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Buffer } from 'buffer';
|
|
3
|
-
import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
|
|
4
|
-
import { IInteractionTransaction } from './interfaces/ITransaction.js';
|
|
5
|
-
import { TransactionBase } from './Transaction.js';
|
|
6
|
-
export declare class InteractionTransaction extends TransactionBase<OPNetTransactionTypes.Interaction> implements IInteractionTransaction {
|
|
7
|
-
readonly calldata: Buffer;
|
|
8
|
-
readonly senderPubKeyHash: Buffer;
|
|
9
|
-
readonly contractSecret: Buffer;
|
|
10
|
-
readonly interactionPubKey: Buffer;
|
|
11
|
-
readonly wasCompressed: boolean;
|
|
12
|
-
readonly from: string;
|
|
13
|
-
readonly contractAddress: string;
|
|
14
|
-
constructor(transaction: IInteractionTransaction);
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Buffer } from 'buffer';
|
|
2
|
-
import { TransactionBase } from './Transaction.js';
|
|
3
|
-
export class InteractionTransaction extends TransactionBase {
|
|
4
|
-
calldata;
|
|
5
|
-
senderPubKeyHash;
|
|
6
|
-
contractSecret;
|
|
7
|
-
interactionPubKey;
|
|
8
|
-
wasCompressed;
|
|
9
|
-
from;
|
|
10
|
-
contractAddress;
|
|
11
|
-
constructor(transaction) {
|
|
12
|
-
super(transaction);
|
|
13
|
-
this.calldata = Buffer.from(transaction.calldata, 'base64');
|
|
14
|
-
this.senderPubKeyHash = Buffer.from(transaction.senderPubKeyHash, 'base64');
|
|
15
|
-
this.contractSecret = Buffer.from(transaction.contractSecret, 'base64');
|
|
16
|
-
this.interactionPubKey = Buffer.from(transaction.interactionPubKey, 'base64');
|
|
17
|
-
this.wasCompressed = transaction.wasCompressed;
|
|
18
|
-
this.from = transaction.from;
|
|
19
|
-
this.contractAddress = transaction.contractAddress;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ScriptSig } from '@btc-vision/bsi-bitcoin-rpc';
|
|
2
|
-
export interface ITransactionInput {
|
|
3
|
-
readonly originalTransactionId: string | undefined;
|
|
4
|
-
readonly outputTransactionIndex: number | undefined;
|
|
5
|
-
readonly scriptSignature: ScriptSig | undefined;
|
|
6
|
-
readonly sequenceId: number;
|
|
7
|
-
readonly transactionInWitness?: string[];
|
|
8
|
-
}
|
|
9
|
-
export declare class TransactionInput implements ITransactionInput {
|
|
10
|
-
readonly originalTransactionId: string | undefined;
|
|
11
|
-
readonly outputTransactionIndex: number | undefined;
|
|
12
|
-
readonly scriptSignature: ScriptSig | undefined;
|
|
13
|
-
readonly sequenceId: number;
|
|
14
|
-
readonly transactionInWitness: string[];
|
|
15
|
-
constructor(data: ITransactionInput);
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class TransactionInput {
|
|
2
|
-
originalTransactionId;
|
|
3
|
-
outputTransactionIndex;
|
|
4
|
-
scriptSignature;
|
|
5
|
-
sequenceId;
|
|
6
|
-
transactionInWitness = [];
|
|
7
|
-
constructor(data) {
|
|
8
|
-
this.originalTransactionId = data.originalTransactionId;
|
|
9
|
-
this.outputTransactionIndex = data.outputTransactionIndex;
|
|
10
|
-
this.scriptSignature = data.scriptSignature;
|
|
11
|
-
this.sequenceId = data.sequenceId;
|
|
12
|
-
this.transactionInWitness = data.transactionInWitness || [];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ScriptPubKey } from '@btc-vision/bsi-bitcoin-rpc';
|
|
3
|
-
export interface ITransactionOutput {
|
|
4
|
-
readonly index: number;
|
|
5
|
-
readonly scriptPubKey: {
|
|
6
|
-
hex: string;
|
|
7
|
-
addresses?: string[];
|
|
8
|
-
address?: string;
|
|
9
|
-
};
|
|
10
|
-
readonly value: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class TransactionOutput {
|
|
13
|
-
readonly value: bigint;
|
|
14
|
-
readonly index: number;
|
|
15
|
-
readonly scriptPubKey: ScriptPubKey;
|
|
16
|
-
readonly script: Array<number | Buffer> | null;
|
|
17
|
-
constructor(data: ITransactionOutput);
|
|
18
|
-
private convertValue;
|
|
19
|
-
}
|