@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,48 @@
|
|
|
1
|
+
import { Address, SmartContractQuery, SmartContractQueryResponse, Token, Transaction, TransactionOnNetwork, TransactionStatus } from "../core";
|
|
2
|
+
import { AccountOnNetwork, AccountStorage, AccountStorageEntry } from "./accounts";
|
|
3
|
+
import { BlockOnNetwork } from "./blocks";
|
|
4
|
+
import { INetworkProvider, IPagination } from "./interface";
|
|
5
|
+
import { NetworkConfig } from "./networkConfig";
|
|
6
|
+
import { NetworkProviderConfig } from "./networkProviderConfig";
|
|
7
|
+
import { NetworkStatus } from "./networkStatus";
|
|
8
|
+
import { AwaitingOptions, TransactionCostResponse } from "./resources";
|
|
9
|
+
import { DefinitionOfFungibleTokenOnNetwork, DefinitionOfTokenCollectionOnNetwork } from "./tokenDefinitions";
|
|
10
|
+
import { TokenAmountOnNetwork } from "./tokens";
|
|
11
|
+
export declare class ApiNetworkProvider implements INetworkProvider {
|
|
12
|
+
private url;
|
|
13
|
+
private config;
|
|
14
|
+
private backingProxyNetworkProvider;
|
|
15
|
+
private userAgentPrefix;
|
|
16
|
+
private axios;
|
|
17
|
+
constructor(url: string, config?: NetworkProviderConfig);
|
|
18
|
+
private getProxyConfig;
|
|
19
|
+
getNetworkConfig(): Promise<NetworkConfig>;
|
|
20
|
+
getNetworkStatus(shard?: number): Promise<NetworkStatus>;
|
|
21
|
+
getBlock(blockHash: string): Promise<BlockOnNetwork>;
|
|
22
|
+
getLatestBlock(): Promise<BlockOnNetwork>;
|
|
23
|
+
getAccount(address: Address): Promise<AccountOnNetwork>;
|
|
24
|
+
getAccountStorage(address: Address): Promise<AccountStorage>;
|
|
25
|
+
getAccountStorageEntry(address: Address, entryKey: string): Promise<AccountStorageEntry>;
|
|
26
|
+
awaitAccountOnCondition(address: Address, condition: (account: AccountOnNetwork) => boolean, options?: AwaitingOptions): Promise<AccountOnNetwork>;
|
|
27
|
+
sendTransaction(tx: Transaction): Promise<string>;
|
|
28
|
+
simulateTransaction(tx: Transaction, checkSignature?: boolean): Promise<any>;
|
|
29
|
+
estimateTransactionCost(tx: Transaction): Promise<TransactionCostResponse>;
|
|
30
|
+
sendTransactions(txs: Transaction[]): Promise<[number, string[]]>;
|
|
31
|
+
getTransaction(txHash: string): Promise<TransactionOnNetwork>;
|
|
32
|
+
getTransactions(address: Address): Promise<TransactionOnNetwork[]>;
|
|
33
|
+
getTransactionStatus(txHash: string): Promise<TransactionStatus>;
|
|
34
|
+
awaitTransactionOnCondition(transactionHash: string, condition: (account: TransactionOnNetwork) => boolean, options?: AwaitingOptions): Promise<TransactionOnNetwork>;
|
|
35
|
+
awaitTransactionCompleted(transactionHash: string, options?: AwaitingOptions): Promise<TransactionOnNetwork>;
|
|
36
|
+
getTokenOfAccount(address: Address, token: Token): Promise<TokenAmountOnNetwork>;
|
|
37
|
+
getFungibleTokensOfAccount(address: Address, pagination?: IPagination): Promise<TokenAmountOnNetwork[]>;
|
|
38
|
+
getNonFungibleTokensOfAccount(address: Address, pagination?: IPagination): Promise<TokenAmountOnNetwork[]>;
|
|
39
|
+
getDefinitionOfFungibleToken(tokenIdentifier: string): Promise<DefinitionOfFungibleTokenOnNetwork>;
|
|
40
|
+
getDefinitionOfTokenCollection(collection: string): Promise<DefinitionOfTokenCollectionOnNetwork>;
|
|
41
|
+
queryContract(query: SmartContractQuery): Promise<SmartContractQueryResponse>;
|
|
42
|
+
doGetGeneric(resourceUrl: string): Promise<any>;
|
|
43
|
+
doPostGeneric(resourceUrl: string, payload: any): Promise<any>;
|
|
44
|
+
private buildPaginationParams;
|
|
45
|
+
private doGet;
|
|
46
|
+
private doPost;
|
|
47
|
+
private handleApiError;
|
|
48
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiNetworkProvider = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const constants_1 = require("../core/constants");
|
|
6
|
+
const accountAwaiter_1 = require("./accountAwaiter");
|
|
7
|
+
const accounts_1 = require("./accounts");
|
|
8
|
+
const blocks_1 = require("./blocks");
|
|
9
|
+
const config_1 = require("./config");
|
|
10
|
+
const constants_2 = require("./constants");
|
|
11
|
+
const contractQueryRequest_1 = require("./contractQueryRequest");
|
|
12
|
+
const proxyNetworkProvider_1 = require("./proxyNetworkProvider");
|
|
13
|
+
const resources_1 = require("./resources");
|
|
14
|
+
const tokenDefinitions_1 = require("./tokenDefinitions");
|
|
15
|
+
const tokens_1 = require("./tokens");
|
|
16
|
+
const userAgent_1 = require("./userAgent");
|
|
17
|
+
// TODO: Find & remove duplicate code between "ProxyNetworkProvider" and "ApiNetworkProvider".
|
|
18
|
+
class ApiNetworkProvider {
|
|
19
|
+
constructor(url, config) {
|
|
20
|
+
this.userAgentPrefix = `${constants_2.BaseUserAgent}/api`;
|
|
21
|
+
this.url = url;
|
|
22
|
+
const proxyConfig = this.getProxyConfig(config);
|
|
23
|
+
this.config = { ...config_1.defaultAxiosConfig, ...config };
|
|
24
|
+
this.backingProxyNetworkProvider = new proxyNetworkProvider_1.ProxyNetworkProvider(url, proxyConfig);
|
|
25
|
+
this.axios = core_1.getAxios();
|
|
26
|
+
userAgent_1.extendUserAgentIfBackend(this.userAgentPrefix, this.config);
|
|
27
|
+
}
|
|
28
|
+
getProxyConfig(config) {
|
|
29
|
+
let proxyConfig = JSON.parse(JSON.stringify(config || {}));
|
|
30
|
+
proxyConfig = { ...config_1.defaultAxiosConfig, ...proxyConfig };
|
|
31
|
+
return proxyConfig;
|
|
32
|
+
}
|
|
33
|
+
async getNetworkConfig() {
|
|
34
|
+
return await this.backingProxyNetworkProvider.getNetworkConfig();
|
|
35
|
+
}
|
|
36
|
+
async getNetworkStatus(shard = constants_1.METACHAIN_ID) {
|
|
37
|
+
return await this.backingProxyNetworkProvider.getNetworkStatus(shard);
|
|
38
|
+
}
|
|
39
|
+
async getBlock(blockHash) {
|
|
40
|
+
const response = await this.doGetGeneric(`blocks/${blockHash}`);
|
|
41
|
+
return blocks_1.BlockOnNetwork.fromHttpResponse(response);
|
|
42
|
+
}
|
|
43
|
+
async getLatestBlock() {
|
|
44
|
+
const response = await this.doGetGeneric("blocks/latest");
|
|
45
|
+
return blocks_1.BlockOnNetwork.fromHttpResponse(response);
|
|
46
|
+
}
|
|
47
|
+
async getAccount(address) {
|
|
48
|
+
const response = await this.doGetGeneric(`accounts/${address.toBech32()}`);
|
|
49
|
+
const account = accounts_1.AccountOnNetwork.fromApiHttpResponse(response);
|
|
50
|
+
return account;
|
|
51
|
+
}
|
|
52
|
+
async getAccountStorage(address) {
|
|
53
|
+
const response = await this.doGetGeneric(`address/${address.toBech32()}/keys`);
|
|
54
|
+
const account = accounts_1.AccountStorage.fromHttpResponse(response.data);
|
|
55
|
+
return account;
|
|
56
|
+
}
|
|
57
|
+
async getAccountStorageEntry(address, entryKey) {
|
|
58
|
+
const keyAsHex = Buffer.from(entryKey).toString("hex");
|
|
59
|
+
const response = await this.doGetGeneric(`address/${address.toBech32()}/key/${keyAsHex}`);
|
|
60
|
+
const account = accounts_1.AccountStorageEntry.fromHttpResponse(response.data, entryKey);
|
|
61
|
+
return account;
|
|
62
|
+
}
|
|
63
|
+
async awaitAccountOnCondition(address, condition, options) {
|
|
64
|
+
if (!options) {
|
|
65
|
+
options = new resources_1.AwaitingOptions();
|
|
66
|
+
}
|
|
67
|
+
const awaiter = new accountAwaiter_1.AccountAwaiter({
|
|
68
|
+
fetcher: this,
|
|
69
|
+
patienceTimeInMilliseconds: options.patienceInMilliseconds,
|
|
70
|
+
pollingIntervalInMilliseconds: options.pollingIntervalInMilliseconds,
|
|
71
|
+
timeoutIntervalInMilliseconds: options.timeoutInMilliseconds,
|
|
72
|
+
});
|
|
73
|
+
return await awaiter.awaitOnCondition(address, condition);
|
|
74
|
+
}
|
|
75
|
+
async sendTransaction(tx) {
|
|
76
|
+
const transaction = core_1.prepareTransactionForBroadcasting(tx);
|
|
77
|
+
const response = await this.doPostGeneric("transactions", transaction);
|
|
78
|
+
return response.txHash;
|
|
79
|
+
}
|
|
80
|
+
async simulateTransaction(tx, checkSignature = false) {
|
|
81
|
+
const transaction = core_1.prepareTransactionForBroadcasting(tx);
|
|
82
|
+
let url = "transaction/simulate?checkSignature=false";
|
|
83
|
+
if (checkSignature) {
|
|
84
|
+
url = "transaction/simulate";
|
|
85
|
+
}
|
|
86
|
+
const response = await this.doPostGeneric(url, transaction);
|
|
87
|
+
const data = response["data"] ?? {};
|
|
88
|
+
return core_1.TransactionOnNetwork.fromSimulateResponse(transaction, data["result"] ?? {});
|
|
89
|
+
}
|
|
90
|
+
async estimateTransactionCost(tx) {
|
|
91
|
+
const transaction = core_1.prepareTransactionForBroadcasting(tx);
|
|
92
|
+
const response = await this.doPostGeneric("transaction/cost", transaction);
|
|
93
|
+
return resources_1.TransactionCostResponse.fromHttpResponse(response.data);
|
|
94
|
+
}
|
|
95
|
+
async sendTransactions(txs) {
|
|
96
|
+
const data = txs.map((tx) => core_1.prepareTransactionForBroadcasting(tx));
|
|
97
|
+
const response = await this.doPostGeneric("transaction/send-multiple", data);
|
|
98
|
+
const numSent = Number(response.data["numOfSentTxs"] ?? 0);
|
|
99
|
+
const hashes = Array(txs.length).fill(null);
|
|
100
|
+
for (let i = 0; i < txs.length; i++) {
|
|
101
|
+
hashes[i] = response.data.txsHashes[i.toString()] || null;
|
|
102
|
+
}
|
|
103
|
+
return [numSent, hashes];
|
|
104
|
+
}
|
|
105
|
+
async getTransaction(txHash) {
|
|
106
|
+
const response = await this.doGetGeneric(`transactions/${txHash}`);
|
|
107
|
+
const transaction = core_1.TransactionOnNetwork.fromApiHttpResponse(txHash, response);
|
|
108
|
+
return transaction;
|
|
109
|
+
}
|
|
110
|
+
async getTransactions(address) {
|
|
111
|
+
const response = await this.doGetGeneric(`accounts/${address.toBech32()}/transactions`);
|
|
112
|
+
const transactions = response.map((item) => core_1.TransactionOnNetwork.fromApiHttpResponse(item.txHash, item));
|
|
113
|
+
return transactions;
|
|
114
|
+
}
|
|
115
|
+
async getTransactionStatus(txHash) {
|
|
116
|
+
const response = await this.doGetGeneric(`transactions/${txHash}?fields=status`);
|
|
117
|
+
const status = new core_1.TransactionStatus(response.status);
|
|
118
|
+
return status;
|
|
119
|
+
}
|
|
120
|
+
async awaitTransactionOnCondition(transactionHash, condition, options) {
|
|
121
|
+
if (!options) {
|
|
122
|
+
options = new resources_1.AwaitingOptions();
|
|
123
|
+
}
|
|
124
|
+
const awaiter = new core_1.TransactionWatcher(this, {
|
|
125
|
+
patienceMilliseconds: options.patienceInMilliseconds,
|
|
126
|
+
pollingIntervalMilliseconds: options.pollingIntervalInMilliseconds,
|
|
127
|
+
timeoutMilliseconds: options.timeoutInMilliseconds,
|
|
128
|
+
});
|
|
129
|
+
return await awaiter.awaitOnCondition(transactionHash, condition);
|
|
130
|
+
}
|
|
131
|
+
async awaitTransactionCompleted(transactionHash, options) {
|
|
132
|
+
if (!options) {
|
|
133
|
+
options = new resources_1.AwaitingOptions();
|
|
134
|
+
}
|
|
135
|
+
const awaiter = new core_1.TransactionWatcher(this, {
|
|
136
|
+
patienceMilliseconds: options.patienceInMilliseconds,
|
|
137
|
+
pollingIntervalMilliseconds: options.pollingIntervalInMilliseconds,
|
|
138
|
+
timeoutMilliseconds: options.timeoutInMilliseconds,
|
|
139
|
+
});
|
|
140
|
+
return await awaiter.awaitCompleted(transactionHash);
|
|
141
|
+
}
|
|
142
|
+
async getTokenOfAccount(address, token) {
|
|
143
|
+
let response;
|
|
144
|
+
if (token.nonce === 0n) {
|
|
145
|
+
response = await this.doGetGeneric(`accounts/${address.toBech32()}/tokens/${token.identifier}`);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
const identifier = new core_1.TokenComputer().computeExtendedIdentifier(token);
|
|
149
|
+
response = await this.doGetGeneric(`accounts/${address.toBech32()}/nfts/${identifier}`);
|
|
150
|
+
}
|
|
151
|
+
return tokens_1.TokenAmountOnNetwork.fromApiResponse(response);
|
|
152
|
+
}
|
|
153
|
+
async getFungibleTokensOfAccount(address, pagination) {
|
|
154
|
+
pagination = pagination || config_1.defaultPagination;
|
|
155
|
+
const url = `accounts/${address.toBech32()}/tokens?${this.buildPaginationParams(pagination)}`;
|
|
156
|
+
const response = await this.doGetGeneric(url);
|
|
157
|
+
const tokens = response.map((item) => tokens_1.TokenAmountOnNetwork.fromApiResponse(item));
|
|
158
|
+
return tokens;
|
|
159
|
+
}
|
|
160
|
+
async getNonFungibleTokensOfAccount(address, pagination) {
|
|
161
|
+
pagination = pagination || config_1.defaultPagination;
|
|
162
|
+
const url = `accounts/${address.toBech32()}/nfts?${this.buildPaginationParams(pagination)}`;
|
|
163
|
+
const response = await this.doGetGeneric(url);
|
|
164
|
+
const tokens = response.map((item) => tokens_1.TokenAmountOnNetwork.fromApiResponse(item));
|
|
165
|
+
return tokens;
|
|
166
|
+
}
|
|
167
|
+
async getDefinitionOfFungibleToken(tokenIdentifier) {
|
|
168
|
+
const response = await this.doGetGeneric(`tokens/${tokenIdentifier}`);
|
|
169
|
+
const definition = tokenDefinitions_1.DefinitionOfFungibleTokenOnNetwork.fromApiHttpResponse(response);
|
|
170
|
+
return definition;
|
|
171
|
+
}
|
|
172
|
+
async getDefinitionOfTokenCollection(collection) {
|
|
173
|
+
const response = await this.doGetGeneric(`collections/${collection}`);
|
|
174
|
+
const definition = tokenDefinitions_1.DefinitionOfTokenCollectionOnNetwork.fromApiHttpResponse(response);
|
|
175
|
+
return definition;
|
|
176
|
+
}
|
|
177
|
+
async queryContract(query) {
|
|
178
|
+
try {
|
|
179
|
+
const request = new contractQueryRequest_1.ContractQueryRequest(query).toHttpRequest();
|
|
180
|
+
const response = await this.doPostGeneric("query", request);
|
|
181
|
+
return core_1.SmartContractQueryResponse.fromHttpResponse(response, query.function);
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
throw new core_1.ErrContractQuery(error);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async doGetGeneric(resourceUrl) {
|
|
188
|
+
const response = await this.doGet(resourceUrl);
|
|
189
|
+
return response;
|
|
190
|
+
}
|
|
191
|
+
async doPostGeneric(resourceUrl, payload) {
|
|
192
|
+
const response = await this.doPost(resourceUrl, payload);
|
|
193
|
+
return response;
|
|
194
|
+
}
|
|
195
|
+
buildPaginationParams(pagination) {
|
|
196
|
+
return `from=${pagination.from}&size=${pagination.size}`;
|
|
197
|
+
}
|
|
198
|
+
async doGet(resourceUrl) {
|
|
199
|
+
const url = `${this.url}/${resourceUrl}`;
|
|
200
|
+
try {
|
|
201
|
+
const response = await this.axios.default.get(url, this.config);
|
|
202
|
+
return response.data;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
this.handleApiError(error, resourceUrl);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
async doPost(resourceUrl, payload) {
|
|
209
|
+
const url = `${this.url}/${resourceUrl}`;
|
|
210
|
+
try {
|
|
211
|
+
const response = await this.axios.default.post(url, payload, {
|
|
212
|
+
...this.config,
|
|
213
|
+
headers: {
|
|
214
|
+
"Content-Type": "application/json",
|
|
215
|
+
...this.config.headers,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
const responsePayload = response.data;
|
|
219
|
+
return responsePayload;
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
this.handleApiError(error, resourceUrl);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
handleApiError(error, resourceUrl) {
|
|
226
|
+
if (!error.response) {
|
|
227
|
+
throw new core_1.ErrNetworkProvider(resourceUrl, error.toString(), error);
|
|
228
|
+
}
|
|
229
|
+
const errorData = error.response.data;
|
|
230
|
+
const originalErrorMessage = errorData.message || errorData.error || JSON.stringify(errorData);
|
|
231
|
+
throw new core_1.ErrNetworkProvider(resourceUrl, originalErrorMessage, error);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.ApiNetworkProvider = ApiNetworkProvider;
|
|
235
|
+
//# sourceMappingURL=apiNetworkProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiNetworkProvider.js","sourceRoot":"","sources":["../../src/networkProviders/apiNetworkProvider.ts"],"names":[],"mappings":";;;AAAA,kCAciB;AACjB,iDAAiD;AACjD,qDAAkD;AAClD,yCAAmF;AACnF,qCAA0C;AAC1C,qCAAiE;AACjE,2CAA4C;AAC5C,iEAA8D;AAK9D,iEAA8D;AAC9D,2CAAuE;AACvE,yDAA8G;AAC9G,qCAAgD;AAChD,2CAAuD;AAEvD,8FAA8F;AAC9F,MAAa,kBAAkB;IAO3B,YAAY,GAAW,EAAE,MAA8B;QAH/C,oBAAe,GAAG,GAAG,yBAAa,MAAM,CAAC;QAI7C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,2BAAkB,EAAE,GAAG,MAAM,EAAE,CAAC;QACnD,IAAI,CAAC,2BAA2B,GAAG,IAAI,2CAAoB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC9E,IAAI,CAAC,KAAK,GAAG,eAAQ,EAAE,CAAC;QACxB,oCAAwB,CAAC,IAAI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
|
|
4
|
+
export declare class BlockOnNetwork {
|
|
5
|
+
/**
|
|
6
|
+
* The raw data return by provider.
|
|
7
|
+
*/
|
|
8
|
+
raw: Record<string, any>;
|
|
9
|
+
/**
|
|
10
|
+
* The shard number.
|
|
11
|
+
*/
|
|
12
|
+
shard: number;
|
|
13
|
+
/**
|
|
14
|
+
* The shard nonce.
|
|
15
|
+
*/
|
|
16
|
+
nonce: bigint;
|
|
17
|
+
/**
|
|
18
|
+
* The block hash.
|
|
19
|
+
*/
|
|
20
|
+
hash: string;
|
|
21
|
+
/**
|
|
22
|
+
* The block previous hash.
|
|
23
|
+
*/
|
|
24
|
+
previousHash: string;
|
|
25
|
+
/**
|
|
26
|
+
* The block timestamp.
|
|
27
|
+
*/
|
|
28
|
+
timestamp: number;
|
|
29
|
+
/**
|
|
30
|
+
* The block timestamp.
|
|
31
|
+
*/
|
|
32
|
+
round: number;
|
|
33
|
+
/**
|
|
34
|
+
* The block timestamp.
|
|
35
|
+
*/
|
|
36
|
+
epoch: number;
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a configuration object from a HTTP response (as returned by the provider).
|
|
39
|
+
*/
|
|
40
|
+
static fromHttpResponse(payload: any): BlockOnNetwork;
|
|
41
|
+
}
|
|
42
|
+
export declare class BlockCoordinates {
|
|
43
|
+
nonce: bigint;
|
|
44
|
+
hash: string;
|
|
45
|
+
rootHash: string;
|
|
46
|
+
constructor(init?: Partial<BlockCoordinates>);
|
|
47
|
+
static fromHttpResponse(payload: any): BlockCoordinates;
|
|
48
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* An object holding network status configuration parameters.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BlockCoordinates = exports.BlockOnNetwork = void 0;
|
|
7
|
+
class BlockOnNetwork {
|
|
8
|
+
constructor() {
|
|
9
|
+
/**
|
|
10
|
+
* The raw data return by provider.
|
|
11
|
+
*/
|
|
12
|
+
this.raw = {};
|
|
13
|
+
/**
|
|
14
|
+
* The shard number.
|
|
15
|
+
*/
|
|
16
|
+
this.shard = 0;
|
|
17
|
+
/**
|
|
18
|
+
* The shard nonce.
|
|
19
|
+
*/
|
|
20
|
+
this.nonce = 0n;
|
|
21
|
+
/**
|
|
22
|
+
* The block hash.
|
|
23
|
+
*/
|
|
24
|
+
this.hash = "";
|
|
25
|
+
/**
|
|
26
|
+
* The block previous hash.
|
|
27
|
+
*/
|
|
28
|
+
this.previousHash = "";
|
|
29
|
+
/**
|
|
30
|
+
* The block timestamp.
|
|
31
|
+
*/
|
|
32
|
+
this.timestamp = 0;
|
|
33
|
+
/**
|
|
34
|
+
* The block timestamp.
|
|
35
|
+
*/
|
|
36
|
+
this.round = 0;
|
|
37
|
+
/**
|
|
38
|
+
* The block timestamp.
|
|
39
|
+
*/
|
|
40
|
+
this.epoch = 0;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Constructs a configuration object from a HTTP response (as returned by the provider).
|
|
44
|
+
*/
|
|
45
|
+
static fromHttpResponse(payload) {
|
|
46
|
+
let blockOnNetwork = new BlockOnNetwork();
|
|
47
|
+
blockOnNetwork.raw = payload;
|
|
48
|
+
blockOnNetwork.shard = Number(payload["shard"]) ?? 0;
|
|
49
|
+
blockOnNetwork.nonce = BigInt(payload["nonce"] ?? 0);
|
|
50
|
+
blockOnNetwork.hash = payload["hash"] ?? "";
|
|
51
|
+
blockOnNetwork.previousHash = payload["prevBlockHash"] ?? payload["prevHash"] ?? "";
|
|
52
|
+
blockOnNetwork.timestamp = Number(payload["timestamp"] ?? 0);
|
|
53
|
+
blockOnNetwork.round = Number(payload["round"] ?? 0);
|
|
54
|
+
blockOnNetwork.epoch = Number(payload["epoch"] ?? 0);
|
|
55
|
+
return blockOnNetwork;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.BlockOnNetwork = BlockOnNetwork;
|
|
59
|
+
class BlockCoordinates {
|
|
60
|
+
constructor(init) {
|
|
61
|
+
this.nonce = 0n;
|
|
62
|
+
this.hash = "";
|
|
63
|
+
this.rootHash = "";
|
|
64
|
+
Object.assign(this, init);
|
|
65
|
+
}
|
|
66
|
+
static fromHttpResponse(payload) {
|
|
67
|
+
const result = new BlockCoordinates();
|
|
68
|
+
const value = payload["blockInfo"] || {};
|
|
69
|
+
result.nonce = value["nonce"] || 0n;
|
|
70
|
+
result.hash = value["hash"] || "";
|
|
71
|
+
result.rootHash = value["rootHash"] || "";
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.BlockCoordinates = BlockCoordinates;
|
|
76
|
+
//# sourceMappingURL=blocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/networkProviders/blocks.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,MAAa,cAAc;IAA3B;QACI;;WAEG;QACI,QAAG,GAAwB,EAAE,CAAC;QAErC;;WAEG;QACI,UAAK,GAAW,CAAC,CAAC;QAEzB;;WAEG;QACI,UAAK,GAAW,EAAE,CAAC;QAE1B;;WAEG;QACI,SAAI,GAAW,EAAE,CAAC;QAEzB;;WAEG;QACI,iBAAY,GAAW,EAAE,CAAC;QAEjC;;WAEG;QACI,cAAS,GAAW,CAAC,CAAC;QAE7B;;WAEG;QACI,UAAK,GAAW,CAAC,CAAC;QAEzB;;WAEG;QACI,UAAK,GAAW,CAAC,CAAC;IAmB7B,CAAC;IAjBG;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAY;QAChC,IAAI,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAE1C,cAAc,CAAC,GAAG,GAAG,OAAO,CAAC;QAC7B,cAAc,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;QACrD,cAAc,CAAC,KAAK,GAAG,MAAM,C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
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultPagination = exports.defaultAxiosConfig = void 0;
|
|
4
|
+
const JSONbig = require("json-bigint")({ constructorAction: "ignore" });
|
|
5
|
+
exports.defaultAxiosConfig = {
|
|
6
|
+
timeout: 5000,
|
|
7
|
+
// See: https://github.com/axios/axios/issues/983 regarding transformResponse
|
|
8
|
+
transformResponse: [
|
|
9
|
+
function (data) {
|
|
10
|
+
return JSONbig.parse(data);
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
exports.defaultPagination = {
|
|
15
|
+
from: 0,
|
|
16
|
+
size: 100,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/networkProviders/config.ts"],"names":[],"mappings":";;;AAEA,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,CAAC;AAE3D,QAAA,kBAAkB,GAAG;IAC9B,OAAO,EAAE,IAAI;IACb,6EAA6E;IAC7E,iBAAiB,EAAE;QACf,UAAU,IAAS;YACf,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;KACJ;CACJ,CAAC;AAEW,QAAA,iBAAiB,GAAgB;IAC1C,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,GAAG;CACZ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import { Address } from "../core/address";
|
|
3
|
+
export declare const MaxUint64AsBigNumber: BigNumber;
|
|
4
|
+
export declare const DcdtContractAddress: Address;
|
|
5
|
+
export declare const BaseUserAgent = "dharitri-sdk";
|
|
6
|
+
export declare const UnknownClientName = "unknown";
|
|
7
|
+
export declare const DEFAULT_ACCOUNT_AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS = 6000;
|
|
8
|
+
export declare const DEFAULT_ACCOUNT_AWAITING_TIMEOUT_IN_MILLISECONDS: number;
|
|
9
|
+
export declare const DEFAULT_ACCOUNT_AWAITING_PATIENCE_IN_MILLISECONDS = 0;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_ACCOUNT_AWAITING_PATIENCE_IN_MILLISECONDS = exports.DEFAULT_ACCOUNT_AWAITING_TIMEOUT_IN_MILLISECONDS = exports.DEFAULT_ACCOUNT_AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS = exports.UnknownClientName = exports.BaseUserAgent = exports.DcdtContractAddress = exports.MaxUint64AsBigNumber = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const address_1 = require("../core/address");
|
|
9
|
+
exports.MaxUint64AsBigNumber = new bignumber_js_1.default("18446744073709551615");
|
|
10
|
+
exports.DcdtContractAddress = new address_1.Address("drt1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls6prdez");
|
|
11
|
+
exports.BaseUserAgent = "dharitri-sdk";
|
|
12
|
+
exports.UnknownClientName = "unknown";
|
|
13
|
+
exports.DEFAULT_ACCOUNT_AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS = 6000;
|
|
14
|
+
exports.DEFAULT_ACCOUNT_AWAITING_TIMEOUT_IN_MILLISECONDS = 15 * exports.DEFAULT_ACCOUNT_AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS;
|
|
15
|
+
exports.DEFAULT_ACCOUNT_AWAITING_PATIENCE_IN_MILLISECONDS = 0;
|
|
16
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/networkProviders/constants.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,6CAA0C;AAE7B,QAAA,oBAAoB,GAAG,IAAI,sBAAS,CAAC,sBAAsB,CAAC,CAAC;AAC7D,QAAA,mBAAmB,GAAG,IAAI,iBAAO,CAAC,gEAAgE,CAAC,CAAC;AACpG,QAAA,aAAa,GAAG,cAAc,CAAC;AAC/B,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAE9B,QAAA,wDAAwD,GAAG,IAAI,CAAC;AAChE,QAAA,gDAAgD,GACzD,EAAE,GAAG,gEAAwD,CAAC;AACrD,QAAA,iDAAiD,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContractQueryRequest = void 0;
|
|
4
|
+
class ContractQueryRequest {
|
|
5
|
+
constructor(query) {
|
|
6
|
+
this.query = query;
|
|
7
|
+
}
|
|
8
|
+
toHttpRequest() {
|
|
9
|
+
let request = {};
|
|
10
|
+
let query = this.query;
|
|
11
|
+
request.scAddress = query.contract.toBech32();
|
|
12
|
+
request.caller = query.caller?.toBech32() ? query.caller.toBech32() : undefined;
|
|
13
|
+
request.funcName = query.function;
|
|
14
|
+
request.value = query.value ? query.value.toString() : undefined;
|
|
15
|
+
request.args = query.arguments?.map((x) => Buffer.from(x).toString("hex"));
|
|
16
|
+
return request;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ContractQueryRequest = ContractQueryRequest;
|
|
20
|
+
//# sourceMappingURL=contractQueryRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractQueryRequest.js","sourceRoot":"","sources":["../../src/networkProviders/contractQueryRequest.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAG7B,YAAY,KAAyB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,aAAa;QACT,IAAI,OAAO,GAAQ,EAAE,CAAC;QACtB,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvB,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC9C,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAChF,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAClC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACjE,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3E,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAjBD,oDAiBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ApiNetworkProvider } from "./apiNetworkProvider";
|
|
2
|
+
export * from "./interface";
|
|
3
|
+
export { ProxyNetworkProvider } from "./proxyNetworkProvider";
|
|
4
|
+
export * from "./accounts";
|
|
5
|
+
export * from "./blocks";
|
|
6
|
+
export { NetworkConfig } from "./networkConfig";
|
|
7
|
+
export { NetworkProviderConfig } from "./networkProviderConfig";
|
|
8
|
+
export { NetworkStatus } from "./networkStatus";
|
|
9
|
+
export * from "./resources";
|
|
10
|
+
export * from "./tokenDefinitions";
|
|
11
|
+
export * from "./tokens";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.NetworkStatus = exports.NetworkConfig = exports.ProxyNetworkProvider = exports.ApiNetworkProvider = void 0;
|
|
14
|
+
var apiNetworkProvider_1 = require("./apiNetworkProvider");
|
|
15
|
+
Object.defineProperty(exports, "ApiNetworkProvider", { enumerable: true, get: function () { return apiNetworkProvider_1.ApiNetworkProvider; } });
|
|
16
|
+
__exportStar(require("./interface"), exports);
|
|
17
|
+
var proxyNetworkProvider_1 = require("./proxyNetworkProvider");
|
|
18
|
+
Object.defineProperty(exports, "ProxyNetworkProvider", { enumerable: true, get: function () { return proxyNetworkProvider_1.ProxyNetworkProvider; } });
|
|
19
|
+
__exportStar(require("./accounts"), exports);
|
|
20
|
+
__exportStar(require("./blocks"), exports);
|
|
21
|
+
var networkConfig_1 = require("./networkConfig");
|
|
22
|
+
Object.defineProperty(exports, "NetworkConfig", { enumerable: true, get: function () { return networkConfig_1.NetworkConfig; } });
|
|
23
|
+
var networkStatus_1 = require("./networkStatus");
|
|
24
|
+
Object.defineProperty(exports, "NetworkStatus", { enumerable: true, get: function () { return networkStatus_1.NetworkStatus; } });
|
|
25
|
+
__exportStar(require("./resources"), exports);
|
|
26
|
+
__exportStar(require("./tokenDefinitions"), exports);
|
|
27
|
+
__exportStar(require("./tokens"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/networkProviders/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,8CAA4B;AAC5B,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAE7B,6CAA2B;AAC3B,2CAAyB;AACzB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAEtB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,8CAA4B;AAC5B,qDAAmC;AACnC,2CAAyB"}
|