Skip to content

Commit 1906b9f

Browse files
authored
Merge pull request #1 from protofire/main
Move out of Organization Repo to allow edits by maintainers
2 parents af104c6 + 781c194 commit 1906b9f

File tree

7,107 files changed

+192215
-154969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,107 files changed

+192215
-154969
lines changed

.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
"env": {
3+
"node": true,
4+
"commonjs": true,
5+
"es2021": true
6+
},
7+
"extends": "eslint:recommended",
8+
"overrides": [
9+
],
10+
"parserOptions": {
11+
"ecmaVersion": "latest"
12+
},
13+
ignorePatterns: ['projects/test/*'],
14+
"rules": {
15+
"no-case-declarations": "off",
16+
"no-unused-vars": "off",
17+
"no-useless-escape": "warn",
18+
"no-prototype-builtins": "off",
19+
"no-unreachable": "off",
20+
}
21+
}

.github/workflows/alert.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
- run: curl https://born-to-llama.onrender.com/refresh
13-
- name: Deploy
14-
run: |
15-
curl -XPOST -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.PAT }}" https://api.github.com/repos/DefiLlama/defillama-server/dispatches --data '{"event_type": "build"}'
12+
- name: Update unlisted
13+
run: curl https://born-to-llama.herokuapp.com/refresh
14+
# - name: Deploy to server
15+
# run: curl https://born-to-llama.herokuapp.com/rebuild-server

.github/workflows/commentResult.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { readFileSync } = require('fs');
22
const axios = require('axios');
3-
const junk = 'VPTOH1X0B7rf8od7BGNsQ1z0BJk8iMNLxqrD';
3+
const junk = 'rmicl\x1Eefn]JsfjoHoGRpWOt3_u@L_LpTUc_BLf0T/i/mXC';
44

55
async function main() {
66
const [, , log, author, repo, pr, path ] = process.argv;
@@ -16,7 +16,7 @@ async function main() {
1616
body = `The adapter at ${path} exports TVL:
1717
\n \n ${file.substring(summaryIndex + 17).replaceAll('\n', '\n ')}`;
1818
} else if (errorIndex != -1) {
19-
body = `Error while running adapter at ${path}:
19+
body = `Error while running adapter at ${path ?? ''}:
2020
\n \n ${file.split(errorString)[1].replaceAll('\n', '\n ')}`;
2121
} else
2222
return;
@@ -25,12 +25,14 @@ async function main() {
2525
`https://api.github.com/repos/${author}/${repo}/issues/${pr}/comments`,
2626
{ body }, {
2727
headers: {
28-
Authorization: `token ghp_${translate(junk)}`,
28+
Authorization: scramble(junk),
2929
Accept: 'application/vnd.github.v3+json'
3030
}
3131
});
3232
};
33-
function translate(input) {
34-
return input ? translate(input.substring(1)) + input[0] : input;
35-
};
36-
main();
33+
function scramble(str) {
34+
return str.split('').reduce((a, b) => {
35+
return a + String.fromCharCode(b.charCodeAt(0) + 2);
36+
}, '');
37+
}
38+
main();

.github/workflows/getFileList.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ const fileSet = new Set();
44

55
[...MODIFIED, ...ADDED].forEach(file => {
66
const [root, dir] = file.split('/')
7-
if (root === 'projects' && dir !=='helper' && dir !== 'config') fileSet.add(root + '/' + dir)
7+
if (dir === 'treasury' || dir === 'entities') fileSet.add(file)
8+
else if (root === 'projects' && dir !=='helper' && dir !== 'config') fileSet.add(root + '/' + dir)
89
})
910

1011
console.log(JSON.stringify([...fileSet]))
1112

1213
function parse(data) {
1314
return data.replace('[', '').replace(']', '').split(',')
14-
}
15+
}

