Skip to content

Commit

Permalink
chore: tsdoc - createBicoPaymasterClient
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Sep 19, 2024
1 parent d0ae8c5 commit 790d1ef
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/sdk/clients/createBicoPaymasterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import {
createPaymasterClient
} from "viem/account-abstraction"

/**
* Configuration options for creating a Bico Paymaster Client.
* @typedef {Object} BicoPaymasterClientConfig
* @property {Transport} [transport] - Optional custom transport.
* @property {string} [paymasterUrl] - URL of the paymaster service.
* @property {number} [chainId] - Chain ID for the network.
* @property {string} [apiKey] - API key for authentication.
*/
type BicoPaymasterClientConfig = Omit<PaymasterClientConfig, "transport"> &
OneOf<
| {
Expand All @@ -19,6 +27,27 @@ type BicoPaymasterClientConfig = Omit<PaymasterClientConfig, "transport"> &
}
>

/**
* Creates a Bico Paymaster Client.
*
* This function sets up a client for interacting with Biconomy's paymaster service.
* It can be configured with a custom transport, a specific paymaster URL, or with a chain ID and API key.
*
* @param {BicoPaymasterClientConfig} parameters - Configuration options for the client.
* @returns {PaymasterClient} A configured Paymaster Client instance.
*
* @example
* // Create a client with a custom transport
* const client1 = createBicoPaymasterClient({ transport: customTransport })
*
* @example
* // Create a client with a specific paymaster URL
* const client2 = createBicoPaymasterClient({ paymasterUrl: 'https://example.com/paymaster' })
*
* @example
* // Create a client with chain ID and API key
* const client3 = createBicoPaymasterClient({ chainId: 1, apiKey: 'your-api-key' })
*/
export const createBicoPaymasterClient = (
parameters: BicoPaymasterClientConfig
): PaymasterClient =>
Expand Down

0 comments on commit 790d1ef

Please sign in to comment.