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/shiny-pants-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Always checksum Account.address
3 changes: 2 additions & 1 deletion packages/thirdweb/src/adapters/ethers5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
TransactionTypeMap,
} from "../transaction/prepare-transaction.js";
import type { SerializableTransaction } from "../transaction/serialize-transaction.js";
import { getAddress } from "../utils/address.js";
import { toHex } from "../utils/encoding/hex.js";
import type { Account } from "../wallets/interfaces/wallet.js";

Expand Down Expand Up @@ -364,7 +365,7 @@ export async function fromEthersSigner(
): Promise<Account> {
const address = await signer.getAddress();
const account: Account = {
address,
address: getAddress(address),
signMessage: async ({ message }) => {
return signer.signMessage(
typeof message === "string" ? message : message.raw,
Expand Down
3 changes: 2 additions & 1 deletion packages/thirdweb/src/adapters/ethers6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { type ThirdwebContract, getContract } from "../contract/contract.js";
import { toSerializableTransaction } from "../transaction/actions/to-serializable-transaction.js";
import type { PreparedTransaction } from "../transaction/prepare-transaction.js";
import type { SerializableTransaction } from "../transaction/serialize-transaction.js";
import { getAddress } from "../utils/address.js";
import { toHex } from "../utils/encoding/hex.js";
import { resolvePromisedValue } from "../utils/promise/resolve-promised-value.js";
import type { Account } from "../wallets/interfaces/wallet.js";
Expand Down Expand Up @@ -327,7 +328,7 @@ export async function fromEthersSigner(
): Promise<Account> {
const address = await signer.getAddress();
const account: Account = {
address,
address: getAddress(address),
signMessage: async ({ message }) => {
return signer.signMessage(
typeof message === "string" ? message : message.raw,
Expand Down
2 changes: 1 addition & 1 deletion packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function createAccount({
client: ThirdwebClient;
}) {
const account: Account = {
address,
address: getAddress(address),
async sendTransaction(tx: SendTransactionOption) {
const transactionHash = (await provider.request({
method: "eth_sendTransaction",
Expand Down
3 changes: 2 additions & 1 deletion packages/thirdweb/src/wallets/private-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getRpcClient } from "../rpc/rpc.js";
import type { AuthorizationRequest } from "../transaction/actions/eip7702/authorization.js";
import { signTransaction } from "../transaction/actions/sign-transaction.js";
import type { SerializableTransaction } from "../transaction/serialize-transaction.js";
import { getAddress } from "../utils/address.js";
import { type Hex, toHex } from "../utils/encoding/hex.js";
import { signMessage } from "../utils/signatures/sign-message.js";
import { signTypedData } from "../utils/signatures/sign-typed-data.js";
Expand Down Expand Up @@ -79,7 +80,7 @@ export function privateKeyToAccount(
const address = publicKeyToAddress(publicKey);

const account = {
address,
address: getAddress(address),
sendTransaction: async (
tx: SerializableTransaction & { chainId: number },
) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/thirdweb/src/wallets/smart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ function createZkSyncAccount(args: {
}): Account {
const { creationOptions, connectionOptions, chain } = args;
const account: Account = {
address: connectionOptions.personalAccount.address,
address: getAddress(connectionOptions.personalAccount.address),
async sendTransaction(transaction: SendTransactionOption) {
// override passed tx, we have to refetch gas and fees always
const prepTx = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function createAccount({
client: ThirdwebClient;
}) {
const account: Account = {
address: address,
address: getAddress(address),
async sendTransaction(tx: SendTransactionOption) {
const transactionHash = (await provider.request({
method: "eth_sendTransaction",
Expand Down
Loading