remove browserify-cipher, use crypto.subtle for nip04.

This commit is contained in:
fiatjaf
2022-12-21 16:04:00 -03:00
parent 0500415a4e
commit 41a1614d89
7 changed files with 58 additions and 35 deletions

View File

@@ -1,6 +1,8 @@
import * as secp256k1 from '@noble/secp256k1'
import {bech32} from 'bech32'
import {utf8Decoder, utf8Encoder} from './utils'
export type ProfilePointer = {
pubkey: string // hex
relays?: string[]
@@ -11,9 +13,6 @@ export type EventPointer = {
relays?: string[]
}
let utf8Decoder = new TextDecoder('utf-8')
let utf8Encoder = new TextEncoder()
export function decode(nip19: string): {
type: string
data: ProfilePointer | EventPointer | string