.github/workflows/test.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
- name: Check out repository code
1414
uses: actions/checkout@v2
1515
- name: Run changes files through test script
16+
env:
17+
LLAMA_DEBUG_MODE: "true"
18+
BSC_RPC: https://rpc.ankr.com/bsc,https://bsc-dataseed4.binance.org
1619
run: |
1720
RUN_FILES=$(
1821
MODIFIED=${{ steps.file_changes.outputs.files_modified}} \
@@ -25,7 +28,18 @@ jobs:
2528
exit 0
2629
fi
2730
28-
npm ci --omit=dev
31+
npm remove typescript @types/async-retry @types/bn.js ts-node @solendprotocol/solend-sdk @hover-labs/kolibri-js
32+
# npm ci --omit=dev
33+
npm ci
34+
# npm update @defillama/sdk
35+
36+
# fail if package.json or package-lock.json is changed
37+
FILES_MODIFIED=${{ steps.file_changes.outputs.files_modified }}
38+
if [[ $FILES_MODIFIED == *"package.json"* || $FILES_MODIFIED == *"package-lock.json"* ]]; then
39+
echo "------ ERROR ------ > Please revert changes to package.json / package-lock.json" > /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/output.txt
40+
node ${{ github.workspace }}/.github/workflows/commentResult.js /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/output.txt "${{ github.repository_owner }}" "${{ github.event.repository.name }}" "${{ github.event.number }}"
41+
exit 1
42+
fi
2943
3044
for i in $(echo $RUN_FILES | tr -d '"[]' | tr "," "\n")
3145
do
@@ -39,4 +53,9 @@ jobs:
3953
echo -n $i
4054
echo ' doesnt run'
4155
}
42-
done
56+
done
57+
58+
- name: Run ESLint
59+
run: |
60+
npm ci
61+
npm run lint

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ historical-data.js
77
/.idea
88
yarn.lock
99
.DS_Store
10-
projects/pooltogether/index.js
1110
.vscode

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore all files
2+
*

.prettierrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
Follow [this guide](https://docs.llama.fi/submit-a-project) to create an adapter and submit a PR with it.
44

5-
Also, don't hesitate to send a message on [our discord](https://discord.gg/buPFYXzDDd) if we're late to merge your PR.
5+
Also, don't hesitate to send a message on [our discord](https://discord.defillama.com/) if we're late to merge your PR.
66

7+
> If you would like to add a `volume` adapter please submit the PR [here](https://github.com/DefiLlama/adapters)
8+
> - If you would like to add a `liquidations` adapter, please refer to [this readme document](https://github.com/DefiLlama/DefiLlama-Adapters/tree/main/liquidations) for details.
9+
10+
1. PLEASE PLEASE **enable "Allow edits by maintainers" while putting up the PR.**
11+
2. Once your adapter has been merged, it takes time to show on the UI. No need to notify us on Discord.
12+
3. TVL must be computed from blockchain data (reason: https://github.com/DefiLlama/DefiLlama-Adapters/discussions/432), if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
13+
4. **For updating listing info** It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
14+
5. Do not edit/push `package-lock.json` file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
15+
6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap
716

817
## Getting listed
918

@@ -13,11 +22,13 @@ Please send answers to questions there https://github.com/DefiLlama/DefiLlama-Ad
1322

1423
This is a work in progress. The goal is to eventually handle historical data. DefiLlama aims to be transparent, accurate and open source.
1524

16-
If you have any suggestions, want to contribute or want to chat, please join [our discord](https://discord.gg/buPFYXzDDd) and drop a message.
25+
If you have any suggestions, want to contribute or want to chat, please join [our discord](https://discord.defillama.com/) and drop a message.
1726

1827
## Testing adapters
19-
```
28+
```bash
2029
node test.js projects/pangolin/index.js
30+
# Add a timestamp at the end to run the adapter at a historical timestamp
31+
node test.js projects/aave/v3.js 1729080692
2132
```
2233

2334
## Changing RPC providers
@@ -26,11 +37,9 @@ If you want to change RPC providers because you need archive node access or beca
2637
ETHEREUM_RPC="..."
2738
BSC_RPC="..."
2839
POLYGON_RPC="..."
29-
FANTOM_RPC="..."
30-
ARBITRUM_RPC="..."
31-
OPTIMISM_RPC="..."
32-
XDAI_RPC="..."
33-
HARMONY_RPC="..."
3440
```
3541

36-
The name of each rpc is `{CHAIN-NAME}_RPC`, and the name we use for each chain can be found [here](https://github.com/DefiLlama/defillama-sdk/blob/master/src/general.ts#L33)
42+
The name of each rpc is `{CHAIN-NAME}_RPC`, and the name we use for each chain can be found [here](https://github.com/DefiLlama/defillama-sdk/blob/master/src/providers.json)
43+
44+
## Adapter rules
45+
- Never add extra npm packages, if you need a chain-level package for your chain, ask us and we'll consider it, but we can't accept any npm package that is project-specific

bun.lockb

145 KB
Binary file not shown.

0 commit comments

Comments
 (0)