Skip to content

added generic client type that only requires specifc methods from our clients, that way version bumps are cross compatible#1203

Open
ethankonk wants to merge 3 commits intomainfrom
ethan/viem-client-version-fix
Open

added generic client type that only requires specifc methods from our clients, that way version bumps are cross compatible#1203
ethankonk wants to merge 3 commits intomainfrom
ethan/viem-client-version-fix

Conversation

@ethankonk
Copy link
Contributor

Summary & Motivation

How I Tested These Changes

Did you add a changeset?

If updating one of our packages, you'll likely need to add a changeset to your PR. To do so, run pnpm changeset. pnpm changeset will generate a file where you should write a human friendly message about the changes. Note how this (example) includes the package name (should be auto added by the command) along with the type of semver change (major.minor.patch) (which you should set).

These changes will be used at release time to determine what packages to publish and how to bump their version. For more context see this comment.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 13, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b146a06:

Sandbox Source
@turnkey/example-react-components Configuration

@ethankonk ethankonk force-pushed the ethan/viem-client-version-fix branch 2 times, most recently from 6b7394f to 7f196c8 Compare February 14, 2026 05:03
@ethankonk ethankonk requested a review from moeodeh3 February 20, 2026 15:08
@@ -674,7 +702,7 @@ async function signMessageImpl(

result = assertNonNull(activity?.result?.signRawPayloadResult);
} else {
Copy link
Contributor

@moeodeh3 moeodeh3 Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m wondering why we’re still conditionally rendering based on isHttpClient(). Will that even work? I don’t think so 🤔

with your changes, isHttpClient() will now always return false, which means we’ll always hit the same code path. That makes this conditional statment dead

but the bigger issue is how we’re constructing and sending the request. The reason we differentiate httpClient from other clients isn’t because the response shape is different, it’s because the intent format is different

for httpClient, the intent is structured like this:

{
  type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2",
  organizationId,
  parameters: {
    signWith,
    type: transactionType ?? "TRANSACTION_TYPE_ETHEREUM",
    unsignedTransaction,
  },
  timestampMs: String(Date.now()),
}

whereas for other clients, the intent is structured like this:

{
  organizationId,
  signWith,
  type: transactionType ?? "TRANSACTION_TYPE_ETHEREUM",
  unsignedTransaction,
}

so we would POST the request to the Turnkey without the required type: "ACTIVITY_TYPE_...", ``timestampMs, and paramaters` wrapper

which would fail :(

result = assertNonNull(activity?.result?.signRawPayloadResult);
} else {
const { activity, r, s, v } = await client.signRawPayload({
const { activity } = await client.signRawPayload({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing goes here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and we chillin, isHttpClient() codepath works correctly still

@ethankonk ethankonk force-pushed the ethan/viem-client-version-fix branch from 59dce6b to ea3413c Compare February 20, 2026 19:22
@ethankonk ethankonk force-pushed the ethan/viem-client-version-fix branch from ea3413c to b146a06 Compare February 20, 2026 19:22
@ethankonk ethankonk added release and removed release labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants