Skip to content

Commit f177113

Browse files
authored
Remove direct axios dependency from por-address-list (#5105)
1 parent 215eb01 commit f177113

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

.changeset/honest-moose-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@chainlink/por-address-list-adapter': patch
3+
---
4+
5+
Remove dependency on axios

.pnp.cjs

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sources/por-address-list/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
},
3636
"dependencies": {
3737
"@chainlink/external-adapter-framework": "2.16.1",
38-
"axios": "1.16.1",
3938
"ethers": "^5.5.1",
4039
"tslib": "2.4.1"
4140
}

packages/sources/por-address-list/src/transport/virtune-utils.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { TransportGenerics } from '@chainlink/external-adapter-framework/transports'
1+
import {
2+
HttpTransportConfig,
3+
TransportGenerics,
4+
} from '@chainlink/external-adapter-framework/transports'
25
import { TypeFromDefinition } from '@chainlink/external-adapter-framework/validation/input-params'
3-
import { AxiosResponse } from 'axios'
46
import { config } from '../config'
57

68
export const getUrl = (params: { accountId: string }): string => {
@@ -39,11 +41,16 @@ export interface ResponseSchema {
3941
}
4042

4143
type VirtuneTransportGenerics = TransportGenerics & {
44+
Settings: typeof config.settings
4245
Response: {
4346
Data: {
4447
result: unknown[]
4548
}
4649
}
50+
Provider: {
51+
RequestBody: never
52+
ResponseBody: ResponseSchema
53+
}
4754
}
4855

4956
export type VirtuneParams<T extends VirtuneTransportGenerics> = TypeFromDefinition<T['Parameters']>
@@ -70,7 +77,7 @@ export const createVirtuneTransportConfig = <T extends VirtuneTransportGenerics>
7077
params: VirtuneParams<T>
7178
addresses: string[]
7279
}) => VirtuneResult<T>,
73-
) => ({
80+
): HttpTransportConfig<T> => ({
7481
prepareRequests: (params: VirtuneParams<T>[], config: Config) => {
7582
return params.map((param) => ({
7683
params: [param],
@@ -83,7 +90,7 @@ export const createVirtuneTransportConfig = <T extends VirtuneTransportGenerics>
8390
},
8491
}))
8592
},
86-
parseResponse: (params: VirtuneParams<T>[], response: AxiosResponse<ResponseSchema>) => {
93+
parseResponse: (params, response) => {
8794
const [param] = params
8895
if (!response.data) {
8996
return [

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4342,7 +4342,6 @@ __metadata:
43424342
"@chainlink/external-adapter-framework": "npm:2.16.1"
43434343
"@types/jest": "npm:^29.5.14"
43444344
"@types/node": "npm:22.14.1"
4345-
axios: "npm:1.16.1"
43464345
ethers: "npm:^5.5.1"
43474346
nock: "npm:13.5.6"
43484347
tslib: "npm:2.4.1"

0 commit comments

Comments
 (0)