Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
miladsoft committed Nov 11, 2024
1 parent 5e67afe commit 7f1cb20
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 38 deletions.
46 changes: 17 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@ngneat/cashew": "^4.1.0",
"@ngneat/transloco": "6.0.4",
"@noble/hashes": "^1.5.0",
"@noble/secp256k1": "1.7.1",
"@noble/secp256k1": "2.1.0",
"@types/qrcode": "^1.5.5",
"@webbtc/webln-types": "^3.0.0",
"@zxing/library": "^0.21.3",
Expand All @@ -65,7 +65,7 @@
"luxon": "3.5.0",
"moment": "^2.30.1",
"ng-apexcharts": "1.12.0",
"ngx-indexed-db": "^19.0.1",
"ngx-indexed-db": "^19.1.0",
"ngx-infinite-scroll": "^18.0.0",
"ngx-quill": "26.0.9",
"nostr-tools": "^2.10.1",
Expand Down Expand Up @@ -104,7 +104,7 @@
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"lodash": "4.17.21",
"postcss": "8.4.47",
"postcss": "8.4.48",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "4.1.0",
"prettier-plugin-tailwindcss": "0.6.8",
Expand Down
17 changes: 11 additions & 6 deletions src/app/services/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ export class Utilities {
return value;
}

private hexToArray(value: string) {
return secp.utils.hexToBytes(value);
private hexToArray(value: string): Uint8Array {
return new Uint8Array(value.match(/.{1,2}/g)?.map(byte => parseInt(byte, 16)) || []);
}

arrayToHex(value: Uint8Array) {
return secp.utils.bytesToHex(value);
arrayToHex(value: Uint8Array): string {
return Array.from(value)
.map(byte => byte.toString(16).padStart(2, '0'))
.join('');
}

convertFromBech32(address: any) {
Expand All @@ -191,10 +193,13 @@ export class Utilities {
return new TextDecoder().decode(Uint8Array.from(buf));
}

keyToHex(publicKey: Uint8Array) {
return secp.utils.bytesToHex(publicKey);
keyToHex(publicKey: Uint8Array): string {
return Array.from(publicKey)
.map(byte => byte.toString(16).padStart(2, '0'))
.join('');
}


sanitizeLUD06(url?: string) {
// Do not allow http prefix.
if (!url) {
Expand Down

0 comments on commit 7f1cb20

Please sign in to comment.