@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,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionCostResponse = exports.AwaitingOptions = void 0;
|
|
4
|
+
const transactionStatus_1 = require("../core/transactionStatus");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
class AwaitingOptions {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.pollingIntervalInMilliseconds = constants_1.DEFAULT_ACCOUNT_AWAITING_POLLING_TIMEOUT_IN_MILLISECONDS;
|
|
9
|
+
this.timeoutInMilliseconds = constants_1.DEFAULT_ACCOUNT_AWAITING_TIMEOUT_IN_MILLISECONDS;
|
|
10
|
+
this.patienceInMilliseconds = constants_1.DEFAULT_ACCOUNT_AWAITING_PATIENCE_IN_MILLISECONDS;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.AwaitingOptions = AwaitingOptions;
|
|
14
|
+
class TransactionCostResponse {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.raw = {};
|
|
17
|
+
this.gasLimit = 0;
|
|
18
|
+
this.status = transactionStatus_1.TransactionStatus.createUnknown();
|
|
19
|
+
}
|
|
20
|
+
static fromHttpResponse(payload) {
|
|
21
|
+
const result = new TransactionCostResponse();
|
|
22
|
+
result.raw = payload;
|
|
23
|
+
result.gasLimit = payload["txGasUnits"] ?? 0;
|
|
24
|
+
result.status = new transactionStatus_1.TransactionStatus("");
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.TransactionCostResponse = TransactionCostResponse;
|
|
29
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/networkProviders/resources.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,2CAIqB;AAErB,MAAa,eAAe;IAA5B;QACI,kCAA6B,GAAW,oEAAwD,CAAC;QACjG,0BAAqB,GAAW,4DAAgD,CAAC;QACjF,2BAAsB,GAAW,6DAAiD,CAAC;IACvF,CAAC;CAAA;AAJD,0CAIC;AAED,MAAa,uBAAuB;IAApC;QACI,QAAG,GAAwB,EAAE,CAAC;QAC9B,aAAQ,GAAW,CAAC,CAAC;QACrB,WAAM,GAAsB,qCAAiB,CAAC,aAAa,EAAE,CAAC;IAUlE,CAAC;IARG,MAAM,CAAC,gBAAgB,CAAC,OAAY;QAChC,MAAM,MAAM,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAC7C,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC;QACrB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,GAAG,IAAI,qCAAiB,CAAC,EAAE,CAAC,CAAC;QAE1C,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAbD,0DAaC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import { Address } from "../core/address";
|
|
4
|
+
export declare class DefinitionOfFungibleTokenOnNetwork {
|
|
5
|
+
identifier: string;
|
|
6
|
+
name: string;
|
|
7
|
+
ticker: string;
|
|
8
|
+
owner: Address;
|
|
9
|
+
decimals: number;
|
|
10
|
+
supply: BigNumber;
|
|
11
|
+
isPaused: boolean;
|
|
12
|
+
canUpgrade: boolean;
|
|
13
|
+
canMint: boolean;
|
|
14
|
+
canBurn: boolean;
|
|
15
|
+
canChangeOwner: boolean;
|
|
16
|
+
canPause: boolean;
|
|
17
|
+
canFreeze: boolean;
|
|
18
|
+
canWipe: boolean;
|
|
19
|
+
canAddSpecialRoles: boolean;
|
|
20
|
+
assets: Record<string, any>;
|
|
21
|
+
static fromApiHttpResponse(payload: any): DefinitionOfFungibleTokenOnNetwork;
|
|
22
|
+
/**
|
|
23
|
+
* The implementation has been moved here from the following location:
|
|
24
|
+
* https://github.com/terradharitri/drt-js-sdk-core/blob/release/v9/src/token.ts
|
|
25
|
+
*/
|
|
26
|
+
static fromResponseOfGetTokenProperties(identifier: string, data: Buffer[]): DefinitionOfFungibleTokenOnNetwork;
|
|
27
|
+
}
|
|
28
|
+
export declare class DefinitionOfTokenCollectionOnNetwork {
|
|
29
|
+
collection: string;
|
|
30
|
+
type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
ticker: string;
|
|
33
|
+
owner: Address;
|
|
34
|
+
decimals: number;
|
|
35
|
+
canPause: boolean;
|
|
36
|
+
canFreeze: boolean;
|
|
37
|
+
canWipe: boolean;
|
|
38
|
+
canUpgrade: boolean;
|
|
39
|
+
canChangeOwner: boolean;
|
|
40
|
+
canAddSpecialRoles: boolean;
|
|
41
|
+
canTransferNftCreateRole: boolean;
|
|
42
|
+
canCreateMultiShard: boolean;
|
|
43
|
+
static fromApiHttpResponse(payload: any): DefinitionOfTokenCollectionOnNetwork;
|
|
44
|
+
/**
|
|
45
|
+
* The implementation has been moved here from the following location:
|
|
46
|
+
* https://github.com/terradharitri/drt-js-sdk-core/blob/release/v9/src/token.ts
|
|
47
|
+
*/
|
|
48
|
+
static fromResponseOfGetTokenProperties(collection: string, data: Buffer[]): DefinitionOfTokenCollectionOnNetwork;
|
|
49
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
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.DefinitionOfTokenCollectionOnNetwork = exports.DefinitionOfFungibleTokenOnNetwork = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const address_1 = require("../core/address");
|
|
9
|
+
class DefinitionOfFungibleTokenOnNetwork {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.identifier = "";
|
|
12
|
+
this.name = "";
|
|
13
|
+
this.ticker = "";
|
|
14
|
+
this.owner = address_1.Address.empty();
|
|
15
|
+
this.decimals = 0;
|
|
16
|
+
this.supply = new bignumber_js_1.default(0);
|
|
17
|
+
this.isPaused = false;
|
|
18
|
+
this.canUpgrade = false;
|
|
19
|
+
this.canMint = false;
|
|
20
|
+
this.canBurn = false;
|
|
21
|
+
this.canChangeOwner = false;
|
|
22
|
+
this.canPause = false;
|
|
23
|
+
this.canFreeze = false;
|
|
24
|
+
this.canWipe = false;
|
|
25
|
+
this.canAddSpecialRoles = false;
|
|
26
|
+
this.assets = {};
|
|
27
|
+
}
|
|
28
|
+
static fromApiHttpResponse(payload) {
|
|
29
|
+
const result = new DefinitionOfFungibleTokenOnNetwork();
|
|
30
|
+
result.identifier = payload.identifier || "";
|
|
31
|
+
result.name = payload.name || "";
|
|
32
|
+
result.ticker = payload.ticker || "";
|
|
33
|
+
result.owner = new address_1.Address(payload.owner || "");
|
|
34
|
+
result.decimals = payload.decimals || 0;
|
|
35
|
+
result.supply = new bignumber_js_1.default(payload.supply || "0");
|
|
36
|
+
result.isPaused = payload.isPaused || false;
|
|
37
|
+
result.canUpgrade = payload.canUpgrade || false;
|
|
38
|
+
result.canMint = payload.canMint || false;
|
|
39
|
+
result.canBurn = payload.canBurn || false;
|
|
40
|
+
result.canChangeOwner = payload.canChangeOwner || false;
|
|
41
|
+
result.canPause = payload.canPause || false;
|
|
42
|
+
result.canFreeze = payload.canFreeze || false;
|
|
43
|
+
result.canWipe = payload.canWipe || false;
|
|
44
|
+
result.assets = payload.assets || {};
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The implementation has been moved here from the following location:
|
|
49
|
+
* https://github.com/terradharitri/drt-js-sdk-core/blob/release/v9/src/token.ts
|
|
50
|
+
*/
|
|
51
|
+
static fromResponseOfGetTokenProperties(identifier, data) {
|
|
52
|
+
let result = new DefinitionOfFungibleTokenOnNetwork();
|
|
53
|
+
let [tokenName, _tokenType, owner, supply, ...propertiesBuffers] = data;
|
|
54
|
+
let properties = parseTokenProperties(propertiesBuffers);
|
|
55
|
+
result.identifier = identifier;
|
|
56
|
+
result.name = tokenName.toString();
|
|
57
|
+
result.ticker = identifier;
|
|
58
|
+
result.owner = new address_1.Address(owner);
|
|
59
|
+
result.decimals = properties.NumDecimals.toNumber();
|
|
60
|
+
result.supply = new bignumber_js_1.default(supply.toString()).shiftedBy(-result.decimals);
|
|
61
|
+
result.isPaused = properties.IsPaused;
|
|
62
|
+
result.canUpgrade = properties.CanUpgrade;
|
|
63
|
+
result.canMint = properties.CanMint;
|
|
64
|
+
result.canBurn = properties.CanBurn;
|
|
65
|
+
result.canChangeOwner = properties.CanChangeOwner;
|
|
66
|
+
result.canPause = properties.CanPause;
|
|
67
|
+
result.canFreeze = properties.CanFreeze;
|
|
68
|
+
result.canWipe = properties.CanWipe;
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.DefinitionOfFungibleTokenOnNetwork = DefinitionOfFungibleTokenOnNetwork;
|
|
73
|
+
class DefinitionOfTokenCollectionOnNetwork {
|
|
74
|
+
constructor() {
|
|
75
|
+
this.collection = "";
|
|
76
|
+
this.type = "";
|
|
77
|
+
this.name = "";
|
|
78
|
+
this.ticker = "";
|
|
79
|
+
this.owner = address_1.Address.empty();
|
|
80
|
+
this.decimals = 0;
|
|
81
|
+
this.canPause = false;
|
|
82
|
+
this.canFreeze = false;
|
|
83
|
+
this.canWipe = false;
|
|
84
|
+
this.canUpgrade = false;
|
|
85
|
+
this.canChangeOwner = false;
|
|
86
|
+
this.canAddSpecialRoles = false;
|
|
87
|
+
this.canTransferNftCreateRole = false;
|
|
88
|
+
this.canCreateMultiShard = false;
|
|
89
|
+
}
|
|
90
|
+
static fromApiHttpResponse(payload) {
|
|
91
|
+
const result = new DefinitionOfTokenCollectionOnNetwork();
|
|
92
|
+
result.collection = payload.collection || "";
|
|
93
|
+
result.type = payload.type || "";
|
|
94
|
+
result.name = payload.name || "";
|
|
95
|
+
result.ticker = payload.ticker || "";
|
|
96
|
+
result.owner = new address_1.Address(payload.owner || "");
|
|
97
|
+
result.decimals = payload.decimals || 0;
|
|
98
|
+
result.canPause = payload.canPause || false;
|
|
99
|
+
result.canFreeze = payload.canFreeze || false;
|
|
100
|
+
result.canWipe = payload.canWipe || false;
|
|
101
|
+
result.canUpgrade = payload.canUpgrade || false;
|
|
102
|
+
result.canAddSpecialRoles = payload.canAddSpecialRoles || false;
|
|
103
|
+
result.canTransferNftCreateRole = payload.canTransferNftCreateRole || false;
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The implementation has been moved here from the following location:
|
|
108
|
+
* https://github.com/terradharitri/drt-js-sdk-core/blob/release/v9/src/token.ts
|
|
109
|
+
*/
|
|
110
|
+
static fromResponseOfGetTokenProperties(collection, data) {
|
|
111
|
+
let result = new DefinitionOfTokenCollectionOnNetwork();
|
|
112
|
+
let [tokenName, tokenType, owner, _, __, ...propertiesBuffers] = data;
|
|
113
|
+
let properties = parseTokenProperties(propertiesBuffers);
|
|
114
|
+
result.collection = collection;
|
|
115
|
+
result.type = tokenType.toString();
|
|
116
|
+
result.name = tokenName.toString();
|
|
117
|
+
result.ticker = collection;
|
|
118
|
+
result.owner = new address_1.Address(owner);
|
|
119
|
+
result.decimals = properties.NumDecimals.toNumber() ?? 0;
|
|
120
|
+
result.canPause = properties.CanPause || false;
|
|
121
|
+
result.canFreeze = properties.CanFreeze || false;
|
|
122
|
+
result.canWipe = properties.CanWipe || false;
|
|
123
|
+
result.canUpgrade = properties.CanUpgrade || false;
|
|
124
|
+
result.canChangeOwner = properties.CanChangeOwner || false;
|
|
125
|
+
result.canAddSpecialRoles = properties.CanAddSpecialRoles || false;
|
|
126
|
+
result.canTransferNftCreateRole = properties.CanTransferNFTCreateRole || false;
|
|
127
|
+
result.canCreateMultiShard = properties.CanCreateMultiShard || false;
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.DefinitionOfTokenCollectionOnNetwork = DefinitionOfTokenCollectionOnNetwork;
|
|
132
|
+
// Token properties have the following format: {PropertyName}-{PropertyValue}.
|
|
133
|
+
function parseTokenProperties(propertiesBuffers) {
|
|
134
|
+
let properties = {};
|
|
135
|
+
for (let buffer of propertiesBuffers) {
|
|
136
|
+
let [name, value] = buffer.toString().split("-");
|
|
137
|
+
properties[name] = parseValueOfTokenProperty(value);
|
|
138
|
+
}
|
|
139
|
+
return properties;
|
|
140
|
+
}
|
|
141
|
+
// This only handles booleans and numbers.
|
|
142
|
+
function parseValueOfTokenProperty(value) {
|
|
143
|
+
switch (value) {
|
|
144
|
+
case "true":
|
|
145
|
+
return true;
|
|
146
|
+
case "false":
|
|
147
|
+
return false;
|
|
148
|
+
default:
|
|
149
|
+
return new bignumber_js_1.default(value);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=tokenDefinitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenDefinitions.js","sourceRoot":"","sources":["../../src/networkProviders/tokenDefinitions.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,6CAA0C;AAE1C,MAAa,kCAAk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YACR,OAAO,KAAK,CAAC;QACjB;YACI,OAAO,IAAI,sBAAS,CAAC,KAAK,CAAC,CAAC;KACnC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BigNumber } from "bignumber.js";
|
|
3
|
+
import { Address, Token } from "../core";
|
|
4
|
+
import { BlockCoordinates } from "./blocks";
|
|
5
|
+
export declare class FungibleTokenOfAccountOnNetwork {
|
|
6
|
+
identifier: string;
|
|
7
|
+
balance: BigNumber;
|
|
8
|
+
rawResponse: any;
|
|
9
|
+
static fromHttpResponse(payload: any): FungibleTokenOfAccountOnNetwork;
|
|
10
|
+
}
|
|
11
|
+
export declare class NonFungibleTokenOfAccountOnNetwork {
|
|
12
|
+
identifier: string;
|
|
13
|
+
collection: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
attributes: Buffer;
|
|
16
|
+
nonce: number;
|
|
17
|
+
type: string;
|
|
18
|
+
name: string;
|
|
19
|
+
creator: Address;
|
|
20
|
+
supply: BigNumber;
|
|
21
|
+
decimals: number;
|
|
22
|
+
royalties: BigNumber;
|
|
23
|
+
assets: string[];
|
|
24
|
+
balance: BigNumber;
|
|
25
|
+
constructor(init?: Partial<NonFungibleTokenOfAccountOnNetwork>);
|
|
26
|
+
static fromProxyHttpResponse(payload: any): NonFungibleTokenOfAccountOnNetwork;
|
|
27
|
+
static fromProxyHttpResponseByNonce(payload: any): NonFungibleTokenOfAccountOnNetwork;
|
|
28
|
+
static fromApiHttpResponse(payload: any): NonFungibleTokenOfAccountOnNetwork;
|
|
29
|
+
private static fromHttpResponse;
|
|
30
|
+
private static parseCollectionFromIdentifier;
|
|
31
|
+
}
|
|
32
|
+
export declare class TokenAmountOnNetwork {
|
|
33
|
+
raw: Record<string, any>;
|
|
34
|
+
token: Token;
|
|
35
|
+
amount: bigint;
|
|
36
|
+
block_coordinates?: BlockCoordinates;
|
|
37
|
+
constructor(init?: Partial<TokenAmountOnNetwork>);
|
|
38
|
+
static fromProxyResponse(payload: any): TokenAmountOnNetwork;
|
|
39
|
+
static fromApiResponse(payload: any): TokenAmountOnNetwork;
|
|
40
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenAmountOnNetwork = exports.NonFungibleTokenOfAccountOnNetwork = exports.FungibleTokenOfAccountOnNetwork = void 0;
|
|
4
|
+
const bignumber_js_1 = require("bignumber.js");
|
|
5
|
+
const core_1 = require("../core");
|
|
6
|
+
const utils_codec_1 = require("../core/utils.codec");
|
|
7
|
+
class FungibleTokenOfAccountOnNetwork {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.identifier = "";
|
|
10
|
+
this.balance = new bignumber_js_1.BigNumber(0);
|
|
11
|
+
this.rawResponse = {};
|
|
12
|
+
}
|
|
13
|
+
static fromHttpResponse(payload) {
|
|
14
|
+
let result = new FungibleTokenOfAccountOnNetwork();
|
|
15
|
+
result.identifier = payload.tokenIdentifier || payload.identifier || "";
|
|
16
|
+
result.balance = new bignumber_js_1.BigNumber(payload.balance || 0);
|
|
17
|
+
result.rawResponse = payload;
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.FungibleTokenOfAccountOnNetwork = FungibleTokenOfAccountOnNetwork;
|
|
22
|
+
class NonFungibleTokenOfAccountOnNetwork {
|
|
23
|
+
constructor(init) {
|
|
24
|
+
this.identifier = "";
|
|
25
|
+
this.collection = "";
|
|
26
|
+
this.timestamp = 0;
|
|
27
|
+
this.attributes = Buffer.from([]);
|
|
28
|
+
this.nonce = 0;
|
|
29
|
+
this.type = "";
|
|
30
|
+
this.name = "";
|
|
31
|
+
this.creator = core_1.Address.empty();
|
|
32
|
+
this.supply = new bignumber_js_1.BigNumber(0);
|
|
33
|
+
this.decimals = 0;
|
|
34
|
+
this.royalties = new bignumber_js_1.BigNumber(0);
|
|
35
|
+
this.assets = [];
|
|
36
|
+
this.balance = new bignumber_js_1.BigNumber(0);
|
|
37
|
+
Object.assign(this, init);
|
|
38
|
+
}
|
|
39
|
+
static fromProxyHttpResponse(payload) {
|
|
40
|
+
const result = NonFungibleTokenOfAccountOnNetwork.fromHttpResponse(payload);
|
|
41
|
+
result.identifier = payload.tokenIdentifier || "";
|
|
42
|
+
result.collection = NonFungibleTokenOfAccountOnNetwork.parseCollectionFromIdentifier(result.identifier);
|
|
43
|
+
result.royalties = new bignumber_js_1.BigNumber(payload.royalties || 0).div(100);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
static fromProxyHttpResponseByNonce(payload) {
|
|
47
|
+
const result = NonFungibleTokenOfAccountOnNetwork.fromHttpResponse(payload);
|
|
48
|
+
let nonceAsHex = utils_codec_1.numberToPaddedHex(result.nonce);
|
|
49
|
+
result.identifier = `${payload.tokenIdentifier}-${nonceAsHex}`;
|
|
50
|
+
result.collection = payload.tokenIdentifier || "";
|
|
51
|
+
result.royalties = new bignumber_js_1.BigNumber(payload.royalties || 0).div(100);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
static fromApiHttpResponse(payload) {
|
|
55
|
+
const result = NonFungibleTokenOfAccountOnNetwork.fromHttpResponse(payload);
|
|
56
|
+
result.identifier = payload.identifier || "";
|
|
57
|
+
result.collection = payload.collection || "";
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
// TODO: Compare results from Proxy and API and try to reconciliate them.
|
|
61
|
+
static fromHttpResponse(payload) {
|
|
62
|
+
let result = new NonFungibleTokenOfAccountOnNetwork();
|
|
63
|
+
result.timestamp = Number(payload.timestamp || 0);
|
|
64
|
+
result.attributes = Buffer.from(payload.attributes || "", "base64");
|
|
65
|
+
result.nonce = payload.nonce || 0;
|
|
66
|
+
result.type = payload.type || "";
|
|
67
|
+
result.name = payload.name || "";
|
|
68
|
+
result.creator = new core_1.Address(payload.creator || "");
|
|
69
|
+
result.decimals = Number(payload.decimals || 0);
|
|
70
|
+
result.supply = new bignumber_js_1.BigNumber(payload.balance || 1);
|
|
71
|
+
result.royalties = new bignumber_js_1.BigNumber(payload.royalties || 0);
|
|
72
|
+
result.assets = payload.assets || [];
|
|
73
|
+
result.balance = new bignumber_js_1.BigNumber(payload.balance || 1);
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
static parseCollectionFromIdentifier(identifier) {
|
|
77
|
+
let parts = identifier.split("-");
|
|
78
|
+
let collection = parts.slice(0, 2).join("-");
|
|
79
|
+
return collection;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.NonFungibleTokenOfAccountOnNetwork = NonFungibleTokenOfAccountOnNetwork;
|
|
83
|
+
class TokenAmountOnNetwork {
|
|
84
|
+
constructor(init) {
|
|
85
|
+
this.raw = {};
|
|
86
|
+
this.token = new core_1.Token({ identifier: "" });
|
|
87
|
+
this.amount = 0n;
|
|
88
|
+
Object.assign(this, init);
|
|
89
|
+
}
|
|
90
|
+
static fromProxyResponse(payload) {
|
|
91
|
+
const result = new TokenAmountOnNetwork();
|
|
92
|
+
result.raw = payload;
|
|
93
|
+
result.amount = BigInt(payload["balance"] ?? 0);
|
|
94
|
+
result.token = new core_1.Token({ identifier: payload["tokenIdentifier"] ?? "", nonce: payload["nonce"] ?? 0 });
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
static fromApiResponse(payload) {
|
|
98
|
+
const result = new TokenAmountOnNetwork();
|
|
99
|
+
result.raw = payload;
|
|
100
|
+
result.amount = BigInt(payload["balance"] ?? 0);
|
|
101
|
+
result.token = new core_1.Token({ identifier: payload["identifier"] ?? "", nonce: payload["nonce"] ?? 0 });
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.TokenAmountOnNetwork = TokenAmountOnNetwork;
|
|
106
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","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|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extendUserAgentIfBackend = void 0;
|
|
4
|
+
const axios_1 = require("axios");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
function extendUserAgentIfBackend(userAgentPrefix, config) {
|
|
7
|
+
if (isBackend()) {
|
|
8
|
+
extendUserAgent(userAgentPrefix, config);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.extendUserAgentIfBackend = extendUserAgentIfBackend;
|
|
12
|
+
function extendUserAgent(userAgentPrefix, config) {
|
|
13
|
+
if (!config.headers) {
|
|
14
|
+
config.headers = new axios_1.AxiosHeaders({});
|
|
15
|
+
}
|
|
16
|
+
if (!config.clientName) {
|
|
17
|
+
console.log("We recommend providing the `clientName` when instantiating a NetworkProvider (e.g. ProxyNetworkProvider, ApiNetworkProvider). This information will be used for metrics collection and improving our services.");
|
|
18
|
+
}
|
|
19
|
+
const headers = axios_1.AxiosHeaders.from(config.headers).normalize(true);
|
|
20
|
+
const resolvedClientName = config.clientName || constants_1.UnknownClientName;
|
|
21
|
+
const currentUserAgent = headers.hasUserAgent() ? headers.getUserAgent() : "";
|
|
22
|
+
const newUserAgent = currentUserAgent
|
|
23
|
+
? `${currentUserAgent} ${userAgentPrefix}/${resolvedClientName}`
|
|
24
|
+
: `${userAgentPrefix}/${resolvedClientName}`;
|
|
25
|
+
headers.setUserAgent(newUserAgent, true);
|
|
26
|
+
}
|
|
27
|
+
function isBackend() {
|
|
28
|
+
return typeof window === "undefined";
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=userAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAgent.js","sourceRoot":"","sources":["../../src/networkProviders/userAgent.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AACrC,2CAAgD;AAGhD,SAAgB,wBAAwB,CAAC,eAAuB,EAAE,MAA6B;IAC3F,IAAI,SAAS,EAAE,EAAE;QACb,eAAe,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;KAC5C;AACL,CAAC;AAJD,4DAIC;AAED,SAAS,eAAe,CAAC,eAAuB,EAAE,MAA6B;IAC3E,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACjB,MAAM,CAAC,OAAO,GAAG,IAAI,oBAAY,CAAC,EAAE,CAAC,CAAC;KACzC;IACD,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;QACpB,OAAO,CAAC,GAAG,CACP,gNAAgN,CACnN,CAAC;KACL;IACD,MAAM,OAAO,GAAG,oBAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAuB,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClF,MAAM,kBAAkB,GAAG,MAAM,CAAC,UAAU,IAAI,6BAAiB,CAAC;IAElE,MAAM,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9E,MAAM,YAAY,GAAG,gBAAgB;QACjC,CAAC,CAAC,GAAG,gBAAgB,IAAI,eAAe,IAAI,kBAAkB,EAAE;QAChE,CAAC,CAAC,GAAG,eAAe,IAAI,kBAAkB,EAAE,CAAC;IAEjD,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,SAAS;IACd,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC;AACzC,CAAC"}
|