From 9be237dd82e11fc41396011a281e5ddd3dc91dab Mon Sep 17 00:00:00 2001 From: Victor-Salomon Date: Thu, 23 Jan 2025 14:07:33 +0100 Subject: [PATCH] ocelloids client upgrade --- app/package.json | 2 +- app/pnpm-lock.yaml | 10 +++++----- app/src/utils/ocelloids.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/package.json b/app/package.json index 26f60304..8458a1b6 100644 --- a/app/package.json +++ b/app/package.json @@ -38,7 +38,7 @@ "@sentry/profiling-node": "^8.35.0", "@snowbridge/api": "^0.1.23", "@snowbridge/contract-types": "^0.1.23", - "@sodazone/ocelloids-client": "^2.4.1", + "@sodazone/ocelloids-client": "^2.4.4", "@talismn/connect-components": "^1.1.8", "@tanstack/react-query": "^5.61.5", "@vercel/analytics": "^1.3.1", diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yaml index 238449c5..a00e0f4b 100644 --- a/app/pnpm-lock.yaml +++ b/app/pnpm-lock.yaml @@ -78,8 +78,8 @@ importers: specifier: ^0.1.23 version: 0.1.25(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@sodazone/ocelloids-client': - specifier: ^2.4.1 - version: 2.4.1(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + specifier: ^2.4.4 + version: 2.4.4(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@talismn/connect-components': specifier: ^1.1.8 version: 1.1.9(@polkadot/api@14.3.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@polkadot/extension-inject@0.56.2(@polkadot/api@14.3.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@polkadot/util@13.3.1)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -3904,8 +3904,8 @@ packages: '@socket.io/component-emitter@3.1.2': resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==} - '@sodazone/ocelloids-client@2.4.1': - resolution: {integrity: sha512-XtgIjppFx9KFFmlKwC5i9LgdVRUq/sfx3m+myf/5wfELOLovumjvsGkWXGKMLkLGmO1NXSZhXRXc0DRjAcoWgA==} + '@sodazone/ocelloids-client@2.4.4': + resolution: {integrity: sha512-saQZhbODukXrML3I+iYKYzCnCMwHmzaxe66TpXs7QtvpVeZFDJ6nyABAsFChpx6mchSckMM7SNDVOmbs2GdMcw==} engines: {node: '>=18'} peerDependencies: ws: '*' @@ -15136,7 +15136,7 @@ snapshots: '@socket.io/component-emitter@3.1.2': {} - '@sodazone/ocelloids-client@2.4.1(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@sodazone/ocelloids-client@2.4.4(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: isows: 1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) ky: 1.7.4 diff --git a/app/src/utils/ocelloids.ts b/app/src/utils/ocelloids.ts index a85985c7..b695890d 100644 --- a/app/src/utils/ocelloids.ts +++ b/app/src/utils/ocelloids.ts @@ -21,16 +21,16 @@ enum xcmNotificationType { Bridge = 'xcm.bridge', } -const OCELLOIDS_API_KEY = process.env.NEXT_PUBLIC_OC_API_KEY_READ_WRITE || '' +export const OCELLOIDS_API_KEY = process.env.NEXT_PUBLIC_OC_API_KEY_READ_WRITE || '' // Helper to filter the subscribable transfers only export const getSubscribableTransfers = (transfers: StoredTransfer[]) => transfers.filter(t => resolveDirection(t.sourceChain, t.destChain) === Direction.WithinPolkadot) -export const initOcelloidsClient = () => { - if (!OCELLOIDS_API_KEY) throw new Error('OCELLOIDS_API_KEY is undefined') +export const initOcelloidsClient = (API_KEY: string) => { + if (!API_KEY) throw new Error('OCELLOIDS_API_KEY is undefined') return new OcelloidsClient({ - apiKey: OCELLOIDS_API_KEY, + apiKey: API_KEY, }) } @@ -38,7 +38,7 @@ export const getOcelloidsAgentApi = async (): Promise< OcelloidsAgentApi | undefined > => { try { - const OCLD_ClIENT = initOcelloidsClient() + const OCLD_ClIENT = initOcelloidsClient(OCELLOIDS_API_KEY) await OCLD_ClIENT.health() .then(() => {})