-
Notifications
You must be signed in to change notification settings - Fork 317
Merc6933 GMCI EA - Data Link Feed #3919
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
Open
Subarna-Singh
wants to merge
43
commits into
main
Choose a base branch
from
MERC6933-GMCI-EA-Data_Link_Feed
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
26760dc
MERC6933-GMCI EA
Subarna-Singh 8d5f2a8
GMCI EA
Subarna-Singh 9f4b9f2
Merge branch 'main' of github.com:smartcontractkit/external-adapters-…
Subarna-Singh 59231d6
Handle Response
Subarna-Singh c06fdd5
Changeset added
Subarna-Singh 3c6f4b5
Add Readme file; modify tsconfig
Subarna-Singh 60a33d5
GMCI EA - parsing price and rebalance messages and producing a result…
Subarna-Singh 17a621f
upgrade version of dependency packages
Subarna-Singh d98103a
remove override functionality
Subarna-Singh 7c0c771
Add new changeset
Subarna-Singh 4fe40f2
Review work: fix data types and hard coded values
Subarna-Singh 000a15e
Integration testing added
Subarna-Singh ff19d55
Remove failure test
Subarna-Singh 2e4d6fd
Correction to pass: Compile test for changed packages workflow
Subarna-Singh 4f55e23
Remove hardcoded values: adapter name
Subarna-Singh f4431aa
Add gmci to tsconfig files
Subarna-Singh e8c8c2b
Merge branch 'main' into MERC6933-GMCI-EA-Data_Link_Feed
Subarna-Singh 66174dc
Testing: add unit tests; add more integration tests
Subarna-Singh 9a5e303
Remove: commented import
Subarna-Singh c5659a7
Merge branch 'MERC6933-GMCI-EA-Data_Link_Feed' of github.com:smartcon…
Subarna-Singh 0b8a763
Alternate implementation for price transport
Subarna-Singh da09e6c
Refactor: add async method processMessage to pull data from local cache
Subarna-Singh a80b239
Rework: Price transport
Subarna-Singh c727a96
Remove: old price transport
Subarna-Singh 50d4d42
Modify: unit test to reflect new price transport
Subarna-Singh 437bfb0
Fix: uppercase to camelcase
Subarna-Singh b9247df
Refactor: make processMessage part of wstransport; move message handl…
Subarna-Singh f80198a
Unit test: for price transport
Subarna-Singh 0912899
Delete .changeset/itchy-pianos-wave.md
Subarna-Singh 30b8375
Remove: support for rebalance_status message; merging of price and re…
Subarna-Singh 6edb102
Merge branch 'MERC6933-GMCI-EA-Data_Link_Feed' of github.com:smartcon…
Subarna-Singh e126611
Remove: default API endpoint; Modify: WsResponse to include Price and…
Subarna-Singh bf6b59d
Add unit test for message handler
Subarna-Singh 418ed2f
Change: index to symbol; make WS_API_ENDPOINT required
Subarna-Singh d4d4720
Change: tests to reflect symbol instead of index
Subarna-Singh 871b36d
Change: test payload
Subarna-Singh dd06ecd
Merge branch 'main' into MERC6933-GMCI-EA-Data_Link_Feed
Subarna-Singh 9916d51
Fix: Failing workflow - missing argument in transport
Subarna-Singh 2292dcd
Merge branch 'MERC6933-GMCI-EA-Data_Link_Feed' of github.com:smartcon…
Subarna-Singh 90ae121
Fix mockContext
Subarna-Singh e28958d
Add: message response type
Subarna-Singh 3833941
Add: unit test for rebalance message
Subarna-Singh 81abf28
update readme
Subarna-Singh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@chainlink/gmci-adapter': minor | ||
--- | ||
|
||
GMCI EA for GMCI30 Index |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# GMCI | ||
|
||
  | ||
