WIP: Bisq DAO support. Transactions list and details.

This commit is contained in:
softsimon
2020-07-03 23:45:19 +07:00
parent 94ccd98d0a
commit d39b4a5c92
59 changed files with 926 additions and 38 deletions

View File

@@ -0,0 +1,8 @@
import { Hex2asciiPipe } from './hex2ascii.pipe';
describe('Hex2asciiPipe', () => {
it('create an instance', () => {
const pipe = new Hex2asciiPipe();
expect(pipe).toBeTruthy();
});
});

View File

@@ -0,0 +1,25 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'hex2ascii'
})
export class Hex2asciiPipe implements PipeTransform {
transform(hex: string): string {
const opPush = hex.split(' ').filter((_, i, a) => i > 0 && /^OP_PUSH/.test(a[i - 1]));
if (opPush[0]) {
hex = opPush[0];
}
if (!hex) {
return '';
}
let str = '';
for (let i = 0; i < hex.length; i += 2) {
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return str;
}
}