diff --git a/package-lock.json b/package-lock.json index d041cb8f..355a26d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,6 @@ "keccak": "3.0.2" }, "devDependencies": { - "@multiversx/sdk-network-providers": "2.6.0", "@multiversx/sdk-wallet": "4.5.1", "@types/assert": "1.4.6", "@types/chai": "4.2.11", @@ -161,21 +160,6 @@ "node": ">=8.9.0" } }, - "node_modules/@multiversx/sdk-network-providers": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-network-providers/-/sdk-network-providers-2.6.0.tgz", - "integrity": "sha512-fAj7Py3otll00iFunwcDwp7/i7NiHInLN4EhdEFVfKNY5Z+roGI6YwPy3i60l8JApGE6DzmBQ22nVFYv8NzrPA==", - "dev": true, - "dependencies": { - "bech32": "1.1.4", - "bignumber.js": "9.0.1", - "buffer": "6.0.3", - "json-bigint": "1.0.0" - }, - "peerDependencies": { - "axios": "^1.7.4" - } - }, "node_modules/@multiversx/sdk-transaction-decoder": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@multiversx/sdk-transaction-decoder/-/sdk-transaction-decoder-1.0.2.tgz", @@ -5317,18 +5301,6 @@ "integrity": "sha512-c0tIdQUnbBLSt6NYU+OpeGPYdL0+GV547HeHT8Xc0BKQ7Cj0v82QUoA2QRtWrR1G4MNZmLsIacZSsf6DrIS2Bw==", "dev": true }, - "@multiversx/sdk-network-providers": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-network-providers/-/sdk-network-providers-2.6.0.tgz", - "integrity": "sha512-fAj7Py3otll00iFunwcDwp7/i7NiHInLN4EhdEFVfKNY5Z+roGI6YwPy3i60l8JApGE6DzmBQ22nVFYv8NzrPA==", - "dev": true, - "requires": { - "bech32": "1.1.4", - "bignumber.js": "9.0.1", - "buffer": "6.0.3", - "json-bigint": "1.0.0" - } - }, "@multiversx/sdk-transaction-decoder": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@multiversx/sdk-transaction-decoder/-/sdk-transaction-decoder-1.0.2.tgz", diff --git a/package.json b/package.json index 0df0f4d3..6fa7815b 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "keccak": "3.0.2" }, "devDependencies": { - "@multiversx/sdk-network-providers": "2.6.0", "@multiversx/sdk-wallet": "4.5.1", "@types/assert": "1.4.6", "@types/chai": "4.2.11", diff --git a/src/converters/transactionsConverters.spec.ts b/src/converters/transactionsConverters.spec.ts index a61dd3bc..12d26271 100644 --- a/src/converters/transactionsConverters.spec.ts +++ b/src/converters/transactionsConverters.spec.ts @@ -2,11 +2,11 @@ import { ContractResultItem, ContractResults, TransactionEventData, - TransactionEvent as TransactionEventOnNetwork, + TransactionEventOnNetwork, TransactionEventTopic, - TransactionLogs as TransactionLogsOnNetwork, + TransactionLogsOnNetwork, TransactionOnNetwork, -} from "@multiversx/sdk-network-providers"; +} from "../networkProviders"; import { assert } from "chai"; import { Address } from "../address"; import { Transaction } from "../transaction"; diff --git a/src/index.ts b/src/index.ts index d244d0e0..8ef8255b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,3 +33,4 @@ export * from "./transactionWatcher"; export * from "./transactionsFactories"; export * from "./transactionsOutcomeParsers"; export * from "./utils"; +export * from "./networkProviders"; diff --git a/src-network-providers/.npmignore b/src/networkProviders/.npmignore similarity index 100% rename from src-network-providers/.npmignore rename to src/networkProviders/.npmignore diff --git a/src-network-providers/accounts.ts b/src/networkProviders/accounts.ts similarity index 100% rename from src-network-providers/accounts.ts rename to src/networkProviders/accounts.ts diff --git a/src-network-providers/apiNetworkProvider.ts b/src/networkProviders/apiNetworkProvider.ts similarity index 100% rename from src-network-providers/apiNetworkProvider.ts rename to src/networkProviders/apiNetworkProvider.ts diff --git a/src-network-providers/config.ts b/src/networkProviders/config.ts similarity index 100% rename from src-network-providers/config.ts rename to src/networkProviders/config.ts diff --git a/src-network-providers/constants.ts b/src/networkProviders/constants.ts similarity index 100% rename from src-network-providers/constants.ts rename to src/networkProviders/constants.ts diff --git a/src-network-providers/contractQueryRequest.ts b/src/networkProviders/contractQueryRequest.ts similarity index 100% rename from src-network-providers/contractQueryRequest.ts rename to src/networkProviders/contractQueryRequest.ts diff --git a/src-network-providers/contractQueryResponse.ts b/src/networkProviders/contractQueryResponse.ts similarity index 100% rename from src-network-providers/contractQueryResponse.ts rename to src/networkProviders/contractQueryResponse.ts diff --git a/src-network-providers/contractResults.ts b/src/networkProviders/contractResults.ts similarity index 100% rename from src-network-providers/contractResults.ts rename to src/networkProviders/contractResults.ts diff --git a/src-network-providers/errors.ts b/src/networkProviders/errors.ts similarity index 100% rename from src-network-providers/errors.ts rename to src/networkProviders/errors.ts diff --git a/src-network-providers/index.ts b/src/networkProviders/index.ts similarity index 80% rename from src-network-providers/index.ts rename to src/networkProviders/index.ts index 804b15b6..16c7fcca 100644 --- a/src-network-providers/index.ts +++ b/src/networkProviders/index.ts @@ -4,8 +4,12 @@ export { ProxyNetworkProvider } from "./proxyNetworkProvider"; export { AccountOnNetwork } from "./accounts"; export { ContractQueryResponse } from "./contractQueryResponse"; export { ContractResultItem, ContractResults } from "./contractResults"; -export { TransactionEvent, TransactionEventData, TransactionEventTopic } from "./transactionEvents"; -export { TransactionLogs } from "./transactionLogs"; +export { + TransactionEvent as TransactionEventOnNetwork, + TransactionEventData, + TransactionEventTopic, +} from "./transactionEvents"; +export { TransactionLogs as TransactionLogsOnNetwork } from "./transactionLogs"; export { TransactionReceipt } from "./transactionReceipt"; export { TransactionStatus } from "./transactionStatus"; export { TransactionOnNetwork } from "./transactions"; @@ -17,4 +21,3 @@ export { NetworkConfig } from "./networkConfig"; export { NetworkGeneralStatistics } from "./networkGeneralStatistics"; export { NetworkStake } from "./networkStake"; export { NetworkStatus } from "./networkStatus"; - diff --git a/src-network-providers/interface.ts b/src/networkProviders/interface.ts similarity index 100% rename from src-network-providers/interface.ts rename to src/networkProviders/interface.ts diff --git a/src-network-providers/networkConfig.ts b/src/networkProviders/networkConfig.ts similarity index 100% rename from src-network-providers/networkConfig.ts rename to src/networkProviders/networkConfig.ts diff --git a/src-network-providers/networkGeneralStatistics.ts b/src/networkProviders/networkGeneralStatistics.ts similarity index 100% rename from src-network-providers/networkGeneralStatistics.ts rename to src/networkProviders/networkGeneralStatistics.ts diff --git a/src-network-providers/networkProviderConfig.ts b/src/networkProviders/networkProviderConfig.ts similarity index 100% rename from src-network-providers/networkProviderConfig.ts rename to src/networkProviders/networkProviderConfig.ts diff --git a/src-network-providers/networkStake.ts b/src/networkProviders/networkStake.ts similarity index 100% rename from src-network-providers/networkStake.ts rename to src/networkProviders/networkStake.ts diff --git a/src-network-providers/networkStatus.ts b/src/networkProviders/networkStatus.ts similarity index 100% rename from src-network-providers/networkStatus.ts rename to src/networkProviders/networkStatus.ts diff --git a/src-network-providers/pairs.ts b/src/networkProviders/pairs.ts similarity index 100% rename from src-network-providers/pairs.ts rename to src/networkProviders/pairs.ts diff --git a/src-network-providers/primitives.spec.ts b/src/networkProviders/primitives.spec.ts similarity index 100% rename from src-network-providers/primitives.spec.ts rename to src/networkProviders/primitives.spec.ts diff --git a/src-network-providers/primitives.ts b/src/networkProviders/primitives.ts similarity index 100% rename from src-network-providers/primitives.ts rename to src/networkProviders/primitives.ts diff --git a/src-network-providers/providers.dev.net.spec.ts b/src/networkProviders/providers.dev.net.spec.ts similarity index 100% rename from src-network-providers/providers.dev.net.spec.ts rename to src/networkProviders/providers.dev.net.spec.ts diff --git a/src-network-providers/proxyNetworkProvider.ts b/src/networkProviders/proxyNetworkProvider.ts similarity index 100% rename from src-network-providers/proxyNetworkProvider.ts rename to src/networkProviders/proxyNetworkProvider.ts diff --git a/src-network-providers/serialization.spec.ts b/src/networkProviders/serialization.spec.ts similarity index 100% rename from src-network-providers/serialization.spec.ts rename to src/networkProviders/serialization.spec.ts diff --git a/src-network-providers/testscommon/dummyQuery.ts b/src/networkProviders/testscommon/dummyQuery.ts similarity index 100% rename from src-network-providers/testscommon/dummyQuery.ts rename to src/networkProviders/testscommon/dummyQuery.ts diff --git a/src-network-providers/tokenDefinitions.ts b/src/networkProviders/tokenDefinitions.ts similarity index 100% rename from src-network-providers/tokenDefinitions.ts rename to src/networkProviders/tokenDefinitions.ts diff --git a/src-network-providers/tokens.ts b/src/networkProviders/tokens.ts similarity index 100% rename from src-network-providers/tokens.ts rename to src/networkProviders/tokens.ts diff --git a/src-network-providers/transactionEvents.ts b/src/networkProviders/transactionEvents.ts similarity index 100% rename from src-network-providers/transactionEvents.ts rename to src/networkProviders/transactionEvents.ts diff --git a/src-network-providers/transactionLogs.ts b/src/networkProviders/transactionLogs.ts similarity index 100% rename from src-network-providers/transactionLogs.ts rename to src/networkProviders/transactionLogs.ts diff --git a/src-network-providers/transactionReceipt.ts b/src/networkProviders/transactionReceipt.ts similarity index 100% rename from src-network-providers/transactionReceipt.ts rename to src/networkProviders/transactionReceipt.ts diff --git a/src-network-providers/transactionStatus.ts b/src/networkProviders/transactionStatus.ts similarity index 100% rename from src-network-providers/transactionStatus.ts rename to src/networkProviders/transactionStatus.ts diff --git a/src-network-providers/transactions.ts b/src/networkProviders/transactions.ts similarity index 100% rename from src-network-providers/transactions.ts rename to src/networkProviders/transactions.ts diff --git a/src-network-providers/userAgent.ts b/src/networkProviders/userAgent.ts similarity index 100% rename from src-network-providers/userAgent.ts rename to src/networkProviders/userAgent.ts diff --git a/src/smartContractQueriesController.spec.ts b/src/smartContractQueriesController.spec.ts index c6530983..07bc570d 100644 --- a/src/smartContractQueriesController.spec.ts +++ b/src/smartContractQueriesController.spec.ts @@ -1,4 +1,4 @@ -import { ContractQueryResponse } from "@multiversx/sdk-network-providers"; +import { ContractQueryResponse } from "./networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; import { QueryRunnerAdapter } from "./adapters/queryRunnerAdapter"; diff --git a/src/smartcontracts/interaction.spec.ts b/src/smartcontracts/interaction.spec.ts index 4777691c..e88789a9 100644 --- a/src/smartcontracts/interaction.spec.ts +++ b/src/smartcontracts/interaction.spec.ts @@ -1,4 +1,4 @@ -import { ContractQueryResponse } from "@multiversx/sdk-network-providers"; +import { ContractQueryResponse } from "../networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; import { Address } from "../address"; diff --git a/src/smartcontracts/resultsParser.spec.ts b/src/smartcontracts/resultsParser.spec.ts index 30757b90..c08bc885 100644 --- a/src/smartcontracts/resultsParser.spec.ts +++ b/src/smartcontracts/resultsParser.spec.ts @@ -2,12 +2,12 @@ import { ContractQueryResponse, ContractResultItem, ContractResults, - TransactionEvent, + TransactionEventOnNetwork, TransactionEventTopic, - TransactionLogs, + TransactionLogsOnNetwork, TransactionOnNetwork, -} from "@multiversx/sdk-network-providers"; -import { TransactionEventData } from "@multiversx/sdk-network-providers/out/transactionEvents"; + TransactionEventData, +} from "../networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; import * as fs from "fs"; @@ -220,10 +220,10 @@ describe("test smart contract results parser", () => { it("should parse contract outcome, on signal error", async () => { let transaction = new TransactionOnNetwork({ - logs: new TransactionLogs({ + logs: new TransactionLogsOnNetwork({ address: Address.empty(), events: [ - new TransactionEvent({ + new TransactionEventOnNetwork({ identifier: "signalError", topics: [new TransactionEventTopic(Buffer.from("something happened").toString("base64"))], data: `@${Buffer.from("user error").toString("hex")}@07`, @@ -240,10 +240,10 @@ describe("test smart contract results parser", () => { it("should parse contract outcome, on too much gas warning", async () => { let transaction = new TransactionOnNetwork({ - logs: new TransactionLogs({ + logs: new TransactionLogsOnNetwork({ address: Address.empty(), events: [ - new TransactionEvent({ + new TransactionEventOnNetwork({ identifier: "writeLog", topics: [ new TransactionEventTopic( @@ -269,7 +269,7 @@ describe("test smart contract results parser", () => { const abiRegistry = await loadAbiRegistry("src/testdata/esdt-safe.abi.json"); const eventDefinition = abiRegistry.getEvent("deposit"); - const event = new TransactionEvent({ + const event = new TransactionEventOnNetwork({ topics: [ new TransactionEventTopic("ZGVwb3NpdA=="), new TransactionEventTopic("cmzC1LRt1r10pMhNAnFb+FyudjGMq4G8CefCYdQUmmc="), diff --git a/src/smartcontracts/smartContract.spec.ts b/src/smartcontracts/smartContract.spec.ts index 7fc958b2..bf5e2a13 100644 --- a/src/smartcontracts/smartContract.spec.ts +++ b/src/smartcontracts/smartContract.spec.ts @@ -1,4 +1,4 @@ -import { TransactionStatus } from "@multiversx/sdk-network-providers"; +import { TransactionStatus } from "../networkProviders"; import { assert } from "chai"; import { Address } from "../address"; import { diff --git a/src/testutils/mockNetworkProvider.ts b/src/testutils/mockNetworkProvider.ts index a8e0a181..988d693f 100644 --- a/src/testutils/mockNetworkProvider.ts +++ b/src/testutils/mockNetworkProvider.ts @@ -1,9 +1,4 @@ -import { - ContractResultItem, - ContractResults, - TransactionOnNetwork, - TransactionStatus, -} from "@multiversx/sdk-network-providers"; +import { ContractResultItem, ContractResults, TransactionOnNetwork, TransactionStatus } from "../networkProviders"; import { Address } from "../address"; import { AsyncTimer } from "../asyncTimer"; import * as errors from "../errors"; diff --git a/src/testutils/networkProviders.ts b/src/testutils/networkProviders.ts index 736a9bed..3b27e3ed 100644 --- a/src/testutils/networkProviders.ts +++ b/src/testutils/networkProviders.ts @@ -1,4 +1,4 @@ -import { ApiNetworkProvider, ProxyNetworkProvider } from "@multiversx/sdk-network-providers"; +import { ApiNetworkProvider, ProxyNetworkProvider } from "../networkProviders"; import { IAddress } from "../interface"; import { IAccountOnNetwork, diff --git a/src/transactionWatcher.spec.ts b/src/transactionWatcher.spec.ts index fbcfae2e..dd223af6 100644 --- a/src/transactionWatcher.spec.ts +++ b/src/transactionWatcher.spec.ts @@ -1,4 +1,4 @@ -import { TransactionOnNetwork, TransactionStatus } from "@multiversx/sdk-network-providers"; +import { TransactionOnNetwork, TransactionStatus } from "./networkProviders"; import { assert } from "chai"; import { MarkCompleted, MockNetworkProvider, Wait } from "./testutils"; import { TransactionHash } from "./transaction"; diff --git a/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts b/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts index 5bbcbdd5..e005f1b3 100644 --- a/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts +++ b/src/transactionsOutcomeParsers/smartContractTransactionsOutcomeParser.spec.ts @@ -3,9 +3,9 @@ import { ContractResults, TransactionEventTopic, TransactionOnNetwork, - TransactionEvent as TransactionOnNetworkEvent, - TransactionLogs as TransactionOnNetworkLogs, -} from "@multiversx/sdk-network-providers"; + TransactionEventOnNetwork, + TransactionLogsOnNetwork, +} from "../networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; import { Address } from "../address"; @@ -60,9 +60,9 @@ describe("test smart contract transactions outcome parser", () => { const transactionOnNetwork = new TransactionOnNetwork({ nonce: 7, - logs: new TransactionOnNetworkLogs({ + logs: new TransactionLogsOnNetwork({ events: [ - new TransactionOnNetworkEvent({ + new TransactionEventOnNetwork({ identifier: "SCDeploy", topics: [ new TransactionEventTopic(contract.getPublicKey().toString("base64")), @@ -102,9 +102,9 @@ describe("test smart contract transactions outcome parser", () => { const transactionOnNetwork = new TransactionOnNetwork({ nonce: 7, - logs: new TransactionOnNetworkLogs({ + logs: new TransactionLogsOnNetwork({ events: [ - new TransactionOnNetworkEvent({ + new TransactionEventOnNetwork({ identifier: "signalError", topics: [ new TransactionEventTopic(deployer.getPublicKey().toString("base64")), diff --git a/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts b/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts index 9ed01c91..cddc8ea3 100644 --- a/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts +++ b/src/transactionsOutcomeParsers/transactionEventsParser.spec.ts @@ -2,11 +2,11 @@ import { ContractResultItem, ContractResults, TransactionEventData, - TransactionEvent as TransactionEventOnNetwork, + TransactionEventOnNetwork, TransactionEventTopic, - TransactionLogs as TransactionLogsOnNetwork, + TransactionLogsOnNetwork, TransactionOnNetwork, -} from "@multiversx/sdk-network-providers"; +} from "../networkProviders"; import BigNumber from "bignumber.js"; import { assert } from "chai"; import { Address } from "../address";