diff --git a/packages/keychain/src/components/Execute/index.tsx b/packages/keychain/src/components/Execute/index.tsx index c0695900c..01e2a4b4b 100644 --- a/packages/keychain/src/components/Execute/index.tsx +++ b/packages/keychain/src/components/Execute/index.tsx @@ -58,6 +58,9 @@ export function Execute({ const [ethApproved, setEthApproved] = useState(); const [lowEthInfo, setLowEthInfo] = useState(); const [bridging, setBridging] = useState(false); + // temporary boosting max fees + // @ts-expect-error there's no setter field for now + const [multiplier, setMultiplier] = useState(2n); const account = controller.account(chainId); const calls = useMemo(() => { @@ -100,8 +103,8 @@ export function Execute({ if (account.status === Status.DEPLOYED && transactionsDetail.maxFee) { setFees({ - base: BigInt(transactionsDetail.maxFee), - max: BigInt(transactionsDetail.maxFee), + base: BigInt(transactionsDetail.maxFee) * multiplier, + max: BigInt(transactionsDetail.maxFee) * multiplier, }); return; } @@ -123,7 +126,7 @@ export function Execute({ account .estimateInvokeFee(calls, transactionsDetail) .then((fees) => { - setFees({ base: fees.overall_fee, max: fees.suggestedMaxFee }); + setFees({ base: fees.overall_fee * multiplier, max: fees.suggestedMaxFee * multiplier }); }) .catch((e) => { console.error(e); @@ -138,6 +141,7 @@ export function Execute({ calls, chainId, transactionsDetail, + multiplier ]); useEffect(() => { diff --git a/packages/keychain/src/pages/index.tsx b/packages/keychain/src/pages/index.tsx index 9d9a485ab..6938e2d5b 100644 --- a/packages/keychain/src/pages/index.tsx +++ b/packages/keychain/src/pages/index.tsx @@ -164,10 +164,10 @@ const Index: NextPage = () => { : [transactions]; const policies = calls.map( (txn) => - ({ - target: addAddressPadding(txn.contractAddress), - method: txn.entrypoint, - } as Policy), + ({ + target: addAddressPadding(txn.contractAddress), + method: txn.entrypoint, + } as Policy), ); const session = controller.session(origin, cId); diff --git a/packages/keychain/src/utils/account.ts b/packages/keychain/src/utils/account.ts index f4e135328..b8bf72b85 100644 --- a/packages/keychain/src/utils/account.ts +++ b/packages/keychain/src/utils/account.ts @@ -15,6 +15,7 @@ import { waitForTransactionOptions, TransactionFinalityStatus, InvocationsDetails, + num, } from "starknet"; import { AccountContractDocument, @@ -176,8 +177,8 @@ class Account extends BaseAccount { transactionsDetail.nonce = transactionsDetail.nonce ?? (await this.getNonce("pending")); // FIXME: estimated max fee is always too low - //transactionsDetail.maxFee = num.toHex(transactionsDetail.maxFee); - transactionsDetail.maxFee = "0x38D7EA4C68000"; // 0.001 eth + transactionsDetail.maxFee = num.toHex(transactionsDetail.maxFee); + // transactionsDetail.maxFee = "0x38D7EA4C68000"; // 0.001 eth const res = await this.cartridge .execute(calls as Array, transactionsDetail, session)