Skip to content
Draft
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
---

Create EA NAV for LiveArt
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.
1 change: 1 addition & 0 deletions packages/sources/liveart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# LiveArt NAV External Adapter
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"
}
}
20 changes: 20 additions & 0 deletions packages/sources/liveart/src/config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AdapterConfig } from '@chainlink/external-adapter-framework/config'

export type Config = {
API_BASE_URL: string
BEARER_TOKEN: string
}
Comment on lines +3 to +6
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need this?


export const config: AdapterConfig = new AdapterConfig({
API_BASE_URL: {
description: 'The API URL for the LiveArt data provider',
type: 'string',
required: true,
},
Comment on lines +9 to +13
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put a default url here?

BEARER_TOKEN: {
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'],
required: true,
type: 'string',
description: 'The ID of the artwork to fetch',
},
},
[
{
artwork_id: 'banksy',
},
],
)

export const liveArtNAV = new AdapterEndpoint({
Copy link
Contributor

Choose a reason for hiding this comment

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

Just call this nav

name: 'nav',
transport: httpTransport,
inputParameters,
})
18 changes: 18 additions & 0 deletions packages/sources/liveart/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expose, ServerInstance } from '@chainlink/external-adapter-framework'
import { Adapter } from '@chainlink/external-adapter-framework/adapter'

import { config } from './config/config'
import { liveArtNAV } from './endpoint/nav'

// Endpoints
// GET /artwork/{artwork_id}/price
// GET /healthcheck
Comment on lines +7 to +9
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 not how this works, we do POST instead. Also this comment is not necessary


export const adapter = new Adapter({
defaultEndpoint: liveArtNAV.name,
name: 'LIVE_ART NAV',
Copy link
Contributor

Choose a reason for hiding this comment

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

LIVE_ART_NAV

config,
endpoints: [liveArtNAV],
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to put a rate limiter here

})

export const server = (): Promise<ServerInstance | undefined> => expose(adapter)
5 changes: 5 additions & 0 deletions packages/sources/liveart/src/test-payload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"requests": [{
"artwork_id": "banksy"
}]
}
Loading
Loading