Skip to content

Commit

Permalink
update contract
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jan 8, 2025
1 parent 4882b8b commit cf0f678
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions fees/dextools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For Tokens created with https://creator.dextools.io, enter "//TOKENCREATOR//" as

import { Adapter, FetchOptions } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { evmReceivedGasAndTokens, getSolanaReceived } from '../helpers/token';
import { addTokensReceived, evmReceivedGasAndTokens, getETHReceived, getSolanaReceived } from '../helpers/token';

const tokens = {
ethereum: [
Expand All @@ -47,13 +47,31 @@ const tokens = {
} as any

const target_even: any = {
[CHAIN.ETHEREUM]: '0x4f62c60468A8F4291fec23701A73a325b2540765',
[CHAIN.BSC]: '0x997Cc123cF292F46E55E6E63e806CD77714DB70f',
[CHAIN.BASE]: '0x997Cc123cF292F46E55E6E63e806CD77714DB70f',
[CHAIN.ETHEREUM]: [
'0x4f62c60468A8F4291fec23701A73a325b2540765',
'0x501424D3F63F30c119cBAE88de531c80D8a93f6B',
'0x96c195F6643A3D797cb90cb6BA0Ae2776D51b5F3',
'0xDeb2FD0a2870Df5eBDC1462E1725B0a30FbB49A3'
],
[CHAIN.BSC]: ['0x997Cc123cF292F46E55E6E63e806CD77714DB70f'],
[CHAIN.BASE]: ['0x997Cc123cF292F46E55E6E63e806CD77714DB70f'],
}

const sol = async (options: FetchOptions) => {
const dailyFees = await getSolanaReceived({ options, target: '4sdKYA9NLD1XHThXGPTmFE973mNs1UeVkCH4dFL3Wgho' })
const dailyFees = await getSolanaReceived({ options, targets:[
'4sdKYA9NLD1XHThXGPTmFE973mNs1UeVkCH4dFL3Wgho',
'e24SXSTq1AkusXQEKgZW389taxTTzSuGF8JQqjhbTfc',
'Hz77efVEvgUHUN55WAY97BiEEFg3DbgYBiCNo4UrQx9r'
]})
return { dailyFees, dailyRevenue: dailyFees, }
}

const fetchEvm = async (options: FetchOptions) => {
const dailyFees = options.createBalances();
if (tokens[options.chain].length > 0) {
await addTokensReceived({ options, tokens: tokens, targets: target_even[options.chain], balances: dailyFees })
}
await getETHReceived({ options, balances: dailyFees, targets: target_even[options.chain] })
return { dailyFees, dailyRevenue: dailyFees, }
}

Expand All @@ -63,8 +81,8 @@ const adapter: Adapter = {
adapter: [CHAIN.ETHEREUM, CHAIN.BASE, CHAIN.BSC].reduce((all, chain) => ({
...all,
[chain]: {
fetch: evmReceivedGasAndTokens(target_even[chain], tokens[chain]),
}
fetch: fetchEvm,
}
}), {
[CHAIN.SOLANA]: {
fetch: sol,
Expand Down

0 comments on commit cf0f678

Please sign in to comment.