@nostr-connect/connect
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -1089,3 +1089,3 @@ 'use strict'; | ||
var _signEvent = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(event) { | ||
var signature; | ||
var eventWithSig; | ||
return _regeneratorRuntime().wrap(function _callee9$(_context9) { | ||
@@ -1109,4 +1109,4 @@ while (1) switch (_context9.prev = _context9.next) { | ||
case 4: | ||
signature = _context9.sent; | ||
return _context9.abrupt("return", signature); | ||
eventWithSig = _context9.sent; | ||
return _context9.abrupt("return", eventWithSig); | ||
case 6: | ||
@@ -1159,3 +1159,3 @@ case "end": | ||
var _delegate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(delegatee, conditions) { | ||
var sig; | ||
var delegation; | ||
return _regeneratorRuntime().wrap(function _callee11$(_context11) { | ||
@@ -1206,4 +1206,4 @@ while (1) switch (_context11.prev = _context11.next) { | ||
case 13: | ||
sig = _context11.sent; | ||
return _context11.abrupt("return", sig); | ||
delegation = _context11.sent; | ||
return _context11.abrupt("return", delegation); | ||
case 15: | ||
@@ -1210,0 +1210,0 @@ case "end": |
/// <reference types="node" /> | ||
import EventEmitter from 'events'; | ||
import { Kind } from 'nostr-tools'; | ||
import { Event, Kind } from 'nostr-tools'; | ||
import { nip26 } from 'nostr-tools'; | ||
import { NostrRPC } from './rpc'; | ||
export interface Metadata { | ||
name: string; | ||
url: string; | ||
url?: string; | ||
description?: string; | ||
@@ -54,3 +55,3 @@ icons?: string[]; | ||
created_at: number; | ||
}): Promise<string>; | ||
}): Promise<Event>; | ||
describe(): Promise<string[]>; | ||
@@ -61,3 +62,3 @@ delegate(delegatee: string | undefined, conditions: { | ||
since?: number | TimeRanges; | ||
}): Promise<string>; | ||
}): Promise<nip26.Delegation>; | ||
getRelays(): Promise<{ | ||
@@ -64,0 +65,0 @@ [url: string]: { |
@@ -1084,3 +1084,3 @@ import EventEmitter from 'events'; | ||
var _signEvent = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(event) { | ||
var signature; | ||
var eventWithSig; | ||
return _regeneratorRuntime().wrap(function _callee9$(_context9) { | ||
@@ -1104,4 +1104,4 @@ while (1) switch (_context9.prev = _context9.next) { | ||
case 4: | ||
signature = _context9.sent; | ||
return _context9.abrupt("return", signature); | ||
eventWithSig = _context9.sent; | ||
return _context9.abrupt("return", eventWithSig); | ||
case 6: | ||
@@ -1154,3 +1154,3 @@ case "end": | ||
var _delegate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(delegatee, conditions) { | ||
var sig; | ||
var delegation; | ||
return _regeneratorRuntime().wrap(function _callee11$(_context11) { | ||
@@ -1201,4 +1201,4 @@ while (1) switch (_context11.prev = _context11.next) { | ||
case 13: | ||
sig = _context11.sent; | ||
return _context11.abrupt("return", sig); | ||
delegation = _context11.sent; | ||
return _context11.abrupt("return", delegation); | ||
case 15: | ||
@@ -1205,0 +1205,0 @@ case "end": |
{ | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -64,4 +64,4 @@ "main": "dist/index.js", | ||
"events": "^3.3.0", | ||
"nostr-tools": "^1.6.0" | ||
"nostr-tools": "^1.7.4" | ||
} | ||
} |
import EventEmitter from 'events'; | ||
import { Event, getPublicKey, nip04, Kind } from 'nostr-tools'; | ||
import { nip26 } from 'nostr-tools'; | ||
@@ -8,3 +9,3 @@ import { isValidRequest, NostrRPC } from './rpc'; | ||
name: string; | ||
url: string; | ||
url?: string; | ||
description?: string; | ||
@@ -222,6 +223,6 @@ icons?: string[]; | ||
created_at: number; | ||
}): Promise<string> { | ||
}): Promise<Event> { | ||
if (!this.target) throw new Error('Not connected'); | ||
const signature = await this.rpc.call({ | ||
const eventWithSig = await this.rpc.call({ | ||
target: this.target, | ||
@@ -234,3 +235,3 @@ request: { | ||
return signature as string; | ||
return eventWithSig as Event; | ||
} | ||
@@ -258,3 +259,3 @@ | ||
} | ||
): Promise<string> { | ||
): Promise<nip26.Delegation> { | ||
if (!this.target) throw new Error('Not connected'); | ||
@@ -277,3 +278,3 @@ | ||
const sig = await this.rpc.call({ | ||
const delegation = await this.rpc.call({ | ||
target: this.target, | ||
@@ -285,3 +286,3 @@ request: { | ||
}); | ||
return sig as string; | ||
return delegation as nip26.Delegation; | ||
} | ||
@@ -288,0 +289,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234662
3308
Updatednostr-tools@^1.7.4