@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,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { List, Type } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
/**
|
|
5
|
+
* Encodes and decodes "List" objects.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ListBinaryCodec {
|
|
8
|
+
private readonly binaryCodec;
|
|
9
|
+
constructor(binaryCodec: BinaryCodec);
|
|
10
|
+
decodeNested(buffer: Buffer, type: Type): [List, number];
|
|
11
|
+
decodeTopLevel(buffer: Buffer, type: Type): List;
|
|
12
|
+
encodeNested(list: List): Buffer;
|
|
13
|
+
encodeTopLevel(list: List): Buffer;
|
|
14
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListBinaryCodec = void 0;
|
|
4
|
+
const typesystem_1 = require("../typesystem");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
/**
|
|
7
|
+
* Encodes and decodes "List" objects.
|
|
8
|
+
*/
|
|
9
|
+
class ListBinaryCodec {
|
|
10
|
+
constructor(binaryCodec) {
|
|
11
|
+
this.binaryCodec = binaryCodec;
|
|
12
|
+
}
|
|
13
|
+
decodeNested(buffer, type) {
|
|
14
|
+
let typeParameter = type.getFirstTypeParameter();
|
|
15
|
+
let result = [];
|
|
16
|
+
let numItems = buffer.readUInt32BE(0);
|
|
17
|
+
this.binaryCodec.constraints.checkListLength(numItems);
|
|
18
|
+
let originalBuffer = buffer;
|
|
19
|
+
let offset = constants_1.SizeOfU32;
|
|
20
|
+
buffer = originalBuffer.slice(offset);
|
|
21
|
+
for (let i = 0; i < numItems; i++) {
|
|
22
|
+
let [decoded, decodedLength] = this.binaryCodec.decodeNested(buffer, typeParameter);
|
|
23
|
+
result.push(decoded);
|
|
24
|
+
offset += decodedLength;
|
|
25
|
+
buffer = originalBuffer.slice(offset);
|
|
26
|
+
}
|
|
27
|
+
return [new typesystem_1.List(type, result), offset];
|
|
28
|
+
}
|
|
29
|
+
decodeTopLevel(buffer, type) {
|
|
30
|
+
let typeParameter = type.getFirstTypeParameter();
|
|
31
|
+
let result = [];
|
|
32
|
+
let originalBuffer = buffer;
|
|
33
|
+
let offset = 0;
|
|
34
|
+
while (buffer.length > 0) {
|
|
35
|
+
let [decoded, decodedLength] = this.binaryCodec.decodeNested(buffer, typeParameter);
|
|
36
|
+
result.push(decoded);
|
|
37
|
+
offset += decodedLength;
|
|
38
|
+
buffer = originalBuffer.slice(offset);
|
|
39
|
+
this.binaryCodec.constraints.checkListLength(result.length);
|
|
40
|
+
}
|
|
41
|
+
return new typesystem_1.List(type, result);
|
|
42
|
+
}
|
|
43
|
+
encodeNested(list) {
|
|
44
|
+
this.binaryCodec.constraints.checkListLength(list.getLength());
|
|
45
|
+
let lengthBuffer = Buffer.alloc(constants_1.SizeOfU32);
|
|
46
|
+
lengthBuffer.writeUInt32BE(list.getLength());
|
|
47
|
+
let itemsBuffers = [];
|
|
48
|
+
for (const item of list.getItems()) {
|
|
49
|
+
let itemBuffer = this.binaryCodec.encodeNested(item);
|
|
50
|
+
itemsBuffers.push(itemBuffer);
|
|
51
|
+
}
|
|
52
|
+
let buffer = Buffer.concat([lengthBuffer, ...itemsBuffers]);
|
|
53
|
+
return buffer;
|
|
54
|
+
}
|
|
55
|
+
encodeTopLevel(list) {
|
|
56
|
+
this.binaryCodec.constraints.checkListLength(list.getLength());
|
|
57
|
+
let itemsBuffers = [];
|
|
58
|
+
for (const item of list.getItems()) {
|
|
59
|
+
let itemBuffer = this.binaryCodec.encodeNested(item);
|
|
60
|
+
itemsBuffers.push(itemBuffer);
|
|
61
|
+
}
|
|
62
|
+
let buffer = Buffer.concat(itemsBuffers);
|
|
63
|
+
return buffer;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.ListBinaryCodec = ListBinaryCodec;
|
|
67
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/abi/codec/list.ts"],"names":[],"mappings":";;;AAAA,8CAAuD;AAEvD,2CAAwC;AAExC;;GAEG;AACH,MAAa,eAAe;IAGxB,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,IAAU;QACnC,IAAI,aAAa,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACjD,IAAI,MAAM,GAAiB,EAAE,CAAC;QAC9B,IAAI,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,cAAc,GAAG,MAAM,CAAC;QAC5B,IAAI,MAAM,GAAG,qBAAS,CAAC;QAEvB,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;YAC/B,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC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Y,GAAa,EAAE,CAAC;QAEhC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;YAChC,IAAI,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACrD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACjC;QAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,IAAU;QACrB,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAE/D,IAAI,YAAY,GAAa,EAAE,CAAC;QAEhC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;YAChC,IAAI,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACrD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACjC;QAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA7ED,0CA6EC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ManagedDecimalType, ManagedDecimalValue } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
export declare class ManagedDecimalCodec {
|
|
5
|
+
private readonly binaryCodec;
|
|
6
|
+
constructor(binaryCodec: BinaryCodec);
|
|
7
|
+
decodeNested(buffer: Buffer, type: ManagedDecimalType): [ManagedDecimalValue, number];
|
|
8
|
+
decodeTopLevel(buffer: Buffer, type: ManagedDecimalType): ManagedDecimalValue;
|
|
9
|
+
encodeNested(value: ManagedDecimalValue): Buffer;
|
|
10
|
+
encodeTopLevel(value: ManagedDecimalValue): Buffer;
|
|
11
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.ManagedDecimalCodec = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const typesystem_1 = require("../typesystem");
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
class ManagedDecimalCodec {
|
|
12
|
+
constructor(binaryCodec) {
|
|
13
|
+
this.binaryCodec = binaryCodec;
|
|
14
|
+
}
|
|
15
|
+
decodeNested(buffer, type) {
|
|
16
|
+
const length = buffer.readUInt32BE(0);
|
|
17
|
+
const payload = buffer.slice(0, length);
|
|
18
|
+
const result = this.decodeTopLevel(payload, type);
|
|
19
|
+
return [result, length];
|
|
20
|
+
}
|
|
21
|
+
decodeTopLevel(buffer, type) {
|
|
22
|
+
if (buffer.length === 0) {
|
|
23
|
+
return new typesystem_1.ManagedDecimalValue(new bignumber_js_1.default(0), 0);
|
|
24
|
+
}
|
|
25
|
+
if (type.isVariable()) {
|
|
26
|
+
const bigUintSize = buffer.length - constants_1.SizeOfU32;
|
|
27
|
+
const [value] = this.binaryCodec.decodeNested(buffer.slice(0, bigUintSize), new typesystem_1.BigUIntType());
|
|
28
|
+
const scale = buffer.readUInt32BE(bigUintSize);
|
|
29
|
+
return new typesystem_1.ManagedDecimalValue(value.valueOf().shiftedBy(-scale), scale);
|
|
30
|
+
}
|
|
31
|
+
const value = utils_1.bufferToBigInt(buffer);
|
|
32
|
+
const metadata = type.getMetadata();
|
|
33
|
+
const scale = metadata !== "usize" ? parseInt(metadata.toString()) : 0;
|
|
34
|
+
return new typesystem_1.ManagedDecimalValue(value.shiftedBy(-scale), scale);
|
|
35
|
+
}
|
|
36
|
+
encodeNested(value) {
|
|
37
|
+
let buffers = [];
|
|
38
|
+
const rawValue = new typesystem_1.BigUIntValue(value.valueOf().shiftedBy(value.getScale()));
|
|
39
|
+
if (value.isVariable()) {
|
|
40
|
+
buffers.push(Buffer.from(this.binaryCodec.encodeNested(rawValue)));
|
|
41
|
+
buffers.push(Buffer.from(this.binaryCodec.encodeNested(new typesystem_1.U32Value(value.getScale()))));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
buffers.push(this.binaryCodec.encodeTopLevel(rawValue));
|
|
45
|
+
}
|
|
46
|
+
return Buffer.concat(buffers);
|
|
47
|
+
}
|
|
48
|
+
encodeTopLevel(value) {
|
|
49
|
+
return this.encodeNested(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.ManagedDecimalCodec = ManagedDecimalCodec;
|
|
53
|
+
//# sourceMappingURL=managedDecimal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managedDecimal.js","sourceRoot":"","sources":["../../../src/abi/codec/managedDecimal.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,8CAA6G;AAE7G,mCAAyC;AACzC,2CAAwC;AAExC,MAAa,mBAAmB;IAG5B,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,IAAwB;QACjD,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAExC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,cAAc,CAAC,MAAc,EAAE,IAAwB;QACnD,I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C,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,qBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5F;aAAM;YACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC3D;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,cAAc,CAAC,KAA0B;QACrC,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ;AAjDD,kDAiDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ManagedDecimalSignedType, ManagedDecimalSignedValue } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
export declare class ManagedDecimalSignedCodec {
|
|
5
|
+
private readonly binaryCodec;
|
|
6
|
+
constructor(binaryCodec: BinaryCodec);
|
|
7
|
+
decodeNested(buffer: Buffer, type: ManagedDecimalSignedType): [ManagedDecimalSignedValue, number];
|
|
8
|
+
decodeTopLevel(buffer: Buffer, type: ManagedDecimalSignedType): ManagedDecimalSignedValue;
|
|
9
|
+
encodeNested(value: ManagedDecimalSignedValue): Buffer;
|
|
10
|
+
encodeTopLevel(value: ManagedDecimalSignedValue): Buffer;
|
|
11
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.ManagedDecimalSignedCodec = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const typesystem_1 = require("../typesystem");
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
class ManagedDecimalSignedCodec {
|
|
12
|
+
constructor(binaryCodec) {
|
|
13
|
+
this.binaryCodec = binaryCodec;
|
|
14
|
+
}
|
|
15
|
+
decodeNested(buffer, type) {
|
|
16
|
+
const length = buffer.readUInt32BE(0);
|
|
17
|
+
const payload = buffer.slice(0, length);
|
|
18
|
+
const result = this.decodeTopLevel(payload, type);
|
|
19
|
+
return [result, length];
|
|
20
|
+
}
|
|
21
|
+
decodeTopLevel(buffer, type) {
|
|
22
|
+
if (buffer.length === 0) {
|
|
23
|
+
return new typesystem_1.ManagedDecimalSignedValue(new bignumber_js_1.default(0), 0);
|
|
24
|
+
}
|
|
25
|
+
if (type.isVariable()) {
|
|
26
|
+
const bigintSize = buffer.length - constants_1.SizeOfU32;
|
|
27
|
+
const [value] = this.binaryCodec.decodeNested(buffer.slice(0, bigintSize), new typesystem_1.BigIntType());
|
|
28
|
+
const scale = buffer.readUInt32BE(bigintSize);
|
|
29
|
+
return new typesystem_1.ManagedDecimalSignedValue(value.valueOf().shiftedBy(-scale), scale);
|
|
30
|
+
}
|
|
31
|
+
const value = utils_1.bufferToBigInt(buffer);
|
|
32
|
+
const metadata = type.getMetadata();
|
|
33
|
+
const scale = metadata !== "usize" ? parseInt(metadata.toString()) : 0;
|
|
34
|
+
return new typesystem_1.ManagedDecimalSignedValue(value.shiftedBy(-scale), scale);
|
|
35
|
+
}
|
|
36
|
+
encodeNested(value) {
|
|
37
|
+
let buffers = [];
|
|
38
|
+
const rawValue = new typesystem_1.BigIntValue(value.valueOf().shiftedBy(value.getScale()));
|
|
39
|
+
if (value.isVariable()) {
|
|
40
|
+
buffers.push(Buffer.from(this.binaryCodec.encodeNested(rawValue)));
|
|
41
|
+
buffers.push(Buffer.from(this.binaryCodec.encodeNested(new typesystem_1.U32Value(value.getScale()))));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
buffers.push(Buffer.from(this.binaryCodec.encodeTopLevel(rawValue)));
|
|
45
|
+
}
|
|
46
|
+
return Buffer.concat(buffers);
|
|
47
|
+
}
|
|
48
|
+
encodeTopLevel(value) {
|
|
49
|
+
return this.encodeNested(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.ManagedDecimalSignedCodec = ManagedDecimalSignedCodec;
|
|
53
|
+
//# sourceMappingURL=managedDecimalSigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managedDecimalSigned.js","sourceRoot":"","sources":["../../../src/abi/codec/managedDecimalSigned.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,8CAAuH;AAEvH,mCAAyC;AACzC,2CAAwC;AAExC,MAAa,yBAAyB;IAGlC,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,IAA8B;QACvD,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAExC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,cAAc,CAAC,MAAc,EAAE,IAA8B;QACzD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,IAAI,sCAAyB,CAAC,IAAI,sBAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7D;QAED,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YACnB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,G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AC,CAAC,CAAC;SAC5F;aAAM;YACH,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SACxE;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,cAAc,CAAC,KAAgC;QAC3C,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ;AAlDD,8DAkDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NothingCodec = void 0;
|
|
4
|
+
const typesystem_1 = require("../typesystem");
|
|
5
|
+
class NothingCodec {
|
|
6
|
+
decodeNested() {
|
|
7
|
+
return [new typesystem_1.NothingValue(), 0];
|
|
8
|
+
}
|
|
9
|
+
decodeTopLevel() {
|
|
10
|
+
return new typesystem_1.NothingValue();
|
|
11
|
+
}
|
|
12
|
+
encodeNested() {
|
|
13
|
+
return Buffer.from([]);
|
|
14
|
+
}
|
|
15
|
+
encodeTopLevel() {
|
|
16
|
+
return Buffer.from([]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.NothingCodec = NothingCodec;
|
|
20
|
+
//# sourceMappingURL=nothing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nothing.js","sourceRoot":"","sources":["../../../src/abi/codec/nothing.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAE7C,MAAa,YAAY;IACrB,YAAY;QACR,OAAO,CAAC,IAAI,yBAAY,EAAE,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,cAAc;QACV,OAAO,IAAI,yBAAY,EAAE,CAAC;IAC9B,CAAC;IAED,YAAY;QACR,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,cAAc;QACV,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;CACJ;AAhBD,oCAgBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { NumericalType, NumericalValue } from "../typesystem";
|
|
3
|
+
/**
|
|
4
|
+
* Encodes and decodes "NumericalValue" objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NumericalBinaryCodec {
|
|
7
|
+
decodeNested(buffer: Buffer, type: NumericalType): [NumericalValue, number];
|
|
8
|
+
decodeTopLevel(buffer: Buffer, type: NumericalType): NumericalValue;
|
|
9
|
+
encodeNested(primitive: NumericalValue): Buffer;
|
|
10
|
+
private encodeNestedFixedSize;
|
|
11
|
+
encodeTopLevel(primitive: NumericalValue): Buffer;
|
|
12
|
+
encodePrimitive(primitive: NumericalValue): Buffer;
|
|
13
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
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.NumericalBinaryCodec = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const typesystem_1 = require("../typesystem");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
/**
|
|
12
|
+
* Encodes and decodes "NumericalValue" objects.
|
|
13
|
+
*/
|
|
14
|
+
class NumericalBinaryCodec {
|
|
15
|
+
decodeNested(buffer, type) {
|
|
16
|
+
let offset = 0;
|
|
17
|
+
let length = type.sizeInBytes;
|
|
18
|
+
if (!length) {
|
|
19
|
+
// Size of type is not known: arbitrary-size big integer.
|
|
20
|
+
// Therefore, we must read the length from the header.
|
|
21
|
+
offset = constants_1.SizeOfU32;
|
|
22
|
+
length = buffer.readUInt32BE(0);
|
|
23
|
+
}
|
|
24
|
+
let payload = buffer.slice(offset, offset + length);
|
|
25
|
+
let result = this.decodeTopLevel(payload, type);
|
|
26
|
+
let decodedLength = length + offset;
|
|
27
|
+
return [result, decodedLength];
|
|
28
|
+
}
|
|
29
|
+
decodeTopLevel(buffer, type) {
|
|
30
|
+
let payload = utils_1.cloneBuffer(buffer);
|
|
31
|
+
let empty = buffer.length == 0;
|
|
32
|
+
if (empty) {
|
|
33
|
+
return new typesystem_1.NumericalValue(type, new bignumber_js_1.default(0));
|
|
34
|
+
}
|
|
35
|
+
let isPositive = !type.withSign || utils_1.isMsbZero(payload);
|
|
36
|
+
if (isPositive) {
|
|
37
|
+
let value = utils_1.bufferToBigInt(payload);
|
|
38
|
+
return new typesystem_1.NumericalValue(type, value);
|
|
39
|
+
}
|
|
40
|
+
// Also see: https://github.com/terradharitri/drt-components-big-int/blob/master/twos-complement/twos2bigint.go
|
|
41
|
+
utils_1.flipBufferBitsInPlace(payload);
|
|
42
|
+
let value = utils_1.bufferToBigInt(payload);
|
|
43
|
+
let negativeValue = value.multipliedBy(new bignumber_js_1.default(-1));
|
|
44
|
+
let negativeValueMinusOne = negativeValue.minus(new bignumber_js_1.default(1));
|
|
45
|
+
return new typesystem_1.NumericalValue(type, negativeValueMinusOne);
|
|
46
|
+
}
|
|
47
|
+
encodeNested(primitive) {
|
|
48
|
+
if (primitive.sizeInBytes) {
|
|
49
|
+
return this.encodeNestedFixedSize(primitive, primitive.sizeInBytes);
|
|
50
|
+
}
|
|
51
|
+
// Size is not known: arbitrary-size big integer. Therefore, we must emit the length (as U32) before the actual payload.
|
|
52
|
+
let buffer = this.encodeTopLevel(primitive);
|
|
53
|
+
let length = Buffer.alloc(constants_1.SizeOfU32);
|
|
54
|
+
length.writeUInt32BE(buffer.length);
|
|
55
|
+
return Buffer.concat([length, buffer]);
|
|
56
|
+
}
|
|
57
|
+
encodeNestedFixedSize(primitive, size) {
|
|
58
|
+
if (primitive.value.isZero()) {
|
|
59
|
+
return Buffer.alloc(size, 0x00);
|
|
60
|
+
}
|
|
61
|
+
if (!primitive.withSign) {
|
|
62
|
+
const buffer = utils_1.bigIntToBuffer(primitive.value);
|
|
63
|
+
const paddingBytes = Buffer.alloc(size - buffer.length, 0x00);
|
|
64
|
+
return Buffer.concat([paddingBytes, buffer]);
|
|
65
|
+
}
|
|
66
|
+
if (primitive.value.isPositive()) {
|
|
67
|
+
let buffer = utils_1.bigIntToBuffer(primitive.value);
|
|
68
|
+
// Fix ambiguity if any
|
|
69
|
+
if (utils_1.isMsbOne(buffer)) {
|
|
70
|
+
buffer = utils_1.prependByteToBuffer(buffer, 0x00);
|
|
71
|
+
}
|
|
72
|
+
const paddingBytes = Buffer.alloc(size - buffer.length, 0x00);
|
|
73
|
+
return Buffer.concat([paddingBytes, buffer]);
|
|
74
|
+
}
|
|
75
|
+
// Negative:
|
|
76
|
+
// Also see: https://github.com/terradharitri/drt-components-big-int/blob/master/twos-complement/bigint2twos.go
|
|
77
|
+
let valuePlusOne = primitive.value.plus(new bignumber_js_1.default(1));
|
|
78
|
+
let buffer = utils_1.bigIntToBuffer(valuePlusOne);
|
|
79
|
+
utils_1.flipBufferBitsInPlace(buffer);
|
|
80
|
+
// Fix ambiguity if any
|
|
81
|
+
if (utils_1.isMsbZero(buffer)) {
|
|
82
|
+
buffer = utils_1.prependByteToBuffer(buffer, 0xff);
|
|
83
|
+
}
|
|
84
|
+
const paddingBytes = Buffer.alloc(size - buffer.length, 0xff);
|
|
85
|
+
return Buffer.concat([paddingBytes, buffer]);
|
|
86
|
+
}
|
|
87
|
+
encodeTopLevel(primitive) {
|
|
88
|
+
let withSign = primitive.withSign;
|
|
89
|
+
// Nothing or Zero:
|
|
90
|
+
if (primitive.value.isZero()) {
|
|
91
|
+
return Buffer.alloc(0);
|
|
92
|
+
}
|
|
93
|
+
// I don't care about the sign:
|
|
94
|
+
if (!withSign) {
|
|
95
|
+
return utils_1.bigIntToBuffer(primitive.value);
|
|
96
|
+
}
|
|
97
|
+
return this.encodePrimitive(primitive);
|
|
98
|
+
}
|
|
99
|
+
encodePrimitive(primitive) {
|
|
100
|
+
// Positive:
|
|
101
|
+
if (primitive.value.isPositive()) {
|
|
102
|
+
let buffer = utils_1.bigIntToBuffer(primitive.value);
|
|
103
|
+
// Fix ambiguity if any
|
|
104
|
+
if (utils_1.isMsbOne(buffer)) {
|
|
105
|
+
buffer = utils_1.prependByteToBuffer(buffer, 0x00);
|
|
106
|
+
}
|
|
107
|
+
return buffer;
|
|
108
|
+
}
|
|
109
|
+
// Negative:
|
|
110
|
+
// Also see: https://github.com/terradharitri/drt-components-big-int/blob/master/twos-complement/bigint2twos.go
|
|
111
|
+
let valuePlusOne = primitive.value.plus(new bignumber_js_1.default(1));
|
|
112
|
+
let buffer = utils_1.bigIntToBuffer(valuePlusOne);
|
|
113
|
+
utils_1.flipBufferBitsInPlace(buffer);
|
|
114
|
+
// Fix ambiguity if any
|
|
115
|
+
if (utils_1.isMsbZero(buffer)) {
|
|
116
|
+
buffer = utils_1.prependByteToBuffer(buffer, 0xff);
|
|
117
|
+
}
|
|
118
|
+
return buffer;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.NumericalBinaryCodec = NumericalBinaryCodec;
|
|
122
|
+
//# sourceMappingURL=numerical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numerical.js","sourceRoot":"","sources":["../../../src/abi/codec/numerical.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,8CAA8D;AAC9D,2CAAwC;AACxC,mCAQiB;AAEjB;;GAEG;AACH,MAAa,oBAAoB;IAC7B,YAAY,CAAC,MAAc,EAAE,IAAmB;QAC5C,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QAE9B,IAAI,CAAC,MAAM,EAAE;YACT,yDAAyD;YACzD,sDAAsD;YACtD,MAAM,GAAG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IAAI,gBAAQ,CAAC,MAAM,CAAC,EAAE;gBAClB,MAAM,GAAG,2BAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aAC9C;YAED,OAAO,MAAM,CAAC;SACjB;QAED,YAAY;QACZ,+GAA+G;QAC/G,IAAI,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,MAAM,GAAG,sBAAc,CAAC,YAAY,CAAC,CAAC;QAC1C,6BAAqB,CAAC,MAAM,CAAC,CAAC;QAE9B,uBAAuB;QACvB,IAAI,iBAAS,CAAC,MAAM,CAAC,EAAE;YACnB,MAAM,GAAG,2BAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;SAC9C;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAtID,oDAsIC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { OptionValue, Type } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
/**
|
|
5
|
+
* Encodes and decodes "OptionValue" objects
|
|
6
|
+
*/
|
|
7
|
+
export declare class OptionValueBinaryCodec {
|
|
8
|
+
private readonly binaryCodec;
|
|
9
|
+
constructor(binaryCodec: BinaryCodec);
|
|
10
|
+
decodeNested(buffer: Buffer, type: Type): [OptionValue, number];
|
|
11
|
+
decodeTopLevel(buffer: Buffer, type: Type): OptionValue;
|
|
12
|
+
encodeNested(optionValue: OptionValue): Buffer;
|
|
13
|
+
encodeTopLevel(optionValue: OptionValue): Buffer;
|
|
14
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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.OptionValueBinaryCodec = void 0;
|
|
23
|
+
const errors = __importStar(require("../../core/errors"));
|
|
24
|
+
const typesystem_1 = require("../typesystem");
|
|
25
|
+
/**
|
|
26
|
+
* Encodes and decodes "OptionValue" objects
|
|
27
|
+
*/
|
|
28
|
+
class OptionValueBinaryCodec {
|
|
29
|
+
constructor(binaryCodec) {
|
|
30
|
+
this.binaryCodec = binaryCodec;
|
|
31
|
+
}
|
|
32
|
+
decodeNested(buffer, type) {
|
|
33
|
+
if (buffer[0] == 0x00) {
|
|
34
|
+
return [typesystem_1.OptionValue.newMissingTyped(type), 1];
|
|
35
|
+
}
|
|
36
|
+
if (buffer[0] != 0x01) {
|
|
37
|
+
throw new errors.ErrCodec("invalid buffer for optional value");
|
|
38
|
+
}
|
|
39
|
+
let [decoded, decodedLength] = this.binaryCodec.decodeNested(buffer.slice(1), type);
|
|
40
|
+
return [typesystem_1.OptionValue.newProvided(decoded), decodedLength + 1];
|
|
41
|
+
}
|
|
42
|
+
decodeTopLevel(buffer, type) {
|
|
43
|
+
if (buffer.length == 0) {
|
|
44
|
+
return new typesystem_1.OptionValue(type);
|
|
45
|
+
}
|
|
46
|
+
if (buffer[0] != 0x01) {
|
|
47
|
+
throw new errors.ErrCodec("invalid buffer for optional value");
|
|
48
|
+
}
|
|
49
|
+
let [decoded, _decodedLength] = this.binaryCodec.decodeNested(buffer.slice(1), type);
|
|
50
|
+
return new typesystem_1.OptionValue(type, decoded);
|
|
51
|
+
}
|
|
52
|
+
encodeNested(optionValue) {
|
|
53
|
+
if (optionValue.isSet()) {
|
|
54
|
+
return Buffer.concat([Buffer.from([1]), this.binaryCodec.encodeNested(optionValue.getTypedValue())]);
|
|
55
|
+
}
|
|
56
|
+
return Buffer.from([0]);
|
|
57
|
+
}
|
|
58
|
+
encodeTopLevel(optionValue) {
|
|
59
|
+
if (optionValue.isSet()) {
|
|
60
|
+
return Buffer.concat([Buffer.from([1]), this.binaryCodec.encodeNested(optionValue.getTypedValue())]);
|
|
61
|
+
}
|
|
62
|
+
return Buffer.from([]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.OptionValueBinaryCodec = OptionValueBinaryCodec;
|
|
66
|
+
//# sourceMappingURL=option.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option.js","sourceRoot":"","sources":["../../../src/abi/codec/option.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,8CAAkD;AAGlD;;GAEG;AACH,MAAa,sBAAsB;IAG/B,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,IAAU;QACnC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;YACnB,OAAO,CAAC,wBAAW,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;SACjD;QAED,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;YACnB,MAAM,IAAI,MAAM,CAAC,QAAQ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C,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;SACxG;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;CACJ;AAhDD,wDAgDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PrimitiveType, PrimitiveValue } from "../typesystem";
|
|
3
|
+
import { BinaryCodec } from "./binary";
|
|
4
|
+
export declare class PrimitiveBinaryCodec {
|
|
5
|
+
private readonly binaryCodec;
|
|
6
|
+
private readonly booleanCodec;
|
|
7
|
+
private readonly numericalCodec;
|
|
8
|
+
private readonly addressCodec;
|
|
9
|
+
private readonly h256Codec;
|
|
10
|
+
private readonly bytesCodec;
|
|
11
|
+
private readonly stringCodec;
|
|
12
|
+
private readonly tokenIdentifierCodec;
|
|
13
|
+
private readonly codeMetadataCodec;
|
|
14
|
+
private readonly nothingCodec;
|
|
15
|
+
constructor(binaryCodec: BinaryCodec);
|
|
16
|
+
decodeNested(buffer: Buffer, type: PrimitiveType): [PrimitiveValue, number];
|
|
17
|
+
decodeTopLevel(buffer: Buffer, type: PrimitiveType): PrimitiveValue;
|
|
18
|
+
encodeNested(value: PrimitiveValue): Buffer;
|
|
19
|
+
encodeTopLevel(value: PrimitiveValue): Buffer;
|
|
20
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrimitiveBinaryCodec = void 0;
|
|
4
|
+
const typesystem_1 = require("../typesystem");
|
|
5
|
+
const address_1 = require("./address");
|
|
6
|
+
const boolean_1 = require("./boolean");
|
|
7
|
+
const numerical_1 = require("./numerical");
|
|
8
|
+
const h256_1 = require("./h256");
|
|
9
|
+
const bytes_1 = require("./bytes");
|
|
10
|
+
const tokenIdentifier_1 = require("./tokenIdentifier");
|
|
11
|
+
const codemetadata_1 = require("./codemetadata");
|
|
12
|
+
const nothing_1 = require("./nothing");
|
|
13
|
+
const string_1 = require("./string");
|
|
14
|
+
class PrimitiveBinaryCodec {
|
|
15
|
+
constructor(binaryCodec) {
|
|
16
|
+
this.binaryCodec = binaryCodec;
|
|
17
|
+
this.booleanCodec = new boolean_1.BooleanBinaryCodec();
|
|
18
|
+
this.numericalCodec = new numerical_1.NumericalBinaryCodec();
|
|
19
|
+
this.addressCodec = new address_1.AddressBinaryCodec();
|
|
20
|
+
this.h256Codec = new h256_1.H256BinaryCodec();
|
|
21
|
+
this.bytesCodec = new bytes_1.BytesBinaryCodec();
|
|
22
|
+
this.stringCodec = new string_1.StringBinaryCodec();
|
|
23
|
+
this.tokenIdentifierCodec = new tokenIdentifier_1.TokenIdentifierCodec();
|
|
24
|
+
this.codeMetadataCodec = new codemetadata_1.CodeMetadataCodec();
|
|
25
|
+
this.nothingCodec = new nothing_1.NothingCodec();
|
|
26
|
+
}
|
|
27
|
+
decodeNested(buffer, type) {
|
|
28
|
+
return typesystem_1.onPrimitiveTypeSelect(type, {
|
|
29
|
+
onBoolean: () => this.booleanCodec.decodeNested(buffer),
|
|
30
|
+
onNumerical: () => this.numericalCodec.decodeNested(buffer, type),
|
|
31
|
+
onAddress: () => this.addressCodec.decodeNested(buffer),
|
|
32
|
+
onBytes: () => this.bytesCodec.decodeNested(buffer),
|
|
33
|
+
onString: () => this.stringCodec.decodeNested(buffer),
|
|
34
|
+
onH256: () => this.h256Codec.decodeNested(buffer),
|
|
35
|
+
onTokenIndetifier: () => this.tokenIdentifierCodec.decodeNested(buffer),
|
|
36
|
+
onCodeMetadata: () => this.codeMetadataCodec.decodeNested(buffer),
|
|
37
|
+
onNothing: () => this.nothingCodec.decodeNested(),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
decodeTopLevel(buffer, type) {
|
|
41
|
+
return typesystem_1.onPrimitiveTypeSelect(type, {
|
|
42
|
+
onBoolean: () => this.booleanCodec.decodeTopLevel(buffer),
|
|
43
|
+
onNumerical: () => this.numericalCodec.decodeTopLevel(buffer, type),
|
|
44
|
+
onAddress: () => this.addressCodec.decodeTopLevel(buffer),
|
|
45
|
+
onBytes: () => this.bytesCodec.decodeTopLevel(buffer),
|
|
46
|
+
onString: () => this.stringCodec.decodeTopLevel(buffer),
|
|
47
|
+
onH256: () => this.h256Codec.decodeTopLevel(buffer),
|
|
48
|
+
onTokenIndetifier: () => this.tokenIdentifierCodec.decodeTopLevel(buffer),
|
|
49
|
+
onCodeMetadata: () => this.codeMetadataCodec.decodeTopLevel(buffer),
|
|
50
|
+
onNothing: () => this.nothingCodec.decodeTopLevel(),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
encodeNested(value) {
|
|
54
|
+
return typesystem_1.onPrimitiveValueSelect(value, {
|
|
55
|
+
onBoolean: () => this.booleanCodec.encodeNested(value),
|
|
56
|
+
onNumerical: () => this.numericalCodec.encodeNested(value),
|
|
57
|
+
onAddress: () => this.addressCodec.encodeNested(value),
|
|
58
|
+
onBytes: () => this.bytesCodec.encodeNested(value),
|
|
59
|
+
onString: () => this.stringCodec.encodeNested(value),
|
|
60
|
+
onH256: () => this.h256Codec.encodeNested(value),
|
|
61
|
+
onTypeIdentifier: () => this.tokenIdentifierCodec.encodeNested(value),
|
|
62
|
+
onCodeMetadata: () => this.codeMetadataCodec.encodeNested(value),
|
|
63
|
+
onNothing: () => this.nothingCodec.encodeNested(),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
encodeTopLevel(value) {
|
|
67
|
+
return typesystem_1.onPrimitiveValueSelect(value, {
|
|
68
|
+
onBoolean: () => this.booleanCodec.encodeTopLevel(value),
|
|
69
|
+
onNumerical: () => this.numericalCodec.encodeTopLevel(value),
|
|
70
|
+
onAddress: () => this.addressCodec.encodeTopLevel(value),
|
|
71
|
+
onBytes: () => this.bytesCodec.encodeTopLevel(value),
|
|
72
|
+
onString: () => this.stringCodec.encodeTopLevel(value),
|
|
73
|
+
onH256: () => this.h256Codec.encodeTopLevel(value),
|
|
74
|
+
onTypeIdentifier: () => this.tokenIdentifierCodec.encodeTopLevel(value),
|
|
75
|
+
onCodeMetadata: () => this.codeMetadataCodec.encodeTopLevel(value),
|
|
76
|
+
onNothing: () => this.nothingCodec.encodeTopLevel(),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.PrimitiveBinaryCodec = PrimitiveBinaryCodec;
|
|
81
|
+
//# sourceMappingURL=primitive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../src/abi/codec/primitive.ts"],"names":[],"mappings":";;;AAAA,8CAWuB;AACvB,uCAA+C;AAC/C,uCAA+C;AAE/C,2CAAmD;AAEnD,iCAAyC;AAEzC,mCAA2C;AAC3C,uDAAyD;AAEzD,iDAAmD;AACnD,uCAAyC;AACzC,qCAA6C;AAE7C,MAAa,oBAAoB;IAa7B,YAAY,WAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAkB,EAAE,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,IAAI,gCAAoB,EAAE,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAkB,EAAE,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAe,EAAE,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,IAAI,wBAAgB,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,0BAAiB,EAAE,CAAC;QAC3C,IAAI,CAAC,oBAAoB,GAAG,IAAI,sCAAoB,EAAE,CAAC;QACvD,IAAI,CAAC,iBAAiB,GAAG,IAAI,gCAAiB,EAAE,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,sBAAY,EAAE,CAAC;IAC3C,CAAC;IAED,YAAY,CAAC,MA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CAAoB,KAAK,CAAC;YACnF,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;SACpD,CAAC,CAAC;IACP,CAAC;IAED,cAAc,CAAC,KAAqB;QAChC,OAAO,mCAAsB,CAAS,KAAK,EAAE;YACzC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAe,KAAK,CAAC;YACtE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAiB,KAAK,CAAC;YAC5E,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAe,KAAK,CAAC;YACtE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAa,KAAK,CAAC;YAChE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAc,KAAK,CAAC;YACnE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAY,KAAK,CAAC;YAC7D,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAuB,KAAK,CAAC;YAC7F,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAoB,KAAK,CAAC;YACrF,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE;SACtD,CAAC,CAAC;IACP,CAAC;CACJ;AAlFD,oDAkFC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { StringValue } from "../typesystem";
|
|
3
|
+
export declare class StringBinaryCodec {
|
|
4
|
+
private readonly bytesBinaryCodec;
|
|
5
|
+
decodeNested(buffer: Buffer): [StringValue, number];
|
|
6
|
+
decodeTopLevel(buffer: Buffer): StringValue;
|
|
7
|
+
encodeNested(value: StringValue): Buffer;
|
|
8
|
+
encodeTopLevel(value: StringValue): Buffer;
|
|
9
|
+
}
|