Skip to content

Conversation

@markhoangcll
Copy link

@markhoangcll markhoangcll commented Sep 15, 2025

Closes OPDATA-4029 / CM-1099

Description

LiveArt External Adapter (EA) to fetch art nav_per_share numerical data.
......

Changes

  • Created EA
  • Wrote integration and unit tests
  • Generated a changeset

Steps to Test

From root directory

  1. yarn setup
  2. export adapter=liveart
  3. yarn test $adapter/test

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file or update the soak testing blacklist.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

@changeset-bot
Copy link

changeset-bot bot commented Sep 15, 2025

🦋 Changeset detected

Latest commit: 26d82b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chainlink/liveart-external-adapter Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markhoangcll markhoangcll marked this pull request as draft September 15, 2025 09:33
@markhoangcll markhoangcll marked this pull request as ready for review September 30, 2025 12:50
mxiao-cll
mxiao-cll previously approved these changes Oct 1, 2025
*/
export function parseResponse(
params: TypeFromDefinition<typeof inputParameters.definition>[],
response: AxiosResponse<ResponseSchema>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this reference to Axios be removed?

Doesn't look like it's being used anywhere (other than a passed in type) and it's adding a bunch of new packages and preventing the checks from succeeding.

description: 'The API URL for the LiveArt data provider',
type: 'string',
required: true,
default: 'https://artwork-price-oracle-api-dev-ms.liveart.ai',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is their prod API?

total_shares: number | null
nav_per_share: string | null
valuation_price_date: string | null
valuation_price: string | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these be returned as explicit null or just missing from the API response ie: undefined? If just missing you can try replacing the nulls by ?:

Copy link
Contributor

@mmcallister-cll mmcallister-cll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find the correct API and get creds. This does not exist against the provided dev environment and we shouldn't merge without testing against prod.

@markhoangcll markhoangcll marked this pull request as draft October 21, 2025 11:11
@@ -0,0 +1,34 @@
{
"name": "@chainlink/liveart-external-adapter",
Copy link
Contributor

@mmcallister-cll mmcallister-cll Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] I don't think any of our other adapters are named 'xxx-external-adapter', just 'xxx-adapter', also this will have effects on the changeset name

},
"license": "MIT",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Copy link
Contributor

@mmcallister-cll mmcallister-cll Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually there is no point to update this file from the generator output.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i could not generate this via generator due to weird interaction with pnpm on my system ... I had to create it manually

Copy link
Contributor

@mmcallister-cll mmcallister-cll Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this ever be used to populate data on a feed? If not, this endpoint and transport isn't needed, remove

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its on the jira ticket, i have no idea, need to ask product

import { assets } from './endpoint/assets'

export const adapter = new Adapter({
defaultEndpoint: assets.name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need a change it you remove the assets endpoint

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider calling this endpoint nav (update both the filename and the name field in the AdapterEndpoint) to be in line with other nav EAs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but its not a nav? ticket says to return all the data from the endpoint?

Parameters: typeof inputParameters.definition
Response: {
Data: Asset
Result: null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core node reads either a top level result field or data.result. Usually best practice to write the data point you want to go on chain here at the top level.

params: param,
response: {
errorMessage: `Mismatched asset_id in response. Expected ${param.asset_id}, got ${response.data.asset_id}`,
statusCode: 500,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe 502 to follow the pattern we use in other EAs

return {
params: param,
response: {
result: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update here once you update the type please

})
},
parseResponse: (params, response) => {
return params.map((param: TypeFromDefinition<typeof inputParameters.definition>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to specify the type here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing this can be removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if only used in one location you can simplify and stick this interfact in that file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove

@@ -0,0 +1,57 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`LiveArt NAV endpoints /asset/\${asset_id} should handle upstream bad response 1`] = `
Copy link
Contributor

@mmcallister-cll mmcallister-cll Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable in the test title looks wrong, similar below

linkType: soft

"@chainlink/liveart-external-adapter@workspace:packages/sources/liveart":
version: 0.0.0-use.local
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rerun yarn && yarn setup once you update your package.json file with the name change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants