import { WbipProvider } from '@stacks/connect-ui'; import { MethodParams, MethodParamsRaw, MethodResult, MethodResultRaw, Methods, MethodsRaw } from './methods'; import { StacksProvider } from './types'; import type { UniversalConnectorConfig } from '@reown/appkit-universal-connector'; export interface ConnectRequestOptions { /** * The provider to use for the request. * If none is provided the UI will be shown. * Defaults to the previously selected provider (unless `forceWalletSelect` is `true`). */ provider?: StacksProvider; /** * Forces the user to select a wallet. * Defaults to `false`. */ forceWalletSelect?: boolean; /** * Persist the selected wallet across requests. * Defaults to `true`. */ persistWalletSelect?: boolean; /** * Adds manual request rewriting to make different providers behave more closely to SIP-030 / WBIPs. * Defaults to `true`. */ enableOverrides?: boolean; /** * Enable local storage caching of addresses. * Defaults to `true`. */ enableLocalStorage?: boolean; /** * The default wallets to display in the modal. * Defaults to some known popular wallets. */ defaultProviders?: WbipProvider[]; /** * A list of provider IDs that are approved to be shown in the Stacks Connect modal. * If not provided, all default and installed providers will be shown. */ approvedProviderIds?: string[]; /** * @deprecated Use `walletConnect` instead. If `walletConnect` is provided, `walletConnectProjectId` is ignored. * * The project ID for WalletConnect. * If provided, the WalletConnect provider will be created with default metadata and networks. */ walletConnectProjectId?: string; /** * The config for WalletConnect. * If provided, the WalletConnect provider will be created. * - `config.projectId` is required. * - `config.metadata` and `config.networks` are optional and will use default values if not provided. * * If using `walletConnect` alongside `approvedProviderIds`, make sure to include * `"WalletConnectProvider"` in the `approvedProviderIds` array. */ walletConnect?: Partial> & Omit; } export declare function requestRaw(provider: StacksProvider, method: M, params?: MethodParamsRaw): Promise>; /** * The main `request` method for interacting with wallets. * This method adds automatic error handling, request parameter serialization, and optional local storage. * For more advanced use cases, consider using the {@link requestRaw} method directly. * * @example * ``` * // Send BTC * const result = await request('sendTransfer', { * recipients: [{ * address: 'bc1...', * amount: 100_000_000n, // 1 BTC = 100,000,000 sats * }], * }); * ``` * * @example * ``` * // Optional features * const result = await request({ * provider: MyCustomProvider, * defaultProviders: [MyCustomProvider, ...], * forceWalletSelect: false, * persistWalletSelect: true, * enableOverrides: true, * enableLocalStorage: true, * }, 'method', params); * ``` */ export declare function request(method: M, params?: MethodParams): Promise>; export declare function request(options: ConnectRequestOptions, method: M, params?: MethodParams): Promise>; /** * Initiate a wallet connection and request addresses. * Alias for `request` to `getAddresses` with `forceWalletSelect: true`. */ export declare function connect(options?: ConnectRequestOptions & MethodParams<'getAddresses'>): Promise; /** * **Note:** Higher order function! * @internal Legacy non-UI request. */ export declare function requestRawLegacy(method: M, mapOptions: (options: O) => MethodParams, mapResponse: (response: MethodResult) => R): (options: O, provider?: StacksProvider) => void; /** * @internal * Simple function for serializing clarity object values to hex strings, in case wallets don't support them. */ export declare function serializeParams(params: MethodParams): MethodParams;