Merge pull request 'Fix #22: Remove 'any' usage and replace shims with proper typed handlers' (#28) from fix-issue-22-remove-any-types into master
Reviewed-on: https://codeberg.org/johba/harb/pulls/28
This commit is contained in:
commit
0eaf91be13
5 changed files with 12 additions and 11 deletions
3
services/ponder/.gitignore
vendored
3
services/ponder/.gitignore
vendored
|
|
@ -4,4 +4,5 @@ node_modules
|
|||
*.log
|
||||
dist
|
||||
build
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
pnpm-lock.yaml
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -10,7 +10,7 @@ import {
|
|||
|
||||
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" as const;
|
||||
|
||||
ponder.on("Kraiken:Transfer", async ({ event, context }: any) => {
|
||||
ponder.on("Kraiken:Transfer", async ({ event, context }) => {
|
||||
const { from, to, value } = event.args;
|
||||
|
||||
await ensureStatsExists(context, event.block.timestamp);
|
||||
|
|
@ -44,7 +44,7 @@ ponder.on("Kraiken:Transfer", async ({ event, context }: any) => {
|
|||
await updateHourlyData(context, event.block.timestamp);
|
||||
});
|
||||
|
||||
ponder.on("StatsBlock:block", async ({ event, context }: any) => {
|
||||
ponder.on("StatsBlock:block", async ({ event, context }) => {
|
||||
await ensureStatsExists(context, event.block.timestamp);
|
||||
await updateHourlyData(context, event.block.timestamp);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
|
||||
const ZERO = 0n;
|
||||
|
||||
async function getKraikenTotalSupply(context: any) {
|
||||
async function getKraikenTotalSupply(context: Context) {
|
||||
return context.client.readContract({
|
||||
abi: context.contracts.Kraiken.abi,
|
||||
address: context.contracts.Kraiken.address,
|
||||
|
|
@ -25,7 +25,7 @@ function toShareRatio(share: bigint, stakeTotalSupply: bigint): number {
|
|||
return Number(share) / Number(stakeTotalSupply);
|
||||
}
|
||||
|
||||
ponder.on("Stake:PositionCreated", async ({ event, context }: any) => {
|
||||
ponder.on("Stake:PositionCreated", async ({ event, context }) => {
|
||||
await ensureStatsExists(context, event.block.timestamp);
|
||||
|
||||
const stakeTotalSupply = await getStakeTotalSupply(context);
|
||||
|
|
@ -53,7 +53,7 @@ ponder.on("Stake:PositionCreated", async ({ event, context }: any) => {
|
|||
await refreshOutstandingStake(context);
|
||||
});
|
||||
|
||||
ponder.on("Stake:PositionRemoved", async ({ event, context }: any) => {
|
||||
ponder.on("Stake:PositionRemoved", async ({ event, context }) => {
|
||||
await ensureStatsExists(context, event.block.timestamp);
|
||||
|
||||
const positionId = event.args.positionId.toString();
|
||||
|
|
@ -75,7 +75,7 @@ ponder.on("Stake:PositionRemoved", async ({ event, context }: any) => {
|
|||
await updateHourlyData(context, event.block.timestamp);
|
||||
});
|
||||
|
||||
ponder.on("Stake:PositionShrunk", async ({ event, context }: any) => {
|
||||
ponder.on("Stake:PositionShrunk", async ({ event, context }) => {
|
||||
await ensureStatsExists(context, event.block.timestamp);
|
||||
|
||||
const positionId = event.args.positionId.toString();
|
||||
|
|
@ -97,7 +97,7 @@ ponder.on("Stake:PositionShrunk", async ({ event, context }: any) => {
|
|||
await updateHourlyData(context, event.block.timestamp);
|
||||
});
|
||||
|
||||
ponder.on("Stake:PositionTaxPaid", async ({ event, context }: any) => {
|
||||
ponder.on("Stake:PositionTaxPaid", async ({ event, context }) => {
|
||||
await ensureStatsExists(context, event.block.timestamp);
|
||||
await updateHourlyData(context, event.block.timestamp);
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ ponder.on("Stake:PositionTaxPaid", async ({ event, context }: any) => {
|
|||
await updateHourlyData(context, event.block.timestamp);
|
||||
});
|
||||
|
||||
ponder.on("Stake:PositionRateHiked", async ({ event, context }: any) => {
|
||||
ponder.on("Stake:PositionRateHiked", async ({ event, context }) => {
|
||||
const positionId = event.args.positionId.toString();
|
||||
await context.db.update(positions, { id: positionId }).set({
|
||||
taxRate: TAX_RATES[Number(event.args.newTaxRate)] || 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue