From 953ca5ab00b4b94ccaa27236626ff50a15394141 Mon Sep 17 00:00:00 2001 From: Tim Hawbaker Date: Fri, 20 Oct 2023 09:52:36 -0700 Subject: [PATCH] updates --- packages/cosmjs/src/index.ts | 4 ++-- packages/ethers/src/index.ts | 8 ++++---- packages/viem/src/index.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/cosmjs/src/index.ts b/packages/cosmjs/src/index.ts index af2428d27..c6ea6896e 100644 --- a/packages/cosmjs/src/index.ts +++ b/packages/cosmjs/src/index.ts @@ -141,11 +141,11 @@ export class TurnkeyDirectWallet implements OfflineDirectSigner { ): Promise { const { activity } = await TurnkeyApi.signRawPayload({ body: { - type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD", + type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", organizationId: this.organizationId, timestampMs: String(Date.now()), parameters: { - privateKeyId: this.privateKeyId, + signWith: this.privateKeyId, payload: toHex(message), encoding: "PAYLOAD_ENCODING_HEXADECIMAL", hashFunction: "HASH_FUNCTION_SHA256", diff --git a/packages/ethers/src/index.ts b/packages/ethers/src/index.ts index 17962ca1c..6b4f0f32e 100644 --- a/packages/ethers/src/index.ts +++ b/packages/ethers/src/index.ts @@ -72,10 +72,10 @@ export class TurnkeySigner extends ethers.Signer implements TypedDataSigner { private async _signTransactionImpl(message: string): Promise { const { activity } = await this.client.signTransaction({ - type: "ACTIVITY_TYPE_SIGN_TRANSACTION", + type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", organizationId: this.organizationId, parameters: { - privateKeyId: this.privateKeyId, + signWith: this.privateKeyId, type: "TRANSACTION_TYPE_ETHEREUM", unsignedTransaction: message, }, @@ -181,10 +181,10 @@ export class TurnkeySigner extends ethers.Signer implements TypedDataSigner { async _signMessageImpl(message: string): Promise { const { activity } = await this.client.signRawPayload({ - type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD", + type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", organizationId: this.organizationId, parameters: { - privateKeyId: this.privateKeyId, + signWith: this.privateKeyId, payload: message, encoding: "PAYLOAD_ENCODING_HEXADECIMAL", hashFunction: "HASH_FUNCTION_NO_OP", diff --git a/packages/viem/src/index.ts b/packages/viem/src/index.ts index d1c060c1d..1d70e0b14 100644 --- a/packages/viem/src/index.ts +++ b/packages/viem/src/index.ts @@ -268,10 +268,10 @@ async function signTransactionImpl( privateKeyId: string ): Promise { const { activity } = await client.signTransaction({ - type: "ACTIVITY_TYPE_SIGN_TRANSACTION", + type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", organizationId: organizationId, parameters: { - privateKeyId: privateKeyId, + signWith: privateKeyId, type: "TRANSACTION_TYPE_ETHEREUM", unsignedTransaction: unsignedTransaction, }, @@ -329,10 +329,10 @@ async function signMessageImpl( privateKeyId: string ): Promise { const { activity } = await client.signRawPayload({ - type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD", + type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", organizationId: organizationId, parameters: { - privateKeyId: privateKeyId, + signWith: privateKeyId, payload: message, encoding: "PAYLOAD_ENCODING_HEXADECIMAL", hashFunction: "HASH_FUNCTION_NO_OP",