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

[Master] Release/v0.2.0 #439

Merged
merged 197 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
a9425aa
coinmarketcap ts refactor
emmick4 Jan 12, 2021
aceeedc
types & lint & package name
emmick4 Jan 12, 2021
bb4e012
CHANGELOG
emmick4 Jan 12, 2021
06ce69a
Merge develop
justinkaseman Jan 27, 2021
988dc26
Requested changes: uses generic execute types, base url from config, …
justinkaseman Jan 28, 2021
5c3a7e0
add conflux adapter
Feb 3, 2021
40090fc
Merge develop
justinkaseman Feb 3, 2021
981c0dc
Remove adapter.js from merge
justinkaseman Feb 3, 2021
9ad5695
Fix: increase test timeout, move marketcap unknown market to error ca…
justinkaseman Feb 3, 2021
c6fc972
getDefaultConfig takes new parameter for required API key
justinkaseman Feb 3, 2021
1d834e7
Brings back dummy API_KEYs for tests
justinkaseman Feb 3, 2021
59c150f
Uses verbose env var to determine response data
justinkaseman Feb 4, 2021
4977c31
update changelog: add conflux adapter
Feb 4, 2021
fb6fad6
Merge branch 'develop' into emmick/coinmarketcap-refactor
justinkaseman Feb 4, 2021
09e2bb2
Merge pull request #218 from smartcontractkit/emmick/coinmarketcap-re…
justinkaseman Feb 4, 2021
9cfa19b
EA migration - batch #1 (#226)
justinkaseman Feb 4, 2021
5ec72c2
Merge branch 'develop' into release/v0.2.0-rc.1
krebernisak Feb 4, 2021
3ee01e9
Merge pull request #298 from smartcontractkit/release/v0.2.0-rc.1
krebernisak Feb 4, 2021
cc6c231
batch adapter TS refactor (#234)
emmick4 Feb 4, 2021
4fea27a
README improvements, fix typo with PRICE_ADAPTER
justinkaseman Jan 29, 2021
efd53dd
networkId type fix
Feb 7, 2021
42ad11e
feed tx gas info
Feb 7, 2021
1284cb9
Read dxFeed config correctly with prefix
boxhock Feb 8, 2021
192aadb
Include config change in secondary adapter
boxhock Feb 8, 2021
59536df
Use "Quote" for WTI
boxhock Feb 8, 2021
6606975
Merge pull request #301 from smartcontractkit/fix-dxfeed-price-config…
boxhock Feb 8, 2021
5d72615
Fix case-sensitive endpoint params
boxhock Feb 10, 2021
4055ca7
Merge pull request #302 from smartcontractkit/fix-case-sensitive-endp…
boxhock Feb 10, 2021
e7a0e76
batch requests on coingecko
RodrigoAD Feb 2, 2021
176a15c
DPI readme updated
RodrigoAD Feb 2, 2021
ad70ac6
removed console
RodrigoAD Feb 2, 2021
47825a9
Merge pull request #287 from smartcontractkit/rate-limit-improvements
RodrigoAD Feb 11, 2021
50194a0
Update Synthetix for new sDEFI pairs
thodges-gh Feb 12, 2021
8d76eb2
Merge pull request #305 from smartcontractkit/update-synthetix-sdefi
thodges-gh Feb 12, 2021
5908438
docs: additiona to 1forge, amberdata-gasprice, anyblock-gasprice, & b…
justinkaseman Feb 6, 2021
c5464bf
Add API_KEY docs & docs from QA for coinapi, coinbase, cmc, coinpapri…
justinkaseman Feb 9, 2021
21a965c
Finish TS migrated adapter QA
justinkaseman Feb 10, 2021
edb4487
Add dummy API keys for tests
justinkaseman Feb 10, 2021
92b718b
Use Jonas' fix to non-lowercase endpoint param
justinkaseman Feb 10, 2021
328eeab
Add dummy API key to openexchangerates test
justinkaseman Feb 10, 2021
0788573
Add dummy API key to polygon test
justinkaseman Feb 10, 2021
4be2213
Requested changes: consistent endpoint title capitalization, tweak AP…
justinkaseman Feb 12, 2021
da022a4
Fix: balance test helper path
justinkaseman Jan 25, 2021
a6cc5ea
Remove WrappedResponse
justinkaseman Jan 25, 2021
b40fd09
Merge develop
justinkaseman Jan 25, 2021
f777be9
CHANGELOG
justinkaseman Jan 25, 2021
590c2f8
Requested Change: remove from CHANGELOG
justinkaseman Feb 4, 2021
aaa6f1b
Change: Only one Middleware type
justinkaseman Feb 4, 2021
a2a2d57
Change: revert change to withCache to remove options param
justinkaseman Feb 4, 2021
caca6dd
Remove util.wrapExecute from all EAs
justinkaseman Feb 5, 2021
8abb484
Revert result being optional
justinkaseman Feb 5, 2021
1d11552
Makes Middleware a generic type to allow withCache options & fix test…
justinkaseman Feb 5, 2021
edc7a21
wrap response
RodrigoAD Feb 16, 2021
5e18d27
returning result on callback
RodrigoAD Feb 16, 2021
9d7981e
removed unused imports
RodrigoAD Feb 16, 2021
c59761f
Merge pull request #309 from smartcontractkit/fix-wrapped-response
RodrigoAD Feb 16, 2021
7fd14dd
Update KCS slug on CMC synth-index
boxhock Feb 17, 2021
34d4e73
Update KCS slug on CMC
boxhock Feb 17, 2021
be0d8b0
Merge pull request #311 from smartcontractkit/cmc-synth-index-kcs
boxhock Feb 17, 2021
f36ff26
synthx as composite using TA
RodrigoAD Jan 21, 2021
ec90d5e
removed old synth adapter and its build steps
RodrigoAD Jan 21, 2021
f5df001
base as default input param
RodrigoAD Jan 22, 2021
308c141
TA default quote as env var
RodrigoAD Jan 22, 2021
353bb42
TA accepts method as param
RodrigoAD Jan 22, 2021
a939cbd
validation on TA
RodrigoAD Jan 25, 2021
77c5667
avoid floating numbers on TA
RodrigoAD Jan 25, 2021
412aeca
removed TA reference from Readme
RodrigoAD Feb 4, 2021
00e0a7e
readme updated
RodrigoAD Feb 11, 2021
2a4c5dd
negative balance checked easier
RodrigoAD Feb 11, 2021
12b4d5d
prefix preference on TA make config
RodrigoAD Feb 11, 2021
f69d133
updated adapter name
RodrigoAD Feb 15, 2021
bda186e
added cmc slugs
RodrigoAD Feb 17, 2021
860eb7d
updated synthx version
RodrigoAD Feb 17, 2021
31255df
fix synthx version
RodrigoAD Feb 17, 2021
514a638
Merge pull request #312 from smartcontractkit/fix-synthx-version
RodrigoAD Feb 17, 2021
de5740c
tiingo adapter with tests
BkChoy Feb 16, 2021
fb37be9
misc tiingo fixes
BkChoy Feb 17, 2021
25960af
updated changelog
BkChoy Feb 17, 2021
71873df
updates
Feb 18, 2021
6a3125e
fix import name error
Feb 18, 2021
6bc56d8
Remove synthetix dependency from global package
boxhock Feb 18, 2021
3d1fd78
Update synthetix package
boxhock Feb 18, 2021
05db76a
Prevent scientific notation of balances
boxhock Feb 18, 2021
34cdda1
Merge pull request #314 from smartcontractkit/update-synth-version
boxhock Feb 18, 2021
7e184fb
removed google finance
ebarakos Feb 17, 2021
ac4c76c
filter out auth from logging
ebarakos Feb 18, 2021
2549b57
Publish Docker images to SDLC Public ECR instead of Prod Public ECR
emedvedev Feb 18, 2021
863e99a
remove old js code
Feb 19, 2021
f820959
add ts conflux adaptor code
Feb 19, 2021
060e03c
remove lock file
Feb 19, 2021
c57d170
Merge branch 'develop' into develop
Pana Feb 19, 2021
6675604
comment example test
Feb 19, 2021
05d71f7
Merge branch 'develop' of github.com:Pana/external-adapters-js into d…
Feb 19, 2021
8899e0f
added preset ticker on coinpaprika and coingecko
ebarakos Feb 19, 2021
8ac8879
Merge branch 'develop' into develop
Pana Feb 20, 2021
c82fa48
update config helper
Feb 20, 2021
82ea689
Include the "result" key on cached responses
boxhock Feb 21, 2021
3ac1fae
Include jobRunID in cached response
boxhock Feb 21, 2021
e7066e9
Merge pull request #322 from smartcontractkit/include-result-on-cache
boxhock Feb 21, 2021
b93557a
Merge branch 'develop' into develop
Pana Feb 21, 2021
cef1190
added ethwrite JS project and its dependencies
ebarakos Feb 3, 2021
8c023e1
converted to TS
ebarakos Feb 3, 2021
4b6dd44
working with the new structure
ebarakos Feb 4, 2021
25fb5c5
added hardhat and relevant test setup
ebarakos Feb 8, 2021
e38a464
default config + naming convention fix
ebarakos Feb 8, 2021
baba37a
changed README, added defaults and test
ebarakos Feb 11, 2021
01a17a9
review changes; need to check tests
ebarakos Feb 15, 2021
58717c0
asserting true values written to contract in test
ebarakos Feb 16, 2021
b238c6c
small change in config
ebarakos Feb 16, 2021
e41c0ee
made dataType optional, altered tests, added helper file
ebarakos Feb 16, 2021
fb60fa9
removed helper files
ebarakos Feb 17, 2021
1ba100d
installed fresh dependencies
ebarakos Feb 17, 2021
cfd0f22
README changes and required env vars
ebarakos Feb 18, 2021
aabae5f
moved private key to hardhat helpers
ebarakos Feb 18, 2021
81e40c0
yarn install
ebarakos Feb 18, 2021
d6b0a48
json for hardhat exported var
ebarakos Feb 19, 2021
e25f817
cleaned comments
ebarakos Feb 19, 2021
5062e00
Merge branch 'develop' into develop
Pana Feb 22, 2021
6e44905
update new ea-bootstrap
Feb 22, 2021
87999f5
fix lint error
Feb 22, 2021
ce710b6
add unit test
Feb 23, 2021
cbbdb66
fix lint
Feb 23, 2021
d316785
update tests
Feb 23, 2021
3e94cbb
Merge pull request #289 from conflux-fans/develop
RodrigoAD Feb 23, 2021
cc50afa
Publish adapters to prod when merging to develop
HenryNguyen5 Feb 23, 2021
6198f32
Merge pull request #327 from smartcontractkit/feature/publish_prod_de…
HenryNguyen5 Feb 23, 2021
5492d66
Merge branch 'develop' into feature/sdlc-publish
emedvedev Feb 24, 2021
eae0831
Merge pull request #316 from smartcontractkit/feature/sdlc-publish
emedvedev Feb 24, 2021
0971a97
basic setup
BkChoy Feb 18, 2021
c1e9023
geoDB adapter
BkChoy Feb 22, 2021
97fbebb
updated changelog
BkChoy Feb 22, 2021
1a39885
Removed other parts of config that include sensitive values. Removed …
ebarakos Feb 26, 2021
04d9264
Add "agoric" adapter (#114)
michaelfig Mar 1, 2021
07af4c7
Kaiko special case for DIGG/BTC (#336)
boxhock Mar 2, 2021
b8f88da
updated geodb url
BkChoy Mar 3, 2021
8eff899
Update node version in GCP readme
tyrion70 Feb 11, 2021
bedd77d
Add Amberdata case for DIGG/BTC (#345)
boxhock Mar 4, 2021
8c892cc
TheRundown adapter
BkChoy Mar 3, 2021
7a67cca
updated changelog
BkChoy Mar 3, 2021
df09d69
updated therundown readme
BkChoy Mar 4, 2021
99a1264
TS EAs #4 batch 0 of 3 (#332)
justinkaseman Mar 5, 2021
333ea1a
Move TE stream adapter to monorepo (#346)
boxhock Mar 5, 2021
8375796
Added LINA preset in coingecko
ebarakos Mar 9, 2021
f21c09e
CMC should prefer IDs over slugs (#343)
boxhock Mar 9, 2021
a664352
Add conversion from AMP to AMP2 for Nomics adapter
justinkaseman Mar 9, 2021
988d8c6
parsing c(close price) according to v3
ebarakos Mar 9, 2021
5abb8e5
Add tradermade support to outlier-detection (#357)
boxhock Mar 11, 2021
3586b8f
Improve Redis connection cleanup
krebernisak Mar 12, 2021
2f83343
AlphaChain adapter to TS
justinkaseman Mar 1, 2021
49533b4
Add postinstall script
justinkaseman Mar 1, 2021
50b4c28
More best practices in the example EA
justinkaseman Mar 1, 2021
d5eec96
Bitex adapter to TS
justinkaseman Mar 1, 2021
3b3b248
Bitso adapter to TS
justinkaseman Mar 1, 2021
5c886c9
Clean up bravenewcoin-vwap fragment
justinkaseman Mar 1, 2021
b4c5798
Coinlore adapter to TS
justinkaseman Mar 1, 2021
d752a12
Remove postinstall script until entire build process can be refactored
justinkaseman Mar 2, 2021
5f0201f
TrueUSD adapter to TS
justinkaseman Feb 26, 2021
28d25b7
Reverts change to TrueUSD param name
justinkaseman Feb 26, 2021
b01ff72
COVID-tracker adapter to TS
justinkaseman Mar 3, 2021
f1c9f86
Cryptomkt adapter to TS
justinkaseman Mar 3, 2021
9273236
Remove google-finance adapter fragment
justinkaseman Mar 3, 2021
6030ab5
Lition adapter to TS
justinkaseman Mar 3, 2021
03e10fb
Add public ecr registry to docker login
HenryNguyen5 Mar 16, 2021
72364a4
Skip coinlore integration tests
HenryNguyen5 Mar 16, 2021
f409c1f
Add baseurl option (#367)
HenryNguyen5 Mar 16, 2021
a0a2842
Explicitly specify aws region (#370)
HenryNguyen5 Mar 17, 2021
a5f708b
Updated Asset Allocation Interface (#358)
RodrigoAD Mar 17, 2021
3059812
Fix support for WING on Nomics (#371)
thodges-gh Mar 17, 2021
6fd4fb1
Add basic prom metrics (#365)
HenryNguyen5 Mar 17, 2021
fd745dc
Messari adapter to TS
justinkaseman Mar 3, 2021
63b6550
Orchid Bandwidth adapter to TS
justinkaseman Mar 3, 2021
691d052
SatoshiTange adapter to TS
justinkaseman Mar 3, 2021
7265936
TradingEconomics adapter to TS
justinkaseman Mar 3, 2021
2578af4
Extra to TradingEconomics README
justinkaseman Mar 3, 2021
9fe0911
Fix to tradingeconomics .eslintrc.js
justinkaseman Mar 3, 2021
bddb7a3
Fix: remove no longer relevant test
justinkaseman Mar 16, 2021
f67cbc1
Cryptoapis tests and README (#248)
ebarakos Mar 22, 2021
f1d6989
Update README about metadata (#379)
connorwstein Mar 23, 2021
4edb2d2
Add new ticker conversions
justinkaseman Mar 24, 2021
a657053
Overrides Input parameter (#384)
RodrigoAD Mar 26, 2021
def1811
Bump elliptic from 3.0.3 to 6.5.4 (#391)
dependabot[bot] Mar 26, 2021
20de7ac
Remove GOOGL override for dxfeed-secondary (#392)
justinkaseman Mar 26, 2021
088cba4
fix-format-readme-link (#393)
RodrigoAD Mar 27, 2021
e67fe1e
Set correct response type on metrics
HenryNguyen5 Mar 31, 2021
d692f4d
Add FB support for dxfeed and dxfeed-secondary (#420)
nzleet Apr 7, 2021
01e05fb
bitcoin endpoints (#417)
emmick4 Apr 7, 2021
157c079
Update Genesis Volatility README (#422)
boxhock Apr 8, 2021
c45ca5e
add support for RAI to kaiko, nomics (#425)
nzleet Apr 8, 2021
fe0e651
add rai, weth (#424)
nzleet Apr 8, 2021
936c7fc
update API key url (#428)
nzleet Apr 9, 2021
eeb6c66
additional fixes for RAI support on kaiko adapter (#431)
aalu1418 Apr 10, 2021
cc0072d
v0.0.4
justinkaseman Apr 13, 2021
b1f424c
Preparing v0.2.0 release: version patch bumps
justinkaseman Apr 13, 2021
b8e8006
Tag changelog
justinkaseman Apr 13, 2021
01f292b
Bump dependency versions
justinkaseman Apr 13, 2021
1e8ef75
Additional CHANGELOG items
justinkaseman Apr 13, 2021
1583613
Merge branch 'master' into release/v0.2.0
justinkaseman Apr 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 11 additions & 22 deletions .github/strategy/adapters.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"image_name": "__ADAPTER__-adapter",
"adapter": [
"1forge",
"agoric",
"alphachain",
"alphavantage",
"amberdata",
Expand All @@ -19,9 +20,9 @@
"blockchain.com",
"blockchair",
"blockcypher",
"blockstream",
"bootstrap",
"bravenewcoin",
"bravenewcoin-vwap",
"coinapi",
"coinbase",
"coincodex",
Expand Down Expand Up @@ -51,7 +52,6 @@
"fixer",
"fmpcloud",
"genesis-volatility",
"google-finance",
"json-rpc",
"kaiko",
"lcx",
Expand Down Expand Up @@ -82,7 +82,13 @@
"dydx-stark",
"iex-cloud",
"cfbenchmarks",
"harmony"
"conflux",
"harmony",
"tiingo",
"ethwrite",
"geodb",
"therundown",
"tradingeconomics-stream"
]
},
"2-step": {
Expand Down Expand Up @@ -116,25 +122,8 @@
"apy-finance",
"crypto-volatility-index",
"bitcoin-json-rpc",
"token-allocation"
]
},
"synth-index": {
"docker": "make docker-synth-index adapter=__ADAPTER__",
"cmd": "make zip-synth-index adapter=__ADAPTER__",
"asset_path": "./synth-index/__ADAPTER__/dist/synth-index-__ADAPTER__-adapter.zip",
"asset_name": "synth-index-__ADAPTER__-adapter.zip",
"image_name": "synth-index-__ADAPTER__-adapter",
"adapter": [
"amberdata",
"bravenewcoin",
"coinapi",
"coingecko",
"coinmarketcap",
"coinpaprika",
"cryptocompare",
"kaiko",
"nomics"
"token-allocation",
"synth-index"
]
}
}
20 changes: 12 additions & 8 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,25 @@ jobs:
run: ${{ matrix.adapter.cmd }}
- name: Build Docker containers
run: ${{ matrix.adapter.docker }} repo="public.ecr.aws/${{ env.publicecr-name }}/adapters/"
- name: Configure AWS Credentials
- name: Configure AWS prod Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to prod S3
run: aws s3 cp ${{ matrix.adapter.asset_path }} s3://adaptor-source-cl/${{ matrix.adapter.asset_name }}
- name: Configure staging AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_STAGING }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_STAGING }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to S3
- name: Upload to staging S3
run: aws s3 cp ${{ matrix.adapter.asset_path }} s3://adaptor-source-cl-staging/${{ matrix.adapter.asset_name }}
- name: Authenticate to public ECR
run: aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws
env:
AWS_DEFAULT_REGION: us-east-1 # https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/${{ env.publicecr-name }}
- name: Create a public ECR repository if does not exist
run: aws ecr-public create-repository --repository-name adapters/${{ matrix.adapter.image_name }} || true
env:
AWS_DEFAULT_REGION: us-east-1
run: aws ecr-public create-repository --region us-east-1 --repository-name adapters/${{ matrix.adapter.image_name }} || true
- name: Push to public ECR
run: docker push public.ecr.aws/${{ env.publicecr-name }}/adapters/${{ matrix.adapter.image_name }}
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Release

env:
cache-name: release-ci
publicecr-name: chainlink
publicecr-name: z0b1w9r9

jobs:
release:
Expand Down Expand Up @@ -90,21 +90,25 @@ jobs:
asset_path: ${{ matrix.adapter.asset_path }}
asset_name: ${{ needs.release.outputs.asset_prefix }}-${{ matrix.adapter.asset_name }}
asset_content_type: application/zip
- name: Configure AWS Credentials
- name: Configure AWS Credentials for Prod S3
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to S3
run: aws s3 cp ${{ matrix.adapter.asset_path }} s3://adaptor-source-cl/${{ matrix.adapter.asset_name }}
- name: Configure AWS Credentials for SDLC Public ECR
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_PUBLICECR_ACCESSKEY }}
aws-secret-access-key: ${{ secrets.AWS_PUBLICECR_SECRETKEY }}
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_PUBLICECR_ROLE_ARN }}
role-duration-seconds: 1200
- name: Authenticate to public ECR
run: aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws
env:
AWS_DEFAULT_REGION: us-east-1 # https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/${{ env.publicecr-name }}
- name: Create a public ECR repository if does not exist
run: aws ecr-public create-repository --repository-name adapters/${{ matrix.adapter.image_name }} || true
env:
AWS_DEFAULT_REGION: us-east-1
run: aws ecr-public create-repository --region us-east-1 --repository-name adapters/${{ matrix.adapter.image_name }} || true
- name: Push to public ECR
run: docker push public.ecr.aws/${{ env.publicecr-name }}/adapters/${{ matrix.adapter.image_name }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
*.zip
dist
.DS_Store
cache
4 changes: 3 additions & 1 deletion 1forge/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = require('../.eslintrc.js')
module.exports = {
...require('../.eslintrc.ts.js'),
}
54 changes: 39 additions & 15 deletions 1forge/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
# Chainlink 1Forge External Adapter
# Chainlink External Adapter for 1forge

## Input Params
### Environment Variables

- `base` or `to`: The target currency to query (required)
- `quote` or `from`: The currency to convert to (required)
- `endpoint`: The endpoint to call (optional)
| Required? | Name | Description | Options | Defaults to |
| :-------: | :-----: | :-------------------------------------------------------: | :-----: | :---------: |
| ✅ | API_KEY | An API key that can be obtained from the 1forge dashboard | | |

## Output
---

### Input Parameters

| Required? | Name | Description | Options | Defaults to |
| :-------: | :------: | :-----------------: | :----------------------: | :---------: |
| | endpoint | The endpoint to use | [price](#Price-Endpoint) | price |

---

## Price Endpoint

[`/convert`](https://1forge.com/api#convert) - Convert from one currency to another

### Input Params

| Required? | Name | Description | Options | Defaults to |
| :-------: | :------------: | :-------------------------------------------: | :--------------------------------------: | :---------: |
| ✅ | `base`, `from` | The symbol of the currency to query | [List](https://1forge.com/currency-list) | |
| ✅ | `quote`, `to` | The symbol of the currency to convert to | [List](https://1forge.com/currency-list) | |
| 🟡 | `quantity` | An additional amount of the original currency | | |
| 🟡 | `overrides` | If base provided is found in overrides, that will be used | [Format](../external-adapter/src/overrides/presetSymbols.json)| |


### Output

```json
{
"jobRunID": "1",
"data": {
"value": 1.22687,
"text": "1.0 GBP is worth 1.22687 USD",
"timestamp": 1587489920,
"result": 1.22687
},
"result": 1.22687,
"statusCode": 200
"jobRunID": "1",
"data": {
"value": 1.22687,
"text": "1.0 GBP is worth 1.22687 USD",
"timestamp": 1587489920,
"result": 1.22687
},
"result": 1.22687,
"statusCode": 200
}
```
43 changes: 0 additions & 43 deletions 1forge/adapter.js

This file was deleted.

4 changes: 0 additions & 4 deletions 1forge/index.js

This file was deleted.

31 changes: 25 additions & 6 deletions 1forge/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
{
"name": "@chainlink/1forge-adapter",
"version": "0.0.3",
"version": "0.0.4",
"license": "MIT",
"main": "index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"server": "node -e 'require(\"./index.js\").server()'",
"prepublishOnly": "yarn build && yarn test:unit",
"setup": "yarn build",
"build": "tsc -b",
"lint": "eslint --ignore-path ../.eslintignore . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint --ignore-path ../.eslintignore . --ext .js,.jsx,.ts,.tsx --fix",
"test": "yarn _mocha --timeout 0",
"test:unit": "yarn _mocha --grep @integration --invert --timeout 0",
"test:integration": "yarn _mocha --grep @integration --timeout 0"
"test": "mocha --exit --timeout 15000 -r ts-node/register 'test/**/*.test.ts'",
"test:unit": "mocha --exit --grep @integration --invert -r ts-node/register 'test/**/*.test.ts'",
"test:integration": "mocha --exit --timeout 15000 --grep @integration -r ts-node/register 'test/**/*.test.ts'",
"server": "node -e 'require(\"./index.js\").server()'",
"server:dist": "node -e 'require(\"./dist/index.js\").server()'",
"start": "yarn server:dist"
},
"devDependencies": {
"@types/chai": "^4.2.11",
"@types/express": "^4.17.6",
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.13",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.0",
"ts-node": "^8.10.2",
"typescript": "^3.9.7"
},
"dependencies": {}
}
35 changes: 35 additions & 0 deletions 1forge/src/adapter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Requester, Validator, AdapterError } from '@chainlink/external-adapter'
import { Config, ExecuteWithConfig, ExecuteFactory } from '@chainlink/types'
import { makeConfig, DEFAULT_ENDPOINT } from './config'
import { price } from './endpoint'

const inputParams = {
endpoint: false,
}

export const execute: ExecuteWithConfig<Config> = async (request, config) => {
const validator = new Validator(request, inputParams)
if (validator.error) throw validator.error

Requester.logConfig(config)

const jobRunID = validator.validated.id
const endpoint = validator.validated.data.endpoint || DEFAULT_ENDPOINT

switch (endpoint) {
case price.NAME: {
return await price.execute(request, config)
}
default: {
throw new AdapterError({
jobRunID,
message: `Endpoint ${endpoint} not supported.`,
statusCode: 400,
})
}
}
}

export const makeExecute: ExecuteFactory<Config> = (config) => {
return async (request) => execute(request, config || makeConfig())
}
19 changes: 19 additions & 0 deletions 1forge/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Requester } from '@chainlink/external-adapter'
import { Config } from '@chainlink/types'

export const NAME = '1FORGE'

export const DEFAULT_ENDPOINT = 'price'
export const DEFAULT_API_ENDPOINT = 'https://api.1forge.com/'

export const makeConfig = (prefix?: string): Config => {
const config = Requester.getDefaultConfig(prefix, true)
config.api = {
...config.api,
baseURL: config.api.baseUrl || DEFAULT_API_ENDPOINT,
params: {
api_key: config.apiKey,
},
}
return config
}
1 change: 1 addition & 0 deletions 1forge/src/endpoint/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as price from './price'
Loading