Skip to content

Commit 3ffb584

Browse files
authored
Data engine lib helper (#4090)
1 parent 6a10318 commit 3ffb584

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/loud-papayas-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@chainlink/data-engine-adapter': patch
3+
---
4+
5+
Expose lib helper properly

packages/sources/data-engine/src/lib.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { BaseEndpointTypes as CryptoV3Types } from './endpoint/cryptoV3'
66
import { BaseEndpointTypes as RwaV8Types } from './endpoint/rwaV8'
77

88
export const getCryptoPrice = async (feedId: string, url: string, requester: Requester) =>
9-
callEA<CryptoV3Types['Response']>(feedId, 'crypto-v3', url, requester)
9+
(await callEA<CryptoV3Types['Response']>(feedId, 'crypto-v3', url, requester)).Data
1010

1111
export const getRwaPrice = async (feedId: string, url: string, requester: Requester) =>
12-
callEA<RwaV8Types['Response']>(feedId, 'rwa-v8', url, requester)
12+
(await callEA<RwaV8Types['Response']>(feedId, 'rwa-v8', url, requester)).Data
1313

1414
const callEA = async <T>(feedId: string, endpoint: string, url: string, requester: Requester) => {
1515
const requestConfig = {
@@ -34,7 +34,7 @@ const callEA = async <T>(feedId: string, endpoint: string, url: string, requeste
3434
})
3535
}
3636

37-
return (data as any).Data
37+
return data
3838
} catch (e) {
3939
if (e instanceof AdapterError) {
4040
e.message = `${e.message} ${JSON.stringify(e?.errorResponse) || e.name}`

0 commit comments

Comments
 (0)