Skip to content

Commit

Permalink
removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee348 committed Nov 26, 2024
1 parent de95c45 commit 57b86fb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions examples/next/src/app/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ export const Connected = () => {
const checkTokenBalancesForFeeOptions = async () => {
if (pendingFeeOptionConfirmation) {
const [account] = await walletClient!.getAddresses()
// ATTENTION: switch to new api
const nativeTokenBalance = await indexerClient.getNativeTokenBalance({ accountAddress: account })

//ATTENTION: switch to new api
const tokenBalances = await indexerClient.getTokenBalancesSummary({
filter: {
accountAddresses: [account],
Expand Down
2 changes: 0 additions & 2 deletions examples/react/src/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ export const Connected = () => {
const checkTokenBalancesForFeeOptions = async () => {
if (pendingFeeOptionConfirmation && walletClient) {
const [account] = await walletClient.getAddresses()
// ATTENTION: switch to new api
const nativeTokenBalance = await indexerClient.getNativeTokenBalance({ accountAddress: account })

// ATTENTION: switch to new api
const tokenBalances = await indexerClient.getTokenBalancesSummary({
filter: {
accountAddresses: [account],
Expand Down
5 changes: 0 additions & 5 deletions packages/kit/src/hooks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const time = {
}

export const getNativeTokenBalance = async (indexerClient: SequenceIndexer, chainId: number, accountAddress: string) => {
// ATTENTION: switch to new api
const res = await indexerClient.getNativeTokenBalance({ accountAddress })

const tokenBalance: TokenBalance = {
Expand Down Expand Up @@ -82,7 +81,6 @@ export const getTokenBalancesByContract = async (indexerClient: SequenceIndexer,
}

export const getBalances = async (indexerClient: SequenceIndexer, chainId: number, args: GetTokenBalancesSummaryArgs) => {
// ATTENTION: switch to new api
if (!args.filter.accountAddresses[0]) {
return []
}
Expand Down Expand Up @@ -129,7 +127,6 @@ interface UseCoinBalanceArgs extends GetTokenBalancesSummaryArgs {
}

export const useCoinBalance = (args: UseCoinBalanceArgs) => {
// ATTENTION: switch to new api
const indexerClient = useIndexerClient(args.chainId)

return useQuery({
Expand All @@ -155,7 +152,6 @@ interface UseCollectibleBalanceArgs extends GetTokenBalancesDetailsArgs {
}

export const useCollectibleBalance = (args: UseCollectibleBalanceArgs) => {
// ATTENTION: switch to new api
const indexerClient = useIndexerClient(args.chainId)

return useQuery({
Expand Down Expand Up @@ -443,7 +439,6 @@ const getSwapPrices = async (
const currencyAddress = compareAddress(rawCurrencyAddress, NATIVE_TOKEN_ADDRESS_0X) ? zeroAddress : rawCurrencyAddress
const isNativeToken = compareAddress(currencyAddress, zeroAddress)

// ATTENTION: switch to new api
if (currencyAddress && !currencyBalanceInfoMap.has(currencyAddress)) {
currencyBalanceInfoMap.set(
currencyAddress,
Expand Down
2 changes: 0 additions & 2 deletions packages/wallet/src/hooks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export const getBalancesAssetsSummary = async (
return []
}

// ATTENTION: switch to new api
return getTokenBalancesDetails(indexerClient, {
filter: {
accountAddresses: [accountAddress],
Expand All @@ -113,7 +112,6 @@ export const getBalancesAssetsSummary = async (
await Promise.all([
...indexerClientsArr.map(([chainId, indexerClient]) => getNativeTokenBalance(indexerClient, chainId, accountAddress)),
...indexerClientsArr.map(([_chainId, indexerClient]) =>
// ATTENTION: switch to new api
getTokenBalancesSummary(indexerClient, {
filter: {
accountAddresses: [accountAddress],
Expand Down

0 comments on commit 57b86fb

Please sign in to comment.