From f988345c0e872fc83eb9cbb9bba5b58972160e29 Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Tue, 18 Nov 2025 15:29:48 +0530 Subject: [PATCH 1/8] Accountable EA --- .pnp.cjs | 20 +++++ packages/sources/accountable/CHANGELOG.md | 1 + packages/sources/accountable/README.md | 54 ++++++++++++++ packages/sources/accountable/package.json | 40 ++++++++++ .../sources/accountable/src/config/index.ts | 9 +++ .../sources/accountable/src/endpoint/index.ts | 1 + .../accountable/src/endpoint/reserve.ts | 41 ++++++++++ packages/sources/accountable/src/index.ts | 20 +++++ .../accountable/src/transport/reserve.ts | 73 ++++++++++++++++++ .../sources/accountable/test-payload.json | 8 ++ .../__snapshots__/reserve.test.ts.snap | 44 +++++++++++ .../accountable/test/integration/fixtures.ts | 41 ++++++++++ .../test/integration/reserve.test.ts | 74 +++++++++++++++++++ packages/sources/accountable/tsconfig.json | 9 +++ .../sources/accountable/tsconfig.test.json | 7 ++ packages/tsconfig.json | 3 + packages/tsconfig.test.json | 3 + yarn.lock | 13 ++++ 18 files changed, 461 insertions(+) create mode 100644 packages/sources/accountable/CHANGELOG.md create mode 100644 packages/sources/accountable/README.md create mode 100644 packages/sources/accountable/package.json create mode 100644 packages/sources/accountable/src/config/index.ts create mode 100644 packages/sources/accountable/src/endpoint/index.ts create mode 100644 packages/sources/accountable/src/endpoint/reserve.ts create mode 100644 packages/sources/accountable/src/index.ts create mode 100644 packages/sources/accountable/src/transport/reserve.ts create mode 100644 packages/sources/accountable/test-payload.json create mode 100644 packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap create mode 100644 packages/sources/accountable/test/integration/fixtures.ts create mode 100644 packages/sources/accountable/test/integration/reserve.test.ts create mode 100644 packages/sources/accountable/tsconfig.json create mode 100644 packages/sources/accountable/tsconfig.test.json diff --git a/.pnp.cjs b/.pnp.cjs index 7461d039ad..4ccaaa4f90 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -194,6 +194,10 @@ const RAW_RUNTIME_STATE = "name": "@chainlink/1forge-adapter",\ "reference": "workspace:packages/sources/1forge"\ },\ + {\ + "name": "@chainlink/accountable-adapter",\ + "reference": "workspace:packages/sources/accountable"\ + },\ {\ "name": "@chainlink/ada-balance-adapter",\ "reference": "workspace:packages/sources/ada-balance"\ @@ -967,6 +971,7 @@ const RAW_RUNTIME_STATE = "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ "fallbackExclusionList": [\ ["@chainlink/1forge-adapter", ["workspace:packages/sources/1forge"]],\ + ["@chainlink/accountable-adapter", ["workspace:packages/sources/accountable"]],\ ["@chainlink/ada-balance-adapter", ["workspace:packages/sources/ada-balance"]],\ ["@chainlink/aleno-adapter", ["workspace:packages/sources/aleno"]],\ ["@chainlink/allium-state-adapter", ["workspace:packages/sources/allium-state"]],\ @@ -5186,6 +5191,21 @@ const RAW_RUNTIME_STATE = "linkType": "SOFT"\ }]\ ]],\ + ["@chainlink/accountable-adapter", [\ + ["workspace:packages/sources/accountable", {\ + "packageLocation": "./packages/sources/accountable/",\ + "packageDependencies": [\ + ["@chainlink/accountable-adapter", "workspace:packages/sources/accountable"],\ + ["@chainlink/external-adapter-framework", "npm:2.8.0"],\ + ["@types/jest", "npm:29.5.14"],\ + ["@types/node", "npm:22.14.1"],\ + ["nock", "npm:13.5.6"],\ + ["tslib", "npm:2.4.1"],\ + ["typescript", "patch:typescript@npm%3A5.8.3#optional!builtin::version=5.8.3&hash=5786d5"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@chainlink/ada-balance-adapter", [\ ["workspace:packages/sources/ada-balance", {\ "packageLocation": "./packages/sources/ada-balance/",\ diff --git a/packages/sources/accountable/CHANGELOG.md b/packages/sources/accountable/CHANGELOG.md new file mode 100644 index 0000000000..7057bc3882 --- /dev/null +++ b/packages/sources/accountable/CHANGELOG.md @@ -0,0 +1 @@ +# @chainlink/accountable-adapter diff --git a/packages/sources/accountable/README.md b/packages/sources/accountable/README.md new file mode 100644 index 0000000000..1eecb2eedd --- /dev/null +++ b/packages/sources/accountable/README.md @@ -0,0 +1,54 @@ +# ACCOUNTABLE + +![1.5.3](https://img.shields.io/github/package-json/v/smartcontractkit/external-adapters-js?filename=packages/sources/accountable/package.json) ![v3](https://img.shields.io/badge/framework%20version-v3-blueviolet) + +This document was generated automatically. Please see [README Generator](../../scripts#readme-generator) for more info. + +## Environment Variables + +| Required? | Name | Description | Type | Options | Default | +| :-------: | :----------: | :-----------------: | :----: | :-----: | :-----: | +| ✅ | API_ENDPOINT | API Endpoint to use | string | | | + +--- + +## Data Provider Rate Limits + +| Name | Requests/credits per second | Requests/credits per minute | Requests/credits per hour | Note | +| :-----: | :-------------------------: | :-------------------------: | :-----------------------: | :--: | +| default | | 30 | | | + +--- + +## Input Parameters + +| Required? | Name | Description | Type | Options | Default | +| :-------: | :------: | :-----------------: | :----: | :--------------------------: | :-------: | +| | endpoint | The endpoint to use | string | [reserve](#reserve-endpoint) | `reserve` | + +## Reserve Endpoint + +`reserve` is the only supported name for this endpoint. + +### Input Params + +| Required? | Name | Aliases | Description | Type | Options | Default | Depends On | Not Valid With | +| :-------: | :----: | :-----: | :------------------------------------------------: | :----: | :-----: | :-----: | :--------: | :------------: | +| ✅ | client | | The name of the Accountable client to consume from | string | | | | | + +### Example + +Request: + +```json +{ + "data": { + "endpoint": "reserve", + "client": "axis" + } +} +``` + +--- + +MIT License diff --git a/packages/sources/accountable/package.json b/packages/sources/accountable/package.json new file mode 100644 index 0000000000..34dcd64a3c --- /dev/null +++ b/packages/sources/accountable/package.json @@ -0,0 +1,40 @@ +{ + "name": "@chainlink/accountable-adapter", + "version": "1.5.3", + "description": "Chainlink's The Network Firm adapter.", + "keywords": [ + "Chainlink", + "LINK", + "blockchain", + "oracle", + "accountable" + ], + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "repository": { + "url": "https://github.com/smartcontractkit/external-adapters-js", + "type": "git" + }, + "license": "MIT", + "scripts": { + "clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo", + "prepack": "yarn build", + "build": "tsc -b", + "server": "node -e 'require(\"./index.js\").server()'", + "server:dist": "node -e 'require(\"./dist/index.js\").server()'", + "start": "yarn server:dist" + }, + "devDependencies": { + "@types/jest": "^29.5.14", + "@types/node": "22.14.1", + "nock": "13.5.6", + "typescript": "5.8.3" + }, + "dependencies": { + "@chainlink/external-adapter-framework": "2.8.0", + "tslib": "2.4.1" + } +} diff --git a/packages/sources/accountable/src/config/index.ts b/packages/sources/accountable/src/config/index.ts new file mode 100644 index 0000000000..bd163df1dd --- /dev/null +++ b/packages/sources/accountable/src/config/index.ts @@ -0,0 +1,9 @@ +import { AdapterConfig } from '@chainlink/external-adapter-framework/config' + +export const config = new AdapterConfig({ + API_ENDPOINT: { + description: 'API Endpoint to use', + type: 'string', + required: true, + }, +}) diff --git a/packages/sources/accountable/src/endpoint/index.ts b/packages/sources/accountable/src/endpoint/index.ts new file mode 100644 index 0000000000..d2d7aef563 --- /dev/null +++ b/packages/sources/accountable/src/endpoint/index.ts @@ -0,0 +1 @@ +export { endpoint as reserve } from './reserve' diff --git a/packages/sources/accountable/src/endpoint/reserve.ts b/packages/sources/accountable/src/endpoint/reserve.ts new file mode 100644 index 0000000000..6ce0cd43c8 --- /dev/null +++ b/packages/sources/accountable/src/endpoint/reserve.ts @@ -0,0 +1,41 @@ +import { + PoRProviderEndpoint, + PoRProviderResponse, +} from '@chainlink/external-adapter-framework/adapter/por' +import { InputParameters } from '@chainlink/external-adapter-framework/validation' +import { AdapterError } from '@chainlink/external-adapter-framework/validation/error' +import { config } from '../config' +import { getApiKey, httpTransport } from '../transport/reserve' + +export const inputParameters = new InputParameters( + { + client: { + type: 'string', + required: true, + description: 'The name of the Accountable client to consume from', + }, + }, + [ + { + client: 'axis', + }, + ], +) + +export type BaseEndpointTypes = { + Parameters: typeof inputParameters.definition + Response: PoRProviderResponse + Settings: typeof config.settings +} + +export const endpoint = new PoRProviderEndpoint({ + name: 'reserve', + transport: httpTransport, + inputParameters, + customInputValidation: (request): AdapterError | undefined => { + if (request.requestContext.data.client) { + getApiKey(request.requestContext.data.client) + } + return + }, +}) diff --git a/packages/sources/accountable/src/index.ts b/packages/sources/accountable/src/index.ts new file mode 100644 index 0000000000..4d00ce1c21 --- /dev/null +++ b/packages/sources/accountable/src/index.ts @@ -0,0 +1,20 @@ +import { expose, ServerInstance } from '@chainlink/external-adapter-framework' +import { PoRAdapter } from '@chainlink/external-adapter-framework/adapter/por' +import { config } from './config' +import { reserve } from './endpoint' + +export const adapter = new PoRAdapter({ + defaultEndpoint: reserve.name, + name: 'ACCOUNTABLE', + config, + endpoints: [reserve], + rateLimiting: { + tiers: { + default: { + rateLimit1m: 30, + }, + }, + }, +}) + +export const server = (): Promise => expose(adapter) diff --git a/packages/sources/accountable/src/transport/reserve.ts b/packages/sources/accountable/src/transport/reserve.ts new file mode 100644 index 0000000000..f30973723c --- /dev/null +++ b/packages/sources/accountable/src/transport/reserve.ts @@ -0,0 +1,73 @@ +import { HttpTransport } from '@chainlink/external-adapter-framework/transports' +import { AdapterInputError } from '@chainlink/external-adapter-framework/validation/error' +import { BaseEndpointTypes } from '../endpoint/reserve' + +export interface ResponseSchema { + client: string + totalReserve: number + totalSupply: number + underlyingAssets: { + name: string + value: number + }[] + collateralization: number +} + +export type HttpTransportTypes = BaseEndpointTypes & { + Provider: { + RequestBody: never + ResponseBody: ResponseSchema + } +} + +export const getApiKey = (client: string) => { + const apiKeyName = `${client.replace(/-/g, '_').toUpperCase()}_API_KEY` + const apiKeyValue = process.env[apiKeyName] + + if (!apiKeyValue) { + throw new AdapterInputError({ + statusCode: 400, + message: `Missing '${apiKeyName}' environment variables.`, + }) + } + + return apiKeyValue +} + +export const httpTransport = new HttpTransport({ + prepareRequests: (params, config) => { + return params.map((param) => { + const client = param.client + return { + params: [param], + request: { + baseURL: config.API_ENDPOINT, + params: { + client: params[0].client, + }, + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${getApiKey(client)}`, + }, + }, + } + }) + }, + parseResponse: (params, response) => { + return params.map((param) => { + const result = response.data.totalReserve + const totalReserve = Number(result) + return { + params: param, + response: { + result, + data: { + result, + totalReserve, + ripcord: false, + }, + }, + } + }) + }, +}) diff --git a/packages/sources/accountable/test-payload.json b/packages/sources/accountable/test-payload.json new file mode 100644 index 0000000000..ee319658d2 --- /dev/null +++ b/packages/sources/accountable/test-payload.json @@ -0,0 +1,8 @@ +{ + "requests": [ + { + "endpoint": "reserves", + "client": "axis" + } + ] +} diff --git a/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap b/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap new file mode 100644 index 0000000000..698066c16c --- /dev/null +++ b/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute reserve endpoint should fail if client name is not present or wrong 1`] = ` +{ + "error": { + "message": "[Param: client] param is required but no value was provided", + "name": "AdapterError", + }, + "status": "errored", + "statusCode": 400, +} +`; + +exports[`execute reserve endpoint should return success for axis 1`] = ` +{ + "data": { + "result": "40438382.35", + "ripcord": false, + "totalReserve": 40438382.35, + }, + "result": "40438382.35", + "statusCode": 200, + "timestamps": { + "providerDataReceivedUnixMs": 978347471111, + "providerDataRequestedUnixMs": 978347471111, + }, +} +`; + +exports[`execute reserve endpoint should return success for unitas 1`] = ` +{ + "data": { + "result": "40438382.35", + "ripcord": false, + "totalReserve": 40438382.35, + }, + "result": "40438382.35", + "statusCode": 200, + "timestamps": { + "providerDataReceivedUnixMs": 978347471111, + "providerDataRequestedUnixMs": 978347471111, + }, +} +`; diff --git a/packages/sources/accountable/test/integration/fixtures.ts b/packages/sources/accountable/test/integration/fixtures.ts new file mode 100644 index 0000000000..3128f7b7fe --- /dev/null +++ b/packages/sources/accountable/test/integration/fixtures.ts @@ -0,0 +1,41 @@ +import nock from 'nock' + +export const mockReserveAxisResponseSuccess = (): nock.Scope => + nock('http://test-endpoint-new?client=axis', { + encodedQueryParams: true, + }) + .get('/') + .query({ client: 'axis' }) + .reply(200, { + client: 'axis', + totalReserve: '40438382.35', + totalSupply: '40355393.07', + underlyingAssets: [ + { name: 'Copper', value: 20000000 }, + { name: 'Fireblocks', value: 20438382.35 }, + { name: 'Insurance Fund', value: 630502.74 }, + { name: 'Ethereum Chain', value: 76414.71688973988 }, + { name: 'Binance', value: 3095.5639951004273 }, + { name: 'BNB Smart Chain', value: 7.3854242495045 }, + ], + collateralization: 1.002056, + }) + .persist() + +export const mockReserveUnitasResponseSuccess = (): nock.Scope => + nock('http://test-endpoint-new?client=unitas', { + encodedQueryParams: true, + }) + .get('/') + .query({ client: 'unitas' }) + .reply(200, { + client: 'unitas', + totalReserve: '25559832.85', + totalSupply: '25559832.85', + underlyingAssets: [ + { name: 'Solana', value: 18440848.73 }, + { name: 'Binance', value: 7118984.11 }, + ], + collateralization: 1.00416, + }) + .persist() diff --git a/packages/sources/accountable/test/integration/reserve.test.ts b/packages/sources/accountable/test/integration/reserve.test.ts new file mode 100644 index 0000000000..87c24a5aab --- /dev/null +++ b/packages/sources/accountable/test/integration/reserve.test.ts @@ -0,0 +1,74 @@ +import { + setEnvVariables, + TestAdapter, +} from '@chainlink/external-adapter-framework/util/testing-utils' +import * as nock from 'nock' +import { mockReserveAxisResponseSuccess, mockReserveUnitasResponseSuccess } from './fixtures' + +describe('execute', () => { + let spy: jest.SpyInstance + let testAdapter: TestAdapter + let oldEnv: NodeJS.ProcessEnv + + beforeAll(async () => { + oldEnv = JSON.parse(JSON.stringify(process.env)) + const mockDate = new Date('2001-01-01T11:11:11.111Z') + spy = jest.spyOn(Date, 'now').mockReturnValue(mockDate.getTime()) + + process.env.API_ENDPOINT = 'http://test-endpoint-new' + process.env.AXIS_API_KEY = 'axis-api-key' + process.env.UNITAS_API_KEY = 'unitas-api-key' + + const adapter = (await import('../../src')).adapter + adapter.rateLimiting = undefined + testAdapter = await TestAdapter.startWithMockedCache(adapter, { + testAdapter: {} as TestAdapter, + }) + }) + + afterAll(async () => { + setEnvVariables(oldEnv) + await testAdapter.api.close() + nock.restore() + nock.cleanAll() + spy.mockRestore() + }) + + describe('reserve endpoint', () => { + it('should return success for axis', async () => { + const data = { + endpoint: 'reserve', + client: 'axis', + } + + mockReserveAxisResponseSuccess() + + const response = await testAdapter.request(data) + expect(response.statusCode).toBe(200) + expect(response.json()).toMatchSnapshot() + }) + + it('should return success for unitas', async () => { + const data = { + endpoint: 'reserve', + client: 'unitas', + } + + mockReserveUnitasResponseSuccess() + + const response = await testAdapter.request(data) + expect(response.statusCode).toBe(200) + expect(response.json()).toMatchSnapshot() + }) + + it('should fail if client name is not present or wrong', async () => { + const data = { + endpoint: 'reserve', + } + + const response = await testAdapter.request(data) + expect(response.statusCode).toBe(400) + expect(response.json()).toMatchSnapshot() + }) + }) +}) diff --git a/packages/sources/accountable/tsconfig.json b/packages/sources/accountable/tsconfig.json new file mode 100644 index 0000000000..f59363fd76 --- /dev/null +++ b/packages/sources/accountable/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*", "src/**/*.json"], + "exclude": ["dist", "**/*.spec.ts", "**/*.test.ts"] +} diff --git a/packages/sources/accountable/tsconfig.test.json b/packages/sources/accountable/tsconfig.test.json new file mode 100644 index 0000000000..e3de28cb5c --- /dev/null +++ b/packages/sources/accountable/tsconfig.test.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["src/**/*", "**/test", "src/**/*.json"], + "compilerOptions": { + "noEmit": true + } +} diff --git a/packages/tsconfig.json b/packages/tsconfig.json index a22a9a7715..8971106301 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -125,6 +125,9 @@ { "path": "./sources/1forge" }, + { + "path": "./sources/accountable" + }, { "path": "./sources/ada-balance" }, diff --git a/packages/tsconfig.test.json b/packages/tsconfig.test.json index 9e10e88b55..3f6177158e 100644 --- a/packages/tsconfig.test.json +++ b/packages/tsconfig.test.json @@ -125,6 +125,9 @@ { "path": "./sources/1forge/tsconfig.test.json" }, + { + "path": "./sources/accountable/tsconfig.test.json" + }, { "path": "./sources/ada-balance/tsconfig.test.json" }, diff --git a/yarn.lock b/yarn.lock index 8ce196c264..70f60d96e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2469,6 +2469,19 @@ __metadata: languageName: unknown linkType: soft +"@chainlink/accountable-adapter@workspace:packages/sources/accountable": + version: 0.0.0-use.local + resolution: "@chainlink/accountable-adapter@workspace:packages/sources/accountable" + dependencies: + "@chainlink/external-adapter-framework": "npm:2.8.0" + "@types/jest": "npm:^29.5.14" + "@types/node": "npm:22.14.1" + nock: "npm:13.5.6" + tslib: "npm:2.4.1" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@chainlink/ada-balance-adapter@workspace:*, @chainlink/ada-balance-adapter@workspace:packages/sources/ada-balance": version: 0.0.0-use.local resolution: "@chainlink/ada-balance-adapter@workspace:packages/sources/ada-balance" From e48651db521e6682aada90eb401ac6914fcf4d7f Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Tue, 18 Nov 2025 16:13:37 +0530 Subject: [PATCH 2/8] FIX: issues --- packages/sources/accountable/src/endpoint/reserve.ts | 1 - packages/sources/accountable/src/transport/reserve.ts | 2 +- packages/sources/accountable/test-payload.json | 2 +- .../test/integration/__snapshots__/reserve.test.ts.snap | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/sources/accountable/src/endpoint/reserve.ts b/packages/sources/accountable/src/endpoint/reserve.ts index 6ce0cd43c8..dce23df5a6 100644 --- a/packages/sources/accountable/src/endpoint/reserve.ts +++ b/packages/sources/accountable/src/endpoint/reserve.ts @@ -36,6 +36,5 @@ export const endpoint = new PoRProviderEndpoint({ if (request.requestContext.data.client) { getApiKey(request.requestContext.data.client) } - return }, }) diff --git a/packages/sources/accountable/src/transport/reserve.ts b/packages/sources/accountable/src/transport/reserve.ts index f30973723c..c65d8d81db 100644 --- a/packages/sources/accountable/src/transport/reserve.ts +++ b/packages/sources/accountable/src/transport/reserve.ts @@ -43,7 +43,7 @@ export const httpTransport = new HttpTransport({ request: { baseURL: config.API_ENDPOINT, params: { - client: params[0].client, + client: client, }, headers: { 'Content-Type': 'application/json', diff --git a/packages/sources/accountable/test-payload.json b/packages/sources/accountable/test-payload.json index ee319658d2..43e4099571 100644 --- a/packages/sources/accountable/test-payload.json +++ b/packages/sources/accountable/test-payload.json @@ -1,7 +1,7 @@ { "requests": [ { - "endpoint": "reserves", + "endpoint": "reserve", "client": "axis" } ] diff --git a/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap b/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap index 698066c16c..8e8d961649 100644 --- a/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap +++ b/packages/sources/accountable/test/integration/__snapshots__/reserve.test.ts.snap @@ -30,11 +30,11 @@ exports[`execute reserve endpoint should return success for axis 1`] = ` exports[`execute reserve endpoint should return success for unitas 1`] = ` { "data": { - "result": "40438382.35", + "result": "25559832.85", "ripcord": false, - "totalReserve": 40438382.35, + "totalReserve": 25559832.85, }, - "result": "40438382.35", + "result": "25559832.85", "statusCode": 200, "timestamps": { "providerDataReceivedUnixMs": 978347471111, From a0a0301ae28c770770910141beedf6bb937bcfb7 Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Tue, 18 Nov 2025 16:14:15 +0530 Subject: [PATCH 3/8] ADD: changeset --- .changeset/orange-cats-rhyme.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/orange-cats-rhyme.md diff --git a/.changeset/orange-cats-rhyme.md b/.changeset/orange-cats-rhyme.md new file mode 100644 index 0000000000..443c41174c --- /dev/null +++ b/.changeset/orange-cats-rhyme.md @@ -0,0 +1,5 @@ +--- +'@chainlink/accountable-adapter': major +--- + +Accountable EA From 6783695751ab2838fab6c57feeae11d343e3e93d Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Tue, 18 Nov 2025 17:34:49 +0530 Subject: [PATCH 4/8] FIX: issues --- packages/sources/accountable/package.json | 2 +- packages/sources/accountable/src/transport/reserve.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sources/accountable/package.json b/packages/sources/accountable/package.json index 34dcd64a3c..55afb796bf 100644 --- a/packages/sources/accountable/package.json +++ b/packages/sources/accountable/package.json @@ -1,7 +1,7 @@ { "name": "@chainlink/accountable-adapter", "version": "1.5.3", - "description": "Chainlink's The Network Firm adapter.", + "description": "Chainlink's Accountable adapter.", "keywords": [ "Chainlink", "LINK", diff --git a/packages/sources/accountable/src/transport/reserve.ts b/packages/sources/accountable/src/transport/reserve.ts index c65d8d81db..a4a284efd3 100644 --- a/packages/sources/accountable/src/transport/reserve.ts +++ b/packages/sources/accountable/src/transport/reserve.ts @@ -27,7 +27,7 @@ export const getApiKey = (client: string) => { if (!apiKeyValue) { throw new AdapterInputError({ statusCode: 400, - message: `Missing '${apiKeyName}' environment variables.`, + message: `Missing '${apiKeyName}' environment variable.`, }) } From 9b2304419038b9936fdae4784f42b5213a418bed Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Tue, 18 Nov 2025 17:39:32 +0530 Subject: [PATCH 5/8] REVERT: change --- packages/sources/accountable/src/endpoint/reserve.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sources/accountable/src/endpoint/reserve.ts b/packages/sources/accountable/src/endpoint/reserve.ts index dce23df5a6..6ce0cd43c8 100644 --- a/packages/sources/accountable/src/endpoint/reserve.ts +++ b/packages/sources/accountable/src/endpoint/reserve.ts @@ -36,5 +36,6 @@ export const endpoint = new PoRProviderEndpoint({ if (request.requestContext.data.client) { getApiKey(request.requestContext.data.client) } + return }, }) From 057f8a0d05237a364c92366025eccfdd6c1c28c4 Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Thu, 20 Nov 2025 00:40:22 +0530 Subject: [PATCH 6/8] POST-REVIEW changes --- packages/sources/accountable/package.json | 4 ++-- packages/sources/accountable/src/endpoint/reserve.ts | 3 ++- packages/sources/accountable/test-payload.json | 8 -------- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 packages/sources/accountable/test-payload.json diff --git a/packages/sources/accountable/package.json b/packages/sources/accountable/package.json index 55afb796bf..18e0190853 100644 --- a/packages/sources/accountable/package.json +++ b/packages/sources/accountable/package.json @@ -1,6 +1,6 @@ { "name": "@chainlink/accountable-adapter", - "version": "1.5.3", + "version": "1.0.0", "description": "Chainlink's Accountable adapter.", "keywords": [ "Chainlink", @@ -34,7 +34,7 @@ "typescript": "5.8.3" }, "dependencies": { - "@chainlink/external-adapter-framework": "2.8.0", + "@chainlink/external-adapter-framework": "2.11.0", "tslib": "2.4.1" } } diff --git a/packages/sources/accountable/src/endpoint/reserve.ts b/packages/sources/accountable/src/endpoint/reserve.ts index 6ce0cd43c8..7998519e35 100644 --- a/packages/sources/accountable/src/endpoint/reserve.ts +++ b/packages/sources/accountable/src/endpoint/reserve.ts @@ -12,7 +12,8 @@ export const inputParameters = new InputParameters( client: { type: 'string', required: true, - description: 'The name of the Accountable client to consume from', + description: + 'The name of the Accountable client to consume from. \n Used to match {client}_API_KEY env variable', }, }, [ diff --git a/packages/sources/accountable/test-payload.json b/packages/sources/accountable/test-payload.json deleted file mode 100644 index 43e4099571..0000000000 --- a/packages/sources/accountable/test-payload.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "requests": [ - { - "endpoint": "reserve", - "client": "axis" - } - ] -} From 81725f9d0f6dbba3bf7116d84fe699e1f99c89fe Mon Sep 17 00:00:00 2001 From: Subarna-Singh Date: Thu, 20 Nov 2025 19:17:04 +0530 Subject: [PATCH 7/8] Update yarn file --- .pnp.cjs | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index b7eaaa6d35..f5c5418211 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -5191,7 +5191,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/sources/accountable/",\ "packageDependencies": [\ ["@chainlink/accountable-adapter", "workspace:packages/sources/accountable"],\ - ["@chainlink/external-adapter-framework", "npm:2.8.0"],\ + ["@chainlink/external-adapter-framework", "npm:2.11.0"],\ ["@types/jest", "npm:29.5.14"],\ ["@types/node", "npm:22.14.1"],\ ["nock", "npm:13.5.6"],\ diff --git a/yarn.lock b/yarn.lock index ec0ca02ce1..47cbe7322a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2473,7 +2473,7 @@ __metadata: version: 0.0.0-use.local resolution: "@chainlink/accountable-adapter@workspace:packages/sources/accountable" dependencies: - "@chainlink/external-adapter-framework": "npm:2.8.0" + "@chainlink/external-adapter-framework": "npm:2.11.0" "@types/jest": "npm:^29.5.14" "@types/node": "npm:22.14.1" nock: "npm:13.5.6" From f81d5b945b5e08086b1f13da6714ff8188d03daf Mon Sep 17 00:00:00 2001 From: Subarna Singh Date: Thu, 20 Nov 2025 19:37:44 +0530 Subject: [PATCH 8/8] Update reserve.ts --- packages/sources/accountable/src/endpoint/reserve.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sources/accountable/src/endpoint/reserve.ts b/packages/sources/accountable/src/endpoint/reserve.ts index 7998519e35..07de38c0ab 100644 --- a/packages/sources/accountable/src/endpoint/reserve.ts +++ b/packages/sources/accountable/src/endpoint/reserve.ts @@ -13,7 +13,7 @@ export const inputParameters = new InputParameters( type: 'string', required: true, description: - 'The name of the Accountable client to consume from. \n Used to match {client}_API_KEY env variable', + 'The name of the Accountable client to consume from. Used to match {client}_API_KEY env variable', }, }, [