@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,134 @@
|
|
|
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.BinaryCodecConstraints = exports.BinaryCodec = void 0;
|
|
23
|
+
const errors = __importStar(require("../../core/errors"));
|
|
24
|
+
const utils_1 = require("../../core/utils");
|
|
25
|
+
const typesystem_1 = require("../typesystem");
|
|
26
|
+
const arrayVec_1 = require("./arrayVec");
|
|
27
|
+
const enum_1 = require("./enum");
|
|
28
|
+
const explicit_enum_1 = require("./explicit-enum");
|
|
29
|
+
const list_1 = require("./list");
|
|
30
|
+
const managedDecimal_1 = require("./managedDecimal");
|
|
31
|
+
const managedDecimalSigned_1 = require("./managedDecimalSigned");
|
|
32
|
+
const option_1 = require("./option");
|
|
33
|
+
const primitive_1 = require("./primitive");
|
|
34
|
+
const struct_1 = require("./struct");
|
|
35
|
+
const tuple_1 = require("./tuple");
|
|
36
|
+
class BinaryCodec {
|
|
37
|
+
constructor(constraints = null) {
|
|
38
|
+
this.constraints = constraints || new BinaryCodecConstraints();
|
|
39
|
+
this.optionCodec = new option_1.OptionValueBinaryCodec(this);
|
|
40
|
+
this.listCodec = new list_1.ListBinaryCodec(this);
|
|
41
|
+
this.arrayCodec = new arrayVec_1.ArrayVecBinaryCodec(this);
|
|
42
|
+
this.primitiveCodec = new primitive_1.PrimitiveBinaryCodec(this);
|
|
43
|
+
this.structCodec = new struct_1.StructBinaryCodec(this);
|
|
44
|
+
this.tupleCodec = new tuple_1.TupleBinaryCodec(this);
|
|
45
|
+
this.enumCodec = new enum_1.EnumBinaryCodec(this);
|
|
46
|
+
this.explicitEnumCodec = new explicit_enum_1.ExplicitEnumBinaryCodec();
|
|
47
|
+
this.managedDecimalCodec = new managedDecimal_1.ManagedDecimalCodec(this);
|
|
48
|
+
this.managedDecimalSignedCodec = new managedDecimalSigned_1.ManagedDecimalSignedCodec(this);
|
|
49
|
+
}
|
|
50
|
+
decodeTopLevel(buffer, type) {
|
|
51
|
+
this.constraints.checkBufferLength(buffer);
|
|
52
|
+
let typedValue = typesystem_1.onTypeSelect(type, {
|
|
53
|
+
onOption: () => this.optionCodec.decodeTopLevel(buffer, type.getFirstTypeParameter()),
|
|
54
|
+
onList: () => this.listCodec.decodeTopLevel(buffer, type),
|
|
55
|
+
onArray: () => this.arrayCodec.decodeTopLevel(buffer, type),
|
|
56
|
+
onPrimitive: () => this.primitiveCodec.decodeTopLevel(buffer, type),
|
|
57
|
+
onStruct: () => this.structCodec.decodeTopLevel(buffer, type),
|
|
58
|
+
onTuple: () => this.tupleCodec.decodeTopLevel(buffer, type),
|
|
59
|
+
onEnum: () => this.enumCodec.decodeTopLevel(buffer, type),
|
|
60
|
+
onExplicitEnum: () => this.explicitEnumCodec.decodeTopLevel(buffer, type),
|
|
61
|
+
onManagedDecimal: () => this.managedDecimalCodec.decodeTopLevel(buffer, type),
|
|
62
|
+
onManagedDecimalSigned: () => this.managedDecimalSignedCodec.decodeTopLevel(buffer, type),
|
|
63
|
+
});
|
|
64
|
+
return typedValue;
|
|
65
|
+
}
|
|
66
|
+
decodeNested(buffer, type) {
|
|
67
|
+
this.constraints.checkBufferLength(buffer);
|
|
68
|
+
let [typedResult, decodedLength] = typesystem_1.onTypeSelect(type, {
|
|
69
|
+
onOption: () => this.optionCodec.decodeNested(buffer, type.getFirstTypeParameter()),
|
|
70
|
+
onList: () => this.listCodec.decodeNested(buffer, type),
|
|
71
|
+
onArray: () => this.arrayCodec.decodeNested(buffer, type),
|
|
72
|
+
onPrimitive: () => this.primitiveCodec.decodeNested(buffer, type),
|
|
73
|
+
onStruct: () => this.structCodec.decodeNested(buffer, type),
|
|
74
|
+
onTuple: () => this.tupleCodec.decodeNested(buffer, type),
|
|
75
|
+
onEnum: () => this.enumCodec.decodeNested(buffer, type),
|
|
76
|
+
onExplicitEnum: () => this.explicitEnumCodec.decodeNested(buffer, type),
|
|
77
|
+
onManagedDecimal: () => this.managedDecimalCodec.decodeNested(buffer, type),
|
|
78
|
+
onManagedDecimalSigned: () => this.managedDecimalSignedCodec.decodeNested(buffer, type),
|
|
79
|
+
});
|
|
80
|
+
return [typedResult, decodedLength];
|
|
81
|
+
}
|
|
82
|
+
encodeNested(typedValue) {
|
|
83
|
+
utils_1.guardTrue(typedValue.getType().getCardinality().isSingular(), "singular cardinality, thus encodable type");
|
|
84
|
+
return typesystem_1.onTypedValueSelect(typedValue, {
|
|
85
|
+
onPrimitive: () => this.primitiveCodec.encodeNested(typedValue),
|
|
86
|
+
onOption: () => this.optionCodec.encodeNested(typedValue),
|
|
87
|
+
onList: () => this.listCodec.encodeNested(typedValue),
|
|
88
|
+
onArray: () => this.arrayCodec.encodeNested(typedValue),
|
|
89
|
+
onStruct: () => this.structCodec.encodeNested(typedValue),
|
|
90
|
+
onTuple: () => this.tupleCodec.encodeNested(typedValue),
|
|
91
|
+
onEnum: () => this.enumCodec.encodeNested(typedValue),
|
|
92
|
+
onExplicitEnum: () => this.explicitEnumCodec.encodeNested(typedValue),
|
|
93
|
+
onManagedDecimal: () => this.managedDecimalCodec.encodeNested(typedValue),
|
|
94
|
+
onManagedDecimalSigned: () => this.managedDecimalSignedCodec.encodeNested(typedValue),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
encodeTopLevel(typedValue) {
|
|
98
|
+
utils_1.guardTrue(typedValue.getType().getCardinality().isSingular(), "singular cardinality, thus encodable type");
|
|
99
|
+
return typesystem_1.onTypedValueSelect(typedValue, {
|
|
100
|
+
onPrimitive: () => this.primitiveCodec.encodeTopLevel(typedValue),
|
|
101
|
+
onOption: () => this.optionCodec.encodeTopLevel(typedValue),
|
|
102
|
+
onList: () => this.listCodec.encodeTopLevel(typedValue),
|
|
103
|
+
onArray: () => this.arrayCodec.encodeTopLevel(typedValue),
|
|
104
|
+
onStruct: () => this.structCodec.encodeTopLevel(typedValue),
|
|
105
|
+
onTuple: () => this.tupleCodec.encodeTopLevel(typedValue),
|
|
106
|
+
onEnum: () => this.enumCodec.encodeTopLevel(typedValue),
|
|
107
|
+
onExplicitEnum: () => this.explicitEnumCodec.encodeTopLevel(typedValue),
|
|
108
|
+
onManagedDecimal: () => this.managedDecimalCodec.encodeTopLevel(typedValue),
|
|
109
|
+
onManagedDecimalSigned: () => this.managedDecimalSignedCodec.encodeTopLevel(typedValue),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.BinaryCodec = BinaryCodec;
|
|
114
|
+
class BinaryCodecConstraints {
|
|
115
|
+
constructor(init) {
|
|
116
|
+
this.maxBufferLength = init?.maxBufferLength || 256000;
|
|
117
|
+
this.maxListLength = init?.maxListLength || 128000;
|
|
118
|
+
}
|
|
119
|
+
checkBufferLength(buffer) {
|
|
120
|
+
if (buffer.length > this.maxBufferLength) {
|
|
121
|
+
throw new errors.ErrCodec(`Buffer too large: ${buffer.length} > ${this.maxBufferLength}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* This constraint avoids computer-freezing decode bugs (e.g. due to invalid ABI or struct definitions).
|
|
126
|
+
*/
|
|
127
|
+
checkListLength(length) {
|
|
128
|
+
if (length > this.maxListLength) {
|
|
129
|
+
throw new errors.ErrCodec(`List too large: ${length} > ${this.maxListLength}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.BinaryCodecConstraints = BinaryCodecConstraints;
|
|
134
|
+
//# sourceMappingURL=binary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../src/abi/codec/binary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,4CAA6C;AAC7C,8CAuBuB;AACvB,yCAAiD;AACjD,iCAAyC;AACzC,mDAA0D;AAC1D,iCAAyC;AACzC,qDAAuD;AACvD,iEAAmE;AACnE,qCAAkD;AAClD,2CAAmD;AACnD,qCAA6C;AAC7C,mCAA2C;AAE3C,MAAa,WAAW;IAapB,YAAY,cAA6C,IAAI;QACzD,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,IAAI,sBAAsB,EAAE,CAAC;QAC/D,IAAI,CAAC,WA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AAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAY,UAAU,CAAC;YAClE,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAoB,UAAU,CAAC;YAC1F,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAsB,UAAU,CAAC;YAChG,sBAAsB,EAAE,GAAG,EAAE,CACzB,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAA4B,UAAU,CAAC;SAC3F,CAAC,CAAC;IACP,CAAC;CACJ;AAtGD,kCAsGC;AAED,MAAa,sBAAsB;IAI/B,YAAY,IAAsC;QAC9C,IAAI,CAAC,eAAe,GAAG,IAAI,EAAE,eAAe,IAAI,MAAM,CAAC;QACvD,IAAI,CAAC,aAAa,GAAG,IAAI,EAAE,aAAa,IAAI,MAAM,CAAC;IACvD,CAAC;IAED,iBAAiB,CAAC,MAAc;QAC5B,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE;YACtC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,qBAAqB,MAAM,CAAC,MAAM,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;SAC7F;IACL,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,MAAc;QAC1B,IAAI,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE;YAC7B,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,mBAAmB,MAAM,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;SAClF;IACL,CAAC;CACJ;AAvBD,wDAuBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
export declare function decodeUnsignedNumber(buffer: Buffer): number;
|
|
4
|
+
export declare function decodeBool(buffer: Buffer): boolean;
|
|
5
|
+
export declare function decodeString(buffer: Buffer): string;
|
|
6
|
+
export declare function decodeBigNumber(buffer: Buffer): BigNumber;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.decodeBigNumber = exports.decodeString = exports.decodeBool = exports.decodeUnsignedNumber = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const typesystem_1 = require("../typesystem");
|
|
9
|
+
const binary_1 = require("./binary");
|
|
10
|
+
const Codec = new binary_1.BinaryCodec();
|
|
11
|
+
function decodeUnsignedNumber(buffer) {
|
|
12
|
+
let value = Codec.decodeTopLevel(buffer, new typesystem_1.BigUIntType());
|
|
13
|
+
let raw = Number(value.valueOf());
|
|
14
|
+
return raw;
|
|
15
|
+
}
|
|
16
|
+
exports.decodeUnsignedNumber = decodeUnsignedNumber;
|
|
17
|
+
function decodeBool(buffer) {
|
|
18
|
+
let value = Codec.decodeTopLevel(buffer, new typesystem_1.BooleanType());
|
|
19
|
+
let raw = Boolean(value.valueOf());
|
|
20
|
+
return raw;
|
|
21
|
+
}
|
|
22
|
+
exports.decodeBool = decodeBool;
|
|
23
|
+
function decodeString(buffer) {
|
|
24
|
+
let value = Codec.decodeTopLevel(buffer, new typesystem_1.BytesType());
|
|
25
|
+
let raw = String(value.valueOf());
|
|
26
|
+
return raw;
|
|
27
|
+
}
|
|
28
|
+
exports.decodeString = decodeString;
|
|
29
|
+
function decodeBigNumber(buffer) {
|
|
30
|
+
let value = Codec.decodeTopLevel(buffer, new typesystem_1.BigUIntType());
|
|
31
|
+
let raw = new bignumber_js_1.default(value.valueOf());
|
|
32
|
+
return raw;
|
|
33
|
+
}
|
|
34
|
+
exports.decodeBigNumber = decodeBigNumber;
|
|
35
|
+
//# sourceMappingURL=binaryCodecUtils.js.map
|
|
@@ -0,0 +1 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// <reference types="node" />
|
|
2
|
+
import { BooleanValue } from "../typesystem";
|
|
3
|
+
/**
|
|
4
|
+
* Encodes and decodes "BooleanValue" objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BooleanBinaryCodec {
|
|
7
|
+
private static readonly TRUE;
|
|
8
|
+
private static readonly FALSE;
|
|
9
|
+
decodeNested(buffer: Buffer): [BooleanValue, number];
|
|
10
|
+
decodeTopLevel(buffer: Buffer): BooleanValue;
|
|
11
|
+
encodeNested(primitive: BooleanValue): Buffer;
|
|
12
|
+
encodeTopLevel(primitive: BooleanValue): Buffer;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.BooleanBinaryCodec = void 0;
|
|
23
|
+
const errors = __importStar(require("../../core/errors"));
|
|
24
|
+
const typesystem_1 = require("../typesystem");
|
|
25
|
+
/**
|
|
26
|
+
* Encodes and decodes "BooleanValue" objects.
|
|
27
|
+
*/
|
|
28
|
+
class BooleanBinaryCodec {
|
|
29
|
+
decodeNested(buffer) {
|
|
30
|
+
// We don't check the size of the buffer, we just read the first byte.
|
|
31
|
+
let byte = buffer.readUInt8(0);
|
|
32
|
+
return [new typesystem_1.BooleanValue(byte == BooleanBinaryCodec.TRUE), 1];
|
|
33
|
+
}
|
|
34
|
+
decodeTopLevel(buffer) {
|
|
35
|
+
if (buffer.length > 1) {
|
|
36
|
+
throw new errors.ErrInvalidArgument("buffer should be of size <= 1");
|
|
37
|
+
}
|
|
38
|
+
let firstByte = buffer[0];
|
|
39
|
+
return new typesystem_1.BooleanValue(firstByte == BooleanBinaryCodec.TRUE);
|
|
40
|
+
}
|
|
41
|
+
encodeNested(primitive) {
|
|
42
|
+
if (primitive.isTrue()) {
|
|
43
|
+
return Buffer.from([BooleanBinaryCodec.TRUE]);
|
|
44
|
+
}
|
|
45
|
+
return Buffer.from([BooleanBinaryCodec.FALSE]);
|
|
46
|
+
}
|
|
47
|
+
encodeTopLevel(primitive) {
|
|
48
|
+
if (primitive.isTrue()) {
|
|
49
|
+
return Buffer.from([BooleanBinaryCodec.TRUE]);
|
|
50
|
+
}
|
|
51
|
+
return Buffer.from([]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.BooleanBinaryCodec = BooleanBinaryCodec;
|
|
55
|
+
BooleanBinaryCodec.TRUE = 0x01;
|
|
56
|
+
BooleanBinaryCodec.FALSE = 0x00;
|
|
57
|
+
//# sourceMappingURL=boolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src/abi/codec/boolean.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,8CAA6C;AAE7C;;GAEG;AACH,MAAa,kBAAkB;IAI3B,YAAY,CAAC,MAAc;QACvB,sEAAsE;QAEtE,IAAI,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,yBAAY,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,cAAc,CAAC,MAAc;QACzB,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;SACxE;QAED,IAAI,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1B,OAAO,IAAI,yBAAY,CAAC,SAAS,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,YAAY,CAAC,SAAuB;QAChC,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE;YACpB,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACjD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,cAAc,CAAC,SAAuB;QAClC,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE;YACpB,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACjD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;;AAlCL,gDAmCC;AAlC2B,uBAAI,GAAW,IAAI,CAAC;AACpB,wBAAK,GAAW,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BytesValue } from "../typesystem/bytes";
|
|
3
|
+
/**
|
|
4
|
+
* Encodes and decodes "BytesValue" objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BytesBinaryCodec {
|
|
7
|
+
decodeNested(buffer: Buffer): [BytesValue, number];
|
|
8
|
+
decodeTopLevel(buffer: Buffer): BytesValue;
|
|
9
|
+
encodeNested(bytes: BytesValue): Buffer;
|
|
10
|
+
encodeTopLevel(bytes: BytesValue): Buffer;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BytesBinaryCodec = void 0;
|
|
4
|
+
const bytes_1 = require("../typesystem/bytes");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
/**
|
|
7
|
+
* Encodes and decodes "BytesValue" objects.
|
|
8
|
+
*/
|
|
9
|
+
class BytesBinaryCodec {
|
|
10
|
+
decodeNested(buffer) {
|
|
11
|
+
let length = buffer.readUInt32BE(0);
|
|
12
|
+
let payload = buffer.slice(constants_1.SizeOfU32, constants_1.SizeOfU32 + length);
|
|
13
|
+
let result = new bytes_1.BytesValue(payload);
|
|
14
|
+
return [result, constants_1.SizeOfU32 + length];
|
|
15
|
+
}
|
|
16
|
+
decodeTopLevel(buffer) {
|
|
17
|
+
return new bytes_1.BytesValue(buffer);
|
|
18
|
+
}
|
|
19
|
+
encodeNested(bytes) {
|
|
20
|
+
let lengthBuffer = Buffer.alloc(constants_1.SizeOfU32);
|
|
21
|
+
lengthBuffer.writeUInt32BE(bytes.getLength());
|
|
22
|
+
let buffer = Buffer.concat([lengthBuffer, bytes.valueOf()]);
|
|
23
|
+
return buffer;
|
|
24
|
+
}
|
|
25
|
+
encodeTopLevel(bytes) {
|
|
26
|
+
return bytes.valueOf();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.BytesBinaryCodec = BytesBinaryCodec;
|
|
30
|
+
//# sourceMappingURL=bytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src/abi/codec/bytes.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,2CAAwC;AAExC;;GAEG;AACH,MAAa,gBAAgB;IACzB,YAAY,CAAC,MAAc;QACvB,IAAI,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,qBAAS,EAAE,qBAAS,GAAG,MAAM,CAAC,CAAC;QAC1D,IAAI,MAAM,GAAG,IAAI,kBAAU,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,CAAC,MAAM,EAAE,qBAAS,GAAG,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,cAAc,CAAC,MAAc;QACzB,OAAO,IAAI,kBAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,YAAY,CAAC,KAAiB;QAC1B,IAAI,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,qBAAS,CAAC,CAAC;QAC3C,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9C,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,KAAiB;QAC5B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACJ;AAtBD,4CAsBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { CodeMetadataValue } from "../typesystem/codeMetadata";
|
|
3
|
+
export declare class CodeMetadataCodec {
|
|
4
|
+
decodeNested(buffer: Buffer): [CodeMetadataValue, number];
|
|
5
|
+
decodeTopLevel(buffer: Buffer): CodeMetadataValue;
|
|
6
|
+
encodeNested(codeMetadata: CodeMetadataValue): Buffer;
|
|
7
|
+
encodeTopLevel(codeMetadata: CodeMetadataValue): Buffer;
|
|
8
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeMetadataCodec = void 0;
|
|
4
|
+
const codeMetadata_1 = require("../../core/codeMetadata");
|
|
5
|
+
const codeMetadata_2 = require("../typesystem/codeMetadata");
|
|
6
|
+
class CodeMetadataCodec {
|
|
7
|
+
decodeNested(buffer) {
|
|
8
|
+
const codeMetadata = codeMetadata_1.CodeMetadata.newFromBytes(buffer.slice(0, codeMetadata_1.CodeMetadataLength));
|
|
9
|
+
return [new codeMetadata_2.CodeMetadataValue(codeMetadata), codeMetadata_1.CodeMetadataLength];
|
|
10
|
+
}
|
|
11
|
+
decodeTopLevel(buffer) {
|
|
12
|
+
const codeMetadata = codeMetadata_1.CodeMetadata.newFromBytes(buffer);
|
|
13
|
+
return new codeMetadata_2.CodeMetadataValue(codeMetadata);
|
|
14
|
+
}
|
|
15
|
+
encodeNested(codeMetadata) {
|
|
16
|
+
return Buffer.from(codeMetadata.valueOf().toBytes());
|
|
17
|
+
}
|
|
18
|
+
encodeTopLevel(codeMetadata) {
|
|
19
|
+
return Buffer.from(codeMetadata.valueOf().toBytes());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.CodeMetadataCodec = CodeMetadataCodec;
|
|
23
|
+
//# sourceMappingURL=codemetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemetadata.js","sourceRoot":"","sources":["../../../src/abi/codec/codemetadata.ts"],"names":[],"mappings":";;;AAAA,0DAA2E;AAC3E,6DAA+D;AAE/D,MAAa,iBAAiB;IAC1B,YAAY,CAAC,MAAc;QACvB,MAAM,YAAY,GAAG,2BAAY,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,iCAAkB,CAAC,CAAC,CAAC;QACpF,OAAO,CAAC,IAAI,gCAAiB,CAAC,YAAY,CAAC,EAAE,iCAAkB,CAAC,CAAC;IACrE,CAAC;IAED,cAAc,CAAC,MAAc;QACzB,MAAM,YAAY,GAAG,2BAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,IAAI,gCAAiB,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,YAAY,CAAC,YAA+B;QACxC,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,cAAc,CAAC,YAA+B;QAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;CACJ;AAlBD,8CAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SizeOfU32 = 4;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/abi/codec/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EnumType, EnumValue } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
export declare class EnumBinaryCodec {
|
|
5
|
+
private readonly binaryCodec;
|
|
6
|
+
private readonly fieldsCodec;
|
|
7
|
+
constructor(binaryCodec: BinaryCodec);
|
|
8
|
+
decodeTopLevel(buffer: Buffer, type: EnumType): EnumValue;
|
|
9
|
+
decodeNested(buffer: Buffer, type: EnumType): [EnumValue, number];
|
|
10
|
+
private readDiscriminant;
|
|
11
|
+
encodeNested(enumValue: EnumValue): Buffer;
|
|
12
|
+
encodeTopLevel(enumValue: EnumValue): Buffer;
|
|
13
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumBinaryCodec = void 0;
|
|
4
|
+
const typesystem_1 = require("../typesystem");
|
|
5
|
+
const fields_1 = require("./fields");
|
|
6
|
+
class EnumBinaryCodec {
|
|
7
|
+
constructor(binaryCodec) {
|
|
8
|
+
this.binaryCodec = binaryCodec;
|
|
9
|
+
this.fieldsCodec = new fields_1.FieldsBinaryCodec(binaryCodec);
|
|
10
|
+
}
|
|
11
|
+
decodeTopLevel(buffer, type) {
|
|
12
|
+
// This handles enums without fields, with discriminant = 0, as well.
|
|
13
|
+
let [enumValue] = this.decodeNested(buffer, type);
|
|
14
|
+
return enumValue;
|
|
15
|
+
}
|
|
16
|
+
decodeNested(buffer, type) {
|
|
17
|
+
let [discriminant, lengthOfDiscriminant] = this.readDiscriminant(buffer);
|
|
18
|
+
buffer = buffer.slice(lengthOfDiscriminant);
|
|
19
|
+
let variant = type.getVariantByDiscriminant(discriminant);
|
|
20
|
+
let fieldDefinitions = variant.getFieldsDefinitions();
|
|
21
|
+
let [fields, lengthOfFields] = this.fieldsCodec.decodeNested(buffer, fieldDefinitions);
|
|
22
|
+
let enumValue = new typesystem_1.EnumValue(type, variant, fields);
|
|
23
|
+
return [enumValue, lengthOfDiscriminant + lengthOfFields];
|
|
24
|
+
}
|
|
25
|
+
readDiscriminant(buffer) {
|
|
26
|
+
let [value, length] = this.binaryCodec.decodeNested(buffer, new typesystem_1.U8Type());
|
|
27
|
+
let discriminant = value.valueOf();
|
|
28
|
+
return [discriminant, length];
|
|
29
|
+
}
|
|
30
|
+
encodeNested(enumValue) {
|
|
31
|
+
let discriminant = new typesystem_1.U8Value(enumValue.discriminant);
|
|
32
|
+
let discriminantBuffer = this.binaryCodec.encodeNested(discriminant);
|
|
33
|
+
let fields = enumValue.getFields();
|
|
34
|
+
let fieldsBuffer = this.fieldsCodec.encodeNested(fields);
|
|
35
|
+
return Buffer.concat([discriminantBuffer, fieldsBuffer]);
|
|
36
|
+
}
|
|
37
|
+
encodeTopLevel(enumValue) {
|
|
38
|
+
let fields = enumValue.getFields();
|
|
39
|
+
let hasFields = fields.length > 0;
|
|
40
|
+
let fieldsBuffer = this.fieldsCodec.encodeNested(fields);
|
|
41
|
+
let discriminant = new typesystem_1.U8Value(enumValue.discriminant);
|
|
42
|
+
let discriminantBuffer = hasFields
|
|
43
|
+
? this.binaryCodec.encodeNested(discriminant)
|
|
44
|
+
: this.binaryCodec.encodeTopLevel(discriminant);
|
|
45
|
+
return Buffer.concat([discriminantBuffer, fieldsBuffer]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.EnumBinaryCodec = EnumBinaryCodec;
|
|
49
|
+
//# sourceMappingURL=enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/abi/codec/enum.ts"],"names":[],"mappings":";;;AAAA,8CAA4E;AAE5E,qCAA6C;AAE7C,MAAa,eAAe;IAIxB,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,0BAAiB,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;IAED,cAAc,CAAC,MAAc,EAAE,IAAc;QACzC,qEAAqE;QACrE,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,IAAc;QACvC,IAAI,CAAC,YAAY,EAAE,oBAAoB,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAE5C,IAAI,OAAO,GAAG,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;QAC1D,IAAI,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;QAEtD,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,GAAsB,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,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C,YAAY,CAAC,YAAY,CAAC;YAC7C,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QAEpD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7D,CAAC;CACJ;AAzDD,0CAyDC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ExplicitEnumType, ExplicitEnumValue } from "../typesystem/explicit-enum";
|
|
3
|
+
export declare class ExplicitEnumBinaryCodec {
|
|
4
|
+
private readonly stringCodec;
|
|
5
|
+
constructor();
|
|
6
|
+
decodeTopLevel(buffer: Buffer, type: ExplicitEnumType): ExplicitEnumValue;
|
|
7
|
+
decodeNested(buffer: Buffer, type: ExplicitEnumType): [ExplicitEnumValue, number];
|
|
8
|
+
encodeNested(enumValue: ExplicitEnumValue): Buffer;
|
|
9
|
+
encodeTopLevel(enumValue: ExplicitEnumValue): Buffer;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExplicitEnumBinaryCodec = void 0;
|
|
4
|
+
const typesystem_1 = require("../typesystem");
|
|
5
|
+
const explicit_enum_1 = require("../typesystem/explicit-enum");
|
|
6
|
+
const string_1 = require("./string");
|
|
7
|
+
class ExplicitEnumBinaryCodec {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.stringCodec = new string_1.StringBinaryCodec();
|
|
10
|
+
}
|
|
11
|
+
decodeTopLevel(buffer, type) {
|
|
12
|
+
const stringValue = this.stringCodec.decodeTopLevel(buffer);
|
|
13
|
+
return new explicit_enum_1.ExplicitEnumValue(type, new explicit_enum_1.ExplicitEnumVariantDefinition(stringValue.valueOf()));
|
|
14
|
+
}
|
|
15
|
+
decodeNested(buffer, type) {
|
|
16
|
+
const [value, length] = this.stringCodec.decodeNested(buffer);
|
|
17
|
+
const enumValue = new explicit_enum_1.ExplicitEnumValue(type, new explicit_enum_1.ExplicitEnumVariantDefinition(value.valueOf()));
|
|
18
|
+
return [enumValue, length];
|
|
19
|
+
}
|
|
20
|
+
encodeNested(enumValue) {
|
|
21
|
+
const buffer = this.stringCodec.encodeNested(new typesystem_1.StringValue(enumValue.valueOf().name));
|
|
22
|
+
return buffer;
|
|
23
|
+
}
|
|
24
|
+
encodeTopLevel(enumValue) {
|
|
25
|
+
const buffer = this.stringCodec.encodeTopLevel(new typesystem_1.StringValue(enumValue.valueOf().name));
|
|
26
|
+
return buffer;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ExplicitEnumBinaryCodec = ExplicitEnumBinaryCodec;
|
|
30
|
+
//# sourceMappingURL=explicit-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explicit-enum.js","sourceRoot":"","sources":["../../../src/abi/codec/explicit-enum.ts"],"names":[],"mappings":";;;AAAA,8CAA4C;AAC5C,+DAAiH;AACjH,qCAA6C;AAE7C,MAAa,uBAAuB;IAGhC;QACI,IAAI,CAAC,WAAW,GAAG,IAAI,0BAAiB,EAAE,CAAC;IAC/C,CAAC;IAED,cAAc,CAAC,MAAc,EAAE,IAAsB;QACjD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5D,OAAO,IAAI,iCAAiB,CAAC,IAAI,EAAE,IAAI,6CAA6B,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACjG,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,IAAsB;QAC/C,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,IAAI,iCAAiB,CAAC,IAAI,EAAE,IAAI,6CAA6B,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAElG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,YAAY,CAAC,SAA4B;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,wBAAW,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,SAA4B;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,wBAAW,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1F,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA5BD,0DA4BC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Field, FieldDefinition } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
export declare class FieldsBinaryCodec {
|
|
5
|
+
private readonly binaryCodec;
|
|
6
|
+
constructor(binaryCodec: BinaryCodec);
|
|
7
|
+
decodeNested(buffer: Buffer, fieldDefinitions: FieldDefinition[]): [Field[], number];
|
|
8
|
+
encodeNested(fields: ReadonlyArray<Field>): Buffer;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldsBinaryCodec = void 0;
|
|
4
|
+
const typesystem_1 = require("../typesystem");
|
|
5
|
+
class FieldsBinaryCodec {
|
|
6
|
+
constructor(binaryCodec) {
|
|
7
|
+
this.binaryCodec = binaryCodec;
|
|
8
|
+
}
|
|
9
|
+
decodeNested(buffer, fieldDefinitions) {
|
|
10
|
+
let fields = [];
|
|
11
|
+
let totalLength = 0;
|
|
12
|
+
for (const fieldDefinition of fieldDefinitions) {
|
|
13
|
+
let [decoded, decodedLength] = this.binaryCodec.decodeNested(buffer, fieldDefinition.type);
|
|
14
|
+
buffer = buffer.slice(decodedLength);
|
|
15
|
+
totalLength += decodedLength;
|
|
16
|
+
let field = new typesystem_1.Field(decoded, fieldDefinition.name);
|
|
17
|
+
fields.push(field);
|
|
18
|
+
}
|
|
19
|
+
return [fields, totalLength];
|
|
20
|
+
}
|
|
21
|
+
encodeNested(fields) {
|
|
22
|
+
let buffers = [];
|
|
23
|
+
for (const field of fields) {
|
|
24
|
+
let fieldBuffer = this.binaryCodec.encodeNested(field.value);
|
|
25
|
+
buffers.push(fieldBuffer);
|
|
26
|
+
}
|
|
27
|
+
return Buffer.concat(buffers);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.FieldsBinaryCodec = FieldsBinaryCodec;
|
|
31
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../src/abi/codec/fields.ts"],"names":[],"mappings":";;;AAAA,8CAAuD;AAGvD,MAAa,iBAAiB;IAG1B,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,gBAAmC;QAC5D,IAAI,MAAM,GAAY,EAAE,CAAC;QACzB,IAAI,WAAW,GAAG,CAAC,CAAC;QAEpB,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE;YAC5C,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YAC3F,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YACrC,WAAW,IAAI,aAAa,CAAC;YAE7B,IAAI,KAAK,GAAG,IAAI,kBAAK,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YACrD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACtB;QAED,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,MAA4B;QACrC,IAAI,OAAO,GAAa,EAAE,CAAC;QAE3B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,IAAI,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC7B;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;CACJ;AAjCD,8CAiCC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { H256Value } from "../typesystem/h256";
|
|
3
|
+
export declare class H256BinaryCodec {
|
|
4
|
+
/**
|
|
5
|
+
* Reads and decodes a H256Value from a given buffer.
|
|
6
|
+
*
|
|
7
|
+
* @param buffer the input buffer
|
|
8
|
+
*/
|
|
9
|
+
decodeNested(buffer: Buffer): [H256Value, number];
|
|
10
|
+
/**
|
|
11
|
+
* Reads and decodes a H256Value from a given buffer.
|
|
12
|
+
*
|
|
13
|
+
* @param buffer the input buffer
|
|
14
|
+
*/
|
|
15
|
+
decodeTopLevel(buffer: Buffer): H256Value;
|
|
16
|
+
/**
|
|
17
|
+
* Encodes a H256Value to a buffer.
|
|
18
|
+
*/
|
|
19
|
+
encodeNested(primitive: H256Value): Buffer;
|
|
20
|
+
/**
|
|
21
|
+
* Encodes a H256Value to a buffer.
|
|
22
|
+
*/
|
|
23
|
+
encodeTopLevel(primitive: H256Value): Buffer;
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.H256BinaryCodec = void 0;
|
|
4
|
+
const h256_1 = require("../typesystem/h256");
|
|
5
|
+
class H256BinaryCodec {
|
|
6
|
+
/**
|
|
7
|
+
* Reads and decodes a H256Value from a given buffer.
|
|
8
|
+
*
|
|
9
|
+
* @param buffer the input buffer
|
|
10
|
+
*/
|
|
11
|
+
decodeNested(buffer) {
|
|
12
|
+
// We don't check the size of the buffer, we just read 32 bytes.
|
|
13
|
+
let slice = buffer.slice(0, 32);
|
|
14
|
+
return [new h256_1.H256Value(slice), 32];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reads and decodes a H256Value from a given buffer.
|
|
18
|
+
*
|
|
19
|
+
* @param buffer the input buffer
|
|
20
|
+
*/
|
|
21
|
+
decodeTopLevel(buffer) {
|
|
22
|
+
let [decoded, _length] = this.decodeNested(buffer);
|
|
23
|
+
return decoded;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Encodes a H256Value to a buffer.
|
|
27
|
+
*/
|
|
28
|
+
encodeNested(primitive) {
|
|
29
|
+
return primitive.valueOf();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Encodes a H256Value to a buffer.
|
|
33
|
+
*/
|
|
34
|
+
encodeTopLevel(primitive) {
|
|
35
|
+
return primitive.valueOf();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.H256BinaryCodec = H256BinaryCodec;
|
|
39
|
+
//# sourceMappingURL=h256.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h256.js","sourceRoot":"","sources":["../../../src/abi/codec/h256.ts"],"names":[],"mappings":";;;AAAA,6CAA+C;AAE/C,MAAa,eAAe;IACxB;;;;OAIG;IACH,YAAY,CAAC,MAAc;QACvB,gEAAgE;QAChE,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,OAAO,CAAC,IAAI,gBAAS,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,MAAc;QACzB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACnD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,SAAoB;QAC7B,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,SAAoB;QAC/B,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACJ;AAnCD,0CAmCC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* @module codec
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./binary"), exports);
|
|
18
|
+
__exportStar(require("./binaryCodecUtils"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abi/codec/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;AAEH,2CAAyB;AACzB,qDAAmC"}
|