-
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 all commits
5c5c573
a64af31
ba0ef5c
e4bb691
372f03f
05d634b
2cc1535
4ad49a9
7e6998c
a775786
3406afd
41a1c4c
ff5e8bf
e2c52cb
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 | ||
--- | ||
|
||
LiveArt EA initial release |
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", | ||
"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", | ||
"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,16 @@ | ||
import { AdapterConfig } from '@chainlink/external-adapter-framework/config' | ||
|
||
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: { | ||
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. Is there an expiry date on this BEARER_TOKEN? Can you double check with the ticket reporter/API provider? |
||
description: 'The Bearer token for authentication', | ||
type: 'string', | ||
required: true, | ||
sensitive: true, | ||
}, | ||
}) |
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'], | ||
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. doesn't really need an alias since this is a pretty non-standard use-case. |
||
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,21 @@ | ||
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: 'LIVEART', | ||
config, | ||
endpoints: [nav], | ||
markhoangcll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rateLimiting: { | ||
tiers: { | ||
default: { | ||
rateLimit1m: 60, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
export const server = (): Promise<ServerInstance | undefined> => expose(adapter) |
There was a problem hiding this comment.
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?