expose hexToBytes and bytesToHex helpers.
This commit is contained in:
parent
924075b803
commit
57354b9fb4
2
nip47.ts
2
nip47.ts
|
@ -32,7 +32,7 @@ export async function makeNwcRequestEvent(
|
||||||
invoice,
|
invoice,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
const encryptedContent = await encrypt(secretKey, pubkey, JSON.stringify(content))
|
const encryptedContent = encrypt(secretKey, pubkey, JSON.stringify(content))
|
||||||
const eventTemplate = {
|
const eventTemplate = {
|
||||||
kind: NWCWalletRequest,
|
kind: NWCWalletRequest,
|
||||||
created_at: Math.round(Date.now() / 1000),
|
created_at: Math.round(Date.now() / 1000),
|
||||||
|
|
2
utils.ts
2
utils.ts
|
@ -3,6 +3,8 @@ import type { Event } from './core.ts'
|
||||||
export const utf8Decoder: TextDecoder = new TextDecoder('utf-8')
|
export const utf8Decoder: TextDecoder = new TextDecoder('utf-8')
|
||||||
export const utf8Encoder: TextEncoder = new TextEncoder()
|
export const utf8Encoder: TextEncoder = new TextEncoder()
|
||||||
|
|
||||||
|
export { bytesToHex, hexToBytes } from '@noble/hashes/utils'
|
||||||
|
|
||||||
export function normalizeURL(url: string): string {
|
export function normalizeURL(url: string): string {
|
||||||
try {
|
try {
|
||||||
if (url.indexOf('://') === -1) url = 'wss://' + url
|
if (url.indexOf('://') === -1) url = 'wss://' + url
|
||||||
|
|
Loading…
Reference in New Issue