{"version":3,"file":"advancedBarrel.mjs","names":[],"sources":["../src/advancedBarrel.ts"],"sourcesContent":["import { ccc } from \"@ckb-ccc/core\";\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n */\nexport interface Provider {\n  /**\n   * Signs a PSBT using UniSat wallet.\n   *\n   * @param psbtHex - The hex string of PSBT to sign\n   * @param options - Options for signing the PSBT\n   * @returns A promise that resolves to the signed PSBT hex string\n   */\n  signPsbt(psbtHex: string, options?: ccc.SignPsbtOptionsLike): Promise<string>;\n\n  /**\n   * Broadcasts a signed PSBT to the Bitcoin network.\n   *\n   * @param psbtHex - The hex string of the signed PSBT to broadcast.\n   * @returns A promise that resolves to the transaction ID.\n   */\n  pushPsbt(psbtHex: string): Promise<string>;\n\n  /**\n   * Requests user accounts.\n   * @returns A promise that resolves to an array of account addresses.\n   */\n  requestAccounts(): Promise<string[]>;\n\n  /**\n   * Gets the current network.\n   * @returns current network.\n   */\n  getNetwork(): Promise<\"livenet\" | \"testnet\">;\n\n  /**\n   * Switch the current network.\n   */\n  switchNetwork(chain: \"livenet\" | \"testnet\"): Promise<void>;\n\n  /**\n   * Gets the current chain.\n   * @returns current chain.\n   */\n  getChain?(): Promise<{ enum: string; name: string; network: string }>;\n\n  /**\n   * Switch the current chain.\n   */\n  switchChain?(\n    chain: string,\n  ): Promise<{ enum: string; name: string; network: string }>;\n\n  /**\n   * Gets the current accounts.\n   * @returns A promise that resolves to an array of account addresses.\n   */\n  getAccounts(): Promise<string[]>;\n\n  /**\n   * Gets the public key of the account.\n   * @returns A promise that resolves to the public key.\n   */\n  getPublicKey(): Promise<string>;\n\n  /**\n   * Signs a message with the specified type.\n   * @param msg - The message to sign.\n   * @param type - The type of signature.\n   * @returns A promise that resolves to the signed message.\n   */\n  signMessage(msg: string, type: \"ecdsa\" | \"bip322-simple\"): Promise<string>;\n\n  /**\n   * Adds an event listener to the provider.\n   */\n  on: OnMethod;\n\n  /**\n   * Removes an event listener from the provider.\n   * @param eventName - The name of the event to remove the listener from.\n   * @param listener - The listener function to remove.\n   * @returns The provider instance.\n   */\n  removeListener(\n    eventName: string,\n    listener: (...args: unknown[]) => unknown,\n  ): Provider;\n}\n\n/**\n * Interface representing a method to add event listeners to the provider.\n */\nexport interface OnMethod {\n  /**\n   * Adds an event listener to the provider.\n   * @param eventName - The name of the event.\n   * @param listener - The listener function.\n   * @returns The provider instance.\n   */\n  (eventName: string, listener: (...args: unknown[]) => unknown): Provider;\n}\n"],"mappings":""}