[
  {
    "path": ".browserslistrc",
    "content": "# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.\n# For additional information regarding the format and rule options, please see:\n# https://github.com/browserslist/browserslist#queries\n\n# For the full list of supported browsers by the Angular framework, please see:\n# https://angular.io/guide/browser-support\n\n# You can see what browsers were selected by your queries by running:\n#   npx browserslist\n\nlast 1 Chrome version\nlast 1 Firefox version\nlast 2 Edge major versions\nlast 2 Safari major versions\nlast 2 iOS major versions\nFirefox ESR\n"
  },
  {
    "path": ".editorconfig",
    "content": "# Editor configuration, see https://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.ts]\nquote_type = single\n\n[*.md]\nmax_line_length = off\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# Compiled output\n/dist\n/tmp\n/out-tsc\n/bazel-out\n\n# Node\n/node_modules\nnpm-debug.log\nyarn-error.log\n\n# IDEs and editors\n.idea/\n.project\n.classpath\n.c9/\n*.launch\n.settings/\n*.sublime-workspace\n\n# Visual Studio Code\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n.history/*\n\n# Miscellaneous\n/.angular/cache\n.sass-cache/\n/connect.lock\n/coverage\n/libpeerconnection.log\ntestem.log\n/typings\n\n# System files\n.DS_Store\nThumbs.db\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846\n  \"recommendations\": [\"angular.ng-template\"]\n}\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"name\": \"ng serve\",\n      \"type\": \"pwa-chrome\",\n      \"request\": \"launch\",\n      \"preLaunchTask\": \"npm: start\",\n      \"url\": \"http://localhost:4200/\"\n    },\n    {\n      \"name\": \"ng test\",\n      \"type\": \"chrome\",\n      \"request\": \"launch\",\n      \"preLaunchTask\": \"npm: test\",\n      \"url\": \"http://localhost:9876/debug.html\"\n    }\n  ]\n}\n"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "{\n  // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      \"type\": \"npm\",\n      \"script\": \"start\",\n      \"isBackground\": true,\n      \"problemMatcher\": {\n        \"owner\": \"typescript\",\n        \"pattern\": \"$tsc\",\n        \"background\": {\n          \"activeOnStart\": true,\n          \"beginsPattern\": {\n            \"regexp\": \"(.*?)\"\n          },\n          \"endsPattern\": {\n            \"regexp\": \"bundle generation complete\"\n          }\n        }\n      }\n    },\n    {\n      \"type\": \"npm\",\n      \"script\": \"test\",\n      \"isBackground\": true,\n      \"problemMatcher\": {\n        \"owner\": \"typescript\",\n        \"pattern\": \"$tsc\",\n        \"background\": {\n          \"activeOnStart\": true,\n          \"beginsPattern\": {\n            \"regexp\": \"(.*?)\"\n          },\n          \"endsPattern\": {\n            \"regexp\": \"bundle generation complete\"\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "README.md",
    "content": "# all-key\n\nAll bitcoin private key.\n\n## Demo\n\nhttps://all-bitcoin-private-key.pages.dev/\n\n## Development\n\n```\ngit clone https://github.com/mingfunwong/all-bitcoin-private-key.git\ncd ./all-bitcoin-private-key\nyarn\nyarn start\n```\n"
  },
  {
    "path": "angular.json",
    "content": "{\n  \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\n  \"version\": 1,\n  \"newProjectRoot\": \"projects\",\n  \"projects\": {\n    \"all-key\": {\n      \"projectType\": \"application\",\n      \"schematics\": {},\n      \"root\": \"\",\n      \"sourceRoot\": \"src\",\n      \"prefix\": \"app\",\n      \"architect\": {\n        \"build\": {\n          \"builder\": \"@angular-devkit/build-angular:browser\",\n          \"options\": {\n            \"outputPath\": \"dist/all-key\",\n            \"index\": \"src/index.html\",\n            \"main\": \"src/main.ts\",\n            \"polyfills\": \"src/polyfills.ts\",\n            \"tsConfig\": \"tsconfig.app.json\",\n            \"assets\": [\"src/favicon.ico\", \"src/assets\"],\n            \"styles\": [\"src/styles.css\"],\n            \"scripts\": [\"node_modules/bitcoinjs-lib/build/bitcoinjs-min.js\"]\n          },\n          \"configurations\": {\n            \"production\": {\n              \"budgets\": [\n                {\n                  \"type\": \"initial\",\n                  \"maximumWarning\": \"500kb\",\n                  \"maximumError\": \"1mb\"\n                },\n                {\n                  \"type\": \"anyComponentStyle\",\n                  \"maximumWarning\": \"2kb\",\n                  \"maximumError\": \"4kb\"\n                }\n              ],\n              \"fileReplacements\": [\n                {\n                  \"replace\": \"src/environments/environment.ts\",\n                  \"with\": \"src/environments/environment.prod.ts\"\n                }\n              ],\n              \"outputHashing\": \"all\"\n            },\n            \"development\": {\n              \"buildOptimizer\": false,\n              \"optimization\": false,\n              \"vendorChunk\": true,\n              \"extractLicenses\": false,\n              \"sourceMap\": true,\n              \"namedChunks\": true\n            }\n          },\n          \"defaultConfiguration\": \"production\"\n        },\n        \"serve\": {\n          \"builder\": \"@angular-devkit/build-angular:dev-server\",\n          \"configurations\": {\n            \"production\": {\n              \"browserTarget\": \"all-key:build:production\"\n            },\n            \"development\": {\n              \"browserTarget\": \"all-key:build:development\"\n            }\n          },\n          \"defaultConfiguration\": \"development\"\n        },\n        \"extract-i18n\": {\n          \"builder\": \"@angular-devkit/build-angular:extract-i18n\",\n          \"options\": {\n            \"browserTarget\": \"all-key:build\"\n          }\n        },\n        \"test\": {\n          \"builder\": \"@angular-devkit/build-angular:karma\",\n          \"options\": {\n            \"main\": \"src/test.ts\",\n            \"polyfills\": \"src/polyfills.ts\",\n            \"tsConfig\": \"tsconfig.spec.json\",\n            \"karmaConfig\": \"karma.conf.js\",\n            \"assets\": [\"src/favicon.ico\", \"src/assets\"],\n            \"styles\": [\"src/styles.css\"],\n            \"scripts\": []\n          }\n        }\n      }\n    }\n  },\n  \"cli\": {\n    \"analytics\": false\n  }\n}\n"
  },
  {
    "path": "karma.conf.js",
    "content": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n  config.set({\n    basePath: '',\n    frameworks: ['jasmine', '@angular-devkit/build-angular'],\n    plugins: [\n      require('karma-jasmine'),\n      require('karma-chrome-launcher'),\n      require('karma-jasmine-html-reporter'),\n      require('karma-coverage'),\n      require('@angular-devkit/build-angular/plugins/karma')\n    ],\n    client: {\n      jasmine: {\n        // you can add configuration options for Jasmine here\n        // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html\n        // for example, you can disable the random execution with `random: false`\n        // or set a specific seed with `seed: 4321`\n      },\n      clearContext: false // leave Jasmine Spec Runner output visible in browser\n    },\n    jasmineHtmlReporter: {\n      suppressAll: true // removes the duplicated traces\n    },\n    coverageReporter: {\n      dir: require('path').join(__dirname, './coverage/all-key'),\n      subdir: '.',\n      reporters: [\n        { type: 'html' },\n        { type: 'text-summary' }\n      ]\n    },\n    reporters: ['progress', 'kjhtml'],\n    port: 9876,\n    colors: true,\n    logLevel: config.LOG_INFO,\n    autoWatch: true,\n    browsers: ['Chrome'],\n    singleRun: false,\n    restartOnFileChange: true\n  });\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"all-key\",\n  \"version\": \"0.0.0\",\n  \"scripts\": {\n    \"ng\": \"ng\",\n    \"start\": \"ng serve\",\n    \"build\": \"ng build\",\n    \"watch\": \"ng build --watch --configuration development\",\n    \"test\": \"ng test\"\n  },\n  \"private\": true,\n  \"dependencies\": {\n    \"@angular/animations\": \"^14.2.9\",\n    \"@angular/common\": \"^14.2.9\",\n    \"@angular/compiler\": \"^14.2.9\",\n    \"@angular/core\": \"^14.2.9\",\n    \"@angular/forms\": \"^14.2.9\",\n    \"@angular/platform-browser\": \"^14.2.9\",\n    \"@angular/platform-browser-dynamic\": \"^14.2.9\",\n    \"@angular/router\": \"^14.2.9\",\n    \"bitcoinjs-lib\": \"pointbiz/bitcoinjs-lib\",\n    \"rxjs\": \"~7.5.7\",\n    \"tslib\": \"^2.4.1\",\n    \"zone.js\": \"~0.12.0\"\n  },\n  \"devDependencies\": {\n    \"@angular-devkit/build-angular\": \"^14.2.8\",\n    \"@angular/cli\": \"~14.2.8\",\n    \"@angular/compiler-cli\": \"^14.2.9\",\n    \"@types/jasmine\": \"~4.3.0\",\n    \"autoprefixer\": \"^10.4.13\",\n    \"jasmine-core\": \"~4.5.0\",\n    \"karma\": \"~6.4.1\",\n    \"karma-chrome-launcher\": \"~3.1.0\",\n    \"karma-coverage\": \"~2.2.0\",\n    \"karma-jasmine\": \"~5.1.0\",\n    \"karma-jasmine-html-reporter\": \"~2.0.0\",\n    \"postcss\": \"^8.4.18\",\n    \"tailwindcss\": \"^3.2.2\",\n    \"typescript\": \"~4.8.4\"\n  }\n}\n"
  },
  {
    "path": "src/app/app-routing.module.ts",
    "content": "import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\nimport { AboutComponent } from './pages/about/about.component';\nimport { HomeComponent } from './pages/home/home.component';\n\nconst routes: Routes = [\n  { path: 'home', component: HomeComponent },\n  { path: 'about', component: AboutComponent },\n  { path: '', redirectTo: '/home', pathMatch: 'full' },\n];\n\n@NgModule({\n  imports: [RouterModule.forRoot(routes)],\n  exports: [RouterModule],\n})\nexport class AppRoutingModule {}\n"
  },
  {
    "path": "src/app/app.component.css",
    "content": ""
  },
  {
    "path": "src/app/app.component.html",
    "content": "<router-outlet></router-outlet>\n"
  },
  {
    "path": "src/app/app.component.spec.ts",
    "content": "import { TestBed } from '@angular/core/testing';\nimport { RouterTestingModule } from '@angular/router/testing';\nimport { AppComponent } from './app.component';\n\ndescribe('AppComponent', () => {\n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [\n        RouterTestingModule\n      ],\n      declarations: [\n        AppComponent\n      ],\n    }).compileComponents();\n  });\n\n  it('should create the app', () => {\n    const fixture = TestBed.createComponent(AppComponent);\n    const app = fixture.componentInstance;\n    expect(app).toBeTruthy();\n  });\n\n  it(`should have as title 'all-key'`, () => {\n    const fixture = TestBed.createComponent(AppComponent);\n    const app = fixture.componentInstance;\n    expect(app.title).toEqual('all-key');\n  });\n\n  it('should render title', () => {\n    const fixture = TestBed.createComponent(AppComponent);\n    fixture.detectChanges();\n    const compiled = fixture.nativeElement as HTMLElement;\n    expect(compiled.querySelector('.content span')?.textContent).toContain('all-key app is running!');\n  });\n});\n"
  },
  {
    "path": "src/app/app.component.ts",
    "content": "import { Component } from '@angular/core';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n  title = 'all-key';\n}\n"
  },
  {
    "path": "src/app/app.module.ts",
    "content": "import { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { HomeComponent } from './pages/home/home.component';\nimport { AboutComponent } from './pages/about/about.component';\nimport { BalancePipe } from './pipes/balance.pipe';\nimport { HttpClientModule } from '@angular/common/http';\nimport { LayoutComponent } from './components/layout/layout.component';\n\n@NgModule({\n  declarations: [AppComponent, HomeComponent, AboutComponent, BalancePipe, LayoutComponent],\n  imports: [BrowserModule, AppRoutingModule, HttpClientModule],\n  providers: [],\n  bootstrap: [AppComponent],\n})\nexport class AppModule {}\n"
  },
  {
    "path": "src/app/components/layout/layout.component.css",
    "content": ""
  },
  {
    "path": "src/app/components/layout/layout.component.html",
    "content": "<div class=\"text-sm\">\n  <header class=\"text-white bg-blue-800 px-6 py-4 mb-4\">\n    <span class=\"text-xl pr-4\">All Key</span>\n    <a routerLink=\"/home\" class=\"px-4 py-2 hover:bg-blue-700 rounded transition\"\n      >Home</a\n    >\n    <a\n      routerLink=\"/about\"\n      class=\"px-4 py-2 hover:bg-blue-700 rounded transition\"\n      >About</a\n    >\n  </header>\n  <main class=\"text-slate-800 overflow-x-auto\">\n    <ng-content></ng-content>\n  </main>\n  <footer class=\"px-6 py-4 text-slate-500\">♥ allKey</footer>\n</div>\n"
  },
  {
    "path": "src/app/components/layout/layout.component.spec.ts",
    "content": "import { ComponentFixture, TestBed } from '@angular/core/testing';\n\nimport { LayoutComponent } from './layout.component';\n\ndescribe('LayoutComponent', () => {\n  let component: LayoutComponent;\n  let fixture: ComponentFixture<LayoutComponent>;\n\n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      declarations: [ LayoutComponent ]\n    })\n    .compileComponents();\n\n    fixture = TestBed.createComponent(LayoutComponent);\n    component = fixture.componentInstance;\n    fixture.detectChanges();\n  });\n\n  it('should create', () => {\n    expect(component).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "src/app/components/layout/layout.component.ts",
    "content": "import { Component, OnInit } from '@angular/core';\n\n@Component({\n  selector: 'app-layout',\n  templateUrl: './layout.component.html',\n  styleUrls: ['./layout.component.css']\n})\nexport class LayoutComponent implements OnInit {\n\n  constructor() { }\n\n  ngOnInit(): void {\n  }\n\n}\n"
  },
  {
    "path": "src/app/pages/about/about.component.css",
    "content": ""
  },
  {
    "path": "src/app/pages/about/about.component.html",
    "content": "<app-layout>\n  <div class=\"p-4\">\n    GitHub:\n    <a\n      href=\"https://github.com/mingfunwong/all-bitcoin-private-key\"\n      class=\"text-blue-500 hover:text-blue-900 hover:underline\"\n      >https://github.com/mingfunwong/all-bitcoin-private-key</a\n    >\n  </div>\n</app-layout>\n"
  },
  {
    "path": "src/app/pages/about/about.component.spec.ts",
    "content": "import { ComponentFixture, TestBed } from '@angular/core/testing';\n\nimport { AboutComponent } from './about.component';\n\ndescribe('AboutComponent', () => {\n  let component: AboutComponent;\n  let fixture: ComponentFixture<AboutComponent>;\n\n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      declarations: [ AboutComponent ]\n    })\n    .compileComponents();\n\n    fixture = TestBed.createComponent(AboutComponent);\n    component = fixture.componentInstance;\n    fixture.detectChanges();\n  });\n\n  it('should create', () => {\n    expect(component).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "src/app/pages/about/about.component.ts",
    "content": "import { Component, OnInit } from '@angular/core';\n\n@Component({\n  selector: 'app-about',\n  templateUrl: './about.component.html',\n  styleUrls: ['./about.component.css']\n})\nexport class AboutComponent implements OnInit {\n\n  constructor() { }\n\n  ngOnInit(): void {\n  }\n\n}\n"
  },
  {
    "path": "src/app/pages/home/home.component.css",
    "content": ""
  },
  {
    "path": "src/app/pages/home/home.component.html",
    "content": "<app-layout>\n  <table class=\"table-auto w-full font-mono font-light\">\n    <thead class=\"text-gray-500 border-b border-b-slate-200\">\n      <tr>\n        <td\n          *ngFor=\"let column of tableHeaderColumns\"\n          class=\"px-4 py-2 whitespace-nowrap\"\n        >\n          {{ column }}\n        </td>\n      </tr>\n    </thead>\n    <tbody>\n      <tr\n        *ngFor=\"let item of items\"\n        class=\"hover:bg-slate-100 border-b border-b-slate-100\"\n      >\n        <td class=\"px-4 py-2 whitespace-nowrap\">{{ item.privateKey }}</td>\n        <td class=\"px-4 py-2 whitespace-nowrap\">\n          <a\n            href=\"https://www.blockchain.com/btc/address/{{\n              item.addressUnCompressed\n            }}\"\n            target=\"_blank\"\n            class=\"text-blue-500 hover:text-blue-900 hover:underline\"\n            >{{ item.addressUnCompressed }}</a\n          >\n        </td>\n        <td\n          class=\"px-4 py-2 whitespace-nowrap\"\n          [ngClass]=\"getBalanceClass(item.addressUnCompressedBalance)\"\n        >\n          {{ item.addressUnCompressedBalance | balance }}\n        </td>\n        <td\n          class=\"px-4 py-2 whitespace-nowrap\"\n          [ngClass]=\"getBalanceClass(item.addressUnCompressedReceived)\"\n        >\n          {{ item.addressUnCompressedReceived | balance }}\n        </td>\n        <td class=\"px-4 py-2 whitespace-nowrap\">\n          <a\n            href=\"https://www.blockchain.com/btc/address/{{\n              item.addressCompressed\n            }}\"\n            target=\"_blank\"\n            class=\"text-blue-500 hover:text-blue-900 hover:underline\"\n            >{{ item.addressCompressed }}</a\n          >\n        </td>\n        <td\n          class=\"px-4 py-2 whitespace-nowrap\"\n          [ngClass]=\"getBalanceClass(item.addressCompressedBalance)\"\n        >\n          {{ item.addressCompressedBalance | balance }}\n        </td>\n        <td\n          class=\"px-4 py-2 whitespace-nowrap\"\n          [ngClass]=\"getBalanceClass(item.addressCompressedReceived)\"\n        >\n          {{ item.addressCompressedReceived | balance }}\n        </td>\n      </tr>\n    </tbody>\n  </table>\n\n  <div class=\"flex justify-between p-4\">\n    <button\n      (click)=\"onOlder()\"\n      class=\"border border-b-slate-200 hover:bg-slate-100 px-4 py-2 whitespace-nowrap focus:ring-2 focus:ring-slate-200 rounded\"\n    >\n      ← Older\n    </button>\n    <div>{{ page }} of {{ maxPage }}</div>\n    <button\n      (click)=\"onNewer()\"\n      class=\"border border-b-slate-200 hover:bg-slate-100 px-4 py-2 whitespace-nowrap focus:ring-2 focus:ring-slate-200 rounded\"\n    >\n      Newer →\n    </button>\n  </div>\n</app-layout>\n"
  },
  {
    "path": "src/app/pages/home/home.component.spec.ts",
    "content": "import { ComponentFixture, TestBed } from '@angular/core/testing';\n\nimport { HomeComponent } from './home.component';\n\ndescribe('HomeComponent', () => {\n  let component: HomeComponent;\n  let fixture: ComponentFixture<HomeComponent>;\n\n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      declarations: [ HomeComponent ]\n    })\n    .compileComponents();\n\n    fixture = TestBed.createComponent(HomeComponent);\n    component = fixture.componentInstance;\n    fixture.detectChanges();\n  });\n\n  it('should create', () => {\n    expect(component).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "src/app/pages/home/home.component.ts",
    "content": "import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { AllKeyService } from 'src/app/services/all-key.service';\nimport { BalanceService } from 'src/app/services/balance.service';\nimport { IAllKey } from 'src/app/types/IAllKey';\nimport { IBlockchain } from 'src/app/types/IBlockchain';\n\n@Component({\n  selector: 'app-home',\n  templateUrl: './home.component.html',\n  styleUrls: ['./home.component.css'],\n})\nexport class HomeComponent implements OnInit {\n  tableHeaderColumns: string[] = [\n    'privateKey',\n    'address',\n    'balance',\n    'received',\n    'compressed',\n    'balance',\n    'received',\n  ];\n\n  items: IAllKey[] = [];\n\n  maxNumber =\n    0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140n; // secp256k1_n - 1\n\n  page = 1n;\n  limitPerPage = 16;\n  maxPage = this.maxNumber / BigInt(this.limitPerPage);\n\n  isLoadingResults = true;\n  isError = false;\n\n  constructor(\n    private allKeyService: AllKeyService,\n    private route: ActivatedRoute,\n    private router: Router,\n    private balanceService: BalanceService\n  ) {}\n\n  ngOnInit() {\n    this.route.queryParamMap.subscribe((params) => {\n      this.page = BigInt(params.get('page') || '1');\n      this.getData();\n    });\n  }\n\n  onOlder() {\n    this.page = this.page - 1n;\n    if (this.page === 0n) {\n      this.page = 1n;\n    }\n    this.router.navigate(['/home'], { queryParams: { page: this.page } });\n  }\n\n  onNewer() {\n    this.page = this.page + 1n;\n    if (this.page >= this.maxPage) {\n      this.page = this.maxPage;\n    }\n    this.router.navigate(['/home'], { queryParams: { page: this.page } });\n  }\n\n  async getData() {\n    this.isLoadingResults = true;\n    const items = this.allKeyService.getData(this.page, this.limitPerPage);\n    this.items = items;\n    const addresses: string[] = [];\n    for (const key in items) {\n      const item = items[key];\n      addresses.push(item.addressCompressed);\n      addresses.push(item.addressUnCompressed);\n    }\n    const balanceList = await firstValueFrom(\n      this.balanceService.getBalance(addresses)\n    );\n    this.items = this.items.map((item) => {\n      item.addressCompressedBalance = this.getBalance(\n        item.addressCompressed,\n        balanceList,\n        'final_balance'\n      );\n      item.addressCompressedReceived = this.getBalance(\n        item.addressCompressed,\n        balanceList,\n        'total_received'\n      );\n      item.addressUnCompressedBalance = this.getBalance(\n        item.addressUnCompressed,\n        balanceList,\n        'final_balance'\n      );\n      item.addressUnCompressedReceived = this.getBalance(\n        item.addressUnCompressed,\n        balanceList,\n        'total_received'\n      );\n      return item;\n    });\n  }\n\n  getBalance(\n    address: string,\n    balanceList: IBlockchain[],\n    type: 'final_balance' | 'total_received'\n  ): number {\n    const balance = balanceList[address as any];\n    return balance ? balance[type] : 0;\n  }\n\n  getBalanceClass(balance: number | null) {\n    return balance ? 'text-slate-900' : 'text-slate-400';\n  }\n}\n"
  },
  {
    "path": "src/app/pipes/balance.pipe.spec.ts",
    "content": "import { BalancePipe } from './balance.pipe';\n\ndescribe('BalancePipe', () => {\n  it('create an instance', () => {\n    const pipe = new BalancePipe();\n    expect(pipe).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "src/app/pipes/balance.pipe.ts",
    "content": "import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n  name: 'balance',\n})\nexport class BalancePipe implements PipeTransform {\n  transform(value: number | null) {\n    return value !== null\n      ? parseFloat(value.toString()) / Math.pow(10, 8) + ' BTC'\n      : 'Loading...';\n  }\n}\n"
  },
  {
    "path": "src/app/services/all-key.service.spec.ts",
    "content": "import { TestBed } from '@angular/core/testing';\n\nimport { AllKeyService } from './all-key.service';\n\ndescribe('AllKeyService', () => {\n  let service: AllKeyService;\n\n  beforeEach(() => {\n    TestBed.configureTestingModule({});\n    service = TestBed.inject(AllKeyService);\n  });\n\n  it('should be created', () => {\n    expect(service).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "src/app/services/all-key.service.ts",
    "content": "import { Injectable } from '@angular/core';\nimport { IAllKey } from '../types/IAllKey';\n\ndeclare var Bitcoin: { ECKey: new (arg0: any) => any },\n  Crypto: { util: { hexToBytes: (arg0: string) => any } };\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class AllKeyService {\n  getData(page: bigint, limitPerPage: number): IAllKey[] {\n    const items: IAllKey[] = [];\n    const addresses: string[] = [];\n    for (let index = 0; index < limitPerPage; index++) {\n      let id = (\n        (page - 1n) * BigInt(limitPerPage) +\n        BigInt(index) +\n        1n\n      ).toString(16);\n\n      if (id.length % 2 !== 0) {\n        id = '0' + id;\n      }\n\n      const addressUnCompressed = this.getAddress(id, false);\n      const addressCompressed = this.getAddress(id, true);\n      const privateKey = this.getPrivateKey(id);\n      addresses.push(addressUnCompressed);\n      addresses.push(addressCompressed);\n      items.push({\n        id,\n        privateKey,\n        addressUnCompressed,\n        addressUnCompressedBalance: null,\n        addressUnCompressedReceived: null,\n        addressCompressed,\n        addressCompressedBalance: null,\n        addressCompressedReceived: null,\n      });\n    }\n    return items;\n  }\n\n  private getAddress(id: string, compressed: boolean) {\n    const bytes = Crypto.util.hexToBytes(id);\n    const btcKey = new Bitcoin.ECKey(bytes);\n    btcKey.compressed = compressed;\n    const address = btcKey.getBitcoinAddress().toString();\n    return address;\n  }\n\n  private getPrivateKey(id: string) {\n    const bytes = Crypto.util.hexToBytes(id);\n    const btcKey = new Bitcoin.ECKey(bytes);\n    const privateKey = btcKey.getExportedPrivateKey();\n    return privateKey;\n  }\n}\n"
  },
  {
    "path": "src/app/services/balance.service.spec.ts",
    "content": "import { TestBed } from '@angular/core/testing';\n\nimport { BalanceService } from './balance.service';\n\ndescribe('BalanceService', () => {\n  let service: BalanceService;\n\n  beforeEach(() => {\n    TestBed.configureTestingModule({});\n    service = TestBed.inject(BalanceService);\n  });\n\n  it('should be created', () => {\n    expect(service).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "src/app/services/balance.service.ts",
    "content": "import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { IBlockchain } from '../types/IBlockchain';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class BalanceService {\n  constructor(private _httpClient: HttpClient) {}\n\n  getBalance(addresses: string[]): Observable<IBlockchain[]> {\n    const requestUrl = `https://blockchain.info/balance?cors=true&active=${addresses.join(\n      ','\n    )}`;\n    const obser = this._httpClient.get<IBlockchain[]>(requestUrl);\n    return obser;\n  }\n}\n"
  },
  {
    "path": "src/app/types/IAllKey.ts",
    "content": "export interface IAllKey {\n  id: string;\n  privateKey: string;\n  addressUnCompressed: string;\n  addressUnCompressedBalance: number | null;\n  addressUnCompressedReceived: number | null;\n  addressCompressed: string;\n  addressCompressedBalance: number | null;\n  addressCompressedReceived: number | null;\n}\n"
  },
  {
    "path": "src/app/types/IBlockchain.ts",
    "content": "export interface IBlockchain {\n  final_balance: number;\n  n_tx: number;\n  total_received: number;\n}\n"
  },
  {
    "path": "src/assets/.gitkeep",
    "content": ""
  },
  {
    "path": "src/environments/environment.prod.ts",
    "content": "export const environment = {\n  production: true\n};\n"
  },
  {
    "path": "src/environments/environment.ts",
    "content": "// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport const environment = {\n  production: false\n};\n\n/*\n * For easier debugging in development mode, you can import the following file\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\n *\n * This import should be commented out in production mode because it will have a negative impact\n * on performance if an error is thrown.\n */\n// import 'zone.js/plugins/zone-error';  // Included with Angular CLI.\n"
  },
  {
    "path": "src/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>AllKey</title>\n  <base href=\"/\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\">\n</head>\n<body>\n  <app-root></app-root>\n</body>\n</html>\n"
  },
  {
    "path": "src/main.ts",
    "content": "import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n  enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n  .catch(err => console.error(err));\n"
  },
  {
    "path": "src/polyfills.ts",
    "content": "/**\n * This file includes polyfills needed by Angular and is loaded before the app.\n * You can add your own extra polyfills to this file.\n *\n * This file is divided into 2 sections:\n *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.\n *   2. Application imports. Files imported after ZoneJS that should be loaded before your main\n *      file.\n *\n * The current setup is for so-called \"evergreen\" browsers; the last versions of browsers that\n * automatically update themselves. This includes recent versions of Safari, Chrome (including\n * Opera), Edge on the desktop, and iOS and Chrome on mobile.\n *\n * Learn more in https://angular.io/guide/browser-support\n */\n\n/***************************************************************************************************\n * BROWSER POLYFILLS\n */\n\n/**\n * By default, zone.js will patch all possible macroTask and DomEvents\n * user can disable parts of macroTask/DomEvents patch by setting following flags\n * because those flags need to be set before `zone.js` being loaded, and webpack\n * will put import in the top of bundle, so user need to create a separate file\n * in this directory (for example: zone-flags.ts), and put the following flags\n * into that file, and then add the following code before importing zone.js.\n * import './zone-flags';\n *\n * The flags allowed in zone-flags.ts are listed here.\n *\n * The following flags will work for all browsers.\n *\n * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame\n * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick\n * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames\n *\n *  in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js\n *  with the following flag, it will bypass `zone.js` patch for IE/Edge\n *\n *  (window as any).__Zone_enable_cross_context_check = true;\n *\n */\n\n/***************************************************************************************************\n * Zone JS is required by default for Angular itself.\n */\nimport 'zone.js';  // Included with Angular CLI.\n\n\n/***************************************************************************************************\n * APPLICATION IMPORTS\n */\n"
  },
  {
    "path": "src/styles.css",
    "content": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"
  },
  {
    "path": "src/test.ts",
    "content": "// This file is required by karma.conf.js and loads recursively all the .spec and framework files\n\nimport 'zone.js/testing';\nimport { getTestBed } from '@angular/core/testing';\nimport {\n  BrowserDynamicTestingModule,\n  platformBrowserDynamicTesting\n} from '@angular/platform-browser-dynamic/testing';\n\ndeclare const require: {\n  context(path: string, deep?: boolean, filter?: RegExp): {\n    <T>(id: string): T;\n    keys(): string[];\n  };\n};\n\n// First, initialize the Angular testing environment.\ngetTestBed().initTestEnvironment(\n  BrowserDynamicTestingModule,\n  platformBrowserDynamicTesting(),\n);\n\n// Then we find all the tests.\nconst context = require.context('./', true, /\\.spec\\.ts$/);\n// And load the modules.\ncontext.keys().forEach(context);\n"
  },
  {
    "path": "tailwind.config.js",
    "content": "/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n  content: [\"./src/**/*.{html,ts}\"],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n};\n"
  },
  {
    "path": "tsconfig.app.json",
    "content": "/* To learn more about this file see: https://angular.io/config/tsconfig. */\n{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./out-tsc/app\",\n    \"types\": []\n  },\n  \"files\": [\n    \"src/main.ts\",\n    \"src/polyfills.ts\"\n  ],\n  \"include\": [\n    \"src/**/*.d.ts\"\n  ]\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "/* To learn more about this file see: https://angular.io/config/tsconfig. */\n{\n  \"compileOnSave\": false,\n  \"compilerOptions\": {\n    \"baseUrl\": \"./\",\n    \"outDir\": \"./dist/out-tsc\",\n    \"forceConsistentCasingInFileNames\": true,\n    \"strict\": true,\n    \"noImplicitOverride\": true,\n    \"noPropertyAccessFromIndexSignature\": true,\n    \"noImplicitReturns\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"sourceMap\": true,\n    \"declaration\": false,\n    \"downlevelIteration\": true,\n    \"experimentalDecorators\": true,\n    \"moduleResolution\": \"node\",\n    \"importHelpers\": true,\n    \"target\": \"es2020\",\n    \"module\": \"es2020\",\n    \"lib\": [\n      \"es2020\",\n      \"dom\"\n    ]\n  },\n  \"angularCompilerOptions\": {\n    \"enableI18nLegacyMessageIdFormat\": false,\n    \"strictInjectionParameters\": true,\n    \"strictInputAccessModifiers\": true,\n    \"strictTemplates\": true\n  }\n}\n"
  },
  {
    "path": "tsconfig.spec.json",
    "content": "/* To learn more about this file see: https://angular.io/config/tsconfig. */\n{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./out-tsc/spec\",\n    \"types\": [\n      \"jasmine\"\n    ]\n  },\n  \"files\": [\n    \"src/test.ts\",\n    \"src/polyfills.ts\"\n  ],\n  \"include\": [\n    \"src/**/*.spec.ts\",\n    \"src/**/*.d.ts\"\n  ]\n}\n"
  }
]