|
||
This document was generated automatically. Please see [README Generator](../../scripts#readme-generator) for more info. | ||
|
||
## Environment Variables | ||
|
||
| Required? | Name | Description | Type | Options | Default | | ||
| :-------: | :-------------: | :--------------------------------: | :----: | :-----: | :-------------------------: | | ||
| ✅ | API_KEY | An API key for Data Provider | string | | | | ||
| | WS_API_ENDPOINT | WS endpoint for GMCI Data Provider | string | | `wss://api.gmci.co/private` | | ||
|
||
--- | ||
|
||
## Data Provider Rate Limits | ||
|
||
There are no rate limits for this adapter. | ||
|
||
--- | ||
|
||
## Input Parameters | ||
|
||
| Required? | Name | Description | Type | Options | Default | | ||
| :-------: | :------: | :-----------------: | :----: | :----------------------: | :-----: | | ||
| | endpoint | The endpoint to use | string | [price](#price-endpoint) | `price` | | ||
|
||
## Price Endpoint | ||
|
||
`price` is the only supported name for this endpoint. | ||
|
||
### Input Params | ||
|
||
| Required? | Name | Aliases | Description | Type | Options | Default | Depends On | Not Valid With | | ||
| :-------: | :---: | :-----: | :---------: | :----: | :-----: | :-----: | :--------: | :------------: | | ||
| ✅ | index | | Index name | string | | | | | | ||
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. Can you recreate the README now that the name of the parameter is changed? |
||
|
||
### Example | ||
|
||
Request: | ||
|
||
```json | ||
{ | ||
"data": { | ||
"endpoint": "price", | ||
"index": "GMCI30" | ||
} | ||
} | ||
``` | ||
|
||
--- | ||
|
||
MIT License |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "@chainlink/gmci-adapter", | ||
"version": "0.0.0", | ||
"description": "Chainlink gmci adapter.", | ||
"keywords": [ | ||
"Chainlink", | ||
"LINK", | ||
"blockchain", | ||
"oracle", | ||
"gmci" | ||
], | ||
"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": { | ||
"clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo", | ||
"prepack": "yarn build", | ||
"build": "tsc -b", | ||
"server": "node -e 'require(\"./index.js\").server()'", | ||
"server:dist": "node -e 'require(\"./dist/index.js\").server()'", | ||
"start": "yarn server:dist" | ||
}, | ||
"devDependencies": { | ||
"@sinonjs/fake-timers": "9.1.2", | ||
"@types/jest": "27.5.2", | ||
Subarna-Singh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"@types/node": "16.18.119", | ||
"@types/sinonjs__fake-timers": "8.1.5", | ||
"nock": "13.5.5", | ||
"typescript": "5.6.3" | ||
}, | ||
"dependencies": { | ||
"@chainlink/external-adapter-framework": "2.6.0", | ||
"tslib": "2.4.1" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { AdapterConfig } from '@chainlink/external-adapter-framework/config' | ||
|
||
export const config = new AdapterConfig({ | ||
API_KEY: { | ||
description: 'An API key for Data Provider', | ||
type: 'string', | ||
required: true, | ||
sensitive: true, | ||
}, | ||
WS_API_ENDPOINT: { | ||
description: 'WS endpoint for GMCI Data Provider', | ||
type: 'string', | ||
default: 'wss://api.gmci.co/private', | ||
}, | ||
}) |
Subarna-Singh marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"gmci": {} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { endpoint as price } from './price' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter' | ||
import { InputParameters } from '@chainlink/external-adapter-framework/validation' | ||
import { config } from '../config' | ||
import overrides from '../config/overrides.json' | ||
import { transport } from '../transport/price' | ||
|
||
export const inputParameters = new InputParameters( | ||
{ | ||
index: { | ||
required: true, | ||
type: 'string', | ||
description: 'Index name', | ||
}, | ||
}, | ||
[ | ||
{ | ||
index: 'GMCI30', | ||
}, | ||
], | ||
) | ||
|
||
export type GMCIResultResponse = { | ||
Result: number | ||
Data: { | ||
status?: string | ||
end_time?: string | ||
start_time?: string | ||
symbol?: string | ||
result?: number | ||
Subarna-Singh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
export type BaseEndpointTypes = { | ||
Parameters: typeof inputParameters.definition | ||
Response: GMCIResultResponse | ||
Settings: typeof config.settings | ||
} | ||
|
||
export const endpoint = new AdapterEndpoint({ | ||
name: 'price', | ||
aliases: [], | ||
transport: transport, | ||
inputParameters, | ||
overrides: overrides['gmci'], | ||
Subarna-Singh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { expose, ServerInstance } from '@chainlink/external-adapter-framework' | ||
import { Adapter } from '@chainlink/external-adapter-framework/adapter' | ||
import { config } from './config' | ||
import { price } from './endpoint' | ||
|
||
export const adapter = new Adapter({ | ||
defaultEndpoint: price.name, | ||
name: 'GMCI', | ||
config, | ||
endpoints: [price], | ||
}) | ||
|
||
export const server = (): Promise<ServerInstance | undefined> => expose(adapter) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
major?
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.
FIXED
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.
Just in case you don't know. You can just edit these changeset files. You don't need to run the command again. Because now you have 2 changeset files which seems unnecessary for a single PR.
Can you remove one of them and make sure the other one is correct?