Skip to content

Commit 28df6f7

Browse files
[SDK] fix: Force pre-EIP1559 transactions on Homeverse chains (#6332)
1 parent 150a90c commit 28df6f7

File tree

8 files changed

+23
-6
lines changed

8 files changed

+23
-6
lines changed

.changeset/violet-planets-remember.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Force pre-eip1559 tx on Homeverse mainnet/testnet

apps/dashboard/src/components/buttons/MismatchButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const GAS_FREE_CHAINS = [
6161
300, // zksync sepolia
6262
7225878, // Saakuru Mainnet
6363
247253, // Saakuru Testnet
64+
19011, // Homeverse Mainnet
65+
40875, // Homeverse Testnet
6466
];
6567

6668
function useIsNetworkMismatch(txChainId: number) {

apps/login/src/api/login/config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ import "server-only";
22
import type { InAppWalletAuth } from "thirdweb/wallets";
33
import type { Permission } from "../../components/permission-card";
44

5-
export async function getLoginConfig(clientId: string) {
5+
export async function getLoginConfig(clientId: string): Promise<LoginConfig> {
66
if (clientId === "demo") {
77
return DEMO_ENVIRONMENT;
88
}
9+
// temporary manual config
10+
if (clientId === "b24106adfb2ec212e6ec4d3b2e04db9e") {
11+
return {
12+
...DEFAULT_CONFIG,
13+
sessionKeySignerAddress: "0xb89e32a18350d6df5bf0b89a227E098013C4Fa72",
14+
};
15+
}
916
// TODO: implement fetch for config from API server
1017
return DEFAULT_CONFIG;
1118
}

packages/thirdweb/src/auth/verify-hash.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ export async function verifyEip1271Signature({
196196
contract,
197197
});
198198
return result === EIP_1271_MAGIC_VALUE;
199-
} catch {
199+
} catch (err) {
200+
console.error("Error verifying EIP-1271 signature", err);
200201
return false;
201202
}
202203
}

packages/thirdweb/src/gas/fee-data.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const FORCE_GAS_PRICE_CHAIN_IDS = [
4040
1942999413, // Humanity Testnet
4141
1952959480, // Lumia Testnet
4242
994873017, // Lumia Mainnet
43+
19011, // Homeverse Mainnet
44+
40875, // Homeverse Testnet
4345
];
4446

4547
/**
@@ -89,7 +91,7 @@ export async function getGasOverridesForTransaction(
8991
}
9092

9193
// return as is
92-
if (defaultGasOverrides.gasPrice) {
94+
if (defaultGasOverrides.gasPrice !== undefined) {
9395
return defaultGasOverrides;
9496
}
9597

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { currencies, getCurrencyMeta, usdCurrency } from "./currencies.js";
88

99
describe("Currency Utilities", () => {
1010
it("should have correct number of currencies", () => {
11-
expect(currencies.length).toBe(5);
11+
expect(currencies.length).toBe(7);
1212
});
1313

1414
it("should have USD as the first currency", () => {

packages/thirdweb/src/transaction/actions/estimate-gas-cost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function estimateGasCost(
3838
transaction.chain,
3939
);
4040
const gasPrice = fees.maxFeePerGas || fees.gasPrice;
41-
if (!gasPrice) {
41+
if (gasPrice === undefined) {
4242
throw new Error(
4343
`Unable to determine gas price for chain ${transaction.chain.id}`,
4444
);

packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe.runIf(process.env.TW_SECRET_KEY)(
109109
smartAccount,
110110
accountContract,
111111
});
112-
await new Promise((resolve) => setTimeout(resolve, 1000)); // pause for a second to prevent race condition
112+
await new Promise((resolve) => setTimeout(resolve, 3000)); // pause for a second to prevent race condition
113113

114114
const signature = await smartAccount.signMessage({
115115
message: "hello world",

0 commit comments

Comments
 (0)