{"version":3,"file":"advancedBarrel.mjs","names":[],"sources":["../src/advancedBarrel.ts"],"sourcesContent":["import { ccc } from \"@ckb-ccc/core\";\nimport { cccA } from \"@ckb-ccc/core/advanced\";\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n * @interface\n */\nexport interface Provider {\n  /**\n   * Sends a request to the provider.\n   * @type {RequestMethod}\n   */\n  request: RequestMethod;\n\n  /**\n   * Adds an event listener to the provider.\n   * @type {OnMethod}\n   */\n  on: OnMethod;\n\n  /**\n   * Checks if rei wallet is connected.\n   * @returns A promise that resolves to true if connected, false otherwise.\n   */\n  isConnected(): Promise<boolean>;\n\n  /**\n   * Removes an event listener from the provider.\n   * @param {string} eventName - The name of the event to remove the listener from.\n   * @param {(...args: unknown[]) => unknown} listener - The listener function to remove.\n   * @returns {Provider} The provider instance.\n   */\n  off(eventName: string, listener: (...args: unknown[]) => unknown): void;\n}\n\n/**\n * Interface representing a method to add event listeners to the provider.\n * @interface\n */\nexport interface OnMethod {\n  /**\n   * Adds an event listener to the provider.\n   * @param {string} eventName - The name of the event.\n   * @param {(...args: unknown[]) => unknown} listener - The listener function.\n   * @returns {Provider} The provider instance.\n   */\n  (eventName: string, listener: (...args: unknown[]) => unknown): void;\n}\n\nexport interface RequestMethod {\n  /**\n   * Requests the accounts from the provider.\n   * @param request - The request object.\n   * @param request.method - The method name.\n   * @param request.data - The optional method parameters.\n   * @returns A promise that resolves to an array of account addresses.\n   */\n  (request: {\n    method: \"ckb_requestAccounts\";\n    data?: undefined;\n  }): Promise<string>;\n\n  /**\n   * Signs a message with the personal account.\n   * @param request - The request object.\n   * @param request.method - The method name.\n   * @param request.data - The method parameters.\n   * @returns A promise that resolves to the signed message.\n   */\n  (request: {\n    method: \"ckb_signMessage\";\n    data: { message: string };\n  }): Promise<ccc.Hex>;\n\n  /**\n   * Gets the identity of the signer.\n   * @param request - The request object.\n   * @param request.method - The method name.\n   * @returns A promise that resolves to the signed message.\n   */\n  (request: { method: \"ckb_getPublicKey\" }): Promise<string>;\n\n  /**\n   * Get network.\n   * @param request - The request object.\n   * @param request.method - The method name.\n   * @param request.data - The method parameters.\n   * @returns A promise that resolves to the signed message.\n   */\n  (request: {\n    method: \"ckb_switchNetwork\";\n    data: string;\n  }): Promise<{ type: string; network: string }>;\n\n  /**\n   * Signs transaction .\n   * @param request - The request object.\n   * @param request.method - The method name.\n   * @param request.data - The method parameters.\n   * @returns A promise that resolves to the signed message.\n   */\n\n  (request: {\n    method: \"ckb_signTransaction\";\n    data: { txSkeleton: cccA.JsonRpcTransaction };\n  }): Promise<ccc.Transaction>;\n}\n"],"mappings":""}