From 0f852b3fedf0b61e14b2f6626b98c6052197b659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20P=C3=A9rez=20V=C3=A1zquez?= Date: Tue, 10 Dec 2024 12:26:39 +0100 Subject: [PATCH] Add types --- packages/protocol-kit/src/types/safeProvider.ts | 2 +- packages/sdk-starter-kit/src/BaseClient.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/protocol-kit/src/types/safeProvider.ts b/packages/protocol-kit/src/types/safeProvider.ts index 6e5c40a6e..d473dae2d 100644 --- a/packages/protocol-kit/src/types/safeProvider.ts +++ b/packages/protocol-kit/src/types/safeProvider.ts @@ -50,7 +50,7 @@ export type HexAddress = string export type PrivateKey = string export type HttpTransport = string export type SocketTransport = string -export type SafeSigner = HexAddress | PrivateKey | PasskeyClient +export type SafeSigner = HexAddress | PrivateKey | PasskeyArgType | PasskeyClient export type SafeProviderConfig = { /** signerOrProvider - Ethers signer or provider */ diff --git a/packages/sdk-starter-kit/src/BaseClient.ts b/packages/sdk-starter-kit/src/BaseClient.ts index f80425124..e40e819e5 100644 --- a/packages/sdk-starter-kit/src/BaseClient.ts +++ b/packages/sdk-starter-kit/src/BaseClient.ts @@ -1,6 +1,8 @@ import Safe, { AddOwnerTxParams, + AddPasskeyOwnerTxParams, RemoveOwnerTxParams, + RemovePasskeyOwnerTxParams, SwapOwnerTxParams } from '@safe-global/protocol-kit' import SafeApiKit from '@safe-global/api-kit' @@ -85,10 +87,12 @@ export class BaseClient { /** * Encodes the data for adding a new owner to the Safe. * - * @param {AddOwnerTxParams} addOwnerParams - The parameters for adding a new owner + * @param {AddOwnerTxParams | AddPasskeyOwnerTxParams} addOwnerParams - The parameters for adding a new owner * @returns {TransactionBase} The encoded data */ - async createAddOwnerTransaction(addOwnerParams: AddOwnerTxParams): Promise { + async createAddOwnerTransaction( + addOwnerParams: AddOwnerTxParams | AddPasskeyOwnerTxParams + ): Promise { const addOwnerTransaction = await this.protocolKit.createAddOwnerTx(addOwnerParams) return this.#buildTransaction(addOwnerTransaction) @@ -97,11 +101,11 @@ export class BaseClient { /** * Encodes the data for removing an owner from the Safe. * - * @param {RemoveOwnerTxParams} removeOwnerParams - The parameters for removing an owner + * @param {RemoveOwnerTxParams | RemovePasskeyOwnerTxParams} removeOwnerParams - The parameters for removing an owner * @returns {TransactionBase} The encoded data */ async createRemoveOwnerTransaction( - removeOwnerParams: RemoveOwnerTxParams + removeOwnerParams: RemoveOwnerTxParams | RemovePasskeyOwnerTxParams ): Promise { const removeOwnerTransaction = await this.protocolKit.createRemoveOwnerTx(removeOwnerParams)