Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thirty-ducks-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/liveart-external-adapter': major
---

LiveArt EA initial release
147 changes: 147 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
35 changes: 35 additions & 0 deletions packages/sources/liveart/package.json
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"
}
}
16 changes: 16 additions & 0 deletions packages/sources/liveart/src/config/config.ts
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',
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?

},
BEARER_TOKEN: {
Copy link
Contributor

Choose a reason for hiding this comment

The 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,
},
})
26 changes: 26 additions & 0 deletions packages/sources/liveart/src/endpoint/nav.ts
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'],
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
choose 1 and we'll go with that

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,
})
21 changes: 21 additions & 0 deletions packages/sources/liveart/src/index.ts
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],
rateLimiting: {
tiers: {
default: {
rateLimit1m: 60,
},
},
},
})

export const server = (): Promise<ServerInstance | undefined> => expose(adapter)
Loading
Loading