diff --git a/src/smartcontracts/argSerializer.spec.ts b/src/abi/argSerializer.spec.ts similarity index 100% rename from src/smartcontracts/argSerializer.spec.ts rename to src/abi/argSerializer.spec.ts diff --git a/src/smartcontracts/argSerializer.ts b/src/abi/argSerializer.ts similarity index 100% rename from src/smartcontracts/argSerializer.ts rename to src/abi/argSerializer.ts diff --git a/src/smartcontracts/argumentErrorContext.ts b/src/abi/argumentErrorContext.ts similarity index 100% rename from src/smartcontracts/argumentErrorContext.ts rename to src/abi/argumentErrorContext.ts diff --git a/src/smartcontracts/code.spec.ts b/src/abi/code.spec.ts similarity index 100% rename from src/smartcontracts/code.spec.ts rename to src/abi/code.spec.ts diff --git a/src/smartcontracts/code.ts b/src/abi/code.ts similarity index 100% rename from src/smartcontracts/code.ts rename to src/abi/code.ts diff --git a/src/smartcontracts/codeMetadata.spec.ts b/src/abi/codeMetadata.spec.ts similarity index 100% rename from src/smartcontracts/codeMetadata.spec.ts rename to src/abi/codeMetadata.spec.ts diff --git a/src/smartcontracts/codeMetadata.ts b/src/abi/codeMetadata.ts similarity index 100% rename from src/smartcontracts/codeMetadata.ts rename to src/abi/codeMetadata.ts diff --git a/src/smartcontracts/codec/address.ts b/src/abi/codec/address.ts similarity index 100% rename from src/smartcontracts/codec/address.ts rename to src/abi/codec/address.ts diff --git a/src/smartcontracts/codec/arrayVec.ts b/src/abi/codec/arrayVec.ts similarity index 100% rename from src/smartcontracts/codec/arrayVec.ts rename to src/abi/codec/arrayVec.ts diff --git a/src/smartcontracts/codec/binary.spec.ts b/src/abi/codec/binary.spec.ts similarity index 100% rename from src/smartcontracts/codec/binary.spec.ts rename to src/abi/codec/binary.spec.ts diff --git a/src/smartcontracts/codec/binary.ts b/src/abi/codec/binary.ts similarity index 100% rename from src/smartcontracts/codec/binary.ts rename to src/abi/codec/binary.ts diff --git a/src/smartcontracts/codec/binaryCodecUtils.ts b/src/abi/codec/binaryCodecUtils.ts similarity index 100% rename from src/smartcontracts/codec/binaryCodecUtils.ts rename to src/abi/codec/binaryCodecUtils.ts diff --git a/src/smartcontracts/codec/boolean.ts b/src/abi/codec/boolean.ts similarity index 100% rename from src/smartcontracts/codec/boolean.ts rename to src/abi/codec/boolean.ts diff --git a/src/smartcontracts/codec/bytes.ts b/src/abi/codec/bytes.ts similarity index 100% rename from src/smartcontracts/codec/bytes.ts rename to src/abi/codec/bytes.ts diff --git a/src/smartcontracts/codec/codemetadata.ts b/src/abi/codec/codemetadata.ts similarity index 100% rename from src/smartcontracts/codec/codemetadata.ts rename to src/abi/codec/codemetadata.ts diff --git a/src/smartcontracts/codec/constants.ts b/src/abi/codec/constants.ts similarity index 100% rename from src/smartcontracts/codec/constants.ts rename to src/abi/codec/constants.ts diff --git a/src/smartcontracts/codec/enum.ts b/src/abi/codec/enum.ts similarity index 100% rename from src/smartcontracts/codec/enum.ts rename to src/abi/codec/enum.ts diff --git a/src/smartcontracts/codec/explicit-enum.ts b/src/abi/codec/explicit-enum.ts similarity index 100% rename from src/smartcontracts/codec/explicit-enum.ts rename to src/abi/codec/explicit-enum.ts diff --git a/src/smartcontracts/codec/fields.ts b/src/abi/codec/fields.ts similarity index 100% rename from src/smartcontracts/codec/fields.ts rename to src/abi/codec/fields.ts diff --git a/src/smartcontracts/codec/h256.ts b/src/abi/codec/h256.ts similarity index 100% rename from src/smartcontracts/codec/h256.ts rename to src/abi/codec/h256.ts diff --git a/src/smartcontracts/codec/index.ts b/src/abi/codec/index.ts similarity index 100% rename from src/smartcontracts/codec/index.ts rename to src/abi/codec/index.ts diff --git a/src/smartcontracts/codec/list.ts b/src/abi/codec/list.ts similarity index 100% rename from src/smartcontracts/codec/list.ts rename to src/abi/codec/list.ts diff --git a/src/smartcontracts/codec/managedDecimal.ts b/src/abi/codec/managedDecimal.ts similarity index 100% rename from src/smartcontracts/codec/managedDecimal.ts rename to src/abi/codec/managedDecimal.ts diff --git a/src/smartcontracts/codec/managedDecimalSigned.ts b/src/abi/codec/managedDecimalSigned.ts similarity index 100% rename from src/smartcontracts/codec/managedDecimalSigned.ts rename to src/abi/codec/managedDecimalSigned.ts diff --git a/src/smartcontracts/codec/nothing.ts b/src/abi/codec/nothing.ts similarity index 100% rename from src/smartcontracts/codec/nothing.ts rename to src/abi/codec/nothing.ts diff --git a/src/smartcontracts/codec/numerical.ts b/src/abi/codec/numerical.ts similarity index 100% rename from src/smartcontracts/codec/numerical.ts rename to src/abi/codec/numerical.ts diff --git a/src/smartcontracts/codec/option.ts b/src/abi/codec/option.ts similarity index 100% rename from src/smartcontracts/codec/option.ts rename to src/abi/codec/option.ts diff --git a/src/smartcontracts/codec/primitive.ts b/src/abi/codec/primitive.ts similarity index 100% rename from src/smartcontracts/codec/primitive.ts rename to src/abi/codec/primitive.ts diff --git a/src/smartcontracts/codec/string.ts b/src/abi/codec/string.ts similarity index 100% rename from src/smartcontracts/codec/string.ts rename to src/abi/codec/string.ts diff --git a/src/smartcontracts/codec/struct.ts b/src/abi/codec/struct.ts similarity index 100% rename from src/smartcontracts/codec/struct.ts rename to src/abi/codec/struct.ts diff --git a/src/smartcontracts/codec/tokenIdentifier.ts b/src/abi/codec/tokenIdentifier.ts similarity index 100% rename from src/smartcontracts/codec/tokenIdentifier.ts rename to src/abi/codec/tokenIdentifier.ts diff --git a/src/smartcontracts/codec/tuple.ts b/src/abi/codec/tuple.ts similarity index 100% rename from src/smartcontracts/codec/tuple.ts rename to src/abi/codec/tuple.ts diff --git a/src/smartcontracts/codec/utils.ts b/src/abi/codec/utils.ts similarity index 100% rename from src/smartcontracts/codec/utils.ts rename to src/abi/codec/utils.ts diff --git a/src/smartcontracts/function.ts b/src/abi/function.ts similarity index 100% rename from src/smartcontracts/function.ts rename to src/abi/function.ts diff --git a/src/smartcontracts/index.ts b/src/abi/index.ts similarity index 100% rename from src/smartcontracts/index.ts rename to src/abi/index.ts diff --git a/src/smartcontracts/interaction.local.net.spec.ts b/src/abi/interaction.local.net.spec.ts similarity index 99% rename from src/smartcontracts/interaction.local.net.spec.ts rename to src/abi/interaction.local.net.spec.ts index 05b8a8106..2f1c286af 100644 --- a/src/smartcontracts/interaction.local.net.spec.ts +++ b/src/abi/interaction.local.net.spec.ts @@ -1,20 +1,20 @@ import BigNumber from "bignumber.js"; import { assert } from "chai"; +import { promises } from "fs"; +import { QueryRunnerAdapter } from "../adapters/queryRunnerAdapter"; +import { SmartContractQueriesController } from "../smartContractQueriesController"; import { loadAbiRegistry, loadTestWallets, prepareDeployment, TestWallet } from "../testutils"; import { ContractController } from "../testutils/contractController"; import { createLocalnetProvider } from "../testutils/networkProviders"; import { Transaction } from "../transaction"; import { TransactionComputer } from "../transactionComputer"; +import { TransactionsFactoryConfig } from "../transactionsFactories"; +import { SmartContractTransactionsFactory } from "../transactionsFactories/smartContractTransactionsFactory"; +import { TransactionWatcher } from "../transactionWatcher"; import { Interaction } from "./interaction"; +import { ResultsParser } from "./resultsParser"; import { ReturnCode } from "./returnCode"; import { SmartContract } from "./smartContract"; -import { TransactionsFactoryConfig } from "../transactionsFactories/transactionsFactoryConfig"; -import { SmartContractTransactionsFactory } from "../transactionsFactories/smartContractTransactionsFactory"; -import { promises } from "fs"; -import { ResultsParser } from "./resultsParser"; -import { TransactionWatcher } from "../transactionWatcher"; -import { SmartContractQueriesController } from "../smartContractQueriesController"; -import { QueryRunnerAdapter } from "../adapters/queryRunnerAdapter"; import { ManagedDecimalSignedValue, ManagedDecimalValue } from "./typesystem"; describe("test smart contract interactor", function () { diff --git a/src/smartcontracts/interaction.spec.ts b/src/abi/interaction.spec.ts similarity index 99% rename from src/smartcontracts/interaction.spec.ts rename to src/abi/interaction.spec.ts index e88789a90..3e1f5b808 100644 --- a/src/smartcontracts/interaction.spec.ts +++ b/src/abi/interaction.spec.ts @@ -1,7 +1,7 @@ -import { ContractQueryResponse } from "../networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; import { Address } from "../address"; +import { ContractQueryResponse } from "../networkProviders"; import { loadAbiRegistry, loadTestWallets, @@ -16,8 +16,7 @@ import { ContractFunction } from "./function"; import { Interaction } from "./interaction"; import { ReturnCode } from "./returnCode"; import { SmartContract } from "./smartContract"; -import { BigUIntValue, OptionalValue, OptionValue, TokenIdentifierValue, U32Value } from "./typesystem"; -import { BytesValue } from "./typesystem/bytes"; +import { BigUIntValue, BytesValue, OptionalValue, OptionValue, TokenIdentifierValue, U32Value } from "./typesystem"; describe("test smart contract interactor", function () { let dummyAddress = new Address("erd1qqqqqqqqqqqqqpgqak8zt22wl2ph4tswtyc39namqx6ysa2sd8ss4xmlj3"); diff --git a/src/smartcontracts/interaction.ts b/src/abi/interaction.ts similarity index 100% rename from src/smartcontracts/interaction.ts rename to src/abi/interaction.ts diff --git a/src/smartcontracts/interactionChecker.spec.ts b/src/abi/interactionChecker.spec.ts similarity index 98% rename from src/smartcontracts/interactionChecker.spec.ts rename to src/abi/interactionChecker.spec.ts index 84da7dab0..caabab429 100644 --- a/src/smartcontracts/interactionChecker.spec.ts +++ b/src/abi/interactionChecker.spec.ts @@ -9,13 +9,13 @@ import { SmartContract } from "./smartContract"; import { BigUIntType, BigUIntValue, + BytesValue, OptionalType, OptionalValue, OptionValue, TokenIdentifierValue, U32Value, } from "./typesystem"; -import { BytesValue } from "./typesystem/bytes"; describe("integration tests: test checker within interactor", function () { let dummyAddress = new Address("erd1qqqqqqqqqqqqqpgqak8zt22wl2ph4tswtyc39namqx6ysa2sd8ss4xmlj3"); diff --git a/src/smartcontracts/interactionChecker.ts b/src/abi/interactionChecker.ts similarity index 100% rename from src/smartcontracts/interactionChecker.ts rename to src/abi/interactionChecker.ts diff --git a/src/smartcontracts/interface.ts b/src/abi/interface.ts similarity index 100% rename from src/smartcontracts/interface.ts rename to src/abi/interface.ts diff --git a/src/smartcontracts/nativeSerializer.spec.ts b/src/abi/nativeSerializer.spec.ts similarity index 100% rename from src/smartcontracts/nativeSerializer.spec.ts rename to src/abi/nativeSerializer.spec.ts diff --git a/src/smartcontracts/nativeSerializer.ts b/src/abi/nativeSerializer.ts similarity index 100% rename from src/smartcontracts/nativeSerializer.ts rename to src/abi/nativeSerializer.ts diff --git a/src/smartcontracts/query.spec.ts b/src/abi/query.spec.ts similarity index 100% rename from src/smartcontracts/query.spec.ts rename to src/abi/query.spec.ts diff --git a/src/smartcontracts/query.ts b/src/abi/query.ts similarity index 100% rename from src/smartcontracts/query.ts rename to src/abi/query.ts diff --git a/src/smartcontracts/resultsParser.spec.ts b/src/abi/resultsParser.spec.ts similarity index 100% rename from src/smartcontracts/resultsParser.spec.ts rename to src/abi/resultsParser.spec.ts diff --git a/src/smartcontracts/resultsParser.ts b/src/abi/resultsParser.ts similarity index 100% rename from src/smartcontracts/resultsParser.ts rename to src/abi/resultsParser.ts diff --git a/src/smartcontracts/returnCode.ts b/src/abi/returnCode.ts similarity index 100% rename from src/smartcontracts/returnCode.ts rename to src/abi/returnCode.ts diff --git a/src/smartcontracts/smartContract.local.net.spec.ts b/src/abi/smartContract.local.net.spec.ts similarity index 99% rename from src/smartcontracts/smartContract.local.net.spec.ts rename to src/abi/smartContract.local.net.spec.ts index 99219622b..57c5646f8 100644 --- a/src/smartcontracts/smartContract.local.net.spec.ts +++ b/src/abi/smartContract.local.net.spec.ts @@ -7,15 +7,22 @@ import { prepareDeployment } from "../testutils"; import { createLocalnetProvider } from "../testutils/networkProviders"; import { loadTestWallets, TestWallet } from "../testutils/wallets"; import { TransactionComputer } from "../transactionComputer"; +import { TransactionsFactoryConfig } from "../transactionsFactories"; import { SmartContractTransactionsFactory } from "../transactionsFactories/smartContractTransactionsFactory"; -import { TransactionsFactoryConfig } from "../transactionsFactories/transactionsFactoryConfig"; import { TransactionWatcher } from "../transactionWatcher"; import { decodeUnsignedNumber } from "./codec"; import { ContractFunction } from "./function"; import { ResultsParser } from "./resultsParser"; import { SmartContract } from "./smartContract"; -import { AddressValue, BigUIntValue, OptionalValue, OptionValue, TokenIdentifierValue, U32Value } from "./typesystem"; -import { BytesValue } from "./typesystem/bytes"; +import { + AddressValue, + BigUIntValue, + BytesValue, + OptionalValue, + OptionValue, + TokenIdentifierValue, + U32Value, +} from "./typesystem"; describe("test on local testnet", function () { let alice: TestWallet, bob: TestWallet, carol: TestWallet; diff --git a/src/smartcontracts/smartContract.spec.ts b/src/abi/smartContract.spec.ts similarity index 100% rename from src/smartcontracts/smartContract.spec.ts rename to src/abi/smartContract.spec.ts diff --git a/src/smartcontracts/smartContract.ts b/src/abi/smartContract.ts similarity index 100% rename from src/smartcontracts/smartContract.ts rename to src/abi/smartContract.ts diff --git a/src/smartcontracts/smartContractResults.local.net.spec.ts b/src/abi/smartContractResults.local.net.spec.ts similarity index 100% rename from src/smartcontracts/smartContractResults.local.net.spec.ts rename to src/abi/smartContractResults.local.net.spec.ts diff --git a/src/smartcontracts/transactionPayloadBuilders.spec.ts b/src/abi/transactionPayloadBuilders.spec.ts similarity index 100% rename from src/smartcontracts/transactionPayloadBuilders.spec.ts rename to src/abi/transactionPayloadBuilders.spec.ts diff --git a/src/smartcontracts/transactionPayloadBuilders.ts b/src/abi/transactionPayloadBuilders.ts similarity index 100% rename from src/smartcontracts/transactionPayloadBuilders.ts rename to src/abi/transactionPayloadBuilders.ts diff --git a/src/smartcontracts/typesystem/abiRegistry.spec.ts b/src/abi/typesystem/abiRegistry.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/abiRegistry.spec.ts rename to src/abi/typesystem/abiRegistry.spec.ts diff --git a/src/smartcontracts/typesystem/abiRegistry.ts b/src/abi/typesystem/abiRegistry.ts similarity index 100% rename from src/smartcontracts/typesystem/abiRegistry.ts rename to src/abi/typesystem/abiRegistry.ts diff --git a/src/smartcontracts/typesystem/address.ts b/src/abi/typesystem/address.ts similarity index 100% rename from src/smartcontracts/typesystem/address.ts rename to src/abi/typesystem/address.ts diff --git a/src/smartcontracts/typesystem/algebraic.ts b/src/abi/typesystem/algebraic.ts similarity index 100% rename from src/smartcontracts/typesystem/algebraic.ts rename to src/abi/typesystem/algebraic.ts diff --git a/src/smartcontracts/typesystem/boolean.ts b/src/abi/typesystem/boolean.ts similarity index 100% rename from src/smartcontracts/typesystem/boolean.ts rename to src/abi/typesystem/boolean.ts diff --git a/src/smartcontracts/typesystem/bytes.ts b/src/abi/typesystem/bytes.ts similarity index 100% rename from src/smartcontracts/typesystem/bytes.ts rename to src/abi/typesystem/bytes.ts diff --git a/src/smartcontracts/typesystem/codeMetadata.ts b/src/abi/typesystem/codeMetadata.ts similarity index 100% rename from src/smartcontracts/typesystem/codeMetadata.ts rename to src/abi/typesystem/codeMetadata.ts diff --git a/src/smartcontracts/typesystem/collections.ts b/src/abi/typesystem/collections.ts similarity index 100% rename from src/smartcontracts/typesystem/collections.ts rename to src/abi/typesystem/collections.ts diff --git a/src/smartcontracts/typesystem/composite.spec.ts b/src/abi/typesystem/composite.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/composite.spec.ts rename to src/abi/typesystem/composite.spec.ts diff --git a/src/smartcontracts/typesystem/composite.ts b/src/abi/typesystem/composite.ts similarity index 100% rename from src/smartcontracts/typesystem/composite.ts rename to src/abi/typesystem/composite.ts diff --git a/src/smartcontracts/typesystem/endpoint.spec.ts b/src/abi/typesystem/endpoint.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/endpoint.spec.ts rename to src/abi/typesystem/endpoint.spec.ts diff --git a/src/smartcontracts/typesystem/endpoint.ts b/src/abi/typesystem/endpoint.ts similarity index 100% rename from src/smartcontracts/typesystem/endpoint.ts rename to src/abi/typesystem/endpoint.ts diff --git a/src/smartcontracts/typesystem/enum.spec.ts b/src/abi/typesystem/enum.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/enum.spec.ts rename to src/abi/typesystem/enum.spec.ts diff --git a/src/smartcontracts/typesystem/enum.ts b/src/abi/typesystem/enum.ts similarity index 100% rename from src/smartcontracts/typesystem/enum.ts rename to src/abi/typesystem/enum.ts diff --git a/src/smartcontracts/typesystem/event.ts b/src/abi/typesystem/event.ts similarity index 100% rename from src/smartcontracts/typesystem/event.ts rename to src/abi/typesystem/event.ts diff --git a/src/smartcontracts/typesystem/explicit-enum.spec.ts b/src/abi/typesystem/explicit-enum.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/explicit-enum.spec.ts rename to src/abi/typesystem/explicit-enum.spec.ts diff --git a/src/smartcontracts/typesystem/explicit-enum.ts b/src/abi/typesystem/explicit-enum.ts similarity index 100% rename from src/smartcontracts/typesystem/explicit-enum.ts rename to src/abi/typesystem/explicit-enum.ts diff --git a/src/smartcontracts/typesystem/factory.spec.ts b/src/abi/typesystem/factory.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/factory.spec.ts rename to src/abi/typesystem/factory.spec.ts diff --git a/src/smartcontracts/typesystem/factory.ts b/src/abi/typesystem/factory.ts similarity index 100% rename from src/smartcontracts/typesystem/factory.ts rename to src/abi/typesystem/factory.ts diff --git a/src/smartcontracts/typesystem/fields.ts b/src/abi/typesystem/fields.ts similarity index 100% rename from src/smartcontracts/typesystem/fields.ts rename to src/abi/typesystem/fields.ts diff --git a/src/smartcontracts/typesystem/generic.ts b/src/abi/typesystem/generic.ts similarity index 100% rename from src/smartcontracts/typesystem/generic.ts rename to src/abi/typesystem/generic.ts diff --git a/src/smartcontracts/typesystem/genericArray.ts b/src/abi/typesystem/genericArray.ts similarity index 100% rename from src/smartcontracts/typesystem/genericArray.ts rename to src/abi/typesystem/genericArray.ts diff --git a/src/smartcontracts/typesystem/h256.ts b/src/abi/typesystem/h256.ts similarity index 100% rename from src/smartcontracts/typesystem/h256.ts rename to src/abi/typesystem/h256.ts diff --git a/src/smartcontracts/typesystem/index.ts b/src/abi/typesystem/index.ts similarity index 97% rename from src/smartcontracts/typesystem/index.ts rename to src/abi/typesystem/index.ts index 936c40328..f05527ba3 100644 --- a/src/smartcontracts/typesystem/index.ts +++ b/src/abi/typesystem/index.ts @@ -12,6 +12,7 @@ export * from "./codeMetadata"; export * from "./composite"; export * from "./endpoint"; export * from "./enum"; +export * from "./event"; export * from "./explicit-enum"; export * from "./factory"; export * from "./fields"; diff --git a/src/smartcontracts/typesystem/managedDecimal.spec.ts b/src/abi/typesystem/managedDecimal.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/managedDecimal.spec.ts rename to src/abi/typesystem/managedDecimal.spec.ts diff --git a/src/smartcontracts/typesystem/managedDecimal.ts b/src/abi/typesystem/managedDecimal.ts similarity index 100% rename from src/smartcontracts/typesystem/managedDecimal.ts rename to src/abi/typesystem/managedDecimal.ts diff --git a/src/smartcontracts/typesystem/managedDecimalSigned.ts b/src/abi/typesystem/managedDecimalSigned.ts similarity index 100% rename from src/smartcontracts/typesystem/managedDecimalSigned.ts rename to src/abi/typesystem/managedDecimalSigned.ts diff --git a/src/smartcontracts/typesystem/matchers.ts b/src/abi/typesystem/matchers.ts similarity index 100% rename from src/smartcontracts/typesystem/matchers.ts rename to src/abi/typesystem/matchers.ts diff --git a/src/smartcontracts/typesystem/nothing.ts b/src/abi/typesystem/nothing.ts similarity index 100% rename from src/smartcontracts/typesystem/nothing.ts rename to src/abi/typesystem/nothing.ts diff --git a/src/smartcontracts/typesystem/numerical.ts b/src/abi/typesystem/numerical.ts similarity index 100% rename from src/smartcontracts/typesystem/numerical.ts rename to src/abi/typesystem/numerical.ts diff --git a/src/smartcontracts/typesystem/string.ts b/src/abi/typesystem/string.ts similarity index 100% rename from src/smartcontracts/typesystem/string.ts rename to src/abi/typesystem/string.ts diff --git a/src/smartcontracts/typesystem/struct.spec.ts b/src/abi/typesystem/struct.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/struct.spec.ts rename to src/abi/typesystem/struct.spec.ts diff --git a/src/smartcontracts/typesystem/struct.ts b/src/abi/typesystem/struct.ts similarity index 100% rename from src/smartcontracts/typesystem/struct.ts rename to src/abi/typesystem/struct.ts diff --git a/src/smartcontracts/typesystem/tokenIdentifier.ts b/src/abi/typesystem/tokenIdentifier.ts similarity index 100% rename from src/smartcontracts/typesystem/tokenIdentifier.ts rename to src/abi/typesystem/tokenIdentifier.ts diff --git a/src/smartcontracts/typesystem/tuple.ts b/src/abi/typesystem/tuple.ts similarity index 100% rename from src/smartcontracts/typesystem/tuple.ts rename to src/abi/typesystem/tuple.ts diff --git a/src/smartcontracts/typesystem/typeExpressionParser.spec.ts b/src/abi/typesystem/typeExpressionParser.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/typeExpressionParser.spec.ts rename to src/abi/typesystem/typeExpressionParser.spec.ts diff --git a/src/smartcontracts/typesystem/typeExpressionParser.ts b/src/abi/typesystem/typeExpressionParser.ts similarity index 100% rename from src/smartcontracts/typesystem/typeExpressionParser.ts rename to src/abi/typesystem/typeExpressionParser.ts diff --git a/src/smartcontracts/typesystem/typeMapper.spec.ts b/src/abi/typesystem/typeMapper.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/typeMapper.spec.ts rename to src/abi/typesystem/typeMapper.spec.ts diff --git a/src/smartcontracts/typesystem/typeMapper.ts b/src/abi/typesystem/typeMapper.ts similarity index 100% rename from src/smartcontracts/typesystem/typeMapper.ts rename to src/abi/typesystem/typeMapper.ts diff --git a/src/smartcontracts/typesystem/types.spec.ts b/src/abi/typesystem/types.spec.ts similarity index 100% rename from src/smartcontracts/typesystem/types.spec.ts rename to src/abi/typesystem/types.spec.ts diff --git a/src/smartcontracts/typesystem/types.ts b/src/abi/typesystem/types.ts similarity index 100% rename from src/smartcontracts/typesystem/types.ts rename to src/abi/typesystem/types.ts diff --git a/src/smartcontracts/typesystem/variadic.ts b/src/abi/typesystem/variadic.ts similarity index 100% rename from src/smartcontracts/typesystem/variadic.ts rename to src/abi/typesystem/variadic.ts diff --git a/src/converters/transactionsConverter.ts b/src/converters/transactionsConverter.ts index 966ec86e4..5d47886e3 100644 --- a/src/converters/transactionsConverter.ts +++ b/src/converters/transactionsConverter.ts @@ -1,6 +1,6 @@ +import { ResultsParser } from "../abi"; import { IPlainTransactionObject, ITransaction } from "../interface"; import { IContractResultItem, ITransactionEvent, ITransactionOnNetwork } from "../interfaceOfNetwork"; -import { ResultsParser } from "../smartcontracts"; import { Transaction } from "../transaction"; import { SmartContractCallOutcome, diff --git a/src/index.ts b/src/index.ts index 08c8affee..08a84ad38 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ require("./globals"); +export * from "./abi"; export * from "./account"; export * from "./adapters"; export * from "./address"; @@ -19,19 +20,18 @@ export * from "./interfaceOfNetwork"; export * from "./logger"; export * from "./message"; export * from "./networkParams"; +export * from "./networkProviders"; export * from "./relayedTransactionV1Builder"; export * from "./relayedTransactionV2Builder"; export * from "./signableMessage"; export * from "./smartContractQueriesController"; -export * from "./smartcontracts"; export * from "./tokenOperations"; export * from "./tokens"; export * from "./transaction"; export * from "./transactionComputer"; export * from "./transactionPayload"; -export * from "./transactionWatcher"; export * from "./transactionsFactories"; export * from "./transactionsOutcomeParsers"; +export * from "./transactionWatcher"; export * from "./utils"; -export * from "./networkProviders"; export * from "./wallet"; diff --git a/src/proto/serializer.ts b/src/proto/serializer.ts index 2f46ee425..c690b5e4d 100644 --- a/src/proto/serializer.ts +++ b/src/proto/serializer.ts @@ -1,9 +1,9 @@ import BigNumber from "bignumber.js"; +import { bigIntToBuffer } from "../abi/codec/utils"; import { Address } from "../address"; import { TRANSACTION_OPTIONS_DEFAULT, TRANSACTION_OPTIONS_TX_GUARDED } from "../constants"; import * as errors from "../errors"; import { ITransaction, ITransactionValue } from "../interface"; -import { bigIntToBuffer } from "../smartcontracts/codec/utils"; import { Transaction } from "../transaction"; /** diff --git a/src/relayedTransactionV2Builder.ts b/src/relayedTransactionV2Builder.ts index b5b01b1a6..54d1595b7 100644 --- a/src/relayedTransactionV2Builder.ts +++ b/src/relayedTransactionV2Builder.ts @@ -1,7 +1,7 @@ +import { AddressValue, ArgSerializer, BytesValue, U64Value } from "./abi"; import { ErrGasLimitShouldBe0ForInnerTransaction, ErrInvalidRelayedV2BuilderArguments } from "./errors"; import { IAddress, IGasLimit, INonce } from "./interface"; import { INetworkConfig } from "./interfaceOfNetwork"; -import { AddressValue, ArgSerializer, BytesValue, U64Value } from "./smartcontracts"; import { Transaction } from "./transaction"; import { TransactionPayload } from "./transactionPayload"; diff --git a/src/smartContractQueriesController.spec.ts b/src/smartContractQueriesController.spec.ts index 07bc570d8..63c7887a1 100644 --- a/src/smartContractQueriesController.spec.ts +++ b/src/smartContractQueriesController.spec.ts @@ -1,12 +1,12 @@ -import { ContractQueryResponse } from "./networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; +import { AbiRegistry, BigUIntValue, BooleanValue, BytesValue, Tuple, U16Value, U64Value } from "./abi"; import { QueryRunnerAdapter } from "./adapters/queryRunnerAdapter"; +import { ContractQueryResponse } from "./networkProviders"; import { SmartContractQueriesController } from "./smartContractQueriesController"; import { SmartContractQueryResponse } from "./smartContractQuery"; -import { AbiRegistry, BigUIntValue, BooleanValue, BytesValue, Tuple, U16Value, U64Value } from "./smartcontracts"; -import { bigIntToBuffer } from "./smartcontracts/codec/utils"; import { MockNetworkProvider, loadAbiRegistry } from "./testutils"; +import { bigIntToBuffer } from "./tokenOperations/codec"; describe("test smart contract queries controller", () => { describe("createQuery", () => { diff --git a/src/smartContractQueriesController.ts b/src/smartContractQueriesController.ts index d156742fc..aee47a980 100644 --- a/src/smartContractQueriesController.ts +++ b/src/smartContractQueriesController.ts @@ -1,8 +1,7 @@ +import { ArgSerializer, ContractFunction, EndpointDefinition, isTyped, NativeSerializer, ResultsParser } from "./abi"; import { Err, ErrSmartContractQuery } from "./errors"; import { IContractQueryResponse } from "./interfaceOfNetwork"; import { SmartContractQuery, SmartContractQueryResponse } from "./smartContractQuery"; -import { ArgSerializer, ContractFunction, EndpointDefinition, NativeSerializer, ResultsParser } from "./smartcontracts"; -import { isTyped } from "./smartcontracts/typesystem"; interface IAbi { getEndpoint(name: string | ContractFunction): EndpointDefinition; diff --git a/src/testutils/contractController.ts b/src/testutils/contractController.ts index f72d30794..a053e4431 100644 --- a/src/testutils/contractController.ts +++ b/src/testutils/contractController.ts @@ -1,8 +1,6 @@ +import { Interaction, ResultsParser, TypedOutcomeBundle, UntypedOutcomeBundle } from "../abi"; import { ITransactionOnNetwork } from "../interfaceOfNetwork"; import { Logger } from "../logger"; -import { Interaction } from "../smartcontracts/interaction"; -import { TypedOutcomeBundle, UntypedOutcomeBundle } from "../smartcontracts/interface"; -import { ResultsParser } from "../smartcontracts/resultsParser"; import { Transaction } from "../transaction"; import { TransactionWatcher } from "../transactionWatcher"; import { INetworkProvider } from "./networkProviders"; diff --git a/src/testutils/mockNetworkProvider.ts b/src/testutils/mockNetworkProvider.ts index 988d693f5..53276a27b 100644 --- a/src/testutils/mockNetworkProvider.ts +++ b/src/testutils/mockNetworkProvider.ts @@ -1,4 +1,4 @@ -import { ContractResultItem, ContractResults, TransactionOnNetwork, TransactionStatus } from "../networkProviders"; +import { Query } from "../abi/query"; import { Address } from "../address"; import { AsyncTimer } from "../asyncTimer"; import * as errors from "../errors"; @@ -11,7 +11,7 @@ import { ITransactionOnNetwork, ITransactionStatus, } from "../interfaceOfNetwork"; -import { Query } from "../smartcontracts/query"; +import { ContractResultItem, ContractResults, TransactionOnNetwork, TransactionStatus } from "../networkProviders"; import { Transaction, TransactionHash } from "../transaction"; import { createAccountBalance } from "./utils"; diff --git a/src/testutils/utils.ts b/src/testutils/utils.ts index 349e82f3b..0b19c55a7 100644 --- a/src/testutils/utils.ts +++ b/src/testutils/utils.ts @@ -1,10 +1,8 @@ import BigNumber from "bignumber.js"; import * as fs from "fs"; import { PathLike } from "fs"; +import { AbiRegistry, Code, SmartContract, TypedValue } from "../abi"; import { IChainID, IGasLimit } from "../interface"; -import { Code } from "../smartcontracts/code"; -import { SmartContract } from "../smartcontracts/smartContract"; -import { AbiRegistry, TypedValue } from "../smartcontracts/typesystem"; import { Transaction } from "../transaction"; import { TransactionWatcher } from "../transactionWatcher"; import { getAxios } from "../utils"; diff --git a/src/tokenOperations/codec.ts b/src/tokenOperations/codec.ts index 64b4c4844..3fc5cad65 100644 --- a/src/tokenOperations/codec.ts +++ b/src/tokenOperations/codec.ts @@ -1,5 +1,5 @@ import BigNumber from "bignumber.js"; -import * as contractsCodecUtils from "../smartcontracts/codec/utils"; +import * as contractsCodecUtils from "../abi/codec/utils"; import * as codecUtils from "../utils.codec"; export function stringToBuffer(value: string): Buffer { @@ -22,7 +22,7 @@ export function bigIntToBuffer(value: BigNumber.Value): Buffer { return contractsCodecUtils.bigIntToBuffer(value); } -export { utf8ToHex, bigIntToHex, addressToHex } from "../utils.codec"; +export { addressToHex, bigIntToHex, utf8ToHex } from "../utils.codec"; export function bufferToHex(value: Buffer) { const hex = value.toString("hex"); diff --git a/src/tokenTransferBuilders.ts b/src/tokenTransferBuilders.ts index a557ca363..d4b6d37ad 100644 --- a/src/tokenTransferBuilders.ts +++ b/src/tokenTransferBuilders.ts @@ -1,7 +1,6 @@ +import { AddressValue, ArgSerializer, BigUIntValue, BytesValue, TypedValue, U16Value, U64Value } from "./abi"; import { Address } from "./address"; import { IAddress, ITokenTransfer } from "./interface"; -import { ArgSerializer } from "./smartcontracts/argSerializer"; -import { AddressValue, BigUIntValue, BytesValue, TypedValue, U16Value, U64Value } from "./smartcontracts/typesystem"; import { TokenTransfer } from "./tokens"; import { TransactionPayload } from "./transactionPayload"; diff --git a/src/transactionsFactories/delegationTransactionsFactory.ts b/src/transactionsFactories/delegationTransactionsFactory.ts index 0b8062ec2..8e0b2c662 100644 --- a/src/transactionsFactories/delegationTransactionsFactory.ts +++ b/src/transactionsFactories/delegationTransactionsFactory.ts @@ -1,8 +1,8 @@ +import { ArgSerializer, BigUIntValue, BytesValue, StringValue } from "../abi"; import { Address } from "../address"; import { DELEGATION_MANAGER_SC_ADDRESS_HEX } from "../constants"; import { Err } from "../errors"; import { IAddress } from "../interface"; -import { ArgSerializer, BigUIntValue, BytesValue, StringValue } from "../smartcontracts"; import { Transaction } from "../transaction"; import { TransactionBuilder } from "./transactionBuilder"; diff --git a/src/transactionsFactories/relayedTransactionsFactory.ts b/src/transactionsFactories/relayedTransactionsFactory.ts index b69741025..13c2a8e6c 100644 --- a/src/transactionsFactories/relayedTransactionsFactory.ts +++ b/src/transactionsFactories/relayedTransactionsFactory.ts @@ -1,8 +1,8 @@ import BigNumber from "bignumber.js"; +import { AddressValue, ArgSerializer, BytesValue, U64Value } from "../abi"; import { Address } from "../address"; import { ErrInvalidInnerTransaction } from "../errors"; import { IAddress, ITransaction } from "../interface"; -import { AddressValue, ArgSerializer, BytesValue, U64Value } from "../smartcontracts"; import { Transaction } from "../transaction"; const JSONbig = require("json-bigint"); diff --git a/src/transactionsFactories/smartContractTransactionsFactory.spec.ts b/src/transactionsFactories/smartContractTransactionsFactory.spec.ts index 096c37ea7..62633f757 100644 --- a/src/transactionsFactories/smartContractTransactionsFactory.spec.ts +++ b/src/transactionsFactories/smartContractTransactionsFactory.spec.ts @@ -1,9 +1,7 @@ import { assert } from "chai"; +import { AbiRegistry, Code, U32Value } from "../abi"; import { Address } from "../address"; import { Err } from "../errors"; -import { U32Value } from "../smartcontracts"; -import { Code } from "../smartcontracts/code"; -import { AbiRegistry } from "../smartcontracts/typesystem/abiRegistry"; import { loadAbiRegistry, loadContractCode } from "../testutils/utils"; import { Token, TokenTransfer } from "../tokens"; import { SmartContractTransactionsFactory } from "./smartContractTransactionsFactory"; diff --git a/src/transactionsFactories/smartContractTransactionsFactory.ts b/src/transactionsFactories/smartContractTransactionsFactory.ts index 6102ebac5..dc55129b1 100644 --- a/src/transactionsFactories/smartContractTransactionsFactory.ts +++ b/src/transactionsFactories/smartContractTransactionsFactory.ts @@ -1,11 +1,9 @@ +import { ArgSerializer, CodeMetadata, ContractFunction, EndpointDefinition, isTyped, NativeSerializer } from "../abi"; import { Address } from "../address"; import { CONTRACT_DEPLOY_ADDRESS_HEX, VM_TYPE_WASM_VM } from "../constants"; import { Err } from "../errors"; import { IAddress } from "../interface"; import { Logger } from "../logger"; -import { ArgSerializer, CodeMetadata, ContractFunction, EndpointDefinition } from "../smartcontracts"; -import { NativeSerializer } from "../smartcontracts/nativeSerializer"; -import { isTyped } from "../smartcontracts/typesystem"; import { TokenComputer, TokenTransfer } from "../tokens"; import { Transaction } from "../transaction"; import { byteArrayToHex, utf8ToHex } from "../utils.codec"; diff --git a/src/transactionsFactories/tokenManagementTransactionsFactory.ts b/src/transactionsFactories/tokenManagementTransactionsFactory.ts index b674313a5..eff2cdf69 100644 --- a/src/transactionsFactories/tokenManagementTransactionsFactory.ts +++ b/src/transactionsFactories/tokenManagementTransactionsFactory.ts @@ -1,9 +1,9 @@ +import { AddressValue, ArgSerializer, BigUIntValue, BytesValue, StringValue } from "../abi"; import { Address } from "../address"; import { ESDT_CONTRACT_ADDRESS_HEX } from "../constants"; import { ErrBadUsage } from "../errors"; import { IAddress } from "../interface"; import { Logger } from "../logger"; -import { AddressValue, ArgSerializer, BigUIntValue, BytesValue, StringValue } from "../smartcontracts"; import { Transaction } from "../transaction"; import { TransactionBuilder } from "./transactionBuilder"; diff --git a/src/transactionsFactories/tokenTransfersDataBuilder.ts b/src/transactionsFactories/tokenTransfersDataBuilder.ts index 45cd92162..75e8b2409 100644 --- a/src/transactionsFactories/tokenTransfersDataBuilder.ts +++ b/src/transactionsFactories/tokenTransfersDataBuilder.ts @@ -1,6 +1,5 @@ +import { AddressValue, ArgSerializer, BigUIntValue, TokenIdentifierValue, TypedValue, U32Value } from "../abi"; import { IAddress } from "../interface"; -import { ArgSerializer } from "../smartcontracts/argSerializer"; -import { AddressValue, BigUIntValue, TokenIdentifierValue, TypedValue, U32Value } from "../smartcontracts/typesystem"; import { TokenComputer, TokenTransfer } from "../tokens"; export class TokenTransfersDataBuilder { diff --git a/src/transactionsFactories/transferTransactionsFactory.ts b/src/transactionsFactories/transferTransactionsFactory.ts index 84dcf2a63..b4e43c079 100644 --- a/src/transactionsFactories/transferTransactionsFactory.ts +++ b/src/transactionsFactories/transferTransactionsFactory.ts @@ -1,3 +1,4 @@ +import { AddressValue, ArgSerializer, BigUIntValue, BytesValue, TypedValue, U16Value, U64Value } from "../abi"; import { EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER } from "../constants"; import { Err, ErrBadUsage } from "../errors"; import { @@ -10,15 +11,6 @@ import { ITransactionPayload, ITransactionValue, } from "../interface"; -import { - AddressValue, - ArgSerializer, - BigUIntValue, - BytesValue, - TypedValue, - U16Value, - U64Value, -} from "../smartcontracts"; import { TokenComputer, TokenTransfer } from "../tokens"; import { Transaction } from "../transaction"; import { TransactionPayload } from "../transactionPayload"; diff --git a/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.ts b/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.ts index 9f57b4782..f575622bb 100644 --- a/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.ts +++ b/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.ts @@ -1,15 +1,8 @@ +import { ArgSerializer, EndpointDefinition, ResultsParser, ReturnCode, Type, UntypedOutcomeBundle } from "../abi"; import { Address } from "../address"; import { ARGUMENTS_SEPARATOR } from "../constants"; import { Err } from "../errors"; import { IContractResultItem, ITransactionEvent, ITransactionOnNetwork } from "../interfaceOfNetwork"; -import { - ArgSerializer, - EndpointDefinition, - ResultsParser, - ReturnCode, - Type, - UntypedOutcomeBundle, -} from "../smartcontracts"; import { SmartContractCallOutcome, TransactionOutcome, findEventsByIdentifier } from "./resources"; enum Events { diff --git a/src/transactionsOutcomeParsers/tokenManagementTransactionsOutcomeParser.ts b/src/transactionsOutcomeParsers/tokenManagementTransactionsOutcomeParser.ts index fcf78d585..43345ddc2 100644 --- a/src/transactionsOutcomeParsers/tokenManagementTransactionsOutcomeParser.ts +++ b/src/transactionsOutcomeParsers/tokenManagementTransactionsOutcomeParser.ts @@ -1,8 +1,8 @@ +import { bufferToBigInt } from "../abi/codec/utils"; import { Address } from "../address"; import { TransactionsConverter } from "../converters/transactionsConverter"; import { ErrParseTransactionOutcome } from "../errors"; import { ITransactionOnNetwork } from "../interfaceOfNetwork"; -import { bufferToBigInt } from "../smartcontracts/codec/utils"; import { TransactionEvent, TransactionOutcome, findEventsByIdentifier } from "./resources"; export class TokenManagementTransactionsOutcomeParser { diff --git a/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts b/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts index cddc8ea3d..6b1a3fa7d 100644 --- a/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts +++ b/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts @@ -1,3 +1,8 @@ +import BigNumber from "bignumber.js"; +import { assert } from "chai"; +import { AbiRegistry } from "../abi"; +import { Address } from "../address"; +import { TransactionsConverter } from "../converters/transactionsConverter"; import { ContractResultItem, ContractResults, @@ -7,11 +12,6 @@ import { TransactionLogsOnNetwork, TransactionOnNetwork, } from "../networkProviders"; -import BigNumber from "bignumber.js"; -import { assert } from "chai"; -import { Address } from "../address"; -import { TransactionsConverter } from "../converters/transactionsConverter"; -import { AbiRegistry } from "../smartcontracts"; import { loadAbiRegistry } from "../testutils"; import { TransactionEvent, findEventsByFirstTopic } from "./resources"; import { TransactionEventsParser } from "./transactionEventsParser"; diff --git a/src/transactionsOutcomeParsers/transactionEventsParser.ts b/src/transactionsOutcomeParsers/transactionEventsParser.ts index 4d568e077..da4c0d316 100644 --- a/src/transactionsOutcomeParsers/transactionEventsParser.ts +++ b/src/transactionsOutcomeParsers/transactionEventsParser.ts @@ -1,5 +1,4 @@ -import { ResultsParser } from "../smartcontracts"; -import { EventDefinition } from "../smartcontracts/typesystem/event"; +import { EventDefinition, ResultsParser } from "../abi"; import { TransactionEvent } from "./resources"; interface IAbi { diff --git a/src/utils.codec.ts b/src/utils.codec.ts index 0e03b658b..4f70e93c8 100644 --- a/src/utils.codec.ts +++ b/src/utils.codec.ts @@ -1,7 +1,7 @@ import BigNumber from "bignumber.js"; +import * as contractsCodecUtils from "./abi/codec/utils"; import { Address } from "./address"; import { IAddress } from "./interface"; -import * as contractsCodecUtils from "./smartcontracts/codec/utils"; export function numberToPaddedHex(value: bigint | number | BigNumber.Value) { let hexableNumber: { toString(radix?: number): string };