Starter Kit Reference
SafeClient
extend

extend

Extends the functionality of the SafeClient class.

The Starter Kit offers some extensions that allow this, but you can also implement your own.

Usage


_10
import { safeOperations } from '@safe-global/sdk-starter-kit'
_10
import { safeClient } from './setup.ts'
_10
_10
const safeOperationClient = await safeClient.extend(
_10
safeOperations({ bundlerUrl }, { isSponsored, paymasterUrl })
_10
)
_10
_10
const safeOperationResult = await safeOperationClient.sendSafeOperation({
_10
transactions
_10
})

Returns

Promise<SafeClient & T> | SafeClient & T

The SafeClient with the added functionality.

Parameters

extendFunction

  • Type: (client: SafeClient) => Promise<T> | (client: SafeClient) => T

The extension function that receives the current SafeClient class and merges it with the added functionality.


_10
const safeMessageClient = safeClient.extend(
_10
offChainMessages()
_10
)

Was this page helpful?