@sravankumar02/sdk-core 1.0.0
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/LICENSE +11 -0
- package/README.md +94 -0
- package/out/abi/argSerializer.d.ts +45 -0
- package/out/abi/argSerializer.js +171 -0
- package/out/abi/argSerializer.js.map +1 -0
- package/out/abi/argumentErrorContext.d.ts +12 -0
- package/out/abi/argumentErrorContext.js +34 -0
- package/out/abi/argumentErrorContext.js.map +1 -0
- package/out/abi/code.d.ts +23 -0
- package/out/abi/code.js +41 -0
- package/out/abi/code.js.map +1 -0
- package/out/abi/codec/address.d.ts +24 -0
- package/out/abi/codec/address.js +41 -0
- package/out/abi/codec/address.js.map +1 -0
- package/out/abi/codec/arrayVec.d.ts +11 -0
- package/out/abi/codec/arrayVec.js +39 -0
- package/out/abi/codec/arrayVec.js.map +1 -0
- package/out/abi/codec/binary.d.ts +30 -0
- package/out/abi/codec/binary.js +134 -0
- package/out/abi/codec/binary.js.map +1 -0
- package/out/abi/codec/binaryCodecUtils.d.ts +6 -0
- package/out/abi/codec/binaryCodecUtils.js +35 -0
- package/out/abi/codec/binaryCodecUtils.js.map +1 -0
- package/out/abi/codec/boolean.d.ts +13 -0
- package/out/abi/codec/boolean.js +57 -0
- package/out/abi/codec/boolean.js.map +1 -0
- package/out/abi/codec/bytes.d.ts +11 -0
- package/out/abi/codec/bytes.js +30 -0
- package/out/abi/codec/bytes.js.map +1 -0
- package/out/abi/codec/codemetadata.d.ts +8 -0
- package/out/abi/codec/codemetadata.js +23 -0
- package/out/abi/codec/codemetadata.js.map +1 -0
- package/out/abi/codec/constants.d.ts +1 -0
- package/out/abi/codec/constants.js +5 -0
- package/out/abi/codec/constants.js.map +1 -0
- package/out/abi/codec/enum.d.ts +13 -0
- package/out/abi/codec/enum.js +49 -0
- package/out/abi/codec/enum.js.map +1 -0
- package/out/abi/codec/explicit-enum.d.ts +10 -0
- package/out/abi/codec/explicit-enum.js +30 -0
- package/out/abi/codec/explicit-enum.js.map +1 -0
- package/out/abi/codec/fields.d.ts +9 -0
- package/out/abi/codec/fields.js +31 -0
- package/out/abi/codec/fields.js.map +1 -0
- package/out/abi/codec/h256.d.ts +24 -0
- package/out/abi/codec/h256.js +39 -0
- package/out/abi/codec/h256.js.map +1 -0
- package/out/abi/codec/index.d.ts +6 -0
- package/out/abi/codec/index.js +19 -0
- package/out/abi/codec/index.js.map +1 -0
- package/out/abi/codec/list.d.ts +14 -0
- package/out/abi/codec/list.js +67 -0
- package/out/abi/codec/list.js.map +1 -0
- package/out/abi/codec/managedDecimal.d.ts +11 -0
- package/out/abi/codec/managedDecimal.js +53 -0
- package/out/abi/codec/managedDecimal.js.map +1 -0
- package/out/abi/codec/managedDecimalSigned.d.ts +11 -0
- package/out/abi/codec/managedDecimalSigned.js +53 -0
- package/out/abi/codec/managedDecimalSigned.js.map +1 -0
- package/out/abi/codec/nothing.d.ts +8 -0
- package/out/abi/codec/nothing.js +20 -0
- package/out/abi/codec/nothing.js.map +1 -0
- package/out/abi/codec/numerical.d.ts +13 -0
- package/out/abi/codec/numerical.js +122 -0
- package/out/abi/codec/numerical.js.map +1 -0
- package/out/abi/codec/option.d.ts +14 -0
- package/out/abi/codec/option.js +66 -0
- package/out/abi/codec/option.js.map +1 -0
- package/out/abi/codec/primitive.d.ts +20 -0
- package/out/abi/codec/primitive.js +81 -0
- package/out/abi/codec/primitive.js.map +1 -0
- package/out/abi/codec/string.d.ts +9 -0
- package/out/abi/codec/string.js +28 -0
- package/out/abi/codec/string.js.map +1 -0
- package/out/abi/codec/struct.d.ts +11 -0
- package/out/abi/codec/struct.js +30 -0
- package/out/abi/codec/struct.js.map +1 -0
- package/out/abi/codec/tokenIdentifier.d.ts +9 -0
- package/out/abi/codec/tokenIdentifier.js +28 -0
- package/out/abi/codec/tokenIdentifier.js.map +1 -0
- package/out/abi/codec/tuple.d.ts +11 -0
- package/out/abi/codec/tuple.js +23 -0
- package/out/abi/codec/tuple.js.map +1 -0
- package/out/abi/codec/utils.d.ts +20 -0
- package/out/abi/codec/utils.js +69 -0
- package/out/abi/codec/utils.js.map +1 -0
- package/out/abi/function.d.ts +24 -0
- package/out/abi/function.js +56 -0
- package/out/abi/function.js.map +1 -0
- package/out/abi/index.d.ts +12 -0
- package/out/abi/index.js +25 -0
- package/out/abi/index.js.map +1 -0
- package/out/abi/interaction.d.ts +67 -0
- package/out/abi/interaction.js +146 -0
- package/out/abi/interaction.js.map +1 -0
- package/out/abi/interface.d.ts +85 -0
- package/out/abi/interface.js +3 -0
- package/out/abi/interface.js.map +1 -0
- package/out/abi/nativeSerializer.d.ts +27 -0
- package/out/abi/nativeSerializer.js +343 -0
- package/out/abi/nativeSerializer.js.map +1 -0
- package/out/abi/query.d.ts +18 -0
- package/out/abi/query.js +19 -0
- package/out/abi/query.js.map +1 -0
- package/out/abi/returnCode.d.ts +26 -0
- package/out/abi/returnCode.js +45 -0
- package/out/abi/returnCode.js.map +1 -0
- package/out/abi/smartContract.d.ts +74 -0
- package/out/abi/smartContract.js +208 -0
- package/out/abi/smartContract.js.map +1 -0
- package/out/abi/typeFormula.d.ts +7 -0
- package/out/abi/typeFormula.js +20 -0
- package/out/abi/typeFormula.js.map +1 -0
- package/out/abi/typeFormulaParser.d.ts +14 -0
- package/out/abi/typeFormulaParser.js +126 -0
- package/out/abi/typeFormulaParser.js.map +1 -0
- package/out/abi/typesystem/abi.d.ts +64 -0
- package/out/abi/typesystem/abi.js +208 -0
- package/out/abi/typesystem/abi.js.map +1 -0
- package/out/abi/typesystem/address.d.ts +23 -0
- package/out/abi/typesystem/address.js +41 -0
- package/out/abi/typesystem/address.js.map +1 -0
- package/out/abi/typesystem/algebraic.d.ts +24 -0
- package/out/abi/typesystem/algebraic.js +59 -0
- package/out/abi/typesystem/algebraic.js.map +1 -0
- package/out/abi/typesystem/boolean.d.ts +24 -0
- package/out/abi/typesystem/boolean.js +46 -0
- package/out/abi/typesystem/boolean.js.map +1 -0
- package/out/abi/typesystem/bytes.d.ts +28 -0
- package/out/abi/typesystem/bytes.js +58 -0
- package/out/abi/typesystem/bytes.js.map +1 -0
- package/out/abi/typesystem/codeMetadata.d.ts +11 -0
- package/out/abi/typesystem/codeMetadata.js +24 -0
- package/out/abi/typesystem/codeMetadata.js.map +1 -0
- package/out/abi/typesystem/collections.d.ts +9 -0
- package/out/abi/typesystem/collections.js +32 -0
- package/out/abi/typesystem/collections.js.map +1 -0
- package/out/abi/typesystem/composite.d.ts +16 -0
- package/out/abi/typesystem/composite.js +53 -0
- package/out/abi/typesystem/composite.js.map +1 -0
- package/out/abi/typesystem/endpoint.d.ts +41 -0
- package/out/abi/typesystem/endpoint.js +78 -0
- package/out/abi/typesystem/endpoint.js.map +1 -0
- package/out/abi/typesystem/enum.d.ts +51 -0
- package/out/abi/typesystem/enum.js +137 -0
- package/out/abi/typesystem/enum.js.map +1 -0
- package/out/abi/typesystem/event.d.ts +25 -0
- package/out/abi/typesystem/event.js +36 -0
- package/out/abi/typesystem/event.js.map +1 -0
- package/out/abi/typesystem/explicit-enum.d.ts +33 -0
- package/out/abi/typesystem/explicit-enum.js +63 -0
- package/out/abi/typesystem/explicit-enum.js.map +1 -0
- package/out/abi/typesystem/factory.d.ts +4 -0
- package/out/abi/typesystem/factory.js +19 -0
- package/out/abi/typesystem/factory.js.map +1 -0
- package/out/abi/typesystem/fields.d.ts +24 -0
- package/out/abi/typesystem/fields.js +90 -0
- package/out/abi/typesystem/fields.js.map +1 -0
- package/out/abi/typesystem/generic.d.ts +47 -0
- package/out/abi/typesystem/generic.js +120 -0
- package/out/abi/typesystem/generic.js.map +1 -0
- package/out/abi/typesystem/genericArray.d.ts +17 -0
- package/out/abi/typesystem/genericArray.js +44 -0
- package/out/abi/typesystem/genericArray.js.map +1 -0
- package/out/abi/typesystem/h256.d.ts +18 -0
- package/out/abi/typesystem/h256.js +35 -0
- package/out/abi/typesystem/h256.js.map +1 -0
- package/out/abi/typesystem/index.d.ts +33 -0
- package/out/abi/typesystem/index.js +46 -0
- package/out/abi/typesystem/index.js.map +1 -0
- package/out/abi/typesystem/managedDecimal.d.ts +26 -0
- package/out/abi/typesystem/managedDecimal.js +62 -0
- package/out/abi/typesystem/managedDecimal.js.map +1 -0
- package/out/abi/typesystem/managedDecimalSigned.d.ts +26 -0
- package/out/abi/typesystem/managedDecimalSigned.js +62 -0
- package/out/abi/typesystem/managedDecimalSigned.js.map +1 -0
- package/out/abi/typesystem/matchers.d.ts +51 -0
- package/out/abi/typesystem/matchers.js +185 -0
- package/out/abi/typesystem/matchers.js.map +1 -0
- package/out/abi/typesystem/nothing.d.ts +13 -0
- package/out/abi/typesystem/nothing.js +31 -0
- package/out/abi/typesystem/nothing.js.map +1 -0
- package/out/abi/typesystem/numerical.d.ts +130 -0
- package/out/abi/typesystem/numerical.js +286 -0
- package/out/abi/typesystem/numerical.js.map +1 -0
- package/out/abi/typesystem/string.d.ts +26 -0
- package/out/abi/typesystem/string.js +51 -0
- package/out/abi/typesystem/string.js.map +1 -0
- package/out/abi/typesystem/struct.d.ts +30 -0
- package/out/abi/typesystem/struct.js +78 -0
- package/out/abi/typesystem/struct.js.map +1 -0
- package/out/abi/typesystem/tokenIdentifier.d.ts +21 -0
- package/out/abi/typesystem/tokenIdentifier.js +51 -0
- package/out/abi/typesystem/tokenIdentifier.js.map +1 -0
- package/out/abi/typesystem/tuple.d.ts +16 -0
- package/out/abi/typesystem/tuple.js +71 -0
- package/out/abi/typesystem/tuple.js.map +1 -0
- package/out/abi/typesystem/typeExpressionParser.d.ts +8 -0
- package/out/abi/typesystem/typeExpressionParser.js +30 -0
- package/out/abi/typesystem/typeExpressionParser.js.map +1 -0
- package/out/abi/typesystem/typeMapper.d.ts +20 -0
- package/out/abi/typesystem/typeMapper.js +215 -0
- package/out/abi/typesystem/typeMapper.js.map +1 -0
- package/out/abi/typesystem/types.d.ts +129 -0
- package/out/abi/typesystem/types.js +285 -0
- package/out/abi/typesystem/types.js.map +1 -0
- package/out/abi/typesystem/variadic.d.ts +35 -0
- package/out/abi/typesystem/variadic.js +81 -0
- package/out/abi/typesystem/variadic.js.map +1 -0
- package/out/accountManagement/accountController.d.ts +18 -0
- package/out/accountManagement/accountController.js +54 -0
- package/out/accountManagement/accountController.js.map +1 -0
- package/out/accountManagement/accountTransactionsFactory.d.ts +27 -0
- package/out/accountManagement/accountTransactionsFactory.js +78 -0
- package/out/accountManagement/accountTransactionsFactory.js.map +1 -0
- package/out/accountManagement/index.d.ts +3 -0
- package/out/accountManagement/index.js +16 -0
- package/out/accountManagement/index.js.map +1 -0
- package/out/accountManagement/resources.d.ts +8 -0
- package/out/accountManagement/resources.js +3 -0
- package/out/accountManagement/resources.js.map +1 -0
- package/out/accounts/account.d.ts +94 -0
- package/out/accounts/account.js +154 -0
- package/out/accounts/account.js.map +1 -0
- package/out/accounts/index.d.ts +1 -0
- package/out/accounts/index.js +14 -0
- package/out/accounts/index.js.map +1 -0
- package/out/core/address.d.ts +105 -0
- package/out/core/address.js +313 -0
- package/out/core/address.js.map +1 -0
- package/out/core/asyncTimer.d.ts +27 -0
- package/out/core/asyncTimer.js +91 -0
- package/out/core/asyncTimer.js.map +1 -0
- package/out/core/baseController.d.ts +16 -0
- package/out/core/baseController.js +34 -0
- package/out/core/baseController.js.map +1 -0
- package/out/core/codeMetadata.d.ts +74 -0
- package/out/core/codeMetadata.js +146 -0
- package/out/core/codeMetadata.js.map +1 -0
- package/out/core/compatibility.d.ts +10 -0
- package/out/core/compatibility.js +22 -0
- package/out/core/compatibility.js.map +1 -0
- package/out/core/config.d.ts +15 -0
- package/out/core/config.js +20 -0
- package/out/core/config.js.map +1 -0
- package/out/core/constants.d.ts +28 -0
- package/out/core/constants.js +32 -0
- package/out/core/constants.js.map +1 -0
- package/out/core/errors.d.ts +279 -0
- package/out/core/errors.js +437 -0
- package/out/core/errors.js.map +1 -0
- package/out/core/globals.d.ts +0 -0
- package/out/core/globals.js +5 -0
- package/out/core/globals.js.map +1 -0
- package/out/core/index.d.ts +21 -0
- package/out/core/index.js +35 -0
- package/out/core/index.js.map +1 -0
- package/out/core/interfaces.d.ts +40 -0
- package/out/core/interfaces.js +3 -0
- package/out/core/interfaces.js.map +1 -0
- package/out/core/logger.d.ts +17 -0
- package/out/core/logger.js +50 -0
- package/out/core/logger.js.map +1 -0
- package/out/core/message.d.ts +57 -0
- package/out/core/message.js +71 -0
- package/out/core/message.js.map +1 -0
- package/out/core/networkParams.d.ts +57 -0
- package/out/core/networkParams.js +112 -0
- package/out/core/networkParams.js.map +1 -0
- package/out/core/reflection.d.ts +1 -0
- package/out/core/reflection.js +14 -0
- package/out/core/reflection.js.map +1 -0
- package/out/core/signature.d.ts +17 -0
- package/out/core/signature.js +82 -0
- package/out/core/signature.js.map +1 -0
- package/out/core/smartContractQuery.d.ts +35 -0
- package/out/core/smartContractQuery.js +34 -0
- package/out/core/smartContractQuery.js.map +1 -0
- package/out/core/tokenTransfersDataBuilder.d.ts +10 -0
- package/out/core/tokenTransfersDataBuilder.js +44 -0
- package/out/core/tokenTransfersDataBuilder.js.map +1 -0
- package/out/core/tokens.d.ts +130 -0
- package/out/core/tokens.js +287 -0
- package/out/core/tokens.js.map +1 -0
- package/out/core/transaction.d.ts +263 -0
- package/out/core/transaction.js +323 -0
- package/out/core/transaction.js.map +1 -0
- package/out/core/transactionBuilder.d.ts +32 -0
- package/out/core/transactionBuilder.js +45 -0
- package/out/core/transactionBuilder.js.map +1 -0
- package/out/core/transactionComputer.d.ts +51 -0
- package/out/core/transactionComputer.js +163 -0
- package/out/core/transactionComputer.js.map +1 -0
- package/out/core/transactionEvents.d.ts +17 -0
- package/out/core/transactionEvents.js +27 -0
- package/out/core/transactionEvents.js.map +1 -0
- package/out/core/transactionLogs.d.ts +11 -0
- package/out/core/transactionLogs.js +38 -0
- package/out/core/transactionLogs.js.map +1 -0
- package/out/core/transactionOnNetwork.d.ts +40 -0
- package/out/core/transactionOnNetwork.js +164 -0
- package/out/core/transactionOnNetwork.js.map +1 -0
- package/out/core/transactionStatus.d.ts +45 -0
- package/out/core/transactionStatus.js +71 -0
- package/out/core/transactionStatus.js.map +1 -0
- package/out/core/transactionWatcher.d.ts +48 -0
- package/out/core/transactionWatcher.js +148 -0
- package/out/core/transactionWatcher.js.map +1 -0
- package/out/core/transactionsFactoryConfig.d.ts +54 -0
- package/out/core/transactionsFactoryConfig.js +66 -0
- package/out/core/transactionsFactoryConfig.js.map +1 -0
- package/out/core/utils.codec.d.ts +8 -0
- package/out/core/utils.codec.js +75 -0
- package/out/core/utils.codec.js.map +1 -0
- package/out/core/utils.d.ts +20 -0
- package/out/core/utils.js +86 -0
- package/out/core/utils.js.map +1 -0
- package/out/delegation/delegationController.d.ts +37 -0
- package/out/delegation/delegationController.js +215 -0
- package/out/delegation/delegationController.js.map +1 -0
- package/out/delegation/delegationTransactionsFactory.d.ts +48 -0
- package/out/delegation/delegationTransactionsFactory.js +311 -0
- package/out/delegation/delegationTransactionsFactory.js.map +1 -0
- package/out/delegation/delegationTransactionsOutcomeParser.d.ts +10 -0
- package/out/delegation/delegationTransactionsOutcomeParser.js +35 -0
- package/out/delegation/delegationTransactionsOutcomeParser.js.map +1 -0
- package/out/delegation/index.d.ts +4 -0
- package/out/delegation/index.js +17 -0
- package/out/delegation/index.js.map +1 -0
- package/out/delegation/resources.d.ts +38 -0
- package/out/delegation/resources.js +3 -0
- package/out/delegation/resources.js.map +1 -0
- package/out/entrypoints/config.d.ts +29 -0
- package/out/entrypoints/config.js +36 -0
- package/out/entrypoints/config.js.map +1 -0
- package/out/entrypoints/entrypoints.d.ts +92 -0
- package/out/entrypoints/entrypoints.js +203 -0
- package/out/entrypoints/entrypoints.js.map +1 -0
- package/out/entrypoints/index.d.ts +2 -0
- package/out/entrypoints/index.js +15 -0
- package/out/entrypoints/index.js.map +1 -0
- package/out/governance/governanceController.d.ts +33 -0
- package/out/governance/governanceController.js +205 -0
- package/out/governance/governanceController.js.map +1 -0
- package/out/governance/governanceTransactionsFactory.d.ts +16 -0
- package/out/governance/governanceTransactionsFactory.js +99 -0
- package/out/governance/governanceTransactionsFactory.js.map +1 -0
- package/out/governance/governanceTransactionsOutcomeParser.d.ts +15 -0
- package/out/governance/governanceTransactionsOutcomeParser.js +99 -0
- package/out/governance/governanceTransactionsOutcomeParser.js.map +1 -0
- package/out/governance/index.d.ts +4 -0
- package/out/governance/index.js +17 -0
- package/out/governance/index.js.map +1 -0
- package/out/governance/resources.d.ts +82 -0
- package/out/governance/resources.js +11 -0
- package/out/governance/resources.js.map +1 -0
- package/out/index.d.ts +19 -0
- package/out/index.js +32 -0
- package/out/index.js.map +1 -0
- package/out/multisig/index.d.ts +3 -0
- package/out/multisig/index.js +16 -0
- package/out/multisig/index.js.map +1 -0
- package/out/multisig/multisigController.d.ts +221 -0
- package/out/multisig/multisigController.js +540 -0
- package/out/multisig/multisigController.js.map +1 -0
- package/out/multisig/multisigTransactionsFactory.d.ts +110 -0
- package/out/multisig/multisigTransactionsFactory.js +355 -0
- package/out/multisig/multisigTransactionsFactory.js.map +1 -0
- package/out/multisig/multisigTransactionsOutcomeParser.d.ts +31 -0
- package/out/multisig/multisigTransactionsOutcomeParser.js +41 -0
- package/out/multisig/multisigTransactionsOutcomeParser.js.map +1 -0
- package/out/multisig/proposeTransferExecuteContractInput.d.ts +32 -0
- package/out/multisig/proposeTransferExecuteContractInput.js +65 -0
- package/out/multisig/proposeTransferExecuteContractInput.js.map +1 -0
- package/out/multisig/resources.d.ts +182 -0
- package/out/multisig/resources.js +125 -0
- package/out/multisig/resources.js.map +1 -0
- package/out/networkProviders/accountAwaiter.d.ts +35 -0
- package/out/networkProviders/accountAwaiter.js +67 -0
- package/out/networkProviders/accountAwaiter.js.map +1 -0
- package/out/networkProviders/accounts.d.ts +55 -0
- package/out/networkProviders/accounts.js +154 -0
- package/out/networkProviders/accounts.js.map +1 -0
- package/out/networkProviders/apiNetworkProvider.d.ts +48 -0
- package/out/networkProviders/apiNetworkProvider.js +235 -0
- package/out/networkProviders/apiNetworkProvider.js.map +1 -0
- package/out/networkProviders/blocks.d.ts +48 -0
- package/out/networkProviders/blocks.js +76 -0
- package/out/networkProviders/blocks.js.map +1 -0
- package/out/networkProviders/config.d.ts +6 -0
- package/out/networkProviders/config.js +18 -0
- package/out/networkProviders/config.js.map +1 -0
- package/out/networkProviders/constants.d.ts +9 -0
- package/out/networkProviders/constants.js +16 -0
- package/out/networkProviders/constants.js.map +1 -0
- package/out/networkProviders/contractQueryRequest.d.ts +6 -0
- package/out/networkProviders/contractQueryRequest.js +20 -0
- package/out/networkProviders/contractQueryRequest.js.map +1 -0
- package/out/networkProviders/index.d.ts +11 -0
- package/out/networkProviders/index.js +28 -0
- package/out/networkProviders/index.js.map +1 -0
- package/out/networkProviders/interface.d.ts +110 -0
- package/out/networkProviders/interface.js +3 -0
- package/out/networkProviders/interface.js.map +1 -0
- package/out/networkProviders/networkConfig.d.ts +48 -0
- package/out/networkProviders/networkConfig.js +41 -0
- package/out/networkProviders/networkConfig.js.map +1 -0
- package/out/networkProviders/networkProviderConfig.d.ts +4 -0
- package/out/networkProviders/networkProviderConfig.js +3 -0
- package/out/networkProviders/networkProviderConfig.js.map +1 -0
- package/out/networkProviders/networkStatus.d.ts +31 -0
- package/out/networkProviders/networkStatus.js +31 -0
- package/out/networkProviders/networkStatus.js.map +1 -0
- package/out/networkProviders/proxyNetworkProvider.d.ts +51 -0
- package/out/networkProviders/proxyNetworkProvider.js +261 -0
- package/out/networkProviders/proxyNetworkProvider.js.map +1 -0
- package/out/networkProviders/resources.d.ts +12 -0
- package/out/networkProviders/resources.js +29 -0
- package/out/networkProviders/resources.js.map +1 -0
- package/out/networkProviders/tokenDefinitions.d.ts +49 -0
- package/out/networkProviders/tokenDefinitions.js +152 -0
- package/out/networkProviders/tokenDefinitions.js.map +1 -0
- package/out/networkProviders/tokens.d.ts +40 -0
- package/out/networkProviders/tokens.js +106 -0
- package/out/networkProviders/tokens.js.map +1 -0
- package/out/networkProviders/userAgent.d.ts +2 -0
- package/out/networkProviders/userAgent.js +30 -0
- package/out/networkProviders/userAgent.js.map +1 -0
- package/out/proto/compiled.d.ts +2 -0
- package/out/proto/compiled.js +719 -0
- package/out/proto/compiled.js.map +1 -0
- package/out/proto/index.d.ts +5 -0
- package/out/proto/index.js +18 -0
- package/out/proto/index.js.map +1 -0
- package/out/proto/serializer.d.ts +22 -0
- package/out/proto/serializer.js +114 -0
- package/out/proto/serializer.js.map +1 -0
- package/out/smartContracts/index.d.ts +4 -0
- package/out/smartContracts/index.js +17 -0
- package/out/smartContracts/index.js.map +1 -0
- package/out/smartContracts/resources.d.ts +38 -0
- package/out/smartContracts/resources.js +3 -0
- package/out/smartContracts/resources.js.map +1 -0
- package/out/smartContracts/smartContractController.d.ts +32 -0
- package/out/smartContracts/smartContractController.js +128 -0
- package/out/smartContracts/smartContractController.js.map +1 -0
- package/out/smartContracts/smartContractTransactionsFactory.d.ts +42 -0
- package/out/smartContracts/smartContractTransactionsFactory.js +165 -0
- package/out/smartContracts/smartContractTransactionsFactory.js.map +1 -0
- package/out/smartContracts/smartContractTransactionsOutcomeParser.d.ts +28 -0
- package/out/smartContracts/smartContractTransactionsOutcomeParser.js +189 -0
- package/out/smartContracts/smartContractTransactionsOutcomeParser.js.map +1 -0
- package/out/tokenManagement/index.d.ts +4 -0
- package/out/tokenManagement/index.js +17 -0
- package/out/tokenManagement/index.js.map +1 -0
- package/out/tokenManagement/resources.d.ts +220 -0
- package/out/tokenManagement/resources.js +3 -0
- package/out/tokenManagement/resources.js.map +1 -0
- package/out/tokenManagement/tokenManagementController.d.ts +108 -0
- package/out/tokenManagement/tokenManagementController.js +582 -0
- package/out/tokenManagement/tokenManagementController.js.map +1 -0
- package/out/tokenManagement/tokenManagementTransactionsFactory.d.ts +82 -0
- package/out/tokenManagement/tokenManagementTransactionsFactory.js +684 -0
- package/out/tokenManagement/tokenManagementTransactionsFactory.js.map +1 -0
- package/out/tokenManagement/tokenManagementTransactionsOutcomeParser.d.ts +109 -0
- package/out/tokenManagement/tokenManagementTransactionsOutcomeParser.js +356 -0
- package/out/tokenManagement/tokenManagementTransactionsOutcomeParser.js.map +1 -0
- package/out/tokenOperations/codec.d.ts +7 -0
- package/out/tokenOperations/codec.js +55 -0
- package/out/tokenOperations/codec.js.map +1 -0
- package/out/transactionsOutcomeParsers/index.d.ts +4 -0
- package/out/transactionsOutcomeParsers/index.js +17 -0
- package/out/transactionsOutcomeParsers/index.js.map +1 -0
- package/out/transactionsOutcomeParsers/resources.d.ts +23 -0
- package/out/transactionsOutcomeParsers/resources.js +48 -0
- package/out/transactionsOutcomeParsers/resources.js.map +1 -0
- package/out/transactionsOutcomeParsers/transactionEventsParser.d.ts +16 -0
- package/out/transactionsOutcomeParsers/transactionEventsParser.js +48 -0
- package/out/transactionsOutcomeParsers/transactionEventsParser.js.map +1 -0
- package/out/transfers/index.d.ts +3 -0
- package/out/transfers/index.js +16 -0
- package/out/transfers/index.js.map +1 -0
- package/out/transfers/resources.d.ts +17 -0
- package/out/transfers/resources.js +3 -0
- package/out/transfers/resources.js.map +1 -0
- package/out/transfers/transferTransactionsFactory.d.ts +32 -0
- package/out/transfers/transferTransactionsFactory.js +131 -0
- package/out/transfers/transferTransactionsFactory.js.map +1 -0
- package/out/transfers/transfersControllers.d.ts +11 -0
- package/out/transfers/transfersControllers.js +43 -0
- package/out/transfers/transfersControllers.js.map +1 -0
- package/out/wallet/assertions.d.ts +3 -0
- package/out/wallet/assertions.js +12 -0
- package/out/wallet/assertions.js.map +1 -0
- package/out/wallet/crypto/constants.d.ts +6 -0
- package/out/wallet/crypto/constants.js +11 -0
- package/out/wallet/crypto/constants.js.map +1 -0
- package/out/wallet/crypto/decryptor.d.ts +5 -0
- package/out/wallet/crypto/decryptor.js +29 -0
- package/out/wallet/crypto/decryptor.js.map +1 -0
- package/out/wallet/crypto/derivationParams.d.ts +23 -0
- package/out/wallet/crypto/derivationParams.js +38 -0
- package/out/wallet/crypto/derivationParams.js.map +1 -0
- package/out/wallet/crypto/encryptedData.d.ts +15 -0
- package/out/wallet/crypto/encryptedData.js +52 -0
- package/out/wallet/crypto/encryptedData.js.map +1 -0
- package/out/wallet/crypto/encryptor.d.ts +14 -0
- package/out/wallet/crypto/encryptor.js +39 -0
- package/out/wallet/crypto/encryptor.js.map +1 -0
- package/out/wallet/crypto/index.d.ts +7 -0
- package/out/wallet/crypto/index.js +20 -0
- package/out/wallet/crypto/index.js.map +1 -0
- package/out/wallet/crypto/pubkeyDecryptor.d.ts +6 -0
- package/out/wallet/crypto/pubkeyDecryptor.js +38 -0
- package/out/wallet/crypto/pubkeyDecryptor.js.map +1 -0
- package/out/wallet/crypto/pubkeyEncryptor.d.ts +6 -0
- package/out/wallet/crypto/pubkeyEncryptor.js +54 -0
- package/out/wallet/crypto/pubkeyEncryptor.js.map +1 -0
- package/out/wallet/crypto/randomness.d.ts +7 -0
- package/out/wallet/crypto/randomness.js +15 -0
- package/out/wallet/crypto/randomness.js.map +1 -0
- package/out/wallet/crypto/x25519EncryptedData.d.ts +15 -0
- package/out/wallet/crypto/x25519EncryptedData.js +37 -0
- package/out/wallet/crypto/x25519EncryptedData.js.map +1 -0
- package/out/wallet/index.d.ts +11 -0
- package/out/wallet/index.js +24 -0
- package/out/wallet/index.js.map +1 -0
- package/out/wallet/keypair.d.ts +12 -0
- package/out/wallet/keypair.js +32 -0
- package/out/wallet/keypair.js.map +1 -0
- package/out/wallet/mnemonic.d.ts +13 -0
- package/out/wallet/mnemonic.js +74 -0
- package/out/wallet/mnemonic.js.map +1 -0
- package/out/wallet/pem.d.ts +8 -0
- package/out/wallet/pem.js +60 -0
- package/out/wallet/pem.js.map +1 -0
- package/out/wallet/pemEntry.d.ts +10 -0
- package/out/wallet/pemEntry.js +73 -0
- package/out/wallet/pemEntry.js.map +1 -0
- package/out/wallet/userKeys.d.ts +23 -0
- package/out/wallet/userKeys.js +99 -0
- package/out/wallet/userKeys.js.map +1 -0
- package/out/wallet/userPem.d.ts +15 -0
- package/out/wallet/userPem.js +51 -0
- package/out/wallet/userPem.js.map +1 -0
- package/out/wallet/userSigner.d.ts +16 -0
- package/out/wallet/userSigner.js +41 -0
- package/out/wallet/userSigner.js.map +1 -0
- package/out/wallet/userVerifier.d.ts +18 -0
- package/out/wallet/userVerifier.js +27 -0
- package/out/wallet/userVerifier.js.map +1 -0
- package/out/wallet/userWallet.d.ts +54 -0
- package/out/wallet/userWallet.js +206 -0
- package/out/wallet/userWallet.js.map +1 -0
- package/out/wallet/validatorKeys.d.ts +26 -0
- package/out/wallet/validatorKeys.js +77 -0
- package/out/wallet/validatorKeys.js.map +1 -0
- package/out/wallet/validatorSigner.d.ts +10 -0
- package/out/wallet/validatorSigner.js +25 -0
- package/out/wallet/validatorSigner.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.Abi = exports.AbiRegistry = void 0;
|
|
23
|
+
const errors = __importStar(require("../../core/errors"));
|
|
24
|
+
const utils_1 = require("../../core/utils");
|
|
25
|
+
const endpoint_1 = require("./endpoint");
|
|
26
|
+
const enum_1 = require("./enum");
|
|
27
|
+
const event_1 = require("./event");
|
|
28
|
+
const explicit_enum_1 = require("./explicit-enum");
|
|
29
|
+
const struct_1 = require("./struct");
|
|
30
|
+
const typeMapper_1 = require("./typeMapper");
|
|
31
|
+
const interfaceNamePlaceholder = "?";
|
|
32
|
+
class AbiRegistry {
|
|
33
|
+
constructor(options) {
|
|
34
|
+
this.endpoints = [];
|
|
35
|
+
this.customTypes = [];
|
|
36
|
+
this.events = [];
|
|
37
|
+
this.name = options.name;
|
|
38
|
+
this.constructorDefinition = options.constructorDefinition;
|
|
39
|
+
this.upgradeConstructorDefinition = options.upgradeConstructorDefinition;
|
|
40
|
+
this.endpoints = options.endpoints;
|
|
41
|
+
this.customTypes = options.customTypes;
|
|
42
|
+
this.events = options.events || [];
|
|
43
|
+
}
|
|
44
|
+
static create(options) {
|
|
45
|
+
const name = options.name || interfaceNamePlaceholder;
|
|
46
|
+
const constructor = options.constructor || {};
|
|
47
|
+
const upgradeConstructor = options.upgradeConstructor || {};
|
|
48
|
+
const endpoints = options.endpoints || [];
|
|
49
|
+
const types = options.types || {};
|
|
50
|
+
const events = options.events || [];
|
|
51
|
+
// Load arbitrary input parameters into properly-defined objects (e.g. EndpointDefinition and CustomType).
|
|
52
|
+
const constructorDefinition = endpoint_1.EndpointDefinition.fromJSON({ name: "constructor", ...constructor });
|
|
53
|
+
const upgradeConstructorDefinition = endpoint_1.EndpointDefinition.fromJSON({
|
|
54
|
+
name: "upgradeConstructor",
|
|
55
|
+
...upgradeConstructor,
|
|
56
|
+
});
|
|
57
|
+
const endpointDefinitions = endpoints.map((item) => endpoint_1.EndpointDefinition.fromJSON(item));
|
|
58
|
+
const customTypes = [];
|
|
59
|
+
for (const customTypeName in types) {
|
|
60
|
+
const typeDefinition = types[customTypeName];
|
|
61
|
+
if (typeDefinition.type == "struct") {
|
|
62
|
+
customTypes.push(struct_1.StructType.fromJSON({ name: customTypeName, fields: typeDefinition.fields }));
|
|
63
|
+
}
|
|
64
|
+
else if (typeDefinition.type == "enum") {
|
|
65
|
+
customTypes.push(enum_1.EnumType.fromJSON({ name: customTypeName, variants: typeDefinition.variants }));
|
|
66
|
+
}
|
|
67
|
+
else if (typeDefinition.type == "explicit-enum") {
|
|
68
|
+
customTypes.push(explicit_enum_1.ExplicitEnumType.fromJSON({ name: customTypeName, variants: typeDefinition.variants }));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw new errors.ErrTypingSystem(`Cannot handle custom type: ${customTypeName}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const eventDefinitions = events.map((item) => event_1.EventDefinition.fromJSON(item));
|
|
75
|
+
const registry = new AbiRegistry({
|
|
76
|
+
name: name,
|
|
77
|
+
constructorDefinition: constructorDefinition,
|
|
78
|
+
upgradeConstructorDefinition: upgradeConstructorDefinition,
|
|
79
|
+
endpoints: endpointDefinitions,
|
|
80
|
+
customTypes: customTypes,
|
|
81
|
+
events: eventDefinitions,
|
|
82
|
+
});
|
|
83
|
+
const remappedRegistry = registry.remapToKnownTypes();
|
|
84
|
+
return remappedRegistry;
|
|
85
|
+
}
|
|
86
|
+
getCustomType(name) {
|
|
87
|
+
const result = this.customTypes.find((e) => e.getName() == name);
|
|
88
|
+
utils_1.guardValueIsSetWithMessage(`custom type [${name}] not found`, result);
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
getStruct(name) {
|
|
92
|
+
const result = this.customTypes.find((e) => e.getName() == name && e.hasExactClass(struct_1.StructType.ClassName));
|
|
93
|
+
utils_1.guardValueIsSetWithMessage(`struct [${name}] not found`, result);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
getStructs(names) {
|
|
97
|
+
return names.map((name) => this.getStruct(name));
|
|
98
|
+
}
|
|
99
|
+
getEnum(name) {
|
|
100
|
+
const result = this.customTypes.find((e) => e.getName() == name && e.hasExactClass(enum_1.EnumType.ClassName));
|
|
101
|
+
utils_1.guardValueIsSetWithMessage(`enum [${name}] not found`, result);
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
getExplicitEnum(name) {
|
|
105
|
+
const result = this.customTypes.find((e) => e.getName() == name && e.hasExactClass(explicit_enum_1.ExplicitEnumType.ClassName));
|
|
106
|
+
utils_1.guardValueIsSetWithMessage(`enum [${name}] not found`, result);
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
getEnums(names) {
|
|
110
|
+
return names.map((name) => this.getEnum(name));
|
|
111
|
+
}
|
|
112
|
+
getEndpoints() {
|
|
113
|
+
return this.endpoints;
|
|
114
|
+
}
|
|
115
|
+
getEndpoint(name) {
|
|
116
|
+
const result = this.endpoints.find((e) => e.name == name);
|
|
117
|
+
utils_1.guardValueIsSetWithMessage(`endpoint [${name}] not found`, result);
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
getEvent(name) {
|
|
121
|
+
const result = this.events.find((e) => e.identifier == name);
|
|
122
|
+
utils_1.guardValueIsSetWithMessage(`event [${name}] not found`, result);
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Right after loading ABI definitions into a registry, the endpoints and the custom types (structs, enums)
|
|
127
|
+
* use raw types for their I/O parameters (in the case of endpoints), or for their fields (in the case of structs).
|
|
128
|
+
*
|
|
129
|
+
* A raw type is merely an instance of {@link Type}, with a given name and type parameters (if it's a generic type).
|
|
130
|
+
*
|
|
131
|
+
* Though, for most (development) purposes, we'd like to operate using known, specific types (e.g. {@link List}, {@link U8Type} etc.).
|
|
132
|
+
* This function increases the specificity of the types used by parameter / field definitions within a registry (on best-efforts basis).
|
|
133
|
+
* The result is an equivalent, more explicit ABI registry.
|
|
134
|
+
*/
|
|
135
|
+
remapToKnownTypes() {
|
|
136
|
+
const mapper = new typeMapper_1.TypeMapper([]);
|
|
137
|
+
const newCustomTypes = [];
|
|
138
|
+
// First, remap custom types (actually, under the hood, this will remap types of struct fields)
|
|
139
|
+
for (const type of this.customTypes) {
|
|
140
|
+
this.mapCustomTypeDepthFirst(type, this.customTypes, mapper, newCustomTypes);
|
|
141
|
+
}
|
|
142
|
+
if (this.customTypes.length != newCustomTypes.length) {
|
|
143
|
+
throw new errors.ErrTypingSystem("Did not re-map all custom types");
|
|
144
|
+
}
|
|
145
|
+
// Let's remap the constructor(s):
|
|
146
|
+
const newConstructor = mapEndpoint(this.constructorDefinition, mapper);
|
|
147
|
+
const newUpgradeConstructor = this.upgradeConstructorDefinition
|
|
148
|
+
? mapEndpoint(this.upgradeConstructorDefinition, mapper)
|
|
149
|
+
: undefined;
|
|
150
|
+
// Then, remap types of all endpoint parameters.
|
|
151
|
+
// The mapper learned all necessary types in the previous step.
|
|
152
|
+
const newEndpoints = [];
|
|
153
|
+
for (const endpoint of this.endpoints) {
|
|
154
|
+
newEndpoints.push(mapEndpoint(endpoint, mapper));
|
|
155
|
+
}
|
|
156
|
+
const newEvents = this.events.map((event) => mapEvent(event, mapper));
|
|
157
|
+
// Now return the new registry, with all types remapped to known types
|
|
158
|
+
const newRegistry = new AbiRegistry({
|
|
159
|
+
name: this.name,
|
|
160
|
+
constructorDefinition: newConstructor,
|
|
161
|
+
upgradeConstructorDefinition: newUpgradeConstructor,
|
|
162
|
+
endpoints: newEndpoints,
|
|
163
|
+
customTypes: newCustomTypes,
|
|
164
|
+
events: newEvents,
|
|
165
|
+
});
|
|
166
|
+
return newRegistry;
|
|
167
|
+
}
|
|
168
|
+
mapCustomTypeDepthFirst(typeToMap, allTypesToMap, mapper, mappedTypes) {
|
|
169
|
+
const hasBeenMapped = mappedTypes.findIndex((type) => type.getName() == typeToMap.getName()) >= 0;
|
|
170
|
+
if (hasBeenMapped) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
for (const typeName of typeToMap.getNamesOfDependencies()) {
|
|
174
|
+
const dependencyType = allTypesToMap.find((type) => type.getName() == typeName);
|
|
175
|
+
if (!dependencyType) {
|
|
176
|
+
// It's a type that we don't have to map (e.g. could be a primitive type).
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
this.mapCustomTypeDepthFirst(dependencyType, allTypesToMap, mapper, mappedTypes);
|
|
180
|
+
}
|
|
181
|
+
const mappedType = mapper.mapType(typeToMap);
|
|
182
|
+
mappedTypes.push(mappedType);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.AbiRegistry = AbiRegistry;
|
|
186
|
+
function mapEndpoint(endpoint, mapper) {
|
|
187
|
+
const newInput = endpoint.input.map((e) => new endpoint_1.EndpointParameterDefinition(e.name, e.description, mapper.mapType(e.type)));
|
|
188
|
+
const newOutput = endpoint.output.map((e) => new endpoint_1.EndpointParameterDefinition(e.name, e.description, mapper.mapType(e.type)));
|
|
189
|
+
return new endpoint_1.EndpointDefinition(endpoint.name, newInput, newOutput, endpoint.modifiers, endpoint.title);
|
|
190
|
+
}
|
|
191
|
+
function mapEvent(event, mapper) {
|
|
192
|
+
const newInputs = event.inputs.map((e) => new event_1.EventTopicDefinition({
|
|
193
|
+
name: e.name,
|
|
194
|
+
type: mapper.mapType(e.type),
|
|
195
|
+
indexed: e.indexed,
|
|
196
|
+
}));
|
|
197
|
+
return new event_1.EventDefinition(event.identifier, newInputs);
|
|
198
|
+
}
|
|
199
|
+
class Abi extends AbiRegistry {
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
*/
|
|
203
|
+
constructor(options) {
|
|
204
|
+
super(options);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.Abi = Abi;
|
|
208
|
+
//# sourceMappingURL=abi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi.js","sourceRoot":"","sources":["../../../src/abi/typesystem/abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,4C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CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1G,CAAC;AAED,SAAS,QAAQ,CAAC,KAAsB,EAAE,MAAkB;IACxD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAC9B,CAAC,CAAC,EAAE,EAAE,CACF,IAAI,4BAAoB,CAAC;QACrB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5B,OAAO,EAAE,CAAC,CAAC,OAAO;KACrB,CAAC,CACT,CAAC;IAEF,OAAO,IAAI,uBAAe,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAC5D,CAAC;AAED,MAAa,GAAI,SAAQ,WAAW;IAChC;;OAEG;IACH,YAAY,OAOX;QACG,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CACJ;AAdD,kBAcC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Address } from "../../core/address";
|
|
2
|
+
import { PrimitiveType, PrimitiveValue } from "./types";
|
|
3
|
+
export declare class AddressType extends PrimitiveType {
|
|
4
|
+
static ClassName: string;
|
|
5
|
+
constructor();
|
|
6
|
+
getClassName(): string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* An address fed to or fetched from a Smart Contract contract, as an immutable abstraction.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AddressValue extends PrimitiveValue {
|
|
12
|
+
static ClassName: string;
|
|
13
|
+
private readonly value;
|
|
14
|
+
constructor(value: Address);
|
|
15
|
+
getClassName(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns whether two objects have the same value.
|
|
18
|
+
*
|
|
19
|
+
* @param other another AddressValue
|
|
20
|
+
*/
|
|
21
|
+
equals(other: AddressValue): boolean;
|
|
22
|
+
valueOf(): Address;
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressValue = exports.AddressType = void 0;
|
|
4
|
+
const address_1 = require("../../core/address");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
class AddressType extends types_1.PrimitiveType {
|
|
7
|
+
constructor() {
|
|
8
|
+
super("Address");
|
|
9
|
+
}
|
|
10
|
+
getClassName() {
|
|
11
|
+
return AddressType.ClassName;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.AddressType = AddressType;
|
|
15
|
+
AddressType.ClassName = "AddressType";
|
|
16
|
+
/**
|
|
17
|
+
* An address fed to or fetched from a Smart Contract contract, as an immutable abstraction.
|
|
18
|
+
*/
|
|
19
|
+
class AddressValue extends types_1.PrimitiveValue {
|
|
20
|
+
constructor(value) {
|
|
21
|
+
super(new AddressType());
|
|
22
|
+
this.value = address_1.Address.newFromBech32(value.toBech32());
|
|
23
|
+
}
|
|
24
|
+
getClassName() {
|
|
25
|
+
return AddressValue.ClassName;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns whether two objects have the same value.
|
|
29
|
+
*
|
|
30
|
+
* @param other another AddressValue
|
|
31
|
+
*/
|
|
32
|
+
equals(other) {
|
|
33
|
+
return this.value.equals(other.value);
|
|
34
|
+
}
|
|
35
|
+
valueOf() {
|
|
36
|
+
return this.value;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.AddressValue = AddressValue;
|
|
40
|
+
AddressValue.ClassName = "AddressValue";
|
|
41
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src/abi/typesystem/address.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAC7C,mCAAwD;AAExD,MAAa,WAAY,SAAQ,qBAAa;IAG1C;QACI,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAED,YAAY;QACR,OAAO,WAAW,CAAC,SAAS,CAAC;IACjC,CAAC;;AATL,kCAUC;AATU,qBAAS,GAAG,aAAa,CAAC;AAWrC;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAc;IAI5C,YAAY,KAAc;QACtB,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,iBAAO,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,YAAY;QACR,OAAO,YAAY,CAAC,SAAS,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAmB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;;AAxBL,oCAyBC;AAxBU,sBAAS,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Type, TypedValue } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* An optional is an algebraic type. It holds zero or one values.
|
|
4
|
+
*/
|
|
5
|
+
export declare class OptionalType extends Type {
|
|
6
|
+
static ClassName: string;
|
|
7
|
+
constructor(typeParameter: Type);
|
|
8
|
+
getClassName(): string;
|
|
9
|
+
isAssignableFrom(type: Type): boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class OptionalValue extends TypedValue {
|
|
12
|
+
static ClassName: string;
|
|
13
|
+
private readonly value;
|
|
14
|
+
constructor(type: OptionalType, value?: TypedValue | null);
|
|
15
|
+
getClassName(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an OptionalValue, as not provided (missing).
|
|
18
|
+
*/
|
|
19
|
+
static newMissing(): OptionalValue;
|
|
20
|
+
isSet(): boolean;
|
|
21
|
+
getTypedValue(): TypedValue;
|
|
22
|
+
valueOf(): any;
|
|
23
|
+
equals(other: OptionalValue): boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OptionalValue = exports.OptionalType = void 0;
|
|
4
|
+
const utils_1 = require("../../core/utils");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
/**
|
|
7
|
+
* An optional is an algebraic type. It holds zero or one values.
|
|
8
|
+
*/
|
|
9
|
+
class OptionalType extends types_1.Type {
|
|
10
|
+
constructor(typeParameter) {
|
|
11
|
+
super("Optional", [typeParameter], types_1.TypeCardinality.variable(1));
|
|
12
|
+
}
|
|
13
|
+
getClassName() {
|
|
14
|
+
return OptionalType.ClassName;
|
|
15
|
+
}
|
|
16
|
+
isAssignableFrom(type) {
|
|
17
|
+
if (!type.hasExactClass(OptionalType.ClassName)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
let invariantTypeParameters = this.getFirstTypeParameter().equals(type.getFirstTypeParameter());
|
|
21
|
+
let fakeCovarianceToNull = type.getFirstTypeParameter().hasExactClass(types_1.NullType.ClassName);
|
|
22
|
+
return invariantTypeParameters || fakeCovarianceToNull;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.OptionalType = OptionalType;
|
|
26
|
+
OptionalType.ClassName = "OptionalType";
|
|
27
|
+
class OptionalValue extends types_1.TypedValue {
|
|
28
|
+
constructor(type, value = null) {
|
|
29
|
+
super(type);
|
|
30
|
+
// TODO: assert value is of type type.getFirstTypeParameter()
|
|
31
|
+
this.value = value;
|
|
32
|
+
}
|
|
33
|
+
getClassName() {
|
|
34
|
+
return OptionalValue.ClassName;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates an OptionalValue, as not provided (missing).
|
|
38
|
+
*/
|
|
39
|
+
static newMissing() {
|
|
40
|
+
let type = new OptionalType(new types_1.NullType());
|
|
41
|
+
return new OptionalValue(type);
|
|
42
|
+
}
|
|
43
|
+
isSet() {
|
|
44
|
+
return this.value ? true : false;
|
|
45
|
+
}
|
|
46
|
+
getTypedValue() {
|
|
47
|
+
utils_1.guardValueIsSet("value", this.value);
|
|
48
|
+
return this.value;
|
|
49
|
+
}
|
|
50
|
+
valueOf() {
|
|
51
|
+
return this.value ? this.value.valueOf() : null;
|
|
52
|
+
}
|
|
53
|
+
equals(other) {
|
|
54
|
+
return this.value?.equals(other.value) || false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.OptionalValue = OptionalValue;
|
|
58
|
+
OptionalValue.ClassName = "OptionalValue";
|
|
59
|
+
//# sourceMappingURL=algebraic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"algebraic.js","sourceRoot":"","sources":["../../../src/abi/typesystem/algebraic.ts"],"names":[],"mappings":";;;AAAA,4CAAmD;AACnD,mCAAsE;AAEtE;;GAEG;AACH,MAAa,YAAa,SAAQ,YAAI;IAGlC,YAAY,aAAmB;QAC3B,KAAK,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,EAAE,uBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,YAAY;QACR,OAAO,YAAY,CAAC,SAAS,CAAC;IAClC,CAAC;IAED,gBAAgB,CAAC,IAAU;QACvB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;YAC7C,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,uBAAuB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAChG,IAAI,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,aAAa,CAAC,gBAAQ,CAAC,SAAS,CAAC,CAAC;QAC1F,OAAO,uBAAuB,IAAI,oBAAoB,CAAC;IAC3D,CAAC;;AAnBL,oCAoBC;AAnBU,sBAAS,GAAG,cAAc,CAAC;AAqBtC,MAAa,aAAc,SAAQ,kBAAU;IAIzC,YAAY,IAAkB,EAAE,QAA2B,IAAI;QAC3D,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,6DAA6D;QAE7D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,YAAY;QACR,OAAO,aAAa,CAAC,SAAS,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU;QACb,IAAI,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,gBAAQ,EAAE,CAAC,CAAC;QAC5C,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACrC,CAAC;IAED,aAAa;QACT,uBAAe,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,KAAM,CAAC;IACvB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,KAAoB;QACvB,OAAO,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IACpD,CAAC;;AAvCL,sCAwCC;AAvCU,uBAAS,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PrimitiveType, PrimitiveValue } from "./types";
|
|
2
|
+
export declare class BooleanType extends PrimitiveType {
|
|
3
|
+
static ClassName: string;
|
|
4
|
+
constructor();
|
|
5
|
+
getClassName(): string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A boolean value fed to or fetched from a Smart Contract contract, as an immutable abstraction.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BooleanValue extends PrimitiveValue {
|
|
11
|
+
static ClassName: string;
|
|
12
|
+
private readonly value;
|
|
13
|
+
constructor(value: boolean);
|
|
14
|
+
getClassName(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Returns whether two objects have the same value.
|
|
17
|
+
*
|
|
18
|
+
* @param other another BooleanValue
|
|
19
|
+
*/
|
|
20
|
+
equals(other: BooleanValue): boolean;
|
|
21
|
+
isTrue(): boolean;
|
|
22
|
+
isFalse(): boolean;
|
|
23
|
+
valueOf(): boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanValue = exports.BooleanType = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
class BooleanType extends types_1.PrimitiveType {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("bool");
|
|
8
|
+
}
|
|
9
|
+
getClassName() {
|
|
10
|
+
return BooleanType.ClassName;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.BooleanType = BooleanType;
|
|
14
|
+
BooleanType.ClassName = "BooleanType";
|
|
15
|
+
/**
|
|
16
|
+
* A boolean value fed to or fetched from a Smart Contract contract, as an immutable abstraction.
|
|
17
|
+
*/
|
|
18
|
+
class BooleanValue extends types_1.PrimitiveValue {
|
|
19
|
+
constructor(value) {
|
|
20
|
+
super(new BooleanType());
|
|
21
|
+
this.value = value;
|
|
22
|
+
}
|
|
23
|
+
getClassName() {
|
|
24
|
+
return BooleanValue.ClassName;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns whether two objects have the same value.
|
|
28
|
+
*
|
|
29
|
+
* @param other another BooleanValue
|
|
30
|
+
*/
|
|
31
|
+
equals(other) {
|
|
32
|
+
return this.value === other.value;
|
|
33
|
+
}
|
|
34
|
+
isTrue() {
|
|
35
|
+
return this.value === true;
|
|
36
|
+
}
|
|
37
|
+
isFalse() {
|
|
38
|
+
return !this.isTrue();
|
|
39
|
+
}
|
|
40
|
+
valueOf() {
|
|
41
|
+
return this.value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.BooleanValue = BooleanValue;
|
|
45
|
+
BooleanValue.ClassName = "BooleanValue";
|
|
46
|
+
//# sourceMappingURL=boolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src/abi/typesystem/boolean.ts"],"names":[],"mappings":";;;AAAA,mCAAwD;AAExD,MAAa,WAAY,SAAQ,qBAAa;IAG1C;QACI,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,YAAY;QACR,OAAO,WAAW,CAAC,SAAS,CAAC;IACjC,CAAC;;AATL,kCAUC;AATU,qBAAS,GAAG,aAAa,CAAC;AAWrC;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAc;IAI5C,YAAY,KAAc;QACtB,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,YAAY;QACR,OAAO,YAAY,CAAC,SAAS,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAmB;QACtB,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC;IAC/B,CAAC;IAED,OAAO;QACH,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;;AAhCL,oCAiCC;AAhCU,sBAAS,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PrimitiveType, PrimitiveValue } from "./types";
|
|
3
|
+
export declare class BytesType extends PrimitiveType {
|
|
4
|
+
static ClassName: string;
|
|
5
|
+
constructor();
|
|
6
|
+
getClassName(): string;
|
|
7
|
+
}
|
|
8
|
+
export declare class BytesValue extends PrimitiveValue {
|
|
9
|
+
static ClassName: string;
|
|
10
|
+
private readonly value;
|
|
11
|
+
constructor(value: Buffer);
|
|
12
|
+
getClassName(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a BytesValue from a utf-8 string.
|
|
15
|
+
*/
|
|
16
|
+
static fromUTF8(value: string): BytesValue;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a BytesValue from a hex-encoded string.
|
|
19
|
+
*/
|
|
20
|
+
static fromHex(value: string): BytesValue;
|
|
21
|
+
getLength(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Returns whether two objects have the same value.
|
|
24
|
+
*/
|
|
25
|
+
equals(other: BytesValue): boolean;
|
|
26
|
+
valueOf(): Buffer;
|
|
27
|
+
toString(): string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BytesValue = exports.BytesType = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
class BytesType extends types_1.PrimitiveType {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("bytes");
|
|
8
|
+
}
|
|
9
|
+
getClassName() {
|
|
10
|
+
return BytesType.ClassName;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.BytesType = BytesType;
|
|
14
|
+
BytesType.ClassName = "BytesType";
|
|
15
|
+
class BytesValue extends types_1.PrimitiveValue {
|
|
16
|
+
constructor(value) {
|
|
17
|
+
super(new BytesType());
|
|
18
|
+
this.value = value;
|
|
19
|
+
}
|
|
20
|
+
getClassName() {
|
|
21
|
+
return BytesValue.ClassName;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a BytesValue from a utf-8 string.
|
|
25
|
+
*/
|
|
26
|
+
static fromUTF8(value) {
|
|
27
|
+
let buffer = Buffer.from(value, "utf-8");
|
|
28
|
+
return new BytesValue(buffer);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates a BytesValue from a hex-encoded string.
|
|
32
|
+
*/
|
|
33
|
+
static fromHex(value) {
|
|
34
|
+
let buffer = Buffer.from(value, "hex");
|
|
35
|
+
return new BytesValue(buffer);
|
|
36
|
+
}
|
|
37
|
+
getLength() {
|
|
38
|
+
return this.value.length;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns whether two objects have the same value.
|
|
42
|
+
*/
|
|
43
|
+
equals(other) {
|
|
44
|
+
if (this.getLength() != other.getLength()) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return this.value.equals(other.value);
|
|
48
|
+
}
|
|
49
|
+
valueOf() {
|
|
50
|
+
return this.value;
|
|
51
|
+
}
|
|
52
|
+
toString() {
|
|
53
|
+
return this.value.toString();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.BytesValue = BytesValue;
|
|
57
|
+
BytesValue.ClassName = "BytesValue";
|
|
58
|
+
//# sourceMappingURL=bytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src/abi/typesystem/bytes.ts"],"names":[],"mappings":";;;AAAA,mCAAwD;AAExD,MAAa,SAAU,SAAQ,qBAAa;IAGxC;QACI,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAED,YAAY;QACR,OAAO,SAAS,CAAC,SAAS,CAAC;IAC/B,CAAC;;AATL,8BAUC;AATU,mBAAS,GAAG,WAAW,CAAC;AAWnC,MAAa,UAAW,SAAQ,sBAAc;IAI1C,YAAY,KAAa;QACrB,KAAK,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,YAAY;QACR,OAAO,UAAU,CAAC,SAAS,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAa;QACzB,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACzC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAa;QACxB,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAiB;QACpB,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE;YACvC,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;;AAlDL,gCAmDC;AAlDU,oBAAS,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CodeMetadata } from "../../core";
|
|
2
|
+
import { PrimitiveType, PrimitiveValue } from "./types";
|
|
3
|
+
export declare class CodeMetadataType extends PrimitiveType {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
export declare class CodeMetadataValue extends PrimitiveValue {
|
|
7
|
+
private readonly value;
|
|
8
|
+
constructor(value: CodeMetadata);
|
|
9
|
+
equals(other: CodeMetadataValue): boolean;
|
|
10
|
+
valueOf(): CodeMetadata;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeMetadataValue = exports.CodeMetadataType = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
class CodeMetadataType extends types_1.PrimitiveType {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("CodeMetadata");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.CodeMetadataType = CodeMetadataType;
|
|
11
|
+
class CodeMetadataValue extends types_1.PrimitiveValue {
|
|
12
|
+
constructor(value) {
|
|
13
|
+
super(new CodeMetadataType());
|
|
14
|
+
this.value = value;
|
|
15
|
+
}
|
|
16
|
+
equals(other) {
|
|
17
|
+
return this.value.equals(other.value);
|
|
18
|
+
}
|
|
19
|
+
valueOf() {
|
|
20
|
+
return this.value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.CodeMetadataValue = CodeMetadataValue;
|
|
24
|
+
//# sourceMappingURL=codeMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeMetadata.js","sourceRoot":"","sources":["../../../src/abi/typesystem/codeMetadata.ts"],"names":[],"mappings":";;;AACA,mCAAwD;AAExD,MAAa,gBAAiB,SAAQ,qBAAa;IAC/C;QACI,KAAK,CAAC,cAAc,CAAC,CAAC;IAC1B,CAAC;CACJ;AAJD,4CAIC;AAED,MAAa,iBAAkB,SAAQ,sBAAc;IAGjD,YAAY,KAAmB;QAC3B,KAAK,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,KAAwB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ;AAfD,8CAeC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TypedValue } from "./types";
|
|
2
|
+
export declare class CollectionOfTypedValues {
|
|
3
|
+
private readonly items;
|
|
4
|
+
constructor(items: TypedValue[]);
|
|
5
|
+
getLength(): number;
|
|
6
|
+
getItems(): ReadonlyArray<TypedValue>;
|
|
7
|
+
valueOf(): any[];
|
|
8
|
+
equals(other: CollectionOfTypedValues): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectionOfTypedValues = void 0;
|
|
4
|
+
class CollectionOfTypedValues {
|
|
5
|
+
constructor(items) {
|
|
6
|
+
this.items = items;
|
|
7
|
+
}
|
|
8
|
+
getLength() {
|
|
9
|
+
return this.items.length;
|
|
10
|
+
}
|
|
11
|
+
getItems() {
|
|
12
|
+
return this.items;
|
|
13
|
+
}
|
|
14
|
+
valueOf() {
|
|
15
|
+
return this.items.map((item) => item.valueOf());
|
|
16
|
+
}
|
|
17
|
+
equals(other) {
|
|
18
|
+
if (this.getLength() != other.getLength()) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
for (let i = 0; i < this.getLength(); i++) {
|
|
22
|
+
let selfItem = this.items[i];
|
|
23
|
+
let otherItem = other.items[i];
|
|
24
|
+
if (!selfItem.equals(otherItem)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.CollectionOfTypedValues = CollectionOfTypedValues;
|
|
32
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/abi/typesystem/collections.ts"],"names":[],"mappings":";;;AAEA,MAAa,uBAAuB;IAGhC,YAAY,KAAmB;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,KAA8B;QACjC,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE;YACvC,OAAO,KAAK,CAAC;SAChB;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;YACvC,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;gBAC7B,OAAO,KAAK,CAAC;aAChB;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAnCD,0DAmCC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Type, TypedValue } from "./types";
|
|
2
|
+
export declare class CompositeType extends Type {
|
|
3
|
+
static ClassName: string;
|
|
4
|
+
constructor(...typeParameters: Type[]);
|
|
5
|
+
getClassName(): string;
|
|
6
|
+
}
|
|
7
|
+
export declare class CompositeValue extends TypedValue {
|
|
8
|
+
static ClassName: string;
|
|
9
|
+
private readonly items;
|
|
10
|
+
constructor(type: CompositeType, items: TypedValue[]);
|
|
11
|
+
getClassName(): string;
|
|
12
|
+
static fromItems(...items: TypedValue[]): CompositeValue;
|
|
13
|
+
getItems(): ReadonlyArray<TypedValue>;
|
|
14
|
+
valueOf(): any[];
|
|
15
|
+
equals(other: CompositeValue): boolean;
|
|
16
|
+
}
|