mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
Add DISABLED_ADAPTER key + add v1 pancake
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
"pre-commit": "npm run check-types",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"weeklyChanges": "git pull && git diff $(git log -1 --before=@{7.days.ago} --format=%H) --stat | grep -E \"projects/\" | cut -d / -f 2 | cut -d \" \" -f 1 | uniq | wc -l",
|
||||
@@ -11,7 +10,8 @@
|
||||
"test-interactive": "node utils/testInteractive",
|
||||
"test-dex": "ts-node volumes/cli/testAdapter.ts",
|
||||
"postinstall": "echo 'run \"npm update @defillama/sdk\" if you want lastest sdk changes' ",
|
||||
"get-not-exported-volumes": "ts-node volumes/cli/checkExported"
|
||||
"get-not-exported-volumes": "ts-node volumes/cli/checkExported",
|
||||
"check-types": "npx tsc volumes/**/*.ts --noEmit"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { SimpleVolumeAdapter } from "../../dexVolume.type";
|
||||
import { BreakdownVolumeAdapter, DISABLED_ADAPTER_KEY, SimpleVolumeAdapter } from "../../dexVolume.type";
|
||||
import disabledAdapter from "../../helper/disabledAdapter";
|
||||
|
||||
const {
|
||||
getChainVolume,
|
||||
@@ -27,15 +28,20 @@ const graphs = getChainVolume({
|
||||
},
|
||||
});
|
||||
|
||||
const adapter: SimpleVolumeAdapter = {
|
||||
volume: {
|
||||
[BSC]: {
|
||||
fetch: graphs(BSC),
|
||||
start: getStartTimestamp({
|
||||
endpoints,
|
||||
chain: BSC,
|
||||
dailyDataField: `${DAILY_VOLUME_FACTORY}s`,
|
||||
}),
|
||||
const adapter: BreakdownVolumeAdapter = {
|
||||
breakdown: {
|
||||
v1: {
|
||||
[DISABLED_ADAPTER_KEY]: disabledAdapter
|
||||
},
|
||||
v2: {
|
||||
[BSC]: {
|
||||
fetch: graphs(BSC),
|
||||
start: getStartTimestamp({
|
||||
endpoints,
|
||||
chain: BSC,
|
||||
dailyDataField: `${DAILY_VOLUME_FACTORY}s`,
|
||||
}),
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -31,6 +31,8 @@ export type Adapter = {
|
||||
}
|
||||
};
|
||||
|
||||
export const DISABLED_ADAPTER_KEY = 'DISABLED_ADAPTER'
|
||||
|
||||
export type SimpleVolumeAdapter = {
|
||||
volume: Adapter
|
||||
};
|
||||
|
||||
4
volumes/helper/disabledAdapter.ts
Normal file
4
volumes/helper/disabledAdapter.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default {
|
||||
start: async () => 0,
|
||||
fetch: async () => ({ timestamp: 0 })
|
||||
}
|
||||
Reference in New Issue
Block a user