Skip to content

Commit cb6a053

Browse files
chore: update chains (#5059)
1 parent 772604e commit cb6a053

File tree

7 files changed

+42
-4
lines changed

7 files changed

+42
-4
lines changed

.changeset/real-insects-fix.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+
Update default zk chains

apps/playground-web/src/components/account-abstraction/sponsored-tx-zksync.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function SponsoredTxZksyncPreview() {
6767
{smartAccount ? (
6868
<div className="flex flex-col justify-center p-2">
6969
<p className="mb-2 text-center font-semibold">
70-
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}
70+
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "}
7171
Kittens
7272
</p>
7373
<TransactionButton

apps/playground-web/src/components/account-abstraction/sponsored-tx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function SponsoredTxPreview() {
6969
{smartAccount ? (
7070
<div className="flex flex-col justify-center p-2">
7171
<p className="mb-2 text-center font-semibold">
72-
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}
72+
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "}
7373
Kittens
7474
</p>
7575
<TransactionButton

apps/portal/src/app/typescript/v5/sidebar.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,15 @@ export const sidebar: SideBar = {
139139
},
140140
...[
141141
"smartWallet",
142+
"predictAddress",
143+
"createAndSignUserOp",
144+
"createUnsignedUserOp",
142145
"signUserOp",
143146
"bundleUserOp",
147+
"getUserOpReceipt",
144148
"waitForUserOpReceipt",
149+
"getUserOpGasFees",
150+
"estimateUserOpGas",
145151
].map((name) => ({
146152
name,
147153
href: `${slug}/${name}`,
@@ -155,7 +161,6 @@ export const sidebar: SideBar = {
155161
"getAccountsOfSigner",
156162
"getAllActiveSigners",
157163
"getPermissionsForSigner",
158-
"createUnsignedUserOp",
159164
].map((name) => ({
160165
name,
161166
href: `${slug}/erc4337/${name}`,

packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ export async function populateEip712Transaction(
133133
maxFeePerGas = baseFee * 2n; // bumping the base fee per gas to ensure fast inclusion
134134
maxPriorityFeePerGas = toBigInt(result.max_priority_fee_per_gas) || 1n;
135135
gasPerPubdata = toBigInt(result.gas_per_pubdata_limit) * 2n; // doubling for fast inclusion;
136+
if (gasPerPubdata < 50000n) {
137+
// enforce a minimum gas per pubdata limit
138+
gasPerPubdata = 50000n;
139+
}
136140
}
137141

138142
// serialize the transaction (with fees, gas, nonce)

packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export async function isZkSyncChain(chain: Chain) {
1616
chain.id === 388 ||
1717
chain.id === 4654 ||
1818
chain.id === 333271 ||
19-
chain.id === 37111
19+
chain.id === 37111 ||
20+
chain.id === 978658
2021
) {
2122
return true;
2223
}

packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,28 @@ describe.runIf(process.env.TW_SECRET_KEY).todo(
148148
console.log(tx.transactionHash);
149149
expect(tx.transactionHash.length).toBe(66);
150150
});
151+
152+
it("should send a transaction on Treasure Topaz Testnet", async () => {
153+
const sw = smartWallet({
154+
chain: defineChain(978658),
155+
sponsorGas: true,
156+
});
157+
const account = await sw.connect({
158+
client: TEST_CLIENT,
159+
personalAccount,
160+
});
161+
const tx = await sendTransaction({
162+
transaction: prepareTransaction({
163+
chain: defineChain(978658),
164+
client: TEST_CLIENT,
165+
to: account.address,
166+
value: BigInt(0),
167+
data: "0x",
168+
}),
169+
account: account,
170+
});
171+
console.log(tx.transactionHash);
172+
expect(tx.transactionHash.length).toBe(66);
173+
});
151174
},
152175
);

0 commit comments

Comments
 (0)