thirdweb@5.26.0
Minor Changes
-
#3161
b569eb4
Thanks @gregfromstl! - Adds waitForBundle function to await a sendCalls bundle's complete confirmation.Usage
import { waitForBundle } from "thirdweb/wallets/eip5792"; const result = await waitForBundle({ client, chain, wallet, bundleId: "0x123...", });
-
#3161
b569eb4
Thanks @gregfromstl! - Adds EIP-5792 react hooksuseSendCalls
useSendCalls
will automatically revalidate all reads from contracts that are interacted with.import { useSendCalls } from "thirdweb/react"; const sendTx1 = approve({ contract: USDT_CONTRACT, amount: 100, spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6", }); const sendTx2 = approve({ contract: USDT_CONTRACT, amount: 100, spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709", }); const { mutate: sendCalls, data: bundleId } = useSendCalls({ client }); await sendCalls({ wallet, client, calls: [sendTx1, sendTx2], });
Await the bundle's full confirmation:
const { mutate: sendCalls, data: bundleId } = useSendCalls({ client, waitForResult: true, }); await sendCalls({ wallet, client, calls: [sendTx1, sendTx2], });
Sponsor transactions with a paymaster:
const { mutate: sendCalls, data: bundleId } = useSendCalls(); await sendCalls({ client, calls: [sendTx1, sendTx2], capabilities: { paymasterService: { url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`, }, }, });
useCapabilities
import { useCapabilities } from "thirdweb/react"; const { data: capabilities, isLoading } = useCapabilities();
useCallsStatus
import { useCallsStatus } from "thirdweb/react"; const { data: status, isLoading } = useCallsStatus({ bundleId, client });
Patch Changes
-
#3178
3dca028
Thanks @joaquim-verges! - Fix gas estimation in transaction button -
#3187
874747b
Thanks @joaquim-verges! - Upgrade to latest coinbase wallet sdk -
#3186
123275b
Thanks @gregfromstl! - Catch any errors thrown while polling block numbers