Skip to content

Commit 926e0b3

Browse files
authored
fix(sdk-starter-kit): Add types (safe-global#1073)
1 parent d4bde5d commit 926e0b3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/protocol-kit/src/types/safeProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export type HexAddress = string
5050
export type PrivateKey = string
5151
export type HttpTransport = string
5252
export type SocketTransport = string
53-
export type SafeSigner = HexAddress | PrivateKey | PasskeyClient
53+
export type SafeSigner = HexAddress | PrivateKey | PasskeyArgType | PasskeyClient
5454

5555
export type SafeProviderConfig = {
5656
/** signerOrProvider - Ethers signer or provider */

packages/sdk-starter-kit/src/BaseClient.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Safe, {
22
AddOwnerTxParams,
3+
AddPasskeyOwnerTxParams,
34
RemoveOwnerTxParams,
5+
RemovePasskeyOwnerTxParams,
46
SwapOwnerTxParams
57
} from '@safe-global/protocol-kit'
68
import SafeApiKit from '@safe-global/api-kit'
@@ -85,10 +87,12 @@ export class BaseClient {
8587
/**
8688
* Encodes the data for adding a new owner to the Safe.
8789
*
88-
* @param {AddOwnerTxParams} addOwnerParams - The parameters for adding a new owner
90+
* @param {AddOwnerTxParams | AddPasskeyOwnerTxParams} addOwnerParams - The parameters for adding a new owner
8991
* @returns {TransactionBase} The encoded data
9092
*/
91-
async createAddOwnerTransaction(addOwnerParams: AddOwnerTxParams): Promise<TransactionBase> {
93+
async createAddOwnerTransaction(
94+
addOwnerParams: AddOwnerTxParams | AddPasskeyOwnerTxParams
95+
): Promise<TransactionBase> {
9296
const addOwnerTransaction = await this.protocolKit.createAddOwnerTx(addOwnerParams)
9397

9498
return this.#buildTransaction(addOwnerTransaction)
@@ -97,11 +101,11 @@ export class BaseClient {
97101
/**
98102
* Encodes the data for removing an owner from the Safe.
99103
*
100-
* @param {RemoveOwnerTxParams} removeOwnerParams - The parameters for removing an owner
104+
* @param {RemoveOwnerTxParams | RemovePasskeyOwnerTxParams} removeOwnerParams - The parameters for removing an owner
101105
* @returns {TransactionBase} The encoded data
102106
*/
103107
async createRemoveOwnerTransaction(
104-
removeOwnerParams: RemoveOwnerTxParams
108+
removeOwnerParams: RemoveOwnerTxParams | RemovePasskeyOwnerTxParams
105109
): Promise<TransactionBase> {
106110
const removeOwnerTransaction = await this.protocolKit.createRemoveOwnerTx(removeOwnerParams)
107111

0 commit comments

Comments
 (0)