From 77c59396bcf81d89b2110992b302133f1b00712f Mon Sep 17 00:00:00 2001 From: goga-m Date: Mon, 18 Nov 2024 15:12:16 +0100 Subject: [PATCH] wip --- src/utils/environment.ts | 8 +++++--- .../migrations/initialize-mainsail-networks.ts | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/utils/migrations/initialize-mainsail-networks.ts diff --git a/src/utils/environment.ts b/src/utils/environment.ts index c9706cbfc6..55050a497c 100644 --- a/src/utils/environment.ts +++ b/src/utils/environment.ts @@ -1,11 +1,12 @@ import { ARK } from "@ardenthq/sdk-ark"; import { Environment } from "@ardenthq/sdk-profiles"; import { Mainsail } from "@ardenthq/sdk-mainsail"; +import { StubStorage } from "@/tests/mocks"; import { connectedTransport as ledgerTransportFactory } from "@/app/contexts/Ledger/transport"; import { httpClient } from "@/app/services"; -import { StubStorage } from "@/tests/mocks"; -import { isE2E, isUnit } from "@/utils/test-helpers"; import { initializeArkNetworks } from "@/utils/migrations/initialize-ark-networks"; +import { initializeMainsailNetworks } from "./migrations/initialize-mainsail-networks"; +import { isE2E, isUnit } from "@/utils/test-helpers"; import { updateArkConstants } from "@/utils/migrations/update-ark-constants"; import { updateArkNethashes } from "@/utils/migrations/update-ark-nethashes"; @@ -27,8 +28,9 @@ export const initializeEnvironment = (): Environment => { "0.0.9": initializeArkNetworks, "1.1.0": updateArkConstants, "1.2.0": updateArkNethashes, + "1.2.1": initializeMainsailNetworks, }, - "1.2.0", + "1.2.1", ); return env; diff --git a/src/utils/migrations/initialize-mainsail-networks.ts b/src/utils/migrations/initialize-mainsail-networks.ts new file mode 100644 index 0000000000..fd0ab5f1be --- /dev/null +++ b/src/utils/migrations/initialize-mainsail-networks.ts @@ -0,0 +1,13 @@ +import { Mainsail } from "@ardenthq/sdk-mainsail"; + +export const initializeMainsailNetworks = ({ data }) => { + console.log("mainsail network") + if (!data.networks) { + data.networks = {}; + } + + data.networks.mainsail = { + devnet: Mainsail.manifest.networks["mainsail.devnet"], + }; + console.log({ data }) +};