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,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionBase = void 0;
|
|
4
|
-
const TransactionInput_js_1 = require("./metadata/TransactionInput.js");
|
|
5
|
-
const TransactionOutput_js_1 = require("./metadata/TransactionOutput.js");
|
|
6
|
-
const TransactionReceipt_js_1 = require("./metadata/TransactionReceipt.js");
|
|
7
|
-
class TransactionBase extends TransactionReceipt_js_1.TransactionReceipt {
|
|
8
|
-
id;
|
|
9
|
-
hash;
|
|
10
|
-
index;
|
|
11
|
-
burnedBitcoin;
|
|
12
|
-
inputs;
|
|
13
|
-
outputs;
|
|
14
|
-
OPNetType;
|
|
15
|
-
gasUsed;
|
|
16
|
-
constructor(transaction) {
|
|
17
|
-
super({
|
|
18
|
-
receipt: transaction.receipt,
|
|
19
|
-
receiptProofs: transaction.receiptProofs,
|
|
20
|
-
events: transaction.events,
|
|
21
|
-
revert: transaction.revert,
|
|
22
|
-
});
|
|
23
|
-
this.id = transaction.id;
|
|
24
|
-
this.hash = transaction.hash;
|
|
25
|
-
this.index = transaction.index;
|
|
26
|
-
this.burnedBitcoin = BigInt(transaction.burnedBitcoin) || 0n;
|
|
27
|
-
this.inputs = transaction.inputs.map((input) => new TransactionInput_js_1.TransactionInput(input));
|
|
28
|
-
this.outputs = transaction.outputs.map((output) => new TransactionOutput_js_1.TransactionOutput(output));
|
|
29
|
-
this.OPNetType = transaction.OPNetType;
|
|
30
|
-
this.gasUsed = BigInt(transaction.gasUsed || '0x00') || 0n;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.TransactionBase = TransactionBase;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
|
|
2
|
-
import { ITransaction } from './interfaces/ITransaction.js';
|
|
3
|
-
import { TransactionBase } from './Transaction.js';
|
|
4
|
-
export declare class TransactionParser {
|
|
5
|
-
static parseTransactions(transactions: ITransaction[]): TransactionBase<OPNetTransactionTypes>[];
|
|
6
|
-
static parseTransaction(transaction: ITransaction): TransactionBase<OPNetTransactionTypes>;
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionParser = void 0;
|
|
4
|
-
const OPNetTransactionTypes_js_1 = require("../interfaces/opnet/OPNetTransactionTypes.js");
|
|
5
|
-
const DeploymentTransaction_js_1 = require("./decoders/DeploymentTransaction.js");
|
|
6
|
-
const GenericTransaction_js_1 = require("./decoders/GenericTransaction.js");
|
|
7
|
-
const InteractionTransaction_js_1 = require("./decoders/InteractionTransaction.js");
|
|
8
|
-
const UnwrapTransaction_js_1 = require("./decoders/UnwrapTransaction.js");
|
|
9
|
-
const WrapTransaction_js_1 = require("./decoders/WrapTransaction.js");
|
|
10
|
-
class TransactionParser {
|
|
11
|
-
static parseTransactions(transactions) {
|
|
12
|
-
if (!transactions) {
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
const transactionArray = [];
|
|
16
|
-
for (let transaction of transactions) {
|
|
17
|
-
if (!transaction)
|
|
18
|
-
throw new Error(`Something went wrong while parsing transactions`);
|
|
19
|
-
transactionArray.push(this.parseTransaction(transaction));
|
|
20
|
-
}
|
|
21
|
-
return transactionArray;
|
|
22
|
-
}
|
|
23
|
-
static parseTransaction(transaction) {
|
|
24
|
-
if (!transaction)
|
|
25
|
-
throw new Error('Transaction is required');
|
|
26
|
-
const opnetType = transaction.OPNetType;
|
|
27
|
-
switch (opnetType) {
|
|
28
|
-
case OPNetTransactionTypes_js_1.OPNetTransactionTypes.Generic:
|
|
29
|
-
return new GenericTransaction_js_1.GenericTransaction(transaction);
|
|
30
|
-
case OPNetTransactionTypes_js_1.OPNetTransactionTypes.Interaction:
|
|
31
|
-
return new InteractionTransaction_js_1.InteractionTransaction(transaction);
|
|
32
|
-
case OPNetTransactionTypes_js_1.OPNetTransactionTypes.Deployment:
|
|
33
|
-
return new DeploymentTransaction_js_1.DeploymentTransaction(transaction);
|
|
34
|
-
case OPNetTransactionTypes_js_1.OPNetTransactionTypes.WrapInteraction:
|
|
35
|
-
return new WrapTransaction_js_1.WrapTransaction(transaction);
|
|
36
|
-
case OPNetTransactionTypes_js_1.OPNetTransactionTypes.UnwrapInteraction:
|
|
37
|
-
return new UnwrapTransaction_js_1.UnwrapTransaction(transaction);
|
|
38
|
-
default:
|
|
39
|
-
throw new Error('Unknown transaction type');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.TransactionParser = TransactionParser;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { OPNetTransactionTypes } from '../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
|
-
import { IDeploymentTransaction } from '../interfaces/transactions/IDeploymentTransaction.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 p2trAddress: string;
|
|
9
|
-
readonly bytecode: Buffer;
|
|
10
|
-
readonly wasCompressed: boolean;
|
|
11
|
-
readonly deployerPubKey: Buffer;
|
|
12
|
-
readonly deployerAddress: string;
|
|
13
|
-
readonly contractSeed: Buffer;
|
|
14
|
-
readonly contractSaltHash: Buffer;
|
|
15
|
-
readonly from: string;
|
|
16
|
-
constructor(transaction: IDeploymentTransaction);
|
|
17
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeploymentTransaction = void 0;
|
|
4
|
-
const Transaction_js_1 = require("../Transaction.js");
|
|
5
|
-
class DeploymentTransaction extends Transaction_js_1.TransactionBase {
|
|
6
|
-
contractAddress;
|
|
7
|
-
virtualAddress;
|
|
8
|
-
p2trAddress;
|
|
9
|
-
bytecode;
|
|
10
|
-
wasCompressed;
|
|
11
|
-
deployerPubKey;
|
|
12
|
-
deployerAddress;
|
|
13
|
-
contractSeed;
|
|
14
|
-
contractSaltHash;
|
|
15
|
-
from;
|
|
16
|
-
constructor(transaction) {
|
|
17
|
-
super(transaction);
|
|
18
|
-
this.from = transaction.from;
|
|
19
|
-
this.contractAddress = transaction.contractAddress;
|
|
20
|
-
this.virtualAddress = transaction.virtualAddress;
|
|
21
|
-
this.p2trAddress = transaction.p2trAddress;
|
|
22
|
-
this.bytecode = Buffer.from(transaction.bytecode, 'base64');
|
|
23
|
-
this.wasCompressed = transaction.wasCompressed;
|
|
24
|
-
this.deployerPubKey = Buffer.from(transaction.deployerPubKey, 'base64');
|
|
25
|
-
this.deployerAddress = transaction.deployerAddress;
|
|
26
|
-
this.contractSeed = Buffer.from(transaction.contractSeed, 'base64');
|
|
27
|
-
this.contractSaltHash = Buffer.from(transaction.contractSaltHash, 'base64');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.DeploymentTransaction = DeploymentTransaction;
|
|
@@ -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,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GenericTransaction = void 0;
|
|
4
|
-
const Transaction_js_1 = require("../Transaction.js");
|
|
5
|
-
class GenericTransaction extends Transaction_js_1.TransactionBase {
|
|
6
|
-
constructor(transaction) {
|
|
7
|
-
super(transaction);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.GenericTransaction = GenericTransaction;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Buffer } from 'buffer';
|
|
3
|
-
import { InteractionType } from '../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
4
|
-
import { IInteractionTransaction } from '../interfaces/transactions/IInteractionTransaction.js';
|
|
5
|
-
import { TransactionBase } from '../Transaction.js';
|
|
6
|
-
export declare class InteractionTransaction extends TransactionBase<InteractionType> 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,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InteractionTransaction = void 0;
|
|
4
|
-
const buffer_1 = require("buffer");
|
|
5
|
-
const Transaction_js_1 = require("../Transaction.js");
|
|
6
|
-
class InteractionTransaction extends Transaction_js_1.TransactionBase {
|
|
7
|
-
calldata;
|
|
8
|
-
senderPubKeyHash;
|
|
9
|
-
contractSecret;
|
|
10
|
-
interactionPubKey;
|
|
11
|
-
wasCompressed;
|
|
12
|
-
from;
|
|
13
|
-
contractAddress;
|
|
14
|
-
constructor(transaction) {
|
|
15
|
-
super(transaction);
|
|
16
|
-
this.calldata = buffer_1.Buffer.from(transaction.calldata, 'base64');
|
|
17
|
-
this.senderPubKeyHash = buffer_1.Buffer.from(transaction.senderPubKeyHash, 'base64');
|
|
18
|
-
this.contractSecret = buffer_1.Buffer.from(transaction.contractSecret, 'base64');
|
|
19
|
-
this.interactionPubKey = buffer_1.Buffer.from(transaction.interactionPubKey, 'base64');
|
|
20
|
-
this.wasCompressed = transaction.wasCompressed;
|
|
21
|
-
this.from = transaction.from;
|
|
22
|
-
this.contractAddress = transaction.contractAddress;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.InteractionTransaction = InteractionTransaction;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IUnwrapTransaction, ParsedPartialWBTCUTXODocument, UsedUTXO } from '../interfaces/transactions/IUnwrapTransaction.js';
|
|
2
|
-
import { InteractionTransaction } from './InteractionTransaction.js';
|
|
3
|
-
export declare class UnwrapTransaction extends InteractionTransaction implements IUnwrapTransaction {
|
|
4
|
-
readonly authorizedBy: string[];
|
|
5
|
-
readonly usedUTXOs: UsedUTXO[];
|
|
6
|
-
readonly consolidatedVault: ParsedPartialWBTCUTXODocument | undefined;
|
|
7
|
-
readonly unwrapAmount: bigint;
|
|
8
|
-
readonly requestedAmount: bigint;
|
|
9
|
-
constructor(transaction: IUnwrapTransaction);
|
|
10
|
-
private decodePartialWBTCUTXODocument;
|
|
11
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnwrapTransaction = void 0;
|
|
4
|
-
const InteractionTransaction_js_1 = require("./InteractionTransaction.js");
|
|
5
|
-
class UnwrapTransaction extends InteractionTransaction_js_1.InteractionTransaction {
|
|
6
|
-
authorizedBy;
|
|
7
|
-
usedUTXOs;
|
|
8
|
-
consolidatedVault;
|
|
9
|
-
unwrapAmount;
|
|
10
|
-
requestedAmount;
|
|
11
|
-
constructor(transaction) {
|
|
12
|
-
super(transaction);
|
|
13
|
-
this.authorizedBy = transaction.authorizedBy;
|
|
14
|
-
this.usedUTXOs = transaction.usedUTXOs;
|
|
15
|
-
this.consolidatedVault = this.decodePartialWBTCUTXODocument(transaction.consolidatedVault);
|
|
16
|
-
this.unwrapAmount = BigInt(transaction.unwrapAmount);
|
|
17
|
-
this.requestedAmount = BigInt(transaction.requestedAmount);
|
|
18
|
-
}
|
|
19
|
-
decodePartialWBTCUTXODocument(document) {
|
|
20
|
-
if (!document) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
console.log(document);
|
|
24
|
-
return {
|
|
25
|
-
vault: document.vault,
|
|
26
|
-
hash: document.hash,
|
|
27
|
-
value: BigInt(document.value),
|
|
28
|
-
outputIndex: document.outputIndex,
|
|
29
|
-
output: Buffer.from(document.output, 'base64'),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.UnwrapTransaction = UnwrapTransaction;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EcKeyPair } from '@btc-vision/transaction';
|
|
2
|
-
import { Network } from 'bitcoinjs-lib';
|
|
3
|
-
import { IWrapTransaction } from '../interfaces/transactions/IWrapTransaction.js';
|
|
4
|
-
import { InteractionTransaction } from './InteractionTransaction.js';
|
|
5
|
-
export declare class WrapTransaction extends InteractionTransaction implements IWrapTransaction {
|
|
6
|
-
readonly penalized: boolean;
|
|
7
|
-
readonly wrappingFees: bigint | string;
|
|
8
|
-
readonly depositAmount: bigint | string;
|
|
9
|
-
readonly depositAddress: string;
|
|
10
|
-
readonly vault: string;
|
|
11
|
-
readonly pubKeys: string[];
|
|
12
|
-
readonly minimumSignatures: number;
|
|
13
|
-
constructor(transaction: IWrapTransaction);
|
|
14
|
-
parsedTrustedKeys(trustedKeys: string[], network: Network): EcKeyPair[];
|
|
15
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WrapTransaction = void 0;
|
|
4
|
-
const transaction_1 = require("@btc-vision/transaction");
|
|
5
|
-
const InteractionTransaction_js_1 = require("./InteractionTransaction.js");
|
|
6
|
-
class WrapTransaction extends InteractionTransaction_js_1.InteractionTransaction {
|
|
7
|
-
penalized;
|
|
8
|
-
wrappingFees;
|
|
9
|
-
depositAmount;
|
|
10
|
-
depositAddress;
|
|
11
|
-
vault;
|
|
12
|
-
pubKeys;
|
|
13
|
-
minimumSignatures;
|
|
14
|
-
constructor(transaction) {
|
|
15
|
-
super(transaction);
|
|
16
|
-
this.penalized = transaction.penalized;
|
|
17
|
-
this.wrappingFees = BigInt(transaction.wrappingFees || '0x00') || 0n;
|
|
18
|
-
this.depositAmount = BigInt(transaction.depositAmount || '0x00') || 0n;
|
|
19
|
-
this.depositAddress = transaction.depositAddress;
|
|
20
|
-
this.vault = transaction.vault;
|
|
21
|
-
this.pubKeys = transaction.pubKeys;
|
|
22
|
-
this.minimumSignatures = transaction.minimumSignatures;
|
|
23
|
-
}
|
|
24
|
-
parsedTrustedKeys(trustedKeys, network) {
|
|
25
|
-
if (!trustedKeys) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
return trustedKeys.map((key) => {
|
|
29
|
-
const buffer = Buffer.from(key, 'base64');
|
|
30
|
-
return transaction_1.EcKeyPair.fromPublicKey(buffer, network);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.WrapTransaction = WrapTransaction;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { BigNumberish } from '../../common/CommonTypes.js';
|
|
3
|
-
import { OPNetTransactionTypes } from '../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
4
|
-
import { ITransactionInput, TransactionInput } from '../metadata/TransactionInput.js';
|
|
5
|
-
import { ITransactionOutput, TransactionOutput } from '../metadata/TransactionOutput.js';
|
|
6
|
-
import { ITransactionReceipt } from './ITransactionReceipt.js';
|
|
7
|
-
import { IDeploymentTransaction } from './transactions/IDeploymentTransaction.js';
|
|
8
|
-
import { IInteractionTransaction } from './transactions/IInteractionTransaction.js';
|
|
9
|
-
import { IWrapTransaction } from './transactions/IWrapTransaction.js';
|
|
10
|
-
export interface ITransactionBase<T extends OPNetTransactionTypes> extends ITransactionReceipt {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly hash: string;
|
|
13
|
-
readonly index: number;
|
|
14
|
-
readonly burnedBitcoin: string | BigNumberish;
|
|
15
|
-
readonly revert?: string | Buffer;
|
|
16
|
-
readonly inputs: ITransactionInput[] | TransactionInput[];
|
|
17
|
-
readonly outputs: ITransactionOutput[] | TransactionOutput[];
|
|
18
|
-
readonly OPNetType: T;
|
|
19
|
-
readonly gasUsed: string | bigint;
|
|
20
|
-
}
|
|
21
|
-
export interface IGenericTransaction extends ITransactionBase<OPNetTransactionTypes.Generic> {
|
|
22
|
-
}
|
|
23
|
-
export type ITransaction = IDeploymentTransaction | IInteractionTransaction | IGenericTransaction | IWrapTransaction;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { NetEvent } from '@btc-vision/bsi-binary';
|
|
3
|
-
export interface NetEventDocument {
|
|
4
|
-
readonly contractAddress: string;
|
|
5
|
-
readonly eventType: string;
|
|
6
|
-
readonly eventDataSelector: string;
|
|
7
|
-
readonly eventData: string;
|
|
8
|
-
}
|
|
9
|
-
export interface IRawContractEvents {
|
|
10
|
-
[key: string]: NetEventDocument[];
|
|
11
|
-
}
|
|
12
|
-
export type RawContractEvents = IRawContractEvents | NetEventDocument[];
|
|
13
|
-
export interface ContractEvents {
|
|
14
|
-
[key: string]: NetEvent[];
|
|
15
|
-
}
|
|
16
|
-
export interface ITransactionReceipt {
|
|
17
|
-
readonly receipt?: string | Buffer;
|
|
18
|
-
readonly receiptProofs?: string[];
|
|
19
|
-
readonly events?: RawContractEvents | ContractEvents;
|
|
20
|
-
readonly revert?: string | Buffer;
|
|
21
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OPNetTransactionTypes } from '../../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
2
|
-
import { ITransactionBase } from '../ITransaction.js';
|
|
3
|
-
export interface ICommonTransaction<T extends OPNetTransactionTypes> extends ITransactionBase<T> {
|
|
4
|
-
readonly from: string;
|
|
5
|
-
readonly contractAddress: string;
|
|
6
|
-
readonly wasCompressed: boolean;
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { OPNetTransactionTypes } from '../../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
|
-
import { ICommonTransaction } from './ICommonTransaction.js';
|
|
4
|
-
export interface IDeploymentTransaction extends ICommonTransaction<OPNetTransactionTypes.Deployment> {
|
|
5
|
-
readonly contractAddress: string;
|
|
6
|
-
readonly p2trAddress: string;
|
|
7
|
-
readonly virtualAddress: string;
|
|
8
|
-
readonly bytecode: Buffer | string;
|
|
9
|
-
readonly deployerPubKey: Buffer | string;
|
|
10
|
-
readonly deployerAddress: string;
|
|
11
|
-
readonly contractSeed: Buffer | string;
|
|
12
|
-
readonly contractSaltHash: Buffer | string;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { InteractionType } from '../../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
|
-
import { ContractEvents } from '../ITransactionReceipt.js';
|
|
4
|
-
import { ICommonTransaction } from './ICommonTransaction.js';
|
|
5
|
-
export interface IInteractionTransaction extends ICommonTransaction<InteractionType> {
|
|
6
|
-
readonly calldata: string | Buffer;
|
|
7
|
-
readonly senderPubKeyHash: string | Buffer;
|
|
8
|
-
readonly contractSecret: string | Buffer;
|
|
9
|
-
readonly interactionPubKey: string | Buffer;
|
|
10
|
-
readonly from: string;
|
|
11
|
-
readonly events: ContractEvents;
|
|
12
|
-
readonly receipt?: string | Buffer;
|
|
13
|
-
readonly receiptProofs?: string[];
|
|
14
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Address } from '@btc-vision/bsi-binary';
|
|
3
|
-
import { IInteractionTransaction } from './IInteractionTransaction.js';
|
|
4
|
-
export interface UsedUTXO {
|
|
5
|
-
readonly hash: string;
|
|
6
|
-
readonly outputIndex: number;
|
|
7
|
-
}
|
|
8
|
-
export interface PartialWBTCUTXODocument {
|
|
9
|
-
readonly vault: Address;
|
|
10
|
-
readonly hash: string;
|
|
11
|
-
readonly value: string;
|
|
12
|
-
readonly outputIndex: number;
|
|
13
|
-
readonly output: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ParsedPartialWBTCUTXODocument {
|
|
16
|
-
readonly vault: Address;
|
|
17
|
-
readonly hash: string;
|
|
18
|
-
readonly value: bigint;
|
|
19
|
-
readonly outputIndex: number;
|
|
20
|
-
readonly output: Buffer;
|
|
21
|
-
}
|
|
22
|
-
export interface IUnwrapTransaction extends IInteractionTransaction {
|
|
23
|
-
readonly authorizedBy: string[];
|
|
24
|
-
readonly usedUTXOs: UsedUTXO[];
|
|
25
|
-
readonly consolidatedVault: PartialWBTCUTXODocument | ParsedPartialWBTCUTXODocument | undefined;
|
|
26
|
-
readonly unwrapAmount: bigint | string;
|
|
27
|
-
readonly requestedAmount: bigint | string;
|
|
28
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IInteractionTransaction } from './IInteractionTransaction.js';
|
|
2
|
-
export interface IWrapTransaction extends IInteractionTransaction {
|
|
3
|
-
readonly penalized: boolean;
|
|
4
|
-
readonly wrappingFees: bigint | string;
|
|
5
|
-
readonly depositAmount: bigint | string;
|
|
6
|
-
readonly depositAddress: string;
|
|
7
|
-
readonly vault: string;
|
|
8
|
-
readonly pubKeys: string[];
|
|
9
|
-
readonly minimumSignatures: number;
|
|
10
|
-
}
|
|
@@ -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,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionInput = void 0;
|
|
4
|
-
class TransactionInput {
|
|
5
|
-
originalTransactionId;
|
|
6
|
-
outputTransactionIndex;
|
|
7
|
-
scriptSignature;
|
|
8
|
-
sequenceId;
|
|
9
|
-
transactionInWitness = [];
|
|
10
|
-
constructor(data) {
|
|
11
|
-
this.originalTransactionId = data.originalTransactionId;
|
|
12
|
-
this.outputTransactionIndex = data.outputTransactionIndex;
|
|
13
|
-
this.scriptSignature = data.scriptSignature;
|
|
14
|
-
this.sequenceId = data.sequenceId;
|
|
15
|
-
this.transactionInWitness = data.transactionInWitness || [];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.TransactionInput = TransactionInput;
|
|
@@ -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
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionOutput = void 0;
|
|
4
|
-
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
5
|
-
class TransactionOutput {
|
|
6
|
-
value;
|
|
7
|
-
index;
|
|
8
|
-
scriptPubKey;
|
|
9
|
-
script;
|
|
10
|
-
constructor(data) {
|
|
11
|
-
this.value = this.convertValue(data.value);
|
|
12
|
-
this.index = data.index;
|
|
13
|
-
this.scriptPubKey = data.scriptPubKey;
|
|
14
|
-
this.script = bitcoinjs_lib_1.script.decompile(Buffer.from(this.scriptPubKey.hex, 'hex'));
|
|
15
|
-
}
|
|
16
|
-
convertValue(value) {
|
|
17
|
-
return BigInt(value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.TransactionOutput = TransactionOutput;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ContractEvents, ITransactionReceipt } from '../interfaces/ITransactionReceipt.js';
|
|
3
|
-
export declare class TransactionReceipt implements ITransactionReceipt {
|
|
4
|
-
readonly receipt?: Buffer;
|
|
5
|
-
readonly receiptProofs: string[];
|
|
6
|
-
readonly events: ContractEvents;
|
|
7
|
-
readonly revert?: Buffer;
|
|
8
|
-
constructor(receipt: ITransactionReceipt);
|
|
9
|
-
private parseEvents;
|
|
10
|
-
private decodeEvent;
|
|
11
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionReceipt = void 0;
|
|
4
|
-
const bsi_binary_1 = require("@btc-vision/bsi-binary");
|
|
5
|
-
class TransactionReceipt {
|
|
6
|
-
receipt;
|
|
7
|
-
receiptProofs;
|
|
8
|
-
events;
|
|
9
|
-
revert;
|
|
10
|
-
constructor(receipt) {
|
|
11
|
-
this.receipt = receipt.receipt
|
|
12
|
-
? Buffer.from(receipt.receipt, 'base64')
|
|
13
|
-
: undefined;
|
|
14
|
-
this.receiptProofs = receipt.receiptProofs || [];
|
|
15
|
-
this.events = receipt.events ? this.parseEvents(receipt.events) : {};
|
|
16
|
-
this.revert = receipt.revert ? Buffer.from(receipt.revert, 'base64') : undefined;
|
|
17
|
-
}
|
|
18
|
-
parseEvents(events) {
|
|
19
|
-
const parsedEvents = {};
|
|
20
|
-
if (!Array.isArray(events)) {
|
|
21
|
-
for (const [key, value] of Object.entries(events)) {
|
|
22
|
-
parsedEvents[key] = value.map((event) => {
|
|
23
|
-
return this.decodeEvent(event);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
for (const event of events) {
|
|
29
|
-
const parsedEvent = this.decodeEvent(event);
|
|
30
|
-
const contractAddress = event.contractAddress;
|
|
31
|
-
if (!parsedEvents[contractAddress]) {
|
|
32
|
-
parsedEvents[contractAddress] = [];
|
|
33
|
-
}
|
|
34
|
-
parsedEvents[contractAddress].push(parsedEvent);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return parsedEvents;
|
|
38
|
-
}
|
|
39
|
-
decodeEvent(event) {
|
|
40
|
-
let eventData;
|
|
41
|
-
let eventDataSelector;
|
|
42
|
-
if (typeof event.eventData === 'string') {
|
|
43
|
-
eventData = new Uint8Array(Buffer.from(event.eventData, 'base64'));
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
eventData = event.eventData;
|
|
47
|
-
}
|
|
48
|
-
if (typeof event.eventDataSelector === 'string') {
|
|
49
|
-
eventDataSelector = BigInt(event.eventDataSelector);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
eventDataSelector = event.eventDataSelector;
|
|
53
|
-
}
|
|
54
|
-
return new bsi_binary_1.NetEvent(event.eventType, eventDataSelector, eventData);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.TransactionReceipt = TransactionReceipt;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BitcoinUtils = void 0;
|
|
7
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
-
class BitcoinUtils {
|
|
9
|
-
static formatUnits(value, decimals = 8) {
|
|
10
|
-
const bn = new bignumber_js_1.default(value.toString());
|
|
11
|
-
return bn.dividedBy(new bignumber_js_1.default(10).pow(decimals)).toString();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.BitcoinUtils = BitcoinUtils;
|