From 41ff1516c6d0ef83e054baedb9f87cdb357babff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Dethier?= Date: Wed, 8 May 2024 11:50:33 +0200 Subject: [PATCH] fix: handle Sepolia and Amoy. logion-network/logion-internal#1244 --- package.json | 2 +- src/logion/services/ownership/alchemy.service.ts | 4 ++-- test/unit/services/ownership/alchemy.service.spec.ts | 2 +- yarn.lock | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 5a4d57b..baac314 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@logion/rest-api-core": "^0.5.0", "@polkadot/api-contract": "^10.12.4", "@polkadot/wasm-crypto": "^7.3.2", - "alchemy-sdk": "^3.2.0", + "alchemy-sdk": "^3.3.0", "ansi-regex": "^6.0.1", "axios": "^1.3.2", "body-parser": "^1.20.1", diff --git a/src/logion/services/ownership/alchemy.service.ts b/src/logion/services/ownership/alchemy.service.ts index f7ace47..8d7fe14 100644 --- a/src/logion/services/ownership/alchemy.service.ts +++ b/src/logion/services/ownership/alchemy.service.ts @@ -40,13 +40,13 @@ export class AlchemyService { constructor(factory: AlchemyFactory) { this.apiKeys = {}; if(process.env.GOERLI_ALCHEMY_KEY) { - this.apiKeys[Network.ETH_GOERLI] = process.env.GOERLI_ALCHEMY_KEY; + this.apiKeys[Network.ETH_SEPOLIA] = process.env.GOERLI_ALCHEMY_KEY; } if(process.env.ETHEREUM_ALCHEMY_KEY) { this.apiKeys[Network.ETH_MAINNET] = process.env.ETHEREUM_ALCHEMY_KEY; } if(process.env.POLYGON_MUMBAI_ALCHEMY_KEY) { - this.apiKeys[Network.MATIC_MUMBAI] = process.env.POLYGON_MUMBAI_ALCHEMY_KEY; + this.apiKeys[Network.MATIC_AMOY] = process.env.POLYGON_MUMBAI_ALCHEMY_KEY; } if(process.env.POLYGON_MAINNET_ALCHEMY_KEY) { this.apiKeys[Network.MATIC_MAINNET] = process.env.POLYGON_MAINNET_ALCHEMY_KEY; diff --git a/test/unit/services/ownership/alchemy.service.spec.ts b/test/unit/services/ownership/alchemy.service.spec.ts index 19a7891..59ce005 100644 --- a/test/unit/services/ownership/alchemy.service.spec.ts +++ b/test/unit/services/ownership/alchemy.service.spec.ts @@ -43,7 +43,7 @@ function buildAlchemyService(): AlchemyService { return new AlchemyService(factoryMock.object()); } -const expectedNetwork = Network.ETH_GOERLI; +const expectedNetwork = Network.ETH_SEPOLIA; const expectedApiKey = "dMRDl5c9KAkuURTKjYgVN5DN06IBRfZG"; const expectedContractAddress = "0x765df6da33c1ec1f83be42db171d7ee334a46df5"; const expectedTokenId = "4391"; diff --git a/yarn.lock b/yarn.lock index 53f527a..428c1b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2735,9 +2735,9 @@ __metadata: languageName: node linkType: hard -"alchemy-sdk@npm:^3.2.0": - version: 3.2.0 - resolution: "alchemy-sdk@npm:3.2.0" +"alchemy-sdk@npm:^3.3.0": + version: 3.3.0 + resolution: "alchemy-sdk@npm:3.3.0" dependencies: "@ethersproject/abi": ^5.7.0 "@ethersproject/abstract-provider": ^5.7.0 @@ -2753,7 +2753,7 @@ __metadata: axios: ^1.6.5 sturdy-websocket: ^0.2.1 websocket: ^1.0.34 - checksum: 90eff795b8d57bcf15292e92ed9997bd67fa000caecd407b0fc3c144b9808e3a8364546e5be549dcca121de101e2511064ebe1670d6b99edfa77475ddd6dc400 + checksum: 4628741ffe27d30ac473529e43fb4cad49916c8ad01bfc2887b3111de7aa9866298efe8b0e1050671b6ffb8edeb90de8a815e8ed4d4bf5c27c43380658f28e10 languageName: node linkType: hard @@ -6752,7 +6752,7 @@ __metadata: "@types/uuid": ^8.3.4 "@typescript-eslint/eslint-plugin": ^6.9.1 "@typescript-eslint/parser": ^6.9.1 - alchemy-sdk: ^3.2.0 + alchemy-sdk: ^3.3.0 ansi-regex: ^6.0.1 axios: ^1.3.2 body-parser: ^1.20.1