Skip to content

Commit 59ec63b

Browse files
feat: add new zksync chain ID
1 parent cb64067 commit 59ec63b

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-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: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,26 @@ export const sidebar: SideBar = {
155155
"getAccountsOfSigner",
156156
"getAllActiveSigners",
157157
"getPermissionsForSigner",
158-
"createUnsignedUserOp",
159158
].map((name) => ({
160159
name,
161160
href: `${slug}/erc4337/${name}`,
162161
icon: <CodeIcon />,
163162
})),
163+
...[
164+
"predictAddress",
165+
"getUserOpReceipt",
166+
"waitForUserOpReceipt",
167+
"getUserOpGasFees",
168+
"estimateUserOpGas",
169+
"createAndSignUserOp",
170+
"createUnsignedUserOp",
171+
"signUserOp",
172+
"bundleUserOp",
173+
].map((name) => ({
174+
name,
175+
href: `${slug}/${name}`,
176+
icon: <CodeIcon />,
177+
})),
164178
],
165179
},
166180
{

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
}

0 commit comments

Comments
 (0)