Skip to content
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e807511
Initial commit for split
chray-zhang Sep 4, 2025
638bf65
dependencies
chray-zhang Sep 4, 2025
620f1ff
Changeset
chray-zhang Sep 4, 2025
73628d2
comma
chray-zhang Sep 4, 2025
7d6bd04
Added transport and endpoint
chray-zhang Sep 4, 2025
6129575
cleanup
chray-zhang Sep 4, 2025
c4452fd
cleanup
chray-zhang Sep 4, 2025
b631b7f
Revision
chray-zhang Sep 4, 2025
a53b80f
Removed unused imports
chray-zhang Sep 4, 2025
a8cef07
Revision for comments
chray-zhang Sep 5, 2025
7fb0283
Removed unused import
chray-zhang Sep 5, 2025
c023388
Merge branch 'ftse-utils' into ftse-transport-endpoint-v2
chray-zhang Sep 5, 2025
6cb34a0
Removed blacklist
chray-zhang Sep 5, 2025
db45779
Merge branch 'main' into ftse-transport-endpoint-v2
chray-zhang Sep 11, 2025
8feab27
Revision
chray-zhang Sep 12, 2025
51bc4ef
Removed env file
chray-zhang Sep 12, 2025
d8b14c7
Revision
chray-zhang Sep 12, 2025
350dcc4
Removed blacklist
chray-zhang Sep 12, 2025
fc20d86
removed transport test
chray-zhang Sep 12, 2025
d4d129c
removed unused transport snap
chray-zhang Sep 12, 2025
b3dafb6
Fix lint
chray-zhang Sep 12, 2025
ecaf34c
Removed download
chray-zhang Sep 12, 2025
af027e9
Added back file name and path
chray-zhang Sep 12, 2025
0fe3e7a
Added back blacklist
chray-zhang Sep 12, 2025
8602bbb
Fix lint
chray-zhang Sep 12, 2025
6b09c27
Revision
chray-zhang Sep 15, 2025
cc89634
renamed utils to constants
chray-zhang Sep 15, 2025
9e0a4ff
Revision
chray-zhang Sep 15, 2025
81592f5
revision
chray-zhang Sep 15, 2025
bd2db03
Revision
chray-zhang Sep 15, 2025
9df9f57
Fixed any
chray-zhang Sep 15, 2025
dde1f42
Fixed Types
chray-zhang Sep 15, 2025
28cc03f
Added Adapter to pass deploy test
chray-zhang Sep 15, 2025
9911e27
Empty index.ts to pass tests
chray-zhang Sep 15, 2025
b9af068
index.ts
chray-zhang Sep 15, 2025
4e946b0
Revert "index.ts"
chray-zhang Sep 16, 2025
b3419ea
Revert "Empty index.ts to pass tests"
chray-zhang Sep 16, 2025
e3d6eaf
Revert "Added Adapter to pass deploy test"
chray-zhang Sep 16, 2025
0b87eac
Merge branch 'main' into ftse-transport-endpoint-v2
chray-zhang Sep 16, 2025
fea6694
Initial commit for download
chray-zhang Sep 16, 2025
ecd2712
[NOISSUE] Adding index.ts to ftse sftp EA to pass deploy workflow (#4…
chray-zhang Sep 15, 2025
a0dc7cb
Added download logic and tests
chray-zhang Sep 17, 2025
873e061
Changesets
chray-zhang Sep 17, 2025
bf673fa
Types
chray-zhang Sep 17, 2025
411d5ed
Types
chray-zhang Sep 17, 2025
0552985
removed all any
chray-zhang Sep 17, 2025
2915326
cleaner validation
chray-zhang Sep 17, 2025
189e150
Merge branch 'ftse-transport-endpoint-v2' into full-ea-sftp
chray-zhang Sep 17, 2025
d9597d3
Merge branch 'main' into full-ea-sftp
chray-zhang Sep 17, 2025
9a8ca73
Fixed Lint
chray-zhang Sep 17, 2025
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/warm-hornets-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/ftse-sftp-adapter': major
---

Adding Downloading and parsing logic for russell and ftse csv files from ftse sftp server
5 changes: 5 additions & 0 deletions .changeset/wild-kids-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/ftse-sftp-adapter': minor
---

Added the SFTP Transport and Configs
101 changes: 101 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.
2 changes: 2 additions & 0 deletions packages/sources/ftse-sftp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
"@chainlink/external-adapter-framework": "2.7.0",
"csv-parse": "5.5.6",
"decimal.js": "^10.5.0",
"ssh2-sftp-client": "^12.0.1",
"tslib": "^2.3.1"
},
"devDependencies": {
"@sinonjs/fake-timers": "^14.0.0",
"@types/jest": "^29.5.14",
"@types/node": "22.14.1",
"@types/ssh2-sftp-client": "^9.0.5",
"jest": "^29.7.0",
"jest-util": "^29.7.0",
"nock": "13.5.6",
Expand Down
33 changes: 33 additions & 0 deletions packages/sources/ftse-sftp/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { AdapterConfig } from '@chainlink/external-adapter-framework/config'

export const NAME = 'FTSE_SFTP_ADAPTER'

export const config = new AdapterConfig({
SFTP_HOST: {
description: 'SFTP server hostname or IP address',
type: 'string',
required: true,
},
SFTP_PORT: {
description: 'SFTP server port',
type: 'number',
default: 22,
},
SFTP_USERNAME: {
description: 'SFTP username for authentication',
type: 'string',
required: true,
},
SFTP_PASSWORD: {
description: 'SFTP password for authentication',
type: 'string',
sensitive: true,
required: true,
},
BACKGROUND_EXECUTE_MS: {
description:
'The amount of time the background execute should sleep before performing the next request',
type: 'number',
default: 10_000,
},
})
3 changes: 3 additions & 0 deletions packages/sources/ftse-sftp/src/endpoint/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as sftp from './sftp'

export { sftp }
54 changes: 54 additions & 0 deletions packages/sources/ftse-sftp/src/endpoint/sftp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter'
import { InputParameters } from '@chainlink/external-adapter-framework/validation'
import { config } from '../config'
import { FTSE100Data } from '../parsing/ftse100'
import { RussellDailyValuesData } from '../parsing/russell'
import { sftpTransport } from '../transport/sftp'

export const inputParameters = new InputParameters(
{
instrument: {
required: true,
type: 'string',
description: 'Abstract identifier of the index to fetch the data for',
},
},
[
{
instrument: 'FTSE100INDEX',
},
{
instrument: 'Russell1000INDEX',
},
{
instrument: 'Russell2000INDEX',
},
{
instrument: 'Russell3000INDEX',
},
],
)

export type TInputParameters = typeof inputParameters.definition

/**
* Union type for all possible response data structures
*/
export type IndexResponseData = FTSE100Data | RussellDailyValuesData

export type BaseEndpointTypes = {
Parameters: typeof inputParameters.definition
Response: {
Result: number
Data: {
result: IndexResponseData
}
}
Settings: typeof config.settings
}

export const endpoint = new AdapterEndpoint({
name: 'ftse_sftp',
transport: sftpTransport,
inputParameters,
})
12 changes: 12 additions & 0 deletions packages/sources/ftse-sftp/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { expose, ServerInstance } from '@chainlink/external-adapter-framework'
import { Adapter } from '@chainlink/external-adapter-framework/adapter'
import { config } from './config'
import * as endpoints from './endpoint'

export const adapter = new Adapter({
name: 'FTSE_SFTP',
config,
endpoints: [endpoints.sftp.endpoint],
})

export const server = (): Promise<ServerInstance | undefined> => expose(adapter)
20 changes: 20 additions & 0 deletions packages/sources/ftse-sftp/src/transport/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const instrumentToFilePathMap: Record<string, string> = {
FTSE100INDEX: '/data/valuation/uk_all_share/',
Russell1000INDEX: '/data/Returns_and_Values/Russell_US_Indexes_Daily_Index_Values_Real_Time_TXT/',
Russell2000INDEX: '/data/Returns_and_Values/Russell_US_Indexes_Daily_Index_Values_Real_Time_TXT/',
Russell3000INDEX: '/data/Returns_and_Values/Russell_US_Indexes_Daily_Index_Values_Real_Time_TXT/',
}

export const instrumentToFileTemplateMap: Record<string, string> = {
FTSE100INDEX: 'ukallv*.csv',
Russell1000INDEX: 'daily_values_russell_*.CSV',
Russell2000INDEX: 'daily_values_russell_*.CSV',
Russell3000INDEX: 'daily_values_russell_*.CSV',
}

export const instrumentToFileRegexMap: Record<string, RegExp> = {
FTSE100INDEX: /^ukallv\d{4}\.csv$/,
Russell1000INDEX: /^daily_values_russell_\d{6}\.CSV$/,
Russell2000INDEX: /^daily_values_russell_\d{6}\.CSV$/,
Russell3000INDEX: /^daily_values_russell_\d{6}\.CSV$/,
}
Loading