@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,182 @@
|
|
|
1
|
+
import { Abi } from "../abi";
|
|
2
|
+
import { TokenTransfer } from "../core";
|
|
3
|
+
import { Address } from "../core/address";
|
|
4
|
+
import { CodeMetadata } from "../core/codeMetadata";
|
|
5
|
+
export declare type DeployMultisigContractInput = {
|
|
6
|
+
quorum: number;
|
|
7
|
+
board: Address[];
|
|
8
|
+
bytecode: Uint8Array;
|
|
9
|
+
isUpgradeable?: boolean;
|
|
10
|
+
isReadable?: boolean;
|
|
11
|
+
isPayable?: boolean;
|
|
12
|
+
isPayableBySmartContract?: boolean;
|
|
13
|
+
gasLimit: bigint;
|
|
14
|
+
};
|
|
15
|
+
export declare type MultisigContractInput = {
|
|
16
|
+
multisigContract: Address;
|
|
17
|
+
gasLimit: bigint;
|
|
18
|
+
};
|
|
19
|
+
export declare type ProposeAddBoardMemberInput = MultisigContractInput & {
|
|
20
|
+
boardMember: Address;
|
|
21
|
+
};
|
|
22
|
+
export declare type ProposeAddProposerInput = MultisigContractInput & {
|
|
23
|
+
proposer: Address;
|
|
24
|
+
};
|
|
25
|
+
export declare type ProposeRemoveUserInput = MultisigContractInput & {
|
|
26
|
+
userAddress: Address;
|
|
27
|
+
};
|
|
28
|
+
export declare type ProposeChangeQuorumInput = MultisigContractInput & {
|
|
29
|
+
newQuorum: number;
|
|
30
|
+
};
|
|
31
|
+
export declare type ProposeTransferExecuteInput = MultisigContractInput & {
|
|
32
|
+
to: Address;
|
|
33
|
+
nativeTokenAmount: bigint;
|
|
34
|
+
optGasLimit?: bigint;
|
|
35
|
+
functionName?: string;
|
|
36
|
+
functionArguments?: any[];
|
|
37
|
+
abi?: Abi;
|
|
38
|
+
};
|
|
39
|
+
export declare type DepositExecuteInput = MultisigContractInput & {
|
|
40
|
+
nativeTokenAmount: bigint;
|
|
41
|
+
gasLimit?: bigint;
|
|
42
|
+
tokenTransfers: TokenTransfer[];
|
|
43
|
+
};
|
|
44
|
+
export declare type ProposeTransferExecuteDcdtInput = MultisigContractInput & {
|
|
45
|
+
to: Address;
|
|
46
|
+
tokens: any[];
|
|
47
|
+
optGasLimit?: bigint;
|
|
48
|
+
functionName: string;
|
|
49
|
+
functionArguments: any[];
|
|
50
|
+
abi?: Abi;
|
|
51
|
+
};
|
|
52
|
+
export declare type ProposeAsyncCallInput = MultisigContractInput & {
|
|
53
|
+
multisigContract: Address;
|
|
54
|
+
to: Address;
|
|
55
|
+
nativeTransferAmount: bigint;
|
|
56
|
+
tokenTransfers: TokenTransfer[];
|
|
57
|
+
functionName: string;
|
|
58
|
+
functionArguments: any[];
|
|
59
|
+
optGasLimit?: bigint;
|
|
60
|
+
abi?: Abi;
|
|
61
|
+
};
|
|
62
|
+
export declare type ProposeContractDeployFromSourceInput = MultisigContractInput & {
|
|
63
|
+
amount: bigint;
|
|
64
|
+
source: Address;
|
|
65
|
+
codeMetadata: CodeMetadata;
|
|
66
|
+
arguments: any[];
|
|
67
|
+
abi?: Abi;
|
|
68
|
+
};
|
|
69
|
+
export declare type ProposeContractUpgradeFromSourceInput = MultisigContractInput & {
|
|
70
|
+
scAddress: Address;
|
|
71
|
+
amount: bigint;
|
|
72
|
+
source: Address;
|
|
73
|
+
codeMetadata: CodeMetadata;
|
|
74
|
+
arguments: any[];
|
|
75
|
+
abi?: Abi;
|
|
76
|
+
};
|
|
77
|
+
export declare type ActionInput = MultisigContractInput & {
|
|
78
|
+
actionId: number;
|
|
79
|
+
};
|
|
80
|
+
export declare type GroupInput = MultisigContractInput & {
|
|
81
|
+
groupId: number;
|
|
82
|
+
};
|
|
83
|
+
export declare type UnsignForOutdatedBoardMembersInput = ActionInput & {
|
|
84
|
+
outdatedBoardMembers: number[];
|
|
85
|
+
};
|
|
86
|
+
export declare type DiscardBatchInput = MultisigContractInput & {
|
|
87
|
+
actionIds: number[];
|
|
88
|
+
};
|
|
89
|
+
export declare enum UserRoleEnum {
|
|
90
|
+
None = "None",
|
|
91
|
+
Proposer = "Proposer",
|
|
92
|
+
BoardMember = "BoardMember"
|
|
93
|
+
}
|
|
94
|
+
export declare enum MultisigActionEnum {
|
|
95
|
+
Nothing = "Nothing",
|
|
96
|
+
AddBoardMember = "AddBoardMember",
|
|
97
|
+
AddProposer = "AddProposer",
|
|
98
|
+
RemoveUser = "RemoveUser",
|
|
99
|
+
ChangeQuorum = "ChangeQuorum",
|
|
100
|
+
SendTransferExecuteRewa = "SendTransferExecuteRewa",
|
|
101
|
+
SendTransferExecuteDcdt = "SendTransferExecuteDcdt",
|
|
102
|
+
SendAsyncCall = "SendAsyncCall",
|
|
103
|
+
SCDeployFromSource = "SCDeployFromSource",
|
|
104
|
+
SCUpgradeFromSource = "SCUpgradeFromSource"
|
|
105
|
+
}
|
|
106
|
+
export declare class MultisigAction {
|
|
107
|
+
type: MultisigActionEnum;
|
|
108
|
+
}
|
|
109
|
+
export declare type FullMultisigAction = {
|
|
110
|
+
actionId: number;
|
|
111
|
+
groupId: number;
|
|
112
|
+
signers: Address[];
|
|
113
|
+
actionData: MultisigAction;
|
|
114
|
+
};
|
|
115
|
+
export declare class AddBoardMember extends MultisigAction {
|
|
116
|
+
address: Address;
|
|
117
|
+
constructor(address: Address);
|
|
118
|
+
}
|
|
119
|
+
export declare class AddProposer extends MultisigAction {
|
|
120
|
+
address: Address;
|
|
121
|
+
constructor(address: Address);
|
|
122
|
+
}
|
|
123
|
+
export declare class RemoveUser extends MultisigAction {
|
|
124
|
+
type: MultisigActionEnum;
|
|
125
|
+
address: Address;
|
|
126
|
+
constructor(address: Address);
|
|
127
|
+
}
|
|
128
|
+
export declare class ChangeQuorum extends MultisigAction {
|
|
129
|
+
quorum: number;
|
|
130
|
+
constructor(quorum: number);
|
|
131
|
+
}
|
|
132
|
+
export declare class SendTransferExecuteRewa extends MultisigAction {
|
|
133
|
+
receiver: Address;
|
|
134
|
+
amount: bigint;
|
|
135
|
+
optionalGasLimit: bigint;
|
|
136
|
+
functionName: string;
|
|
137
|
+
arguments: Uint8Array[];
|
|
138
|
+
constructor(data: any);
|
|
139
|
+
}
|
|
140
|
+
export declare class SendTransferExecuteDcdt extends MultisigAction {
|
|
141
|
+
receiver: Address;
|
|
142
|
+
tokens: TokenTransfer[];
|
|
143
|
+
optionalGasLimit: bigint;
|
|
144
|
+
functionName: string;
|
|
145
|
+
arguments: Uint8Array[];
|
|
146
|
+
constructor(data: any);
|
|
147
|
+
}
|
|
148
|
+
export declare class SendAsyncCall extends MultisigAction {
|
|
149
|
+
receiver: Address;
|
|
150
|
+
amount: bigint;
|
|
151
|
+
optionalGasLimit: bigint;
|
|
152
|
+
functionName: string;
|
|
153
|
+
arguments: Uint8Array[];
|
|
154
|
+
constructor(data: any);
|
|
155
|
+
}
|
|
156
|
+
export declare class SCDeployFromSource extends MultisigAction {
|
|
157
|
+
sourceContract: Address;
|
|
158
|
+
amount: bigint;
|
|
159
|
+
codeMetadata: CodeMetadata;
|
|
160
|
+
arguments: Uint8Array[];
|
|
161
|
+
constructor(data: any);
|
|
162
|
+
}
|
|
163
|
+
export declare class SCUpgradeFromSource extends MultisigAction {
|
|
164
|
+
sourceContract: Address;
|
|
165
|
+
destinationContract: Address;
|
|
166
|
+
amount: bigint;
|
|
167
|
+
codeMetadata: CodeMetadata;
|
|
168
|
+
arguments: Uint8Array[];
|
|
169
|
+
constructor(data: any);
|
|
170
|
+
}
|
|
171
|
+
export declare type CallActionData = {
|
|
172
|
+
receiver: Address;
|
|
173
|
+
amount: bigint;
|
|
174
|
+
optionalGasLimit?: number | null;
|
|
175
|
+
functionName: Uint8Array;
|
|
176
|
+
arguments: Uint8Array[];
|
|
177
|
+
};
|
|
178
|
+
export declare type DcdtTokenPayment = {
|
|
179
|
+
token_identifier: any;
|
|
180
|
+
token_nonce: any;
|
|
181
|
+
amount: any;
|
|
182
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SCUpgradeFromSource = exports.SCDeployFromSource = exports.SendAsyncCall = exports.SendTransferExecuteDcdt = exports.SendTransferExecuteRewa = exports.ChangeQuorum = exports.RemoveUser = exports.AddProposer = exports.AddBoardMember = exports.MultisigAction = exports.MultisigActionEnum = exports.UserRoleEnum = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
var UserRoleEnum;
|
|
6
|
+
(function (UserRoleEnum) {
|
|
7
|
+
UserRoleEnum["None"] = "None";
|
|
8
|
+
UserRoleEnum["Proposer"] = "Proposer";
|
|
9
|
+
UserRoleEnum["BoardMember"] = "BoardMember";
|
|
10
|
+
})(UserRoleEnum = exports.UserRoleEnum || (exports.UserRoleEnum = {}));
|
|
11
|
+
var MultisigActionEnum;
|
|
12
|
+
(function (MultisigActionEnum) {
|
|
13
|
+
MultisigActionEnum["Nothing"] = "Nothing";
|
|
14
|
+
MultisigActionEnum["AddBoardMember"] = "AddBoardMember";
|
|
15
|
+
MultisigActionEnum["AddProposer"] = "AddProposer";
|
|
16
|
+
MultisigActionEnum["RemoveUser"] = "RemoveUser";
|
|
17
|
+
MultisigActionEnum["ChangeQuorum"] = "ChangeQuorum";
|
|
18
|
+
MultisigActionEnum["SendTransferExecuteRewa"] = "SendTransferExecuteRewa";
|
|
19
|
+
MultisigActionEnum["SendTransferExecuteDcdt"] = "SendTransferExecuteDcdt";
|
|
20
|
+
MultisigActionEnum["SendAsyncCall"] = "SendAsyncCall";
|
|
21
|
+
MultisigActionEnum["SCDeployFromSource"] = "SCDeployFromSource";
|
|
22
|
+
MultisigActionEnum["SCUpgradeFromSource"] = "SCUpgradeFromSource";
|
|
23
|
+
})(MultisigActionEnum = exports.MultisigActionEnum || (exports.MultisigActionEnum = {}));
|
|
24
|
+
class MultisigAction {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.type = MultisigActionEnum.Nothing;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.MultisigAction = MultisigAction;
|
|
30
|
+
class AddBoardMember extends MultisigAction {
|
|
31
|
+
constructor(address) {
|
|
32
|
+
super();
|
|
33
|
+
this.type = MultisigActionEnum.AddBoardMember;
|
|
34
|
+
this.address = address;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.AddBoardMember = AddBoardMember;
|
|
38
|
+
class AddProposer extends MultisigAction {
|
|
39
|
+
constructor(address) {
|
|
40
|
+
super();
|
|
41
|
+
this.type = MultisigActionEnum.AddProposer;
|
|
42
|
+
this.address = address;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.AddProposer = AddProposer;
|
|
46
|
+
class RemoveUser extends MultisigAction {
|
|
47
|
+
constructor(address) {
|
|
48
|
+
super();
|
|
49
|
+
this.type = MultisigActionEnum.RemoveUser;
|
|
50
|
+
this.type = MultisigActionEnum.RemoveUser;
|
|
51
|
+
this.address = address;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.RemoveUser = RemoveUser;
|
|
55
|
+
class ChangeQuorum extends MultisigAction {
|
|
56
|
+
constructor(quorum) {
|
|
57
|
+
super();
|
|
58
|
+
this.type = MultisigActionEnum.ChangeQuorum;
|
|
59
|
+
this.quorum = quorum;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.ChangeQuorum = ChangeQuorum;
|
|
63
|
+
class SendTransferExecuteRewa extends MultisigAction {
|
|
64
|
+
constructor(data) {
|
|
65
|
+
super();
|
|
66
|
+
this.type = MultisigActionEnum.SendTransferExecuteRewa;
|
|
67
|
+
this.receiver = data.to;
|
|
68
|
+
this.amount = BigInt(data.rewa_amount?.toFixed() ?? 0);
|
|
69
|
+
this.optionalGasLimit = BigInt(data.opt_gas_limit?.toFixed() ?? 0);
|
|
70
|
+
this.functionName = data.endpoint_name?.toString() ?? "";
|
|
71
|
+
this.arguments = data.arguments ?? [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.SendTransferExecuteRewa = SendTransferExecuteRewa;
|
|
75
|
+
class SendTransferExecuteDcdt extends MultisigAction {
|
|
76
|
+
constructor(data) {
|
|
77
|
+
super();
|
|
78
|
+
this.type = MultisigActionEnum.SendTransferExecuteDcdt;
|
|
79
|
+
this.receiver = data.to;
|
|
80
|
+
this.tokens = data.tokens.map((token) => new core_1.TokenTransfer({
|
|
81
|
+
token: new core_1.Token({ identifier: token.token_identifier, nonce: token.nonce }),
|
|
82
|
+
amount: token.amount,
|
|
83
|
+
}));
|
|
84
|
+
this.optionalGasLimit = BigInt(data.opt_gas_limit?.toFixed() ?? 0);
|
|
85
|
+
this.functionName = Buffer.from(data.endpoint_name?.toString() ?? "", "hex").toString();
|
|
86
|
+
this.arguments = data.arguments ?? [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.SendTransferExecuteDcdt = SendTransferExecuteDcdt;
|
|
90
|
+
class SendAsyncCall extends MultisigAction {
|
|
91
|
+
constructor(data) {
|
|
92
|
+
super();
|
|
93
|
+
this.type = MultisigActionEnum.SendAsyncCall;
|
|
94
|
+
this.receiver = data.to;
|
|
95
|
+
this.amount = BigInt(data.rewa_amount?.toFixed() ?? 0);
|
|
96
|
+
this.optionalGasLimit = BigInt(data.opt_gas_limit?.toFixed() ?? 0);
|
|
97
|
+
this.functionName = data.endpoint_name.toString();
|
|
98
|
+
this.arguments = data.arguments ?? [];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.SendAsyncCall = SendAsyncCall;
|
|
102
|
+
class SCDeployFromSource extends MultisigAction {
|
|
103
|
+
constructor(data) {
|
|
104
|
+
super();
|
|
105
|
+
this.type = MultisigActionEnum.SCDeployFromSource;
|
|
106
|
+
this.sourceContract = data[1];
|
|
107
|
+
this.amount = data[0];
|
|
108
|
+
this.codeMetadata = data[2];
|
|
109
|
+
this.arguments = data[3];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.SCDeployFromSource = SCDeployFromSource;
|
|
113
|
+
class SCUpgradeFromSource extends MultisigAction {
|
|
114
|
+
constructor(data) {
|
|
115
|
+
super();
|
|
116
|
+
this.type = MultisigActionEnum.SCUpgradeFromSource;
|
|
117
|
+
this.destinationContract = data[0];
|
|
118
|
+
this.amount = data[1];
|
|
119
|
+
this.sourceContract = data[2];
|
|
120
|
+
this.codeMetadata = data[3];
|
|
121
|
+
this.arguments = data[4];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.SCUpgradeFromSource = SCUpgradeFromSource;
|
|
125
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/multisig/resources.ts"],"names":[],"mappings":";;;AACA,kCAA+C;AAwG/C,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,2CAA2B,CAAA;AAC/B,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC1B,yCAAmB,CAAA;IACnB,uDAAiC,CAAA;IACjC,iDAA2B,CAAA;IAC3B,+CAAyB,CAAA;IACzB,mDAA6B,CAAA;IAC7B,yEAAmD,CAAA;IACnD,yEAAmD,CAAA;IACnD,qDAA+B,CAAA;IAC/B,+DAAyC,CAAA;IACzC,iEAA2C,CAAA;AAC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,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACJ;AAhBD,kDAgBC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Address } from "../core/address";
|
|
2
|
+
import { AccountOnNetwork } from "./accounts";
|
|
3
|
+
interface IAccountFetcher {
|
|
4
|
+
getAccount(address: Address): Promise<AccountOnNetwork>;
|
|
5
|
+
}
|
|
6
|
+
export declare class AccountAwaiter {
|
|
7
|
+
private readonly fetcher;
|
|
8
|
+
private readonly pollingIntervalInMilliseconds;
|
|
9
|
+
private readonly timeoutIntervalInMilliseconds;
|
|
10
|
+
private readonly patienceTimeInMilliseconds;
|
|
11
|
+
/**
|
|
12
|
+
* AccountAwaiter allows one to await until a specific event occurs on a given address.
|
|
13
|
+
*
|
|
14
|
+
* @param fetcher - Used to fetch the account of the network.
|
|
15
|
+
* @param pollingIntervalInMilliseconds - The polling interval, in milliseconds.
|
|
16
|
+
* @param timeoutIntervalInMilliseconds - The timeout, in milliseconds.
|
|
17
|
+
* @param patienceTimeInMilliseconds - The patience, an extra time (in milliseconds) to wait, after the account has reached its desired condition.
|
|
18
|
+
*/
|
|
19
|
+
constructor(options: {
|
|
20
|
+
fetcher: IAccountFetcher;
|
|
21
|
+
pollingIntervalInMilliseconds?: number;
|
|
22
|
+
timeoutIntervalInMilliseconds?: number;
|
|
23
|
+
patienceTimeInMilliseconds?: number;
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Waits until the condition is satisfied.
|
|
27
|
+
*
|
|
28
|
+
* @param address - The address to monitor.
|
|
29
|
+
* @param condition - A callable that evaluates the desired condition.
|
|
30
|
+
*/
|
|
31
|
+
awaitOnCondition(address: Address, condition: (account: AccountOnNetwork) => boolean): Promise<AccountOnNetwork>;
|
|
32
|
+
private awaitConditionally;
|
|
33
|
+
private _sleep;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountAwaiter = void 0;
|
|
4
|
+
const errors_1 = require("../core/errors");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
class AccountAwaiter {
|
|
7
|
+
/**
|
|
8
|
+
* AccountAwaiter allows one to await until a specific event occurs on a given address.
|
|
9
|
+
*
|
|
10
|
+
* @param fetcher - Used to fetch the account of the network.
|
|
11
|
+
* @param pollingIntervalInMilliseconds - The polling interval, in milliseconds.
|
|
12
|
+
* @param timeoutIntervalInMilliseconds - The timeout, in milliseconds.
|
|
13
|
+
* @param patienceTimeInMilliseconds - The patience, an extra time (in milliseconds) to wait, after the account has reached its desired condition.
|
|
14
|
+
*/
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.fetcher = options.fetcher;
|
|
17
|
+
this.pollingIntervalInMilliseconds =
|
|
18
|
+
options.pollingIntervalInMilliseconds ?? constants_1.DEFAULT_ACCOUNT_AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS;
|
|
19
|
+
this.timeoutIntervalInMilliseconds =
|
|
20
|
+
options.timeoutIntervalInMilliseconds ?? constants_1.DEFAULT_ACCOUNT_AWAITING_TIMEOUT_IN_MILLISECONDS;
|
|
21
|
+
this.patienceTimeInMilliseconds =
|
|
22
|
+
options.patienceTimeInMilliseconds ?? constants_1.DEFAULT_ACCOUNT_AWAITING_PATIENCE_IN_MILLISECONDS;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Waits until the condition is satisfied.
|
|
26
|
+
*
|
|
27
|
+
* @param address - The address to monitor.
|
|
28
|
+
* @param condition - A callable that evaluates the desired condition.
|
|
29
|
+
*/
|
|
30
|
+
async awaitOnCondition(address, condition) {
|
|
31
|
+
const doFetch = async () => await this.fetcher.getAccount(address);
|
|
32
|
+
return this.awaitConditionally(condition, doFetch, new errors_1.ExpectedAccountConditionNotReachedError());
|
|
33
|
+
}
|
|
34
|
+
async awaitConditionally(isSatisfied, doFetch, error) {
|
|
35
|
+
let isConditionSatisfied = false;
|
|
36
|
+
let fetchedData = null;
|
|
37
|
+
const maxNumberOfRetries = Math.floor(this.timeoutIntervalInMilliseconds / this.pollingIntervalInMilliseconds);
|
|
38
|
+
let numberOfRetries = 0;
|
|
39
|
+
while (numberOfRetries < maxNumberOfRetries) {
|
|
40
|
+
try {
|
|
41
|
+
fetchedData = await doFetch();
|
|
42
|
+
isConditionSatisfied = isSatisfied(fetchedData);
|
|
43
|
+
if (isConditionSatisfied) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (ex) {
|
|
48
|
+
throw ex;
|
|
49
|
+
}
|
|
50
|
+
numberOfRetries += 1;
|
|
51
|
+
await this._sleep(this.pollingIntervalInMilliseconds);
|
|
52
|
+
}
|
|
53
|
+
if (!fetchedData || !isConditionSatisfied) {
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
if (this.patienceTimeInMilliseconds) {
|
|
57
|
+
await this._sleep(this.patienceTimeInMilliseconds);
|
|
58
|
+
return doFetch();
|
|
59
|
+
}
|
|
60
|
+
return fetchedData;
|
|
61
|
+
}
|
|
62
|
+
async _sleep(milliseconds) {
|
|
63
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.AccountAwaiter = AccountAwaiter;
|
|
67
|
+
//# sourceMappingURL=accountAwaiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountAwaiter.js","sourceRoot":"","sources":["../../src/networkProviders/accountAwaiter.ts"],"names":[],"mappings":";;;AACA,2CAAyE;AAEzE,2CAIqB;AAMrB,MAAa,cAAc;IAMvB;;;;;;;OAOG;IACH,YAAY,OAKX;QACG,IA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AC,WAAW,IAAI,CAAC,oBAAoB,EAAE;YACvC,MAAM,KAAK,CAAC;SACf;QAED,IAAI,IAAI,CAAC,0BAA0B,EAAE;YACjC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;YACnD,OAAO,OAAO,EAAE,CAAC;SACpB;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,MAAM,CAAC,YAAoB;QACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ;AA1FD,wCA0FC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Address } from "../core";
|
|
2
|
+
import { BlockCoordinates } from "./blocks";
|
|
3
|
+
/**
|
|
4
|
+
* A plain view of an account, as queried from the Network.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AccountOnNetwork {
|
|
7
|
+
address: Address;
|
|
8
|
+
nonce: bigint;
|
|
9
|
+
balance: bigint;
|
|
10
|
+
userName: string;
|
|
11
|
+
contractCodeHash?: string;
|
|
12
|
+
contractCode?: Uint8Array;
|
|
13
|
+
contractDeveloperReward?: bigint;
|
|
14
|
+
contractOwnerAddress?: Address;
|
|
15
|
+
isContractUpgradable?: boolean;
|
|
16
|
+
isContractReadable?: boolean;
|
|
17
|
+
isContractPayable?: boolean;
|
|
18
|
+
isContractPayableByContract?: boolean;
|
|
19
|
+
isGuarded: boolean;
|
|
20
|
+
constructor(init?: Partial<AccountOnNetwork>);
|
|
21
|
+
static fromApiHttpResponse(payload: any): AccountOnNetwork;
|
|
22
|
+
static fromProxyHttpResponse(payload: any): AccountOnNetwork;
|
|
23
|
+
}
|
|
24
|
+
export declare class GuardianData {
|
|
25
|
+
guarded: boolean;
|
|
26
|
+
activeGuardian?: Guardian;
|
|
27
|
+
pendingGuardian?: Guardian;
|
|
28
|
+
constructor(init?: Partial<GuardianData>);
|
|
29
|
+
static fromHttpResponse(response: any): GuardianData;
|
|
30
|
+
getCurrentGuardianAddress(): Address | undefined;
|
|
31
|
+
}
|
|
32
|
+
export declare class Guardian {
|
|
33
|
+
activationEpoch: number;
|
|
34
|
+
address: Address;
|
|
35
|
+
serviceUID: string;
|
|
36
|
+
static fromHttpResponse(responsePart: any): Guardian;
|
|
37
|
+
}
|
|
38
|
+
export declare class AccountStorageEntry {
|
|
39
|
+
raw: Record<string, any>;
|
|
40
|
+
address: Address;
|
|
41
|
+
key: string;
|
|
42
|
+
value: string;
|
|
43
|
+
constructor(init?: Partial<AccountStorageEntry>);
|
|
44
|
+
static fromHttpResponse(payload: any, key: string): AccountStorageEntry;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A plain view of an account storage.
|
|
48
|
+
*/
|
|
49
|
+
export declare class AccountStorage {
|
|
50
|
+
raw: Record<string, any>;
|
|
51
|
+
blockCoordinates: BlockCoordinates;
|
|
52
|
+
entries: AccountStorageEntry[];
|
|
53
|
+
constructor(init?: Partial<AccountStorage>);
|
|
54
|
+
static fromHttpResponse(payload: any): AccountStorage;
|
|
55
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountStorage = exports.AccountStorageEntry = exports.Guardian = exports.GuardianData = exports.AccountOnNetwork = void 0;
|
|
4
|
+
const abi_1 = require("../abi");
|
|
5
|
+
const core_1 = require("../core");
|
|
6
|
+
const blocks_1 = require("./blocks");
|
|
7
|
+
/**
|
|
8
|
+
* A plain view of an account, as queried from the Network.
|
|
9
|
+
*/
|
|
10
|
+
class AccountOnNetwork {
|
|
11
|
+
constructor(init) {
|
|
12
|
+
this.address = core_1.Address.empty();
|
|
13
|
+
this.nonce = 0n;
|
|
14
|
+
this.balance = 0n;
|
|
15
|
+
this.userName = "";
|
|
16
|
+
this.isGuarded = false;
|
|
17
|
+
Object.assign(this, init);
|
|
18
|
+
}
|
|
19
|
+
static fromApiHttpResponse(payload) {
|
|
20
|
+
const result = new AccountOnNetwork();
|
|
21
|
+
result.address = payload["address"] ? core_1.Address.newFromBech32(payload["address"]) : core_1.Address.empty();
|
|
22
|
+
result.nonce = BigInt(payload["nonce"] || 0);
|
|
23
|
+
result.balance = BigInt(payload["balance"] || 0);
|
|
24
|
+
result.userName = payload["username"] || undefined;
|
|
25
|
+
result.contractCodeHash = payload["codeHash"] || "";
|
|
26
|
+
result.contractCode = Buffer.from(payload["code"] || "");
|
|
27
|
+
result.contractDeveloperReward = payload["developerReward"] || 0n;
|
|
28
|
+
result.contractOwnerAddress = payload["ownerAddress"]
|
|
29
|
+
? core_1.Address.newFromBech32(payload["ownerAddress"])
|
|
30
|
+
: undefined;
|
|
31
|
+
result.isContractUpgradable = Boolean(payload["isUpgradeable"]);
|
|
32
|
+
result.isContractReadable = Boolean(payload["isReadable"]);
|
|
33
|
+
result.isContractPayable = Boolean(payload["isPayable"]);
|
|
34
|
+
result.isContractPayableByContract = Boolean(payload["isPayableBySmartContract"]);
|
|
35
|
+
result.isGuarded = Boolean(payload["isGuarded"]);
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
static fromProxyHttpResponse(payload) {
|
|
39
|
+
const result = new AccountOnNetwork();
|
|
40
|
+
result.address = payload["address"] ? core_1.Address.newFromBech32(payload["address"]) : core_1.Address.empty();
|
|
41
|
+
result.nonce = BigInt(payload["nonce"] || 0);
|
|
42
|
+
result.balance = BigInt(payload["balance"] || 0);
|
|
43
|
+
result.userName = payload["username"] || undefined;
|
|
44
|
+
const codeMetadata = payload["codeMetadata"] ?? null;
|
|
45
|
+
result.isContractUpgradable = false;
|
|
46
|
+
result.isContractReadable = false;
|
|
47
|
+
result.isContractPayable = false;
|
|
48
|
+
result.isContractPayableByContract = false;
|
|
49
|
+
if (codeMetadata) {
|
|
50
|
+
const metadataBuffer = Buffer.from(codeMetadata, "base64");
|
|
51
|
+
const metadata = core_1.CodeMetadata.newFromBytes(metadataBuffer);
|
|
52
|
+
result.isContractUpgradable = metadata.upgradeable;
|
|
53
|
+
result.isContractReadable = metadata.readable;
|
|
54
|
+
result.isContractPayable = metadata.payable;
|
|
55
|
+
result.isContractPayableByContract = metadata.payableBySc;
|
|
56
|
+
}
|
|
57
|
+
result.contractCodeHash = payload["codeHash"] || "";
|
|
58
|
+
result.contractCode = Buffer.from(payload["code"] || "");
|
|
59
|
+
result.contractDeveloperReward = payload["developerReward"] || 0n;
|
|
60
|
+
result.contractOwnerAddress = payload["ownerAddress"]
|
|
61
|
+
? core_1.Address.newFromBech32(payload["ownerAddress"])
|
|
62
|
+
: undefined;
|
|
63
|
+
result.isGuarded = Boolean(payload["isGuarded"]);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.AccountOnNetwork = AccountOnNetwork;
|
|
68
|
+
class GuardianData {
|
|
69
|
+
constructor(init) {
|
|
70
|
+
this.guarded = false;
|
|
71
|
+
Object.assign(this, init);
|
|
72
|
+
}
|
|
73
|
+
static fromHttpResponse(response) {
|
|
74
|
+
const result = new GuardianData();
|
|
75
|
+
result.guarded = response["guarded"] || false;
|
|
76
|
+
if (response["activeGuardian"]) {
|
|
77
|
+
result.activeGuardian = Guardian.fromHttpResponse(response["activeGuardian"]);
|
|
78
|
+
}
|
|
79
|
+
if (response["pendingGuardian"]) {
|
|
80
|
+
result.pendingGuardian = Guardian.fromHttpResponse(response["pendingGuardian"]);
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
getCurrentGuardianAddress() {
|
|
85
|
+
if (!this.guarded) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
return this.activeGuardian?.address;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.GuardianData = GuardianData;
|
|
92
|
+
class Guardian {
|
|
93
|
+
constructor() {
|
|
94
|
+
this.activationEpoch = 0;
|
|
95
|
+
this.address = core_1.Address.empty();
|
|
96
|
+
this.serviceUID = "";
|
|
97
|
+
}
|
|
98
|
+
static fromHttpResponse(responsePart) {
|
|
99
|
+
const result = new Guardian();
|
|
100
|
+
result.activationEpoch = Number(responsePart["activationEpoch"] || 0);
|
|
101
|
+
result.address = core_1.Address.newFromBech32(responsePart["address"] || "");
|
|
102
|
+
result.serviceUID = responsePart["serviceUID"] || "";
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.Guardian = Guardian;
|
|
107
|
+
class AccountStorageEntry {
|
|
108
|
+
constructor(init) {
|
|
109
|
+
this.raw = {};
|
|
110
|
+
this.address = core_1.Address.empty();
|
|
111
|
+
this.key = "";
|
|
112
|
+
this.value = "";
|
|
113
|
+
Object.assign(this, init);
|
|
114
|
+
}
|
|
115
|
+
static fromHttpResponse(payload, key) {
|
|
116
|
+
const result = new AccountStorageEntry();
|
|
117
|
+
const value = payload["value"] || "";
|
|
118
|
+
result.raw = payload;
|
|
119
|
+
result.key = key;
|
|
120
|
+
result.value = abi_1.BytesValue.fromHex(value).toString();
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.AccountStorageEntry = AccountStorageEntry;
|
|
125
|
+
/**
|
|
126
|
+
* A plain view of an account storage.
|
|
127
|
+
*/
|
|
128
|
+
class AccountStorage {
|
|
129
|
+
constructor(init) {
|
|
130
|
+
this.raw = {};
|
|
131
|
+
this.entries = [];
|
|
132
|
+
Object.assign(this, init);
|
|
133
|
+
}
|
|
134
|
+
static fromHttpResponse(payload) {
|
|
135
|
+
let result = new AccountStorage();
|
|
136
|
+
const pairs = payload["pairs"] || {};
|
|
137
|
+
const entries = Object.entries(pairs).map(([key, value]) => {
|
|
138
|
+
const decodedKey = Buffer.from(key, "hex").toString("utf8");
|
|
139
|
+
const val = value ? value.toString() : "";
|
|
140
|
+
const decodedValue = Buffer.from(val).toString();
|
|
141
|
+
return new AccountStorageEntry({
|
|
142
|
+
raw: { [key]: value },
|
|
143
|
+
key: decodedKey,
|
|
144
|
+
value: decodedValue,
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
result.raw = payload;
|
|
148
|
+
result.entries = entries;
|
|
149
|
+
result.blockCoordinates = blocks_1.BlockCoordinates.fromHttpResponse(payload);
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.AccountStorage = AccountStorage;
|
|
154
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/networkProviders/accounts.ts"],"names":[],"mappings":";;;AAAA,gCAAoC;AACpC,kCAAgD;AAChD,qCAA4C;AAE5C;;GAEG;AACH,MAAa,gBAAgB;IAkBzB,YAAY,IAAgC;QAjB5C,YAAO,GAAY,cAAO,CAAC,KAAK,EAAE,CAAC;QACnC,UAAK,GAAW,EAAE,CAAC;QACnB,YAAO,GAAW,EAAE,CAAC;QACrB,aAAQ,GAAW,EAAE,CAAC;QAYtB,cAAS,GAAY,KAAK,CAAC;QAGvB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,OAAY;QACnC,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAEtC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,cAAO,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,cAAO,CAAC,KAAK,EAAE,CAAC;QAClG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,Q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