export class BlockletService {
  async getVault() {
    return { address: (globalThis as any).__CF_ENV__?.VAULT_ADDRESS || '' };
  }
  async getBlocklet() {
    return { id: '', site: { id: '' } };
  }
  async updateRoutingRule() {}
  async addRoutingRule() {}
  async getPermissionsByRole(_role: string) {
    return [];
  }
  async getRoles() {
    return [];
  }
  async getUsers(_params?: any) {
    return [];
  }
  async getUser(did: string, _opts?: any) {
    // In CF Workers, the DID from DID Connect IS the wallet DID.
    // Return it as a connectedAccount so getWalletDid(user) works correctly.
    return {
      user: {
        did,
        fullName: did,
        email: '',
        phone: '',
        remark: '',
        connectedAccounts: [{ provider: 'wallet', did }],
      },
    };
  }
}
