Conversation
|
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:
|
6b7394f to
7f196c8
Compare
| @@ -674,7 +702,7 @@ async function signMessageImpl( | |||
|
|
|||
| result = assertNonNull(activity?.result?.signRawPayloadResult); | |||
| } else { | |||
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
tested and we chillin, isHttpClient() codepath works correctly still
59dce6b to
ea3413c
Compare
… clients, that way version bumps are cross compatible
ea3413c to
b146a06
Compare
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 changesetwill 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.