Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/real-insects-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Update default zk chains
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function SponsoredTxZksyncPreview() {
{smartAccount ? (
<div className="flex flex-col justify-center p-2">
<p className="mb-2 text-center font-semibold">
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "}
Kittens
</p>
<TransactionButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function SponsoredTxPreview() {
{smartAccount ? (
<div className="flex flex-col justify-center p-2">
<p className="mb-2 text-center font-semibold">
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "}
Kittens
</p>
<TransactionButton
Expand Down
7 changes: 6 additions & 1 deletion apps/portal/src/app/typescript/v5/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ export const sidebar: SideBar = {
},
...[
"smartWallet",
"predictAddress",
"createAndSignUserOp",
"createUnsignedUserOp",
"signUserOp",
"bundleUserOp",
"getUserOpReceipt",
"waitForUserOpReceipt",
"getUserOpGasFees",
"estimateUserOpGas",
].map((name) => ({
name,
href: `${slug}/${name}`,
Expand All @@ -155,7 +161,6 @@ export const sidebar: SideBar = {
"getAccountsOfSigner",
"getAllActiveSigners",
"getPermissionsForSigner",
"createUnsignedUserOp",
].map((name) => ({
name,
href: `${slug}/erc4337/${name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
maxFeePerGas = baseFee * 2n; // bumping the base fee per gas to ensure fast inclusion
maxPriorityFeePerGas = toBigInt(result.max_priority_fee_per_gas) || 1n;
gasPerPubdata = toBigInt(result.gas_per_pubdata_limit) * 2n; // doubling for fast inclusion;
if (gasPerPubdata < 50000n) {

Check warning on line 136 in packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L136 was not covered by tests
// enforce a minimum gas per pubdata limit
gasPerPubdata = 50000n;
}

Check warning on line 139 in packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L138 - L139 were not covered by tests
}

// serialize the transaction (with fees, gas, nonce)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export async function isZkSyncChain(chain: Chain) {
chain.id === 388 ||
chain.id === 4654 ||
chain.id === 333271 ||
chain.id === 37111
chain.id === 37111 ||
chain.id === 978658
) {
return true;
}
Expand Down
23 changes: 23 additions & 0 deletions packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,28 @@ describe.runIf(process.env.TW_SECRET_KEY).todo(
console.log(tx.transactionHash);
expect(tx.transactionHash.length).toBe(66);
});

it("should send a transaction on Treasure Topaz Testnet", async () => {
const sw = smartWallet({
chain: defineChain(978658),
sponsorGas: true,
});
const account = await sw.connect({
client: TEST_CLIENT,
personalAccount,
});
const tx = await sendTransaction({
transaction: prepareTransaction({
chain: defineChain(978658),
client: TEST_CLIENT,
to: account.address,
value: BigInt(0),
data: "0x",
}),
account: account,
});
console.log(tx.transactionHash);
expect(tx.transactionHash.length).toBe(66);
});
},
);