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: improve function documentation #1916

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions src/core/OnchainKitConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export const getOnchainKitConfig = <K extends keyof typeof ONCHAIN_KIT_CONFIG>(
/**
* Update the ONCHAIN_KIT_CONFIG object directly by providing the properties to update.
* This is powerful when you use OnchainKit utilities outside of the React context.
*
* @param {SetOnchainKitConfig} properties - Properties to update in the configuration
* @returns {Function} Returns the getOnchainKitConfig function for chaining
*/
export const setOnchainKitConfig = (properties: SetOnchainKitConfig) => {
Object.assign(ONCHAIN_KIT_CONFIG, properties);
Expand Down
5 changes: 5 additions & 0 deletions src/core/createWagmiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import type { CreateWagmiConfigParams } from './types';
/**
* createWagmiConfig returns a WagmiConfig (https://wagmi.sh/react/api/createConfig) using OnchainKit provided settings.
* This function should only be used if the user does not provide WagmiProvider as a parent in the React context.
* @param {Object} params - Configuration parameters
* @param {string} [params.apiKey] - Optional API key for Coinbase Developer Platform
* @param {string} [params.appName] - Optional application name for Coinbase Wallet
* @param {string} [params.appLogoUrl] - Optional application logo URL for Coinbase Wallet
* @returns {Config} Wagmi configuration object
*/
export const createWagmiConfig = ({
apiKey,
Expand Down
10 changes: 6 additions & 4 deletions src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type { Address, Chain } from 'viem';
* Note: exported as public Type
*/
export type AppConfig = {
/** Enable/disable telemetry. Set to false to disable telemetry. Defaults to true (enabled) */
analytics?: boolean;
/** Optional analytics URL for analytics data, defaults to Coinbase */
analyticsUrl?: string | null;
appearance?: {
Expand Down Expand Up @@ -41,7 +43,7 @@ export type CreateWagmiConfigParams = {
/**
* Note: exported as public Type
*/
export type isBaseOptions = {
export type IsBaseOptions = {
/** Chain ID for the network */
chainId: number;
/** If the chainId check is only allowed on mainnet */
Expand All @@ -51,7 +53,7 @@ export type isBaseOptions = {
/**
* Note: exported as public Type
*/
export type isEthereumOptions = {
export type IsEthereumOptions = {
/** Chain ID for the network */
chainId: number;
/** If the chainId check is only allowed on mainnet */
Expand Down Expand Up @@ -100,8 +102,8 @@ export type OnchainKitConfig = {
schemaId: EASSchemaUid | null;
/** ProjectId from Coinbase Developer Platform, only required for Coinbase Onramp support */
projectId: string | null;
/** InteractionId, used for analytics */
interactionId: string | null;
/** SessionId, used for analytics */
sessionId: string | null;
};

export type SetOnchainKitConfig = Partial<OnchainKitConfig>;
Expand Down
Loading