Skip to content

Commit

Permalink
Add sonic
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Dec 20, 2024
1 parent 054be7d commit 102c00c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
# beefy-balances-api

```

Access api for the CLM subgraph: https://github.com/beefyfinance/beefy-balances-subgraph

## add a new chain

- Add the chain to `src/config/chains.ts`
- `npm run update:addressbook`
- `npm run test:ts` and fix errs
- `npm run format`
- `npm run dev`
- http://localhost:4000/api/v1/status
- http://localhost:4000/api/v1/holders/counts/all
- http://localhost:4000/api/v1/config/:chain/vaults
- http://localhost:4000/api/v1/contract/:chain/:vault_address/:block_number/share-tokens-balances


## Deploy the api

- `npm run deploy` to deploy the api


# Test urls
```
https://balance-api.beefy.finance/api/v1/status
http://localhost:4000/api/v1/status
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"package:fix": "ncu -u && npm install",
"postinstall": "npm --silent run codegen",
"codegen": "graphql-codegen --config ./src/queries/codegen/codegen.ts",
"update:addressbook": "ncu --upgrade blockchain-addressbook viem && i install",
"lint-staged": "lint-staged"
},
"dependencies": {
Expand All @@ -38,7 +39,7 @@
"@sinclair/typebox": "^0.32.33",
"@types/lodash-es": "^4.17.12",
"async-lock": "^1.4.1",
"blockchain-addressbook": "^0.47.98",
"blockchain-addressbook": "^0.47.107",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.5",
"fastify": "^4.26.2",
Expand All @@ -48,7 +49,7 @@
"lodash": "^4.17.21",
"node-cache": "^5.1.2",
"pino": "^8.19.0",
"viem": "^2.21.54"
"viem": "^2.21.56"
},
"lint-staged": {
"src/**/*.{ts,graphql,json}": "biome check --write"
Expand Down
3 changes: 2 additions & 1 deletion src/config/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export enum ChainId {
optimism = 'optimism',
polygon = 'polygon',
rootstock = 'rootstock',
sei = 'sei',
scroll = 'scroll',
sei = 'sei',
sonic = 'sonic',
zksync = 'zksync',
}

Expand Down
3 changes: 2 additions & 1 deletion src/utils/viemClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
fantom,
fraxtal,
gnosis,
//kava,
linea,
lisk,
mainnet,
Expand All @@ -21,6 +20,7 @@ import {
rootstock,
scroll,
sei,
sonic,
zksync,
} from 'viem/chains';
import type { ChainId } from '../config/chains';
Expand All @@ -47,6 +47,7 @@ const mapping: Record<ChainId, ViemChain> = {
rootstock: rootstock,
scroll: scroll,
sei: sei,
sonic: sonic,
zksync: zksync,
};

Expand Down

0 comments on commit 102c00c

Please sign in to comment.