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