Skip to content

Commit

Permalink
fix: partially exclude fot from fee
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Jul 18, 2024
1 parent 44a4c39 commit e9aa20f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/graphql/graphql-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ query Token($chain: Chain!, $address: String!) {
feeData {
buyFeeBps
sellFeeBps
feeTakenOnTransfer
externalTransferFailed
sellReverted
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions lib/graphql/graphql-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ export interface TokenInfo {
feeData?: {
buyFeeBps?: string
sellFeeBps?: string
feeTakenOnTransfer?: boolean
externalTransferFailed?: boolean
sellReverted?: boolean
}
}
7 changes: 5 additions & 2 deletions lib/graphql/graphql-token-fee-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ export class GraphQLTokenFeeFetcher implements ITokenFeeFetcher {
if (token.feeData?.buyFeeBps || token.feeData?.sellFeeBps) {
const buyFeeBps = token.feeData.buyFeeBps ? BigNumber.from(token.feeData.buyFeeBps) : undefined
const sellFeeBps = token.feeData.sellFeeBps ? BigNumber.from(token.feeData.sellFeeBps) : undefined
tokenFeeMap[token.address] = { buyFeeBps, sellFeeBps }
const feeTakenOnTransfer = token.feeData.feeTakenOnTransfer
const externalTransferFailed = token.feeData.externalTransferFailed
const sellReverted = token.feeData.sellReverted
tokenFeeMap[token.address] = { buyFeeBps, sellFeeBps, feeTakenOnTransfer, externalTransferFailed, sellReverted }

Check failure on line 52 in lib/graphql/graphql-token-fee-fetcher.ts

View workflow job for this annotation

GitHub Actions / Run tests

Type '{ buyFeeBps: BigNumber | undefined; sellFeeBps: BigNumber | undefined; feeTakenOnTransfer: boolean | undefined; externalTransferFailed: boolean | undefined; sellReverted: boolean | undefined; }' is not assignable to type 'TokenFeeResult'.
} else {
tokenFeeMap[token.address] = { buyFeeBps: undefined, sellFeeBps: undefined }
tokenFeeMap[token.address] = { buyFeeBps: undefined, sellFeeBps: undefined, feeTakenOnTransfer: false, externalTransferFailed: false, sellReverted: false }

Check failure on line 54 in lib/graphql/graphql-token-fee-fetcher.ts

View workflow job for this annotation

GitHub Actions / Run tests

Type '{ buyFeeBps: undefined; sellFeeBps: undefined; feeTakenOnTransfer: boolean; externalTransferFailed: boolean; sellReverted: boolean; }' is not assignable to type 'TokenFeeResult'.
}
})
metric.putMetric('GraphQLTokenFeeFetcherFetchFeesSuccess', 1, MetricLoggerUnit.Count)
Expand Down

0 comments on commit e9aa20f

Please sign in to comment.