@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,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompositeValue = exports.CompositeType = void 0;
|
|
4
|
+
const utils_1 = require("../../core/utils");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
class CompositeType extends types_1.Type {
|
|
7
|
+
constructor(...typeParameters) {
|
|
8
|
+
super("Composite", typeParameters, types_1.TypeCardinality.variable(typeParameters.length));
|
|
9
|
+
}
|
|
10
|
+
getClassName() {
|
|
11
|
+
return CompositeType.ClassName;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.CompositeType = CompositeType;
|
|
15
|
+
CompositeType.ClassName = "CompositeType";
|
|
16
|
+
class CompositeValue extends types_1.TypedValue {
|
|
17
|
+
constructor(type, items) {
|
|
18
|
+
super(type);
|
|
19
|
+
utils_1.guardLength(items, type.getTypeParameters().length);
|
|
20
|
+
// TODO: assert type of each item (wrt. type.getTypeParameters()).
|
|
21
|
+
this.items = items;
|
|
22
|
+
}
|
|
23
|
+
getClassName() {
|
|
24
|
+
return CompositeValue.ClassName;
|
|
25
|
+
}
|
|
26
|
+
static fromItems(...items) {
|
|
27
|
+
let typeParameters = items.map((value) => value.getType());
|
|
28
|
+
let type = new CompositeType(...typeParameters);
|
|
29
|
+
return new CompositeValue(type, items);
|
|
30
|
+
}
|
|
31
|
+
getItems() {
|
|
32
|
+
return this.items;
|
|
33
|
+
}
|
|
34
|
+
valueOf() {
|
|
35
|
+
return this.items.map((item) => item?.valueOf());
|
|
36
|
+
}
|
|
37
|
+
equals(other) {
|
|
38
|
+
if (this.getType().differs(other.getType())) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
for (let i = 0; i < this.items.length; i++) {
|
|
42
|
+
let selfItem = this.items[i];
|
|
43
|
+
let otherItem = other.items[i];
|
|
44
|
+
if (!selfItem.equals(otherItem)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.CompositeValue = CompositeValue;
|
|
52
|
+
CompositeValue.ClassName = "CompositeValue";
|
|
53
|
+
//# sourceMappingURL=composite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composite.js","sourceRoot":"","sources":["../../../src/abi/typesystem/composite.ts"],"names":[],"mappings":";;;AAAA,4CAA+C;AAC/C,mCAA4D;AAE5D,MAAa,aAAc,SAAQ,YAAI;IAGnC,YAAY,GAAG,cAAsB;QACjC,KAAK,CAAC,WAAW,EAAE,cAAc,EAAE,uBAAe,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,YAAY;QACR,OAAO,aAAa,CAAC,SAAS,CAAC;IACnC,CAAC;;AATL,sCAUC;AATU,uBAAS,GAAG,eAAe,CAAC;AAWvC,MAAa,cAAe,SAAQ,kBAAU;IAI1C,YAAY,IAAmB,EAAE,KAAmB;QAChD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,mBAAW,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC,CAAC;QAEpD,kEAAkE;QAElE,I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
|
+
export declare class EndpointDefinition {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly input: EndpointParameterDefinition[];
|
|
6
|
+
readonly output: EndpointParameterDefinition[];
|
|
7
|
+
readonly modifiers: EndpointModifiers;
|
|
8
|
+
constructor(name: string, input: EndpointParameterDefinition[], output: EndpointParameterDefinition[], modifiers: EndpointModifiers, title?: string);
|
|
9
|
+
isConstructor(): boolean;
|
|
10
|
+
static fromJSON(json: {
|
|
11
|
+
name: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
onlyOwner?: boolean;
|
|
14
|
+
mutability: string;
|
|
15
|
+
payableInTokens: string[];
|
|
16
|
+
inputs: any[];
|
|
17
|
+
outputs: any[];
|
|
18
|
+
}): EndpointDefinition;
|
|
19
|
+
}
|
|
20
|
+
export declare class EndpointModifiers {
|
|
21
|
+
readonly mutability: string;
|
|
22
|
+
readonly payableInTokens: string[];
|
|
23
|
+
readonly onlyOwner: boolean;
|
|
24
|
+
constructor(mutability: string, payableInTokens: string[], onlyOwner?: boolean);
|
|
25
|
+
isPayableInREWA(): boolean;
|
|
26
|
+
isPayableInToken(token: string): boolean;
|
|
27
|
+
isPayable(): boolean;
|
|
28
|
+
isReadonly(): boolean;
|
|
29
|
+
isOnlyOwner(): boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare class EndpointParameterDefinition {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly type: Type;
|
|
35
|
+
constructor(name: string, description: string, type: Type);
|
|
36
|
+
static fromJSON(json: {
|
|
37
|
+
name?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}): EndpointParameterDefinition;
|
|
41
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EndpointParameterDefinition = exports.EndpointModifiers = exports.EndpointDefinition = void 0;
|
|
4
|
+
const typeExpressionParser_1 = require("./typeExpressionParser");
|
|
5
|
+
const NamePlaceholder = "?";
|
|
6
|
+
const DescriptionPlaceholder = "N / A";
|
|
7
|
+
class EndpointDefinition {
|
|
8
|
+
constructor(name, input, output, modifiers, title) {
|
|
9
|
+
this.input = [];
|
|
10
|
+
this.output = [];
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.title = title || "";
|
|
13
|
+
this.input = input || [];
|
|
14
|
+
this.output = output || [];
|
|
15
|
+
this.modifiers = modifiers;
|
|
16
|
+
}
|
|
17
|
+
isConstructor() {
|
|
18
|
+
return this.name == "constructor";
|
|
19
|
+
}
|
|
20
|
+
static fromJSON(json) {
|
|
21
|
+
json.name = json.name == null ? NamePlaceholder : json.name;
|
|
22
|
+
json.onlyOwner = json.onlyOwner || false;
|
|
23
|
+
json.title = json.title || "";
|
|
24
|
+
json.payableInTokens = json.payableInTokens || [];
|
|
25
|
+
json.inputs = json.inputs || [];
|
|
26
|
+
json.outputs = json.outputs || [];
|
|
27
|
+
let input = json.inputs.map((param) => EndpointParameterDefinition.fromJSON(param));
|
|
28
|
+
let output = json.outputs.map((param) => EndpointParameterDefinition.fromJSON(param));
|
|
29
|
+
let modifiers = new EndpointModifiers(json.mutability, json.payableInTokens, json.onlyOwner);
|
|
30
|
+
return new EndpointDefinition(json.name, input, output, modifiers, json.title);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.EndpointDefinition = EndpointDefinition;
|
|
34
|
+
class EndpointModifiers {
|
|
35
|
+
constructor(mutability, payableInTokens, onlyOwner) {
|
|
36
|
+
this.mutability = mutability || "";
|
|
37
|
+
this.payableInTokens = payableInTokens || [];
|
|
38
|
+
this.onlyOwner = onlyOwner || false;
|
|
39
|
+
}
|
|
40
|
+
isPayableInREWA() {
|
|
41
|
+
return this.isPayableInToken("REWA");
|
|
42
|
+
}
|
|
43
|
+
isPayableInToken(token) {
|
|
44
|
+
if (this.payableInTokens.includes(token)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (this.payableInTokens.includes(`!${token}`)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (this.payableInTokens.includes("*")) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
isPayable() {
|
|
56
|
+
return this.payableInTokens.length != 0;
|
|
57
|
+
}
|
|
58
|
+
isReadonly() {
|
|
59
|
+
return this.mutability == "readonly";
|
|
60
|
+
}
|
|
61
|
+
isOnlyOwner() {
|
|
62
|
+
return this.onlyOwner;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.EndpointModifiers = EndpointModifiers;
|
|
66
|
+
class EndpointParameterDefinition {
|
|
67
|
+
constructor(name, description, type) {
|
|
68
|
+
this.name = name;
|
|
69
|
+
this.description = description;
|
|
70
|
+
this.type = type;
|
|
71
|
+
}
|
|
72
|
+
static fromJSON(json) {
|
|
73
|
+
let parsedType = new typeExpressionParser_1.TypeExpressionParser().parse(json.type);
|
|
74
|
+
return new EndpointParameterDefinition(json.name || NamePlaceholder, json.description || DescriptionPlaceholder, parsedType);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.EndpointParameterDefinition = EndpointParameterDefinition;
|
|
78
|
+
//# sourceMappingURL=endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/abi/typesystem/endpoint.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAG9D,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC,MAAa,kBAAkB;IAO3B,YACI,IAAY,EACZ,KAAoC,EACpC,MAAqC,EACrC,SAA4B,EAC5B,KAAc;QATT,UAAK,GAAkC,EAAE,CAAC;QAC1C,WAAM,GAAkC,EAAE,CAAC;QAUhD,IAAI,CAAC,IAAI,GAAG,IAAI,CA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,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAA2D;QACvE,IAAI,UAAU,GAAG,IAAI,2CAAoB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,OAAO,IAAI,2BAA2B,CAClC,IAAI,CAAC,IAAI,IAAI,eAAe,EAC5B,IAAI,CAAC,WAAW,IAAI,sBAAsB,EAC1C,UAAU,CACb,CAAC;IACN,CAAC;CACJ;AAnBD,kEAmBC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Field, FieldDefinition } from "./fields";
|
|
2
|
+
import { CustomType, TypedValue } from "./types";
|
|
3
|
+
export declare class EnumType extends CustomType {
|
|
4
|
+
static ClassName: string;
|
|
5
|
+
readonly variants: EnumVariantDefinition[];
|
|
6
|
+
constructor(name: string, variants: EnumVariantDefinition[]);
|
|
7
|
+
getClassName(): string;
|
|
8
|
+
static fromJSON(json: {
|
|
9
|
+
name: string;
|
|
10
|
+
variants: any[];
|
|
11
|
+
}): EnumType;
|
|
12
|
+
private static assignMissingDiscriminants;
|
|
13
|
+
getVariantByDiscriminant(discriminant: number): EnumVariantDefinition;
|
|
14
|
+
getVariantByName(name: string): EnumVariantDefinition;
|
|
15
|
+
getNamesOfDependencies(): string[];
|
|
16
|
+
}
|
|
17
|
+
export declare class EnumVariantDefinition {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly discriminant: number;
|
|
20
|
+
private readonly fieldsDefinitions;
|
|
21
|
+
constructor(name: string, discriminant: number, fieldsDefinitions?: FieldDefinition[]);
|
|
22
|
+
static fromJSON(json: {
|
|
23
|
+
name: string;
|
|
24
|
+
discriminant: number;
|
|
25
|
+
fields: any[];
|
|
26
|
+
}): EnumVariantDefinition;
|
|
27
|
+
getFieldsDefinitions(): FieldDefinition[];
|
|
28
|
+
getFieldDefinition(name: string): FieldDefinition | undefined;
|
|
29
|
+
getNamesOfDependencies(): string[];
|
|
30
|
+
}
|
|
31
|
+
export declare class EnumValue extends TypedValue {
|
|
32
|
+
static ClassName: string;
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly discriminant: number;
|
|
35
|
+
private readonly fields;
|
|
36
|
+
private readonly fieldsByName;
|
|
37
|
+
constructor(type: EnumType, variant: EnumVariantDefinition, fields: Field[]);
|
|
38
|
+
getClassName(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Utility (named constructor) to create a simple (i.e. without fields) enum value.
|
|
41
|
+
*/
|
|
42
|
+
static fromName(type: EnumType, name: string): EnumValue;
|
|
43
|
+
/**
|
|
44
|
+
* Utility (named constructor) to create a simple (i.e. without fields) enum value.
|
|
45
|
+
*/
|
|
46
|
+
static fromDiscriminant(type: EnumType, discriminant: number): EnumValue;
|
|
47
|
+
equals(other: EnumValue): boolean;
|
|
48
|
+
getFields(): ReadonlyArray<Field>;
|
|
49
|
+
getFieldValue(name: string): any;
|
|
50
|
+
valueOf(): any;
|
|
51
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumValue = exports.EnumVariantDefinition = exports.EnumType = void 0;
|
|
4
|
+
const errors_1 = require("../../core/errors");
|
|
5
|
+
const utils_1 = require("../../core/utils");
|
|
6
|
+
const fields_1 = require("./fields");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
const SimpleEnumMaxDiscriminant = 256;
|
|
9
|
+
class EnumType extends types_1.CustomType {
|
|
10
|
+
constructor(name, variants) {
|
|
11
|
+
super(name);
|
|
12
|
+
this.variants = [];
|
|
13
|
+
this.variants = variants;
|
|
14
|
+
}
|
|
15
|
+
getClassName() {
|
|
16
|
+
return EnumType.ClassName;
|
|
17
|
+
}
|
|
18
|
+
static fromJSON(json) {
|
|
19
|
+
const rawVariants = EnumType.assignMissingDiscriminants(json.variants || []);
|
|
20
|
+
const variants = rawVariants.map((variant) => EnumVariantDefinition.fromJSON(variant));
|
|
21
|
+
return new EnumType(json.name, variants);
|
|
22
|
+
}
|
|
23
|
+
// For some enums (e.g. some "explicit-enum" types), the discriminants are missing.
|
|
24
|
+
static assignMissingDiscriminants(variants) {
|
|
25
|
+
const allDiscriminantsAreMissing = variants.every((variant) => variant.discriminant == undefined);
|
|
26
|
+
if (!allDiscriminantsAreMissing) {
|
|
27
|
+
// We only assign discriminants if all of them are missing.
|
|
28
|
+
return variants;
|
|
29
|
+
}
|
|
30
|
+
return variants.map((variant, index) => {
|
|
31
|
+
return {
|
|
32
|
+
...variant,
|
|
33
|
+
discriminant: index,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getVariantByDiscriminant(discriminant) {
|
|
38
|
+
let result = this.variants.find((e) => e.discriminant == discriminant);
|
|
39
|
+
utils_1.guardValueIsSet(`variant by discriminant (${discriminant})`, result);
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
getVariantByName(name) {
|
|
43
|
+
let result = this.variants.find((e) => e.name == name);
|
|
44
|
+
utils_1.guardValueIsSet(`variant by name (${name})`, result);
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
getNamesOfDependencies() {
|
|
48
|
+
const dependencies = [];
|
|
49
|
+
for (const variant of this.variants) {
|
|
50
|
+
dependencies.push(...variant.getNamesOfDependencies());
|
|
51
|
+
}
|
|
52
|
+
return [...new Set(dependencies)];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.EnumType = EnumType;
|
|
56
|
+
EnumType.ClassName = "EnumType";
|
|
57
|
+
class EnumVariantDefinition {
|
|
58
|
+
constructor(name, discriminant, fieldsDefinitions = []) {
|
|
59
|
+
this.fieldsDefinitions = [];
|
|
60
|
+
utils_1.guardTrue(discriminant < SimpleEnumMaxDiscriminant, `discriminant for simple enum should be less than ${SimpleEnumMaxDiscriminant}`);
|
|
61
|
+
this.name = name;
|
|
62
|
+
this.discriminant = discriminant;
|
|
63
|
+
this.fieldsDefinitions = fieldsDefinitions;
|
|
64
|
+
}
|
|
65
|
+
static fromJSON(json) {
|
|
66
|
+
let definitions = (json.fields || []).map((definition) => fields_1.FieldDefinition.fromJSON(definition));
|
|
67
|
+
return new EnumVariantDefinition(json.name, json.discriminant, definitions);
|
|
68
|
+
}
|
|
69
|
+
getFieldsDefinitions() {
|
|
70
|
+
return this.fieldsDefinitions;
|
|
71
|
+
}
|
|
72
|
+
getFieldDefinition(name) {
|
|
73
|
+
return this.fieldsDefinitions.find((item) => item.name == name);
|
|
74
|
+
}
|
|
75
|
+
getNamesOfDependencies() {
|
|
76
|
+
return fields_1.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.EnumVariantDefinition = EnumVariantDefinition;
|
|
80
|
+
class EnumValue extends types_1.TypedValue {
|
|
81
|
+
constructor(type, variant, fields) {
|
|
82
|
+
super(type);
|
|
83
|
+
this.fields = [];
|
|
84
|
+
this.name = variant.name;
|
|
85
|
+
this.discriminant = variant.discriminant;
|
|
86
|
+
this.fields = fields;
|
|
87
|
+
this.fieldsByName = new Map(fields.map((field) => [field.name, field]));
|
|
88
|
+
let definitions = variant.getFieldsDefinitions();
|
|
89
|
+
fields_1.Fields.checkTyping(this.fields, definitions);
|
|
90
|
+
}
|
|
91
|
+
getClassName() {
|
|
92
|
+
return EnumValue.ClassName;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Utility (named constructor) to create a simple (i.e. without fields) enum value.
|
|
96
|
+
*/
|
|
97
|
+
static fromName(type, name) {
|
|
98
|
+
let variant = type.getVariantByName(name);
|
|
99
|
+
return new EnumValue(type, variant, []);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Utility (named constructor) to create a simple (i.e. without fields) enum value.
|
|
103
|
+
*/
|
|
104
|
+
static fromDiscriminant(type, discriminant) {
|
|
105
|
+
let variant = type.getVariantByDiscriminant(discriminant);
|
|
106
|
+
return new EnumValue(type, variant, []);
|
|
107
|
+
}
|
|
108
|
+
equals(other) {
|
|
109
|
+
if (!this.getType().equals(other.getType())) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
let selfFields = this.getFields();
|
|
113
|
+
let otherFields = other.getFields();
|
|
114
|
+
const nameIsSame = this.name == other.name;
|
|
115
|
+
const discriminantIsSame = this.discriminant == other.discriminant;
|
|
116
|
+
const fieldsAreSame = fields_1.Fields.equals(selfFields, otherFields);
|
|
117
|
+
return nameIsSame && discriminantIsSame && fieldsAreSame;
|
|
118
|
+
}
|
|
119
|
+
getFields() {
|
|
120
|
+
return this.fields;
|
|
121
|
+
}
|
|
122
|
+
getFieldValue(name) {
|
|
123
|
+
let field = this.fieldsByName.get(name);
|
|
124
|
+
if (field) {
|
|
125
|
+
return field.value.valueOf();
|
|
126
|
+
}
|
|
127
|
+
throw new errors_1.ErrMissingFieldOnEnum(name, this.getType().getName());
|
|
128
|
+
}
|
|
129
|
+
valueOf() {
|
|
130
|
+
let result = { name: this.name, fields: [] };
|
|
131
|
+
this.fields.forEach((field, index) => (result.fields[index] = field.value.valueOf()));
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.EnumValue = EnumValue;
|
|
136
|
+
EnumValue.ClassName = "EnumValue";
|
|
137
|
+
//# sourceMappingURL=enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/abi/typesystem/enum.ts"],"names":[],"mappings":";;;AAAA,8CAA0D;AAC1D,4CAA8D;AAC9D,qCAA0D;AAC1D,mCAAiD;AAEjD,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC,MAAa,QAAS,SAAQ,kBAAU;IAIpC,YAAY,IAAY,EAAE,QAAiC;QACvD,KAAK,CAAC,IAAI,CAAC,CAAC;QAHP,aAAQ,GAA4B,EAAE,CAAC;QAI5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,YAA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CAAC,CAAC;QAEtF,OAAO,MAAM,CAAC;IAClB,CAAC;;AAxEL,8BAyEC;AAxEU,mBAAS,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Type } from "./types";
|
|
2
|
+
export declare class EventDefinition {
|
|
3
|
+
readonly identifier: string;
|
|
4
|
+
readonly inputs: EventTopicDefinition[];
|
|
5
|
+
constructor(identifier: string, inputs: EventTopicDefinition[]);
|
|
6
|
+
static fromJSON(json: {
|
|
7
|
+
identifier: string;
|
|
8
|
+
inputs: any[];
|
|
9
|
+
}): EventDefinition;
|
|
10
|
+
}
|
|
11
|
+
export declare class EventTopicDefinition {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly type: Type;
|
|
14
|
+
readonly indexed: boolean;
|
|
15
|
+
constructor(options: {
|
|
16
|
+
name: string;
|
|
17
|
+
type: Type;
|
|
18
|
+
indexed: boolean;
|
|
19
|
+
});
|
|
20
|
+
static fromJSON(json: {
|
|
21
|
+
name?: string;
|
|
22
|
+
type: string;
|
|
23
|
+
indexed: boolean;
|
|
24
|
+
}): EventTopicDefinition;
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventTopicDefinition = exports.EventDefinition = void 0;
|
|
4
|
+
const typeExpressionParser_1 = require("./typeExpressionParser");
|
|
5
|
+
const NamePlaceholder = "?";
|
|
6
|
+
class EventDefinition {
|
|
7
|
+
constructor(identifier, inputs) {
|
|
8
|
+
this.inputs = [];
|
|
9
|
+
this.identifier = identifier;
|
|
10
|
+
this.inputs = inputs || [];
|
|
11
|
+
}
|
|
12
|
+
static fromJSON(json) {
|
|
13
|
+
json.identifier = json.identifier == null ? NamePlaceholder : json.identifier;
|
|
14
|
+
json.inputs = json.inputs || [];
|
|
15
|
+
const inputs = json.inputs.map((param) => EventTopicDefinition.fromJSON(param));
|
|
16
|
+
return new EventDefinition(json.identifier, inputs);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.EventDefinition = EventDefinition;
|
|
20
|
+
class EventTopicDefinition {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
this.name = options.name;
|
|
23
|
+
this.type = options.type;
|
|
24
|
+
this.indexed = options.indexed;
|
|
25
|
+
}
|
|
26
|
+
static fromJSON(json) {
|
|
27
|
+
const parsedType = new typeExpressionParser_1.TypeExpressionParser().parse(json.type);
|
|
28
|
+
return new EventTopicDefinition({
|
|
29
|
+
name: json.name || NamePlaceholder,
|
|
30
|
+
type: parsedType,
|
|
31
|
+
indexed: json.indexed,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.EventTopicDefinition = EventTopicDefinition;
|
|
36
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/abi/typesystem/event.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAG9D,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAa,eAAe;IAIxB,YAAY,UAAkB,EAAE,MAA8B;QAFrD,WAAM,GAA2B,EAAE,CAAC;QAGzC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAA2C;QACvD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAC9E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAEhC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAChF,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;CACJ;AAhBD,0CAgBC;AAED,MAAa,oBAAoB;IAK7B,YAAY,OAAuD;QAC/D,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAuD;QACnE,MAAM,UAAU,GAAG,IAAI,2CAAoB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/D,OAAO,IAAI,oBAAoB,CAAC;YAC5B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,eAAe;YAClC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,IAAI,CAAC,OAAO;SACxB,CAAC,CAAC;IACP,CAAC;CACJ;AApBD,oDAoBC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CustomType, TypedValue } from "./types";
|
|
2
|
+
export declare class ExplicitEnumType extends CustomType {
|
|
3
|
+
static ClassName: string;
|
|
4
|
+
readonly variants: ExplicitEnumVariantDefinition[];
|
|
5
|
+
constructor(name: string, variants: ExplicitEnumVariantDefinition[]);
|
|
6
|
+
getClassName(): string;
|
|
7
|
+
static fromJSON(json: {
|
|
8
|
+
name: string;
|
|
9
|
+
variants: any[];
|
|
10
|
+
}): ExplicitEnumType;
|
|
11
|
+
getVariantByName(name: string): ExplicitEnumVariantDefinition;
|
|
12
|
+
}
|
|
13
|
+
export declare class ExplicitEnumVariantDefinition {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
constructor(name: string);
|
|
16
|
+
static fromJSON(json: {
|
|
17
|
+
name: string;
|
|
18
|
+
}): ExplicitEnumVariantDefinition;
|
|
19
|
+
}
|
|
20
|
+
export declare class ExplicitEnumValue extends TypedValue {
|
|
21
|
+
static ClassName: string;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
constructor(type: ExplicitEnumType, variant: ExplicitEnumVariantDefinition);
|
|
24
|
+
getClassName(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Utility (named constructor) to create a simple (i.e. without fields) enum value.
|
|
27
|
+
*/
|
|
28
|
+
static fromName(type: ExplicitEnumType, name: string): ExplicitEnumValue;
|
|
29
|
+
equals(other: ExplicitEnumValue): boolean;
|
|
30
|
+
valueOf(): {
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExplicitEnumValue = exports.ExplicitEnumVariantDefinition = exports.ExplicitEnumType = void 0;
|
|
4
|
+
const utils_1 = require("../../core/utils");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
class ExplicitEnumType extends types_1.CustomType {
|
|
7
|
+
constructor(name, variants) {
|
|
8
|
+
super(name);
|
|
9
|
+
this.variants = [];
|
|
10
|
+
this.variants = variants;
|
|
11
|
+
}
|
|
12
|
+
getClassName() {
|
|
13
|
+
return ExplicitEnumType.ClassName;
|
|
14
|
+
}
|
|
15
|
+
static fromJSON(json) {
|
|
16
|
+
const variants = json.variants.map((variant) => ExplicitEnumVariantDefinition.fromJSON(variant));
|
|
17
|
+
return new ExplicitEnumType(json.name, variants);
|
|
18
|
+
}
|
|
19
|
+
getVariantByName(name) {
|
|
20
|
+
let result = this.variants.find((e) => e.name == name);
|
|
21
|
+
utils_1.guardValueIsSet(`variant by name (${name})`, result);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.ExplicitEnumType = ExplicitEnumType;
|
|
26
|
+
ExplicitEnumType.ClassName = "ExplicitEnumType";
|
|
27
|
+
class ExplicitEnumVariantDefinition {
|
|
28
|
+
constructor(name) {
|
|
29
|
+
this.name = name;
|
|
30
|
+
}
|
|
31
|
+
static fromJSON(json) {
|
|
32
|
+
return new ExplicitEnumVariantDefinition(json.name);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ExplicitEnumVariantDefinition = ExplicitEnumVariantDefinition;
|
|
36
|
+
class ExplicitEnumValue extends types_1.TypedValue {
|
|
37
|
+
constructor(type, variant) {
|
|
38
|
+
super(type);
|
|
39
|
+
this.name = variant.name;
|
|
40
|
+
}
|
|
41
|
+
getClassName() {
|
|
42
|
+
return ExplicitEnumValue.ClassName;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Utility (named constructor) to create a simple (i.e. without fields) enum value.
|
|
46
|
+
*/
|
|
47
|
+
static fromName(type, name) {
|
|
48
|
+
let variant = type.getVariantByName(name);
|
|
49
|
+
return new ExplicitEnumValue(type, variant);
|
|
50
|
+
}
|
|
51
|
+
equals(other) {
|
|
52
|
+
if (!this.getType().equals(other.getType())) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return this.name == other.name;
|
|
56
|
+
}
|
|
57
|
+
valueOf() {
|
|
58
|
+
return { name: this.name };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.ExplicitEnumValue = ExplicitEnumValue;
|
|
62
|
+
ExplicitEnumValue.ClassName = "ExplicitEnumValue";
|
|
63
|
+
//# sourceMappingURL=explicit-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explicit-enum.js","sourceRoot":"","sources":["../../../src/abi/typesystem/explicit-enum.ts"],"names":[],"mappings":";;;AAAA,4CAAmD;AACnD,mCAAiD;AAEjD,MAAa,gBAAiB,SAAQ,kBAAU;IAI5C,YAAY,IAAY,EAAE,QAAyC;QAC/D,KAAK,CAAC,IAAI,CAAC,CAAC;QAHP,aAAQ,GAAoC,EAAE,CAAC;QAIpD,IAAI,CAAC,QAAQ,GAAG,QAAQ,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AI,CAAC,CAAC;QAE1C,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,KAAwB;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE;YACzC,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,OAAO;QACH,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;;AAhCL,8CAiCC;AAhCU,2BAAS,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createListOfTokenIdentifiers = exports.createListOfAddresses = void 0;
|
|
4
|
+
const address_1 = require("./address");
|
|
5
|
+
const generic_1 = require("./generic");
|
|
6
|
+
const tokenIdentifier_1 = require("./tokenIdentifier");
|
|
7
|
+
function createListOfAddresses(addresses) {
|
|
8
|
+
let addressesTyped = addresses.map((address) => new address_1.AddressValue(address));
|
|
9
|
+
let list = generic_1.List.fromItems(addressesTyped);
|
|
10
|
+
return list;
|
|
11
|
+
}
|
|
12
|
+
exports.createListOfAddresses = createListOfAddresses;
|
|
13
|
+
function createListOfTokenIdentifiers(identifiers) {
|
|
14
|
+
let identifiersTyped = identifiers.map((identifier) => new tokenIdentifier_1.TokenIdentifierValue(identifier));
|
|
15
|
+
let list = generic_1.List.fromItems(identifiersTyped);
|
|
16
|
+
return list;
|
|
17
|
+
}
|
|
18
|
+
exports.createListOfTokenIdentifiers = createListOfTokenIdentifiers;
|
|
19
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/abi/typesystem/factory.ts"],"names":[],"mappings":";;;AACA,uCAAyC;AACzC,uCAAiC;AACjC,uDAAyD;AAEzD,SAAgB,qBAAqB,CAAC,SAAoB;IACtD,IAAI,cAAc,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,sBAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,IAAI,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,OAAO,IAAI,CAAC;AAChB,CAAC;AAJD,sDAIC;AAED,SAAgB,4BAA4B,CAAC,WAAqB;IAC9D,IAAI,gBAAgB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,sCAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7F,IAAI,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC;AAChB,CAAC;AAJD,oEAIC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Type, TypedValue } from "./types";
|
|
2
|
+
export declare class FieldDefinition {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly description: string;
|
|
5
|
+
readonly type: Type;
|
|
6
|
+
constructor(name: string, description: string, type: Type);
|
|
7
|
+
static fromJSON(json: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
type: string;
|
|
11
|
+
}): FieldDefinition;
|
|
12
|
+
}
|
|
13
|
+
export declare class Field {
|
|
14
|
+
readonly value: TypedValue;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
constructor(value: TypedValue, name?: string);
|
|
17
|
+
checkTyping(expectedDefinition: FieldDefinition): void;
|
|
18
|
+
equals(other: Field): boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class Fields {
|
|
21
|
+
static checkTyping(fields: Field[], definitions: FieldDefinition[]): void;
|
|
22
|
+
static equals(actual: ReadonlyArray<Field>, expected: ReadonlyArray<Field>): boolean;
|
|
23
|
+
static getNamesOfTypeDependencies(definitions: FieldDefinition[]): string[];
|
|
24
|
+
}
|