Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk-starter-kit): Add passkey types to starter #1073

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/protocol-kit/src/types/safeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
12 changes: 8 additions & 4 deletions packages/sdk-starter-kit/src/BaseClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Safe, {
AddOwnerTxParams,
AddPasskeyOwnerTxParams,
RemoveOwnerTxParams,
RemovePasskeyOwnerTxParams,
SwapOwnerTxParams
} from '@safe-global/protocol-kit'
import SafeApiKit from '@safe-global/api-kit'
Expand Down Expand Up @@ -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<TransactionBase> {
async createAddOwnerTransaction(
addOwnerParams: AddOwnerTxParams | AddPasskeyOwnerTxParams
): Promise<TransactionBase> {
const addOwnerTransaction = await this.protocolKit.createAddOwnerTx(addOwnerParams)

return this.#buildTransaction(addOwnerTransaction)
Expand All @@ -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<TransactionBase> {
const removeOwnerTransaction = await this.protocolKit.createRemoveOwnerTx(removeOwnerParams)

Expand Down
Loading