diff --git a/lib/contracts.ts b/lib/contracts.ts index 77aa386..ab656a3 100644 --- a/lib/contracts.ts +++ b/lib/contracts.ts @@ -76,11 +76,8 @@ export async function declareContract(contractName: string, wait = true, folder return cachedClass; } const payload = getDeclareContractPayload(contractName, folder); - const skipSimulation = provider.isDevnet; - // max fee avoids slow estimate - const maxFee = skipSimulation ? 1e18 : undefined; - const { class_hash, transaction_hash } = await deployer.declareIfNot(payload, { maxFee }); + const { class_hash, transaction_hash } = await deployer.declareIfNot(payload, { maxFee: undefined }); if (wait && transaction_hash) { await provider.waitForTransaction(transaction_hash); diff --git a/lib/provider.ts b/lib/provider.ts index bc2a82a..37d869d 100644 --- a/lib/provider.ts +++ b/lib/provider.ts @@ -3,19 +3,12 @@ import { RpcProvider } from "starknet"; dotenv.config({ override: true }); -const devnetBaseUrl = "http://127.0.0.1:5050"; - -// Polls quickly for a local network +// Polls quickly export class FastRpcProvider extends RpcProvider { - get isDevnet() { - return this.channel.nodeUrl.startsWith(devnetBaseUrl); - } - waitForTransaction(txHash: string, options = {}) { - const retryInterval = this.isDevnet ? 250 : 1000; - return super.waitForTransaction(txHash, { retryInterval, ...options }); + return super.waitForTransaction(txHash, { retryInterval: 1000, ...options }); } } -export const provider = new FastRpcProvider({ nodeUrl: process.env.RPC_URL || `${devnetBaseUrl}` }); +export const provider = new FastRpcProvider({ nodeUrl: process.env.RPC_URL }); console.log("Provider:", provider.channel.nodeUrl);