Skip to content

Commit

Permalink
fix getProider call
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-nax committed Aug 28, 2024
1 parent be7e2d3 commit bd7f9fe
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion spaceward/src/components/SendEth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ArrowUpRight } from "lucide-react";
import { useEthereumTx } from "@/hooks/useEthereumTx";
import { getProvider } from "@/lib/eth";

const provider = getProvider("sepolia");
const { provider } = getProvider("sepolia");

async function buildEthTransaction(
chainId: string | number,
Expand Down
2 changes: 0 additions & 2 deletions spaceward/src/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ export const ENABLED_ETH_CHAINS = _ENABLED_ETH_CHAINS.filter(({ testnet }) =>
: Boolean(testnet),
);

console.log("ENABLED_ETH_CHAINS", ENABLED_ETH_CHAINS);

const _COSMOS_CHAINS: {
chainName: string;
feeAmount?: string;
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/actions/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function ActionItem({ single, ...item }: ItemProps) {
}).then(() => true);
}
} else {
const provider = getProvider(chainName).provider;
const { provider } = getProvider(chainName);

promise = provider
.broadcastTransaction(signedTx.serialized)
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/assets/Assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { PageRequest } from "@wardenprotocol/wardenjs/codegen/cosmos/base/query/
import { AddressType } from "@wardenprotocol/wardenjs/codegen/warden/warden/v1beta3/key";
import { getProvider } from "@/lib/eth";

const provider = getProvider("sepolia");
const { provider } = getProvider("sepolia");

const USDollar = new Intl.NumberFormat("en-US", {
style: "currency",
Expand Down
6 changes: 3 additions & 3 deletions spaceward/src/features/assets/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const eip155NativeBalanceQuery = ({
? new ethers.Contract(
priceFeed,
aggregatorV3InterfaceABI,
getProvider(chainName),
provider,
)
: undefined;

Expand Down Expand Up @@ -345,7 +345,7 @@ const eip155ERC20BalanceQuery = ({
? new ethers.Contract(
priceFeed,
aggregatorV3InterfaceABI,
getProvider(chainName),
provider,
)
: undefined;

Expand Down Expand Up @@ -574,7 +574,7 @@ const fiatPriceQuery = (enabled: boolean, name: string) => {
throw new Error("Invalid fiat currency");
}

const provider = getProvider("mainnet");
const { provider } = getProvider("mainnet");

const priceFeedContract = new ethers.Contract(
FIAT_PRICE_FEEDS[name],
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/home/HomeAssets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AddressType } from "@wardenprotocol/wardenjs/codegen/warden/warden/v1be
import { PageRequest } from "@wardenprotocol/wardenjs/codegen/cosmos/base/query/v1beta1/pagination";
import { getProvider } from "@/lib/eth";

const provider = getProvider("sepolia");
const { provider } = getProvider("sepolia");

async function getEthBalance(address: string) {
const balance = await provider.getBalance(address);
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/home/TotalAssetValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AddressType } from "@wardenprotocol/wardenjs/codegen/warden/warden/v1be
import { getProvider } from "@/lib/eth";

const chainId = 11155111;
const provider = getProvider("sepolia");
const { provider } = getProvider("sepolia");

async function getEthBalance(address: string) {
const balance = await provider.getBalance(address);
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/intents/util/query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KNOWN_ADDRESSES, compareAddress, getProvider } from "@/lib/eth";

const provider = getProvider("mainnet");
const { provider } = getProvider("mainnet");

const resolveEns = async (address: `0x${string}`) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/modals/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function buildTransaction({
}

const amount = parseUnits(_amount, item.decimals);
const provider = getProvider(item.chainName);
const { provider } = getProvider(item.chainName);
const nonce = await provider.getTransactionCount(from);
const feeData = await provider.getFeeData();
const gasLimit = BigInt(21000);
Expand Down
5 changes: 4 additions & 1 deletion spaceward/src/pages/Intents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ export const useRules = () => {

const rules = useRules({
request: {
pagination: PageRequest.fromPartial({ limit: BigInt(100) }),
pagination: PageRequest.fromPartial({ limit: BigInt(100000) }),
},
});
console.log(rules.data)



/** @deprecated would be nice to query intent by creator or space */
const rulesBySpace = useMemo(
Expand Down

0 comments on commit bd7f9fe

Please sign in to comment.