-
Notifications
You must be signed in to change notification settings - Fork 323
CM-1099 LiveArt External Adapter #4018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
5c5c573
a64af31
ba0ef5c
e4bb691
372f03f
05d634b
2cc1535
4ad49a9
7e6998c
a775786
3406afd
41a1c4c
ff5e8bf
e2c52cb
2fae932
3233279
45dd724
d1d79e1
a9a3faf
731f1d7
90b6795
26d82b9
b38beb2
415ee4e
7e18493
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@chainlink/liveart-external-adapter': major | ||
| --- | ||
|
|
||
| Create EA NAV for LiveArt | ||
mmcallister-cll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "@chainlink/liveart-external-adapter", | ||
markhoangcll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "version": "1.0.0", | ||
| "description": "LiveArt NAV external adapter for Chainlink", | ||
| "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": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
markhoangcll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo", | ||
| "prepack": "yarn build", | ||
| "build": "tsc -b", | ||
| "server": "node -e 'require(\"./src/index.ts\").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.7.0", | ||
| "axios": "^1.11.0", | ||
| "tslib": "2.4.1" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { AdapterConfig } from '@chainlink/external-adapter-framework/config' | ||
|
|
||
| export type Config = { | ||
| API_BASE_URL: string | ||
| BEARER_TOKEN: string | ||
| } | ||
markhoangcll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| export const config: AdapterConfig = new AdapterConfig({ | ||
| API_BASE_URL: { | ||
| description: 'The API URL for the LiveArt data provider', | ||
| type: 'string', | ||
| required: true, | ||
| default: 'https://artwork-price-oracle-api-dev-ms.liveart.ai', | ||
|
||
| }, | ||
| BEARER_TOKEN: { | ||
markhoangcll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| description: 'The Bearer token for authentication', | ||
| type: 'string', | ||
| required: true, | ||
| sensitive: true, | ||
| }, | ||
| }) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider calling this endpoint There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter' | ||
| import { InputParameters } from '@chainlink/external-adapter-framework/validation' | ||
|
|
||
| import { httpTransport } from '../transport/transport' | ||
|
|
||
| export const inputParameters = new InputParameters( | ||
| { | ||
| artwork_id: { | ||
| aliases: ['artworkId'], | ||
markhoangcll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| required: true, | ||
| type: 'string', | ||
| description: 'The ID of the artwork to fetch', | ||
| }, | ||
| }, | ||
| [ | ||
| { | ||
| artwork_id: 'banksy', | ||
| }, | ||
| ], | ||
| ) | ||
|
|
||
| export const nav = new AdapterEndpoint({ | ||
| name: 'nav', | ||
| transport: httpTransport, | ||
| inputParameters, | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { expose, ServerInstance } from '@chainlink/external-adapter-framework' | ||
| import { Adapter } from '@chainlink/external-adapter-framework/adapter' | ||
|
|
||
| import { config } from './config/config' | ||
| import { nav } from './endpoint/nav' | ||
|
|
||
| export const adapter = new Adapter({ | ||
| defaultEndpoint: nav.name, | ||
| name: 'LIVE_ART_NAV', | ||
mmcallister-cll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| config, | ||
| endpoints: [nav], | ||
markhoangcll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }) | ||
|
|
||
| export const server = (): Promise<ServerInstance | undefined> => expose(adapter) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "requests": [{ | ||
| "artwork_id": "banksy" | ||
| }] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.