Skip to content

Commit

Permalink
ocelloids client upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor-Salomon committed Jan 23, 2025
1 parent cc337a5 commit 9be237d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions app/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions app/src/utils/ocelloids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ 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,
})
}

export const getOcelloidsAgentApi = async (): Promise<
OcelloidsAgentApi<xcm.XcmInputs> | undefined
> => {
try {
const OCLD_ClIENT = initOcelloidsClient()
const OCLD_ClIENT = initOcelloidsClient(OCELLOIDS_API_KEY)

await OCLD_ClIENT.health()
.then(() => {})
Expand Down

0 comments on commit 9be237d

Please sign in to comment.