@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,74 @@
|
|
|
1
|
+
import { Address } from "../core/address";
|
|
2
|
+
import { Transaction } from "../core/transaction";
|
|
3
|
+
import { ContractFunction } from "./function";
|
|
4
|
+
import { Interaction } from "./interaction";
|
|
5
|
+
import { CallArguments, DeployArguments, ISmartContract, QueryArguments, UpgradeArguments } from "./interface";
|
|
6
|
+
import { Query } from "./query";
|
|
7
|
+
import { Abi, EndpointDefinition, TypedValue } from "./typesystem";
|
|
8
|
+
/**
|
|
9
|
+
* * @deprecated component. Use "SmartContractTransactionsFactory" or "SmartContractController", instead.
|
|
10
|
+
*
|
|
11
|
+
* An abstraction for deploying and interacting with Smart Contracts.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SmartContract implements ISmartContract {
|
|
14
|
+
private address;
|
|
15
|
+
private abi?;
|
|
16
|
+
/**
|
|
17
|
+
* This object contains a function for each endpoint defined by the contract.
|
|
18
|
+
* (a bit similar to web3js's "contract.methods").
|
|
19
|
+
*/
|
|
20
|
+
readonly methodsExplicit: {
|
|
21
|
+
[key: string]: (args?: TypedValue[]) => Interaction;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* This object contains a function for each endpoint defined by the contract.
|
|
25
|
+
* (a bit similar to web3js's "contract.methods").
|
|
26
|
+
*
|
|
27
|
+
* This is an alternative to {@link methodsExplicit}.
|
|
28
|
+
* Unlike {@link methodsExplicit}, automatic type inference (wrt. ABI) is applied when using {@link methods}.
|
|
29
|
+
*/
|
|
30
|
+
readonly methods: {
|
|
31
|
+
[key: string]: (args?: any[]) => Interaction;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Create a SmartContract object by providing its address on the Network.
|
|
35
|
+
*/
|
|
36
|
+
constructor(options?: {
|
|
37
|
+
address?: Address;
|
|
38
|
+
abi?: Abi;
|
|
39
|
+
});
|
|
40
|
+
private setupMethods;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the address, as on Network.
|
|
43
|
+
*/
|
|
44
|
+
setAddress(address: Address): void;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the address, as on Network.
|
|
47
|
+
*/
|
|
48
|
+
getAddress(): Address;
|
|
49
|
+
private getAbi;
|
|
50
|
+
getEndpoint(name: string | ContractFunction): EndpointDefinition;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a {@link Transaction} for deploying the Smart Contract to the Network.
|
|
53
|
+
*/
|
|
54
|
+
deploy({ deployer, code, codeMetadata, initArguments, value, gasLimit, gasPrice, chainID, }: DeployArguments): Transaction;
|
|
55
|
+
private getMetadataPropertiesAsObject;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a {@link Transaction} for upgrading the Smart Contract on the Network.
|
|
58
|
+
*/
|
|
59
|
+
upgrade({ caller, code, codeMetadata, initArguments, value, gasLimit, gasPrice, chainID, }: UpgradeArguments): Transaction;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a {@link Transaction} for calling (a function of) the Smart Contract.
|
|
62
|
+
*/
|
|
63
|
+
call({ func, args, value, gasLimit, receiver, gasPrice, chainID, caller }: CallArguments): Transaction;
|
|
64
|
+
createQuery({ func, args, value, caller }: QueryArguments): Query;
|
|
65
|
+
private ensureHasAddress;
|
|
66
|
+
/**
|
|
67
|
+
* Computes the address of a Smart Contract.
|
|
68
|
+
* The address is computed deterministically, from the address of the owner and the nonce of the deployment transaction.
|
|
69
|
+
*
|
|
70
|
+
* @param owner The owner of the Smart Contract
|
|
71
|
+
* @param nonce The owner nonce used for the deployment transaction
|
|
72
|
+
*/
|
|
73
|
+
static computeAddress(owner: Address, nonce: bigint): Address;
|
|
74
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartContract = void 0;
|
|
4
|
+
const address_1 = require("../core/address");
|
|
5
|
+
const codeMetadata_1 = require("../core/codeMetadata");
|
|
6
|
+
const compatibility_1 = require("../core/compatibility");
|
|
7
|
+
const constants_1 = require("../core/constants");
|
|
8
|
+
const errors_1 = require("../core/errors");
|
|
9
|
+
const transactionsFactoryConfig_1 = require("../core/transactionsFactoryConfig");
|
|
10
|
+
const utils_1 = require("../core/utils");
|
|
11
|
+
const smartContractTransactionsFactory_1 = require("./../smartContracts/smartContractTransactionsFactory");
|
|
12
|
+
const function_1 = require("./function");
|
|
13
|
+
const interaction_1 = require("./interaction");
|
|
14
|
+
const nativeSerializer_1 = require("./nativeSerializer");
|
|
15
|
+
const query_1 = require("./query");
|
|
16
|
+
/**
|
|
17
|
+
* * @deprecated component. Use "SmartContractTransactionsFactory" or "SmartContractController", instead.
|
|
18
|
+
*
|
|
19
|
+
* An abstraction for deploying and interacting with Smart Contracts.
|
|
20
|
+
*/
|
|
21
|
+
class SmartContract {
|
|
22
|
+
/**
|
|
23
|
+
* Create a SmartContract object by providing its address on the Network.
|
|
24
|
+
*/
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.address = address_1.Address.empty();
|
|
27
|
+
/**
|
|
28
|
+
* This object contains a function for each endpoint defined by the contract.
|
|
29
|
+
* (a bit similar to web3js's "contract.methods").
|
|
30
|
+
*/
|
|
31
|
+
this.methodsExplicit = {};
|
|
32
|
+
/**
|
|
33
|
+
* This object contains a function for each endpoint defined by the contract.
|
|
34
|
+
* (a bit similar to web3js's "contract.methods").
|
|
35
|
+
*
|
|
36
|
+
* This is an alternative to {@link methodsExplicit}.
|
|
37
|
+
* Unlike {@link methodsExplicit}, automatic type inference (wrt. ABI) is applied when using {@link methods}.
|
|
38
|
+
*/
|
|
39
|
+
this.methods = {};
|
|
40
|
+
this.address = options.address || address_1.Address.empty();
|
|
41
|
+
this.abi = options.abi;
|
|
42
|
+
if (this.abi) {
|
|
43
|
+
this.setupMethods();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
setupMethods() {
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
48
|
+
let contract = this;
|
|
49
|
+
let abi = this.getAbi();
|
|
50
|
+
for (const definition of abi.getEndpoints()) {
|
|
51
|
+
let functionName = definition.name;
|
|
52
|
+
// For each endpoint defined by the ABI, we attach a function to the "methods" and "methodsAuto" objects,
|
|
53
|
+
// a function that receives typed values as arguments
|
|
54
|
+
// and returns a prepared contract interaction.
|
|
55
|
+
this.methodsExplicit[functionName] = function (args) {
|
|
56
|
+
let func = new function_1.ContractFunction(functionName);
|
|
57
|
+
let interaction = new interaction_1.Interaction(contract, func, args || []);
|
|
58
|
+
return interaction;
|
|
59
|
+
};
|
|
60
|
+
this.methods[functionName] = function (args) {
|
|
61
|
+
let func = new function_1.ContractFunction(functionName);
|
|
62
|
+
// Perform automatic type inference, wrt. the endpoint definition:
|
|
63
|
+
let typedArgs = nativeSerializer_1.NativeSerializer.nativeToTypedValues(args || [], definition);
|
|
64
|
+
let interaction = new interaction_1.Interaction(contract, func, typedArgs || []);
|
|
65
|
+
return interaction;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Sets the address, as on Network.
|
|
71
|
+
*/
|
|
72
|
+
setAddress(address) {
|
|
73
|
+
this.address = address;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets the address, as on Network.
|
|
77
|
+
*/
|
|
78
|
+
getAddress() {
|
|
79
|
+
return this.address;
|
|
80
|
+
}
|
|
81
|
+
getAbi() {
|
|
82
|
+
utils_1.guardValueIsSet("abi", this.abi);
|
|
83
|
+
return this.abi;
|
|
84
|
+
}
|
|
85
|
+
getEndpoint(name) {
|
|
86
|
+
if (typeof name === "string") {
|
|
87
|
+
return this.getAbi().getEndpoint(name);
|
|
88
|
+
}
|
|
89
|
+
return this.getAbi().getEndpoint(name.name);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Creates a {@link Transaction} for deploying the Smart Contract to the Network.
|
|
93
|
+
*/
|
|
94
|
+
deploy({ deployer, code, codeMetadata, initArguments, value, gasLimit, gasPrice, chainID, }) {
|
|
95
|
+
compatibility_1.Compatibility.guardAddressIsSetAndNonZero(deployer, "'deployer' of SmartContract.deploy()", "pass the actual address to deploy()");
|
|
96
|
+
const config = new transactionsFactoryConfig_1.TransactionsFactoryConfig({ chainID: chainID.valueOf() });
|
|
97
|
+
const factory = new smartContractTransactionsFactory_1.SmartContractTransactionsFactory({
|
|
98
|
+
config: config,
|
|
99
|
+
abi: this.abi,
|
|
100
|
+
});
|
|
101
|
+
const bytecode = Buffer.from(code.toString(), "hex");
|
|
102
|
+
const metadataAsJson = this.getMetadataPropertiesAsObject(codeMetadata);
|
|
103
|
+
const transaction = factory.createTransactionForDeploy(deployer, {
|
|
104
|
+
bytecode: bytecode,
|
|
105
|
+
gasLimit: BigInt(gasLimit.valueOf()),
|
|
106
|
+
arguments: initArguments ?? [],
|
|
107
|
+
isUpgradeable: metadataAsJson.upgradeable,
|
|
108
|
+
isReadable: metadataAsJson.readable,
|
|
109
|
+
isPayable: metadataAsJson.payable,
|
|
110
|
+
isPayableBySmartContract: metadataAsJson.payableBySc,
|
|
111
|
+
});
|
|
112
|
+
transaction.chainID = chainID;
|
|
113
|
+
transaction.value = value ?? 0n;
|
|
114
|
+
transaction.gasPrice = gasPrice ?? BigInt(constants_1.TRANSACTION_MIN_GAS_PRICE);
|
|
115
|
+
return transaction;
|
|
116
|
+
}
|
|
117
|
+
getMetadataPropertiesAsObject(codeMetadata) {
|
|
118
|
+
let metadata;
|
|
119
|
+
if (codeMetadata) {
|
|
120
|
+
metadata = codeMetadata_1.CodeMetadata.newFromBytes(Buffer.from(codeMetadata.toString(), "hex"));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
metadata = new codeMetadata_1.CodeMetadata();
|
|
124
|
+
}
|
|
125
|
+
const metadataAsJson = metadata.toJSON();
|
|
126
|
+
return metadataAsJson;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Creates a {@link Transaction} for upgrading the Smart Contract on the Network.
|
|
130
|
+
*/
|
|
131
|
+
upgrade({ caller, code, codeMetadata, initArguments, value, gasLimit, gasPrice, chainID, }) {
|
|
132
|
+
compatibility_1.Compatibility.guardAddressIsSetAndNonZero(caller, "'caller' of SmartContract.upgrade()", "pass the actual address to upgrade()");
|
|
133
|
+
this.ensureHasAddress();
|
|
134
|
+
const config = new transactionsFactoryConfig_1.TransactionsFactoryConfig({ chainID: chainID.valueOf() });
|
|
135
|
+
const factory = new smartContractTransactionsFactory_1.SmartContractTransactionsFactory({
|
|
136
|
+
config: config,
|
|
137
|
+
abi: this.abi,
|
|
138
|
+
});
|
|
139
|
+
const bytecode = Uint8Array.from(Buffer.from(code.toString(), "hex"));
|
|
140
|
+
const metadataAsJson = this.getMetadataPropertiesAsObject(codeMetadata);
|
|
141
|
+
const transaction = factory.createTransactionForUpgrade(caller, {
|
|
142
|
+
contract: this.getAddress(),
|
|
143
|
+
bytecode: bytecode,
|
|
144
|
+
gasLimit: BigInt(gasLimit.valueOf()),
|
|
145
|
+
arguments: initArguments ?? [],
|
|
146
|
+
isUpgradeable: metadataAsJson.upgradeable,
|
|
147
|
+
isReadable: metadataAsJson.readable,
|
|
148
|
+
isPayable: metadataAsJson.payable,
|
|
149
|
+
isPayableBySmartContract: metadataAsJson.payableBySc,
|
|
150
|
+
});
|
|
151
|
+
transaction.chainID = chainID;
|
|
152
|
+
transaction.value = value ?? 0n;
|
|
153
|
+
transaction.gasPrice = gasPrice ?? BigInt(constants_1.TRANSACTION_MIN_GAS_PRICE);
|
|
154
|
+
return transaction;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Creates a {@link Transaction} for calling (a function of) the Smart Contract.
|
|
158
|
+
*/
|
|
159
|
+
call({ func, args, value, gasLimit, receiver, gasPrice, chainID, caller }) {
|
|
160
|
+
compatibility_1.Compatibility.guardAddressIsSetAndNonZero(caller, "'caller' of SmartContract.call()", "pass the actual address to call()");
|
|
161
|
+
this.ensureHasAddress();
|
|
162
|
+
const config = new transactionsFactoryConfig_1.TransactionsFactoryConfig({ chainID: chainID.valueOf() });
|
|
163
|
+
const factory = new smartContractTransactionsFactory_1.SmartContractTransactionsFactory({
|
|
164
|
+
config: config,
|
|
165
|
+
abi: this.abi,
|
|
166
|
+
});
|
|
167
|
+
args = args || [];
|
|
168
|
+
value = value || 0n;
|
|
169
|
+
const transaction = factory.createTransactionForExecute(caller, {
|
|
170
|
+
contract: receiver ? receiver : this.getAddress(),
|
|
171
|
+
function: func.toString(),
|
|
172
|
+
gasLimit: gasLimit,
|
|
173
|
+
arguments: args,
|
|
174
|
+
});
|
|
175
|
+
transaction.chainID = chainID;
|
|
176
|
+
transaction.value = value;
|
|
177
|
+
transaction.gasPrice = gasPrice ?? BigInt(constants_1.TRANSACTION_MIN_GAS_PRICE);
|
|
178
|
+
return transaction;
|
|
179
|
+
}
|
|
180
|
+
createQuery({ func, args, value, caller }) {
|
|
181
|
+
this.ensureHasAddress();
|
|
182
|
+
return new query_1.Query({
|
|
183
|
+
address: this.getAddress(),
|
|
184
|
+
func: func,
|
|
185
|
+
args: args,
|
|
186
|
+
value: value,
|
|
187
|
+
caller: caller,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
ensureHasAddress() {
|
|
191
|
+
if (!this.getAddress().toBech32()) {
|
|
192
|
+
throw new errors_1.ErrContractHasNoAddress();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Computes the address of a Smart Contract.
|
|
197
|
+
* The address is computed deterministically, from the address of the owner and the nonce of the deployment transaction.
|
|
198
|
+
*
|
|
199
|
+
* @param owner The owner of the Smart Contract
|
|
200
|
+
* @param nonce The owner nonce used for the deployment transaction
|
|
201
|
+
*/
|
|
202
|
+
static computeAddress(owner, nonce) {
|
|
203
|
+
const addressComputer = new address_1.AddressComputer();
|
|
204
|
+
return addressComputer.computeContractAddress(owner, BigInt(nonce.valueOf()));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.SmartContract = SmartContract;
|
|
208
|
+
//# sourceMappingURL=smartContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartContract.js","sourceRoot":"","sources":["../../src/abi/smartContract.ts"],"names":[],"mappings":";;;AAAA,6CAA2D;AAC3D,uDAAoD;AACpD,yDAAsD;AACtD,iDAA8D;AAC9D,2CAAyD;AAEzD,iFAA8E;AAC9E,yCAAgD;AAChD,2GAAwG;AACxG,yCAA8C;AAC9C,+CAA4C;AAS5C,yDAAsD;AACtD,mCAAgC;AAGhC;;;;GAIG;AACH,MAAa,aAAa;IAmBtB;;OAEG;IACH,YAAY,UAA4C,EAAE;QArBlD,YAAO,GAAY,iBAAO,CAAC,KAAK,EAAE,CAAC;QAG3C;;;WAGG;QACa,oBAAe,GAA4D,EAAE,CAAC;QAE9F;;;;;;WAMG;QACa,YAAO,GAAqD,EAAE,CAAC;QAM3E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAO,CAAC,KAAK,EAAE,CAAC;QAClD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QAEvB,IAAI,IAAI,CAAC,GAAG,EAAE;YACV,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;IACL,CAAC;IAEO,YAAY;QAChB,4DAA4D;QAC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C,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE;YACjD,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;YACzB,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;QAEH,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;QAC9B,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,WAAW,CAAC,QAAQ,GAAG,QAAQ,IAAI,MAAM,CAAC,qCAAyB,CAAC,CAAC;QAErE,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAkB;QACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,OAAO,IAAI,aAAK,CAAC;YACb,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;YAC1B,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACjB,CAAC,CAAC;IACP,CAAC;IAEO,gBAAgB;QACpB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC/B,MAAM,IAAI,gCAAuB,EAAE,CAAC;SACvC;IACL,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CAAC,KAAc,EAAE,KAAa;QAC/C,MAAM,eAAe,GAAG,IAAI,yBAAe,EAAE,CAAC;QAC9C,OAAO,eAAe,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAClF,CAAC;CACJ;AAvQD,sCAuQC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeFormula = void 0;
|
|
4
|
+
class TypeFormula {
|
|
5
|
+
constructor(name, typeParameters, metadata) {
|
|
6
|
+
this.name = name;
|
|
7
|
+
this.typeParameters = typeParameters;
|
|
8
|
+
this.metadata = metadata;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
const hasTypeParameters = this.typeParameters.length > 0;
|
|
12
|
+
const typeParameters = hasTypeParameters
|
|
13
|
+
? `<${this.typeParameters.map((tp) => tp.toString()).join(", ")}>`
|
|
14
|
+
: "";
|
|
15
|
+
const baseName = `${this.name}${typeParameters}`;
|
|
16
|
+
return this.metadata !== undefined ? `${baseName}*${this.metadata}*` : baseName;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.TypeFormula = TypeFormula;
|
|
20
|
+
//# sourceMappingURL=typeFormula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeFormula.js","sourceRoot":"","sources":["../../src/abi/typeFormula.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAW;IAKpB,YAAY,IAAY,EAAE,cAA6B,EAAE,QAAc;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,QAAQ;QACJ,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QACzD,MAAM,cAAc,GAAG,iBAAiB;YACpC,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YAClE,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,cAAc,EAAE,CAAC;QAEjD,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;IACpF,CAAC;CACJ;AApBD,kCAoBC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TypeFormula } from "./typeFormula";
|
|
2
|
+
export declare class TypeFormulaParser {
|
|
3
|
+
static BEGIN_TYPE_PARAMETERS: string;
|
|
4
|
+
static END_TYPE_PARAMETERS: string;
|
|
5
|
+
static COMMA: string;
|
|
6
|
+
static PUNCTUATION: string[];
|
|
7
|
+
parseExpression(expression: string): TypeFormula;
|
|
8
|
+
private tokenizeExpression;
|
|
9
|
+
private acquireTypeWithParameters;
|
|
10
|
+
private acquireTypeParameters;
|
|
11
|
+
private isPunctuation;
|
|
12
|
+
private isEndOfTypeParameters;
|
|
13
|
+
private isBeginningOfTypeParameters;
|
|
14
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeFormulaParser = void 0;
|
|
4
|
+
const typeFormula_1 = require("./typeFormula");
|
|
5
|
+
class TypeFormulaParser {
|
|
6
|
+
parseExpression(expression) {
|
|
7
|
+
expression = expression.trim();
|
|
8
|
+
const tokens = this.tokenizeExpression(expression).filter((token) => token !== TypeFormulaParser.COMMA);
|
|
9
|
+
const stack = [];
|
|
10
|
+
for (const token of tokens) {
|
|
11
|
+
if (this.isPunctuation(token)) {
|
|
12
|
+
if (this.isEndOfTypeParameters(token)) {
|
|
13
|
+
const typeFormula = this.acquireTypeWithParameters(stack);
|
|
14
|
+
stack.push(typeFormula);
|
|
15
|
+
}
|
|
16
|
+
else if (this.isBeginningOfTypeParameters(token)) {
|
|
17
|
+
// This symbol is pushed as a simple string.
|
|
18
|
+
stack.push(token);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
throw new Error(`Unexpected token (punctuation): ${token}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// It's a type name. We push it as a simple string.
|
|
26
|
+
stack.push(token);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (stack.length !== 1) {
|
|
30
|
+
throw new Error(`Unexpected stack length at end of parsing: ${stack.length}`);
|
|
31
|
+
}
|
|
32
|
+
if (TypeFormulaParser.PUNCTUATION.includes(stack[0])) {
|
|
33
|
+
throw new Error("Unexpected root element.");
|
|
34
|
+
}
|
|
35
|
+
const item = stack[0];
|
|
36
|
+
if (item instanceof typeFormula_1.TypeFormula) {
|
|
37
|
+
return item;
|
|
38
|
+
}
|
|
39
|
+
else if (typeof item === "string") {
|
|
40
|
+
// Expression contained a simple, non-generic type.
|
|
41
|
+
return new typeFormula_1.TypeFormula(item, []);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw new Error(`Unexpected item on stack: ${item}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
tokenizeExpression(expression) {
|
|
48
|
+
const tokens = [];
|
|
49
|
+
let currentToken = "";
|
|
50
|
+
for (const character of expression) {
|
|
51
|
+
if (this.isPunctuation(character)) {
|
|
52
|
+
if (currentToken) {
|
|
53
|
+
// Retain current token
|
|
54
|
+
tokens.push(currentToken.trim());
|
|
55
|
+
// Reset current token
|
|
56
|
+
currentToken = "";
|
|
57
|
+
}
|
|
58
|
+
// Punctuation character
|
|
59
|
+
tokens.push(character);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
currentToken += character;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (currentToken) {
|
|
66
|
+
// Retain the last token (if any).
|
|
67
|
+
tokens.push(currentToken.trim());
|
|
68
|
+
}
|
|
69
|
+
return tokens;
|
|
70
|
+
}
|
|
71
|
+
acquireTypeWithParameters(stack) {
|
|
72
|
+
const typeParameters = this.acquireTypeParameters(stack);
|
|
73
|
+
const typeName = stack.pop();
|
|
74
|
+
if (typeName === "ManagedDecimal" || typeName === "ManagedDecimalSigned") {
|
|
75
|
+
const metadata = typeParameters[0].name;
|
|
76
|
+
const typeFormula = new typeFormula_1.TypeFormula(typeName, [], metadata);
|
|
77
|
+
return typeFormula;
|
|
78
|
+
}
|
|
79
|
+
const typeFormula = new typeFormula_1.TypeFormula(typeName, typeParameters.reverse());
|
|
80
|
+
return typeFormula;
|
|
81
|
+
}
|
|
82
|
+
acquireTypeParameters(stack) {
|
|
83
|
+
const typeParameters = [];
|
|
84
|
+
while (true) {
|
|
85
|
+
const item = stack.pop();
|
|
86
|
+
if (item === undefined) {
|
|
87
|
+
throw new Error("Badly specified type parameters");
|
|
88
|
+
}
|
|
89
|
+
if (this.isBeginningOfTypeParameters(item)) {
|
|
90
|
+
// We've acquired all type parameters.
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (item instanceof typeFormula_1.TypeFormula) {
|
|
94
|
+
// Type parameter is a previously-acquired type.
|
|
95
|
+
typeParameters.push(item);
|
|
96
|
+
}
|
|
97
|
+
else if (typeof item === "string") {
|
|
98
|
+
// Type parameter is a simple, non-generic type.
|
|
99
|
+
typeParameters.push(new typeFormula_1.TypeFormula(item, []));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw new Error(`Unexpected type parameter object in stack: ${item}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return typeParameters;
|
|
106
|
+
}
|
|
107
|
+
isPunctuation(token) {
|
|
108
|
+
return TypeFormulaParser.PUNCTUATION.includes(token);
|
|
109
|
+
}
|
|
110
|
+
isEndOfTypeParameters(token) {
|
|
111
|
+
return token === TypeFormulaParser.END_TYPE_PARAMETERS;
|
|
112
|
+
}
|
|
113
|
+
isBeginningOfTypeParameters(token) {
|
|
114
|
+
return token === TypeFormulaParser.BEGIN_TYPE_PARAMETERS;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.TypeFormulaParser = TypeFormulaParser;
|
|
118
|
+
TypeFormulaParser.BEGIN_TYPE_PARAMETERS = "<";
|
|
119
|
+
TypeFormulaParser.END_TYPE_PARAMETERS = ">";
|
|
120
|
+
TypeFormulaParser.COMMA = ",";
|
|
121
|
+
TypeFormulaParser.PUNCTUATION = [
|
|
122
|
+
TypeFormulaParser.COMMA,
|
|
123
|
+
TypeFormulaParser.BEGIN_TYPE_PARAMETERS,
|
|
124
|
+
TypeFormulaParser.END_TYPE_PARAMETERS,
|
|
125
|
+
];
|
|
126
|
+
//# sourceMappingURL=typeFormulaParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeFormulaParser.js","sourceRoot":"","sources":["../../src/abi/typeFormulaParser.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAE5C,MAAa,iBAAiB;IAU1B,eAAe,CAAC,UAAkB;QAC9B,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACxG,MAAM,KAAK,GAAU,EAAE,CAAC;QAExB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBAC3B,IAAI,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE;oBACnC,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;oBAC1D,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;iBAC3B;qBAAM,IAAI,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,EAAE;oBAChD,4CAA4C;oBAC5C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBACrB;qBAAM;oBACH,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;iBAC/D;aACJ;iBAAM;gBACH,mDAAmD;gBACnD,KAAK,CAAC,IAAI,CA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;QAED,OAAO,cAAc,CAAC;IAC1B,CAAC;IAEO,aAAa,CAAC,KAAa;QAC/B,OAAO,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAEO,qBAAqB,CAAC,KAAa;QACvC,OAAO,KAAK,KAAK,iBAAiB,CAAC,mBAAmB,CAAC;IAC3D,CAAC;IAEO,2BAA2B,CAAC,KAAa;QAC7C,OAAO,KAAK,KAAK,iBAAiB,CAAC,qBAAqB,CAAC;IAC7D,CAAC;;AAjIL,8CAkIC;AAjIU,uCAAqB,GAAG,GAAG,CAAC;AAC5B,qCAAmB,GAAG,GAAG,CAAC;AAC1B,uBAAK,GAAG,GAAG,CAAC;AACZ,6BAAW,GAAG;IACjB,iBAAiB,CAAC,KAAK;IACvB,iBAAiB,CAAC,qBAAqB;IACvC,iBAAiB,CAAC,mBAAmB;CACxC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EndpointDefinition } from "./endpoint";
|
|
2
|
+
import { EnumType } from "./enum";
|
|
3
|
+
import { EventDefinition } from "./event";
|
|
4
|
+
import { ExplicitEnumType } from "./explicit-enum";
|
|
5
|
+
import { StructType } from "./struct";
|
|
6
|
+
import { CustomType } from "./types";
|
|
7
|
+
export declare class AbiRegistry {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly constructorDefinition: EndpointDefinition;
|
|
10
|
+
readonly upgradeConstructorDefinition?: EndpointDefinition;
|
|
11
|
+
readonly endpoints: EndpointDefinition[];
|
|
12
|
+
readonly customTypes: CustomType[];
|
|
13
|
+
readonly events: EventDefinition[];
|
|
14
|
+
protected constructor(options: {
|
|
15
|
+
name: string;
|
|
16
|
+
constructorDefinition: EndpointDefinition;
|
|
17
|
+
upgradeConstructorDefinition?: EndpointDefinition;
|
|
18
|
+
endpoints: EndpointDefinition[];
|
|
19
|
+
customTypes: CustomType[];
|
|
20
|
+
events?: EventDefinition[];
|
|
21
|
+
});
|
|
22
|
+
static create(options: {
|
|
23
|
+
name?: string;
|
|
24
|
+
constructor?: any;
|
|
25
|
+
upgradeConstructor?: any;
|
|
26
|
+
endpoints?: any[];
|
|
27
|
+
types?: Record<string, any>;
|
|
28
|
+
events?: any[];
|
|
29
|
+
}): AbiRegistry;
|
|
30
|
+
getCustomType(name: string): CustomType;
|
|
31
|
+
getStruct(name: string): StructType;
|
|
32
|
+
getStructs(names: string[]): StructType[];
|
|
33
|
+
getEnum(name: string): EnumType;
|
|
34
|
+
getExplicitEnum(name: string): ExplicitEnumType;
|
|
35
|
+
getEnums(names: string[]): EnumType[];
|
|
36
|
+
getEndpoints(): EndpointDefinition[];
|
|
37
|
+
getEndpoint(name: string): EndpointDefinition;
|
|
38
|
+
getEvent(name: string): EventDefinition;
|
|
39
|
+
/**
|
|
40
|
+
* Right after loading ABI definitions into a registry, the endpoints and the custom types (structs, enums)
|
|
41
|
+
* use raw types for their I/O parameters (in the case of endpoints), or for their fields (in the case of structs).
|
|
42
|
+
*
|
|
43
|
+
* A raw type is merely an instance of {@link Type}, with a given name and type parameters (if it's a generic type).
|
|
44
|
+
*
|
|
45
|
+
* Though, for most (development) purposes, we'd like to operate using known, specific types (e.g. {@link List}, {@link U8Type} etc.).
|
|
46
|
+
* This function increases the specificity of the types used by parameter / field definitions within a registry (on best-efforts basis).
|
|
47
|
+
* The result is an equivalent, more explicit ABI registry.
|
|
48
|
+
*/
|
|
49
|
+
remapToKnownTypes(): AbiRegistry;
|
|
50
|
+
private mapCustomTypeDepthFirst;
|
|
51
|
+
}
|
|
52
|
+
export declare class Abi extends AbiRegistry {
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
constructor(options: {
|
|
57
|
+
name: string;
|
|
58
|
+
constructorDefinition: EndpointDefinition;
|
|
59
|
+
upgradeConstructorDefinition?: EndpointDefinition;
|
|
60
|
+
endpoints: EndpointDefinition[];
|
|
61
|
+
customTypes: CustomType[];
|
|
62
|
+
events?: EventDefinition[];
|
|
63
|
+
});
|
|
64
|
+
}
|