Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions components/contract/SendTokens.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { useToasts } from '@geist-ui/core';
import {
useCapabilities,
useChainId,
useSendCalls,
usePublicClient,
useWalletClient,
} from 'wagmi';
import { useSendCalls, usePublicClient, useWalletClient } from 'wagmi';

import { isAddress } from 'essential-eth';
import { useAtom } from 'jotai';
Expand Down Expand Up @@ -54,9 +48,7 @@ export const SendTokens = () => {
const [checkedRecords, setCheckedRecords] = useAtom(checkedTokensAtom);
const { data: walletClient } = useWalletClient();
const publicClient = usePublicClient();
const chainId = useChainId();
const { sendCallsAsync } = useSendCalls();
const { data: capabilities } = useCapabilities();

// Resolve the destination, following an ENS name to its address if needed.
// Returns the final 0x address, or null when it could not be resolved.
Expand Down Expand Up @@ -113,14 +105,6 @@ export const SendTokens = () => {
}),
}));

// DIAGNOSTIC: what does the wallet say it can do for this chain?
console.log('[drain] chainId', chainId);
console.log('[drain] wallet capabilities', capabilities);
console.log(
'[drain] atomic capability for chain',
(capabilities as any)?.[chainId]?.atomic,
);

const { id } = await sendCallsAsync({ calls, forceAtomic: true });
tokensToSend.forEach((tokenAddress) => markPending(tokenAddress, id));
showToast(
Expand Down Expand Up @@ -207,8 +191,6 @@ export const SendTokens = () => {
// cannot guarantee atomicity reject, so we cleanly fall back below.
await sendBatchedTokens(tokensToSend, toAddress);
} catch (err) {
// DIAGNOSTIC: surface exactly why the batch failed before we fall back.
console.error('[drain] batch sendCalls failed', err);
const e = err as {
name?: string;
shortMessage?: string;
Expand Down
2 changes: 0 additions & 2 deletions config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import './.next/dev/types/routes.d.ts';
import './.next/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
44 changes: 0 additions & 44 deletions package-lock.json

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

Loading