@unicitylabs/nostr-js-sdk 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/browser/index.js +253 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.min.js +7 -7
- package/dist/browser/index.min.js.map +1 -1
- package/dist/browser/index.umd.js +254 -1
- package/dist/browser/index.umd.js.map +1 -1
- package/dist/browser/index.umd.min.js +7 -7
- package/dist/browser/index.umd.min.js.map +1 -1
- package/dist/cjs/client/NostrClient.js +72 -0
- package/dist/cjs/client/NostrClient.js.map +1 -1
- package/dist/cjs/payment/PaymentRequestProtocol.js +170 -0
- package/dist/cjs/payment/PaymentRequestProtocol.js.map +1 -1
- package/dist/cjs/protocol/EventKinds.js +7 -1
- package/dist/cjs/protocol/EventKinds.js.map +1 -1
- package/dist/esm/client/NostrClient.js +72 -0
- package/dist/esm/client/NostrClient.js.map +1 -1
- package/dist/esm/payment/PaymentRequestProtocol.js +162 -0
- package/dist/esm/payment/PaymentRequestProtocol.js.map +1 -1
- package/dist/esm/protocol/EventKinds.js +6 -0
- package/dist/esm/protocol/EventKinds.js.map +1 -1
- package/dist/types/client/NostrClient.d.ts +27 -0
- package/dist/types/client/NostrClient.d.ts.map +1 -1
- package/dist/types/payment/PaymentRequestProtocol.d.ts +105 -0
- package/dist/types/payment/PaymentRequestProtocol.d.ts.map +1 -1
- package/dist/types/protocol/EventKinds.d.ts +4 -0
- package/dist/types/protocol/EventKinds.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ A TypeScript SDK for Nostr protocol with Unicity extensions. Works in both Node.
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **NIP-17 Private Messages** - Gift-wrapped private direct messages with sender anonymity
|
|
8
|
+
- **NIP-42 Client Authentication** - Automatic relay authentication for protected relays
|
|
8
9
|
- **NIP-44 Encryption** - Modern ChaCha20-Poly1305 AEAD encryption with HKDF
|
|
9
10
|
- **BIP-340 Schnorr Signatures** - Full support for secp256k1 Schnorr signatures
|
|
10
11
|
- **NIP-04 Encryption** - Legacy AES-256-CBC encryption with ECDH key agreement
|
|
@@ -470,6 +471,7 @@ const parsed = await PaymentRequestProtocol.parsePaymentRequest(event, keyManage
|
|
|
470
471
|
| 14 | CHAT_MESSAGE | Private direct message rumor (NIP-17) |
|
|
471
472
|
| 15 | READ_RECEIPT | Read receipt rumor (NIP-17) |
|
|
472
473
|
| 1059 | GIFT_WRAP | Gift-wrapped message (NIP-17) |
|
|
474
|
+
| 22242 | AUTH | Client authentication to relay (NIP-42) |
|
|
473
475
|
| 30078 | APP_DATA | Application-specific data (nametag bindings) |
|
|
474
476
|
| 31111 | AGENT_PROFILE | Agent profile information |
|
|
475
477
|
| 31112 | AGENT_LOCATION | Agent GPS location |
|
package/dist/browser/index.js
CHANGED
|
@@ -5585,6 +5585,8 @@ const REACTION = 7;
|
|
|
5585
5585
|
const GIFT_WRAP = 1059;
|
|
5586
5586
|
/** NIP-65: Relay list metadata */
|
|
5587
5587
|
const RELAY_LIST = 10002;
|
|
5588
|
+
/** NIP-42: Client authentication to relay */
|
|
5589
|
+
const AUTH = 22242;
|
|
5588
5590
|
/** NIP-78: Application-specific data (parameterized replaceable) */
|
|
5589
5591
|
const APP_DATA = 30078;
|
|
5590
5592
|
// ============================================================================
|
|
@@ -5600,6 +5602,8 @@ const TOKEN_TRANSFER = 31113;
|
|
|
5600
5602
|
const FILE_METADATA = 31114;
|
|
5601
5603
|
/** Unicity: Payment request */
|
|
5602
5604
|
const PAYMENT_REQUEST = 31115;
|
|
5605
|
+
/** Unicity: Payment request response (accept/decline) */
|
|
5606
|
+
const PAYMENT_REQUEST_RESPONSE = 31116;
|
|
5603
5607
|
// ============================================================================
|
|
5604
5608
|
// Event Kind Classification Functions
|
|
5605
5609
|
// ============================================================================
|
|
@@ -5675,6 +5679,8 @@ function getName(kind) {
|
|
|
5675
5679
|
return 'File Metadata';
|
|
5676
5680
|
case PAYMENT_REQUEST:
|
|
5677
5681
|
return 'Payment Request';
|
|
5682
|
+
case PAYMENT_REQUEST_RESPONSE:
|
|
5683
|
+
return 'Payment Request Response';
|
|
5678
5684
|
default:
|
|
5679
5685
|
if (isReplaceable(kind)) {
|
|
5680
5686
|
return `Replaceable (${kind})`;
|
|
@@ -5694,6 +5700,7 @@ var EventKinds = /*#__PURE__*/Object.freeze({
|
|
|
5694
5700
|
AGENT_LOCATION: AGENT_LOCATION,
|
|
5695
5701
|
AGENT_PROFILE: AGENT_PROFILE,
|
|
5696
5702
|
APP_DATA: APP_DATA,
|
|
5703
|
+
AUTH: AUTH,
|
|
5697
5704
|
CHAT_MESSAGE: CHAT_MESSAGE,
|
|
5698
5705
|
CONTACTS: CONTACTS,
|
|
5699
5706
|
DELETION: DELETION,
|
|
@@ -5701,6 +5708,7 @@ var EventKinds = /*#__PURE__*/Object.freeze({
|
|
|
5701
5708
|
FILE_METADATA: FILE_METADATA,
|
|
5702
5709
|
GIFT_WRAP: GIFT_WRAP,
|
|
5703
5710
|
PAYMENT_REQUEST: PAYMENT_REQUEST,
|
|
5711
|
+
PAYMENT_REQUEST_RESPONSE: PAYMENT_REQUEST_RESPONSE,
|
|
5704
5712
|
PROFILE: PROFILE,
|
|
5705
5713
|
REACTION: REACTION,
|
|
5706
5714
|
READ_RECEIPT: READ_RECEIPT,
|
|
@@ -5993,6 +6001,13 @@ const DEFAULT_QUERY_TIMEOUT_MS = 5000;
|
|
|
5993
6001
|
const DEFAULT_RECONNECT_INTERVAL_MS = 1000;
|
|
5994
6002
|
const DEFAULT_MAX_RECONNECT_INTERVAL_MS = 30000;
|
|
5995
6003
|
const DEFAULT_PING_INTERVAL_MS = 30000;
|
|
6004
|
+
/**
|
|
6005
|
+
* Delay before resubscribing after NIP-42 authentication.
|
|
6006
|
+
* This gives the relay time to process the AUTH response before we send
|
|
6007
|
+
* subscription requests. Without this delay, some relays may still reject
|
|
6008
|
+
* the subscriptions as the AUTH hasn't been fully processed yet.
|
|
6009
|
+
*/
|
|
6010
|
+
const AUTH_RESUBSCRIBE_DELAY_MS = 100;
|
|
5996
6011
|
/**
|
|
5997
6012
|
* NostrClient provides the main interface for Nostr protocol operations.
|
|
5998
6013
|
*/
|
|
@@ -6337,6 +6352,9 @@ class NostrClient {
|
|
|
6337
6352
|
case 'CLOSED':
|
|
6338
6353
|
this.handleClosedMessage(json);
|
|
6339
6354
|
break;
|
|
6355
|
+
case 'AUTH':
|
|
6356
|
+
this.handleAuthMessage(_url, json);
|
|
6357
|
+
break;
|
|
6340
6358
|
}
|
|
6341
6359
|
}
|
|
6342
6360
|
catch {
|
|
@@ -6417,6 +6435,33 @@ class NostrClient {
|
|
|
6417
6435
|
subscription.listener.onError(subscriptionId, `Subscription closed: ${message}`);
|
|
6418
6436
|
}
|
|
6419
6437
|
}
|
|
6438
|
+
/**
|
|
6439
|
+
* Handle AUTH message from relay (NIP-42 authentication challenge).
|
|
6440
|
+
*/
|
|
6441
|
+
handleAuthMessage(relayUrl, json) {
|
|
6442
|
+
if (json.length < 2)
|
|
6443
|
+
return;
|
|
6444
|
+
const challenge = json[1];
|
|
6445
|
+
const relay = this.relays.get(relayUrl);
|
|
6446
|
+
if (!relay?.socket || !relay.connected)
|
|
6447
|
+
return;
|
|
6448
|
+
// Create and sign the auth event (kind 22242)
|
|
6449
|
+
const authEvent = Event.create(this.keyManager, {
|
|
6450
|
+
kind: AUTH,
|
|
6451
|
+
tags: [
|
|
6452
|
+
['relay', relayUrl],
|
|
6453
|
+
['challenge', challenge],
|
|
6454
|
+
],
|
|
6455
|
+
content: '',
|
|
6456
|
+
});
|
|
6457
|
+
// Send AUTH response
|
|
6458
|
+
const message = JSON.stringify(['AUTH', authEvent.toJSON()]);
|
|
6459
|
+
relay.socket.send(message);
|
|
6460
|
+
// Re-send subscriptions after auth (relay may have ignored pre-auth requests)
|
|
6461
|
+
setTimeout(() => {
|
|
6462
|
+
this.resubscribeAll(relayUrl);
|
|
6463
|
+
}, AUTH_RESUBSCRIBE_DELAY_MS);
|
|
6464
|
+
}
|
|
6420
6465
|
/**
|
|
6421
6466
|
* Disconnect from all relays.
|
|
6422
6467
|
*/
|
|
@@ -6563,6 +6608,41 @@ class NostrClient {
|
|
|
6563
6608
|
const event = await PaymentRequestProtocol$1.createPaymentRequestEvent(this.keyManager, targetPubkeyHex, request);
|
|
6564
6609
|
return this.publishEvent(event);
|
|
6565
6610
|
}
|
|
6611
|
+
/**
|
|
6612
|
+
* Send a payment request response (decline/expiration notification).
|
|
6613
|
+
* @param targetPubkeyHex Original requester's public key
|
|
6614
|
+
* @param response Response details
|
|
6615
|
+
* @returns Promise that resolves with the event ID
|
|
6616
|
+
*/
|
|
6617
|
+
async sendPaymentRequestResponse(targetPubkeyHex, response) {
|
|
6618
|
+
const PaymentRequestProtocol$1 = await Promise.resolve().then(function () { return PaymentRequestProtocol; });
|
|
6619
|
+
const event = await PaymentRequestProtocol$1.createPaymentRequestResponseEvent(this.keyManager, targetPubkeyHex, {
|
|
6620
|
+
requestId: response.requestId,
|
|
6621
|
+
originalEventId: response.originalEventId,
|
|
6622
|
+
status: response.status === 'DECLINED'
|
|
6623
|
+
? PaymentRequestProtocol$1.ResponseStatus.DECLINED
|
|
6624
|
+
: PaymentRequestProtocol$1.ResponseStatus.EXPIRED,
|
|
6625
|
+
reason: response.reason,
|
|
6626
|
+
});
|
|
6627
|
+
return this.publishEvent(event);
|
|
6628
|
+
}
|
|
6629
|
+
/**
|
|
6630
|
+
* Send a payment request decline response.
|
|
6631
|
+
* Convenience method for declining a payment request.
|
|
6632
|
+
* @param originalRequestSenderPubkey Pubkey of who sent the original payment request
|
|
6633
|
+
* @param originalEventId Event ID of the original payment request
|
|
6634
|
+
* @param requestId Request ID from the original payment request
|
|
6635
|
+
* @param reason Optional reason for declining
|
|
6636
|
+
* @returns Promise that resolves with the event ID
|
|
6637
|
+
*/
|
|
6638
|
+
async sendPaymentRequestDecline(originalRequestSenderPubkey, originalEventId, requestId, reason) {
|
|
6639
|
+
return this.sendPaymentRequestResponse(originalRequestSenderPubkey, {
|
|
6640
|
+
requestId,
|
|
6641
|
+
originalEventId,
|
|
6642
|
+
status: 'DECLINED',
|
|
6643
|
+
reason,
|
|
6644
|
+
});
|
|
6645
|
+
}
|
|
6566
6646
|
/**
|
|
6567
6647
|
* Publish a nametag binding.
|
|
6568
6648
|
* @param nametagId Nametag identifier
|
|
@@ -10198,6 +10278,20 @@ var TokenTransferProtocol = /*#__PURE__*/Object.freeze({
|
|
|
10198
10278
|
*/
|
|
10199
10279
|
/** Prefix for payment request messages */
|
|
10200
10280
|
const MESSAGE_PREFIX = 'payment_request:';
|
|
10281
|
+
/** Prefix for payment request response messages */
|
|
10282
|
+
const RESPONSE_PREFIX = 'payment_request_response:';
|
|
10283
|
+
/** Default deadline duration: 5 minutes in milliseconds */
|
|
10284
|
+
const DEFAULT_DEADLINE_MS = 5 * 60 * 1000;
|
|
10285
|
+
/**
|
|
10286
|
+
* Payment request response status.
|
|
10287
|
+
*/
|
|
10288
|
+
var ResponseStatus;
|
|
10289
|
+
(function (ResponseStatus) {
|
|
10290
|
+
/** Payment request was declined by the recipient */
|
|
10291
|
+
ResponseStatus["DECLINED"] = "DECLINED";
|
|
10292
|
+
/** Payment request expired (deadline passed) */
|
|
10293
|
+
ResponseStatus["EXPIRED"] = "EXPIRED";
|
|
10294
|
+
})(ResponseStatus || (ResponseStatus = {}));
|
|
10201
10295
|
/**
|
|
10202
10296
|
* Generate a short unique request ID.
|
|
10203
10297
|
*/
|
|
@@ -10238,6 +10332,13 @@ function generateRequestId() {
|
|
|
10238
10332
|
async function createPaymentRequestEvent(keyManager, targetPubkeyHex, request) {
|
|
10239
10333
|
// Generate request ID if not provided
|
|
10240
10334
|
const requestId = request.requestId || generateRequestId();
|
|
10335
|
+
// Calculate deadline: use provided value, or default to 5 minutes from now
|
|
10336
|
+
// If explicitly set to null, no deadline
|
|
10337
|
+
const deadline = request.deadline === null
|
|
10338
|
+
? null
|
|
10339
|
+
: request.deadline !== undefined
|
|
10340
|
+
? request.deadline
|
|
10341
|
+
: Date.now() + DEFAULT_DEADLINE_MS;
|
|
10241
10342
|
// Serialize request to JSON
|
|
10242
10343
|
const requestJson = JSON.stringify({
|
|
10243
10344
|
amount: String(request.amount), // Convert to string for JSON compatibility with bigint
|
|
@@ -10245,6 +10346,7 @@ async function createPaymentRequestEvent(keyManager, targetPubkeyHex, request) {
|
|
|
10245
10346
|
message: request.message,
|
|
10246
10347
|
recipientNametag: request.recipientNametag,
|
|
10247
10348
|
requestId: requestId,
|
|
10349
|
+
deadline: deadline,
|
|
10248
10350
|
});
|
|
10249
10351
|
// Add prefix and encrypt
|
|
10250
10352
|
const message = MESSAGE_PREFIX + requestJson;
|
|
@@ -10316,6 +10418,7 @@ async function parsePaymentRequest(event, keyManager) {
|
|
|
10316
10418
|
senderPubkey: event.pubkey,
|
|
10317
10419
|
timestamp: event.created_at * 1000, // Convert to milliseconds
|
|
10318
10420
|
eventId: event.id,
|
|
10421
|
+
deadline: parsed.deadline !== undefined ? parsed.deadline : null,
|
|
10319
10422
|
};
|
|
10320
10423
|
}
|
|
10321
10424
|
/**
|
|
@@ -10413,18 +10516,166 @@ function parseAmount(amountStr, decimals = 8) {
|
|
|
10413
10516
|
const fractionalPart = BigInt(fractionalStr);
|
|
10414
10517
|
return wholePart * multiplier + fractionalPart;
|
|
10415
10518
|
}
|
|
10519
|
+
// ============================================================================
|
|
10520
|
+
// Payment Request Response Functions
|
|
10521
|
+
// ============================================================================
|
|
10522
|
+
/**
|
|
10523
|
+
* Check if a parsed payment request has expired.
|
|
10524
|
+
* @param request Parsed payment request
|
|
10525
|
+
* @returns true if the request has a deadline and it has passed
|
|
10526
|
+
*/
|
|
10527
|
+
function isExpired(request) {
|
|
10528
|
+
return request.deadline !== null && Date.now() > request.deadline;
|
|
10529
|
+
}
|
|
10530
|
+
/**
|
|
10531
|
+
* Get remaining time until deadline in milliseconds.
|
|
10532
|
+
* @param request Parsed payment request
|
|
10533
|
+
* @returns Remaining time in ms, 0 if expired, null if no deadline
|
|
10534
|
+
*/
|
|
10535
|
+
function getRemainingTimeMs(request) {
|
|
10536
|
+
if (request.deadline === null)
|
|
10537
|
+
return null;
|
|
10538
|
+
const remaining = request.deadline - Date.now();
|
|
10539
|
+
return remaining > 0 ? remaining : 0;
|
|
10540
|
+
}
|
|
10541
|
+
/**
|
|
10542
|
+
* Create a payment request response event (for decline/expiration).
|
|
10543
|
+
*
|
|
10544
|
+
* Event structure:
|
|
10545
|
+
* - Kind: 31116 (PAYMENT_REQUEST_RESPONSE)
|
|
10546
|
+
* - Tags:
|
|
10547
|
+
* - ["p", "<target_pubkey_hex>"] - Original requester
|
|
10548
|
+
* - ["type", "payment_request_response"]
|
|
10549
|
+
* - ["status", "DECLINED" | "EXPIRED"]
|
|
10550
|
+
* - ["e", "<original_event_id>", "", "reply"] - Reference to original request
|
|
10551
|
+
* - Content: NIP-04 encrypted response JSON
|
|
10552
|
+
*
|
|
10553
|
+
* @param keyManager Key manager with signing keys
|
|
10554
|
+
* @param targetPubkeyHex Original requester's public key
|
|
10555
|
+
* @param response Response details
|
|
10556
|
+
* @returns Signed event
|
|
10557
|
+
*/
|
|
10558
|
+
async function createPaymentRequestResponseEvent(keyManager, targetPubkeyHex, response) {
|
|
10559
|
+
// Serialize response to JSON
|
|
10560
|
+
const responseJson = JSON.stringify({
|
|
10561
|
+
requestId: response.requestId,
|
|
10562
|
+
originalEventId: response.originalEventId,
|
|
10563
|
+
status: response.status,
|
|
10564
|
+
reason: response.reason,
|
|
10565
|
+
});
|
|
10566
|
+
// Add prefix and encrypt
|
|
10567
|
+
const message = RESPONSE_PREFIX + responseJson;
|
|
10568
|
+
const encryptedContent = await keyManager.encryptHex(message, targetPubkeyHex);
|
|
10569
|
+
// Build tags
|
|
10570
|
+
const tags = [
|
|
10571
|
+
['p', targetPubkeyHex],
|
|
10572
|
+
['type', 'payment_request_response'],
|
|
10573
|
+
['status', response.status],
|
|
10574
|
+
];
|
|
10575
|
+
// Add reference to original event
|
|
10576
|
+
if (response.originalEventId) {
|
|
10577
|
+
tags.push(['e', response.originalEventId, '', 'reply']);
|
|
10578
|
+
}
|
|
10579
|
+
const event = Event.create(keyManager, {
|
|
10580
|
+
kind: PAYMENT_REQUEST_RESPONSE,
|
|
10581
|
+
tags,
|
|
10582
|
+
content: encryptedContent,
|
|
10583
|
+
});
|
|
10584
|
+
return event;
|
|
10585
|
+
}
|
|
10586
|
+
/**
|
|
10587
|
+
* Parse a payment request response event.
|
|
10588
|
+
* Decrypts and parses the response data.
|
|
10589
|
+
*
|
|
10590
|
+
* @param event Payment request response event
|
|
10591
|
+
* @param keyManager Key manager for decryption
|
|
10592
|
+
* @returns Parsed payment request response
|
|
10593
|
+
* @throws Error if the event is not a valid payment request response
|
|
10594
|
+
*/
|
|
10595
|
+
async function parsePaymentRequestResponse(event, keyManager) {
|
|
10596
|
+
// Verify event kind
|
|
10597
|
+
if (event.kind !== PAYMENT_REQUEST_RESPONSE) {
|
|
10598
|
+
throw new Error('Event is not a payment request response');
|
|
10599
|
+
}
|
|
10600
|
+
// Determine the peer's public key for decryption
|
|
10601
|
+
let peerPubkeyHex;
|
|
10602
|
+
if (keyManager.isMyPublicKey(event.pubkey)) {
|
|
10603
|
+
// We sent this response, decrypt with target's key
|
|
10604
|
+
const targetPubkey = event.getTagValue('p');
|
|
10605
|
+
if (!targetPubkey) {
|
|
10606
|
+
throw new Error('No target found in event');
|
|
10607
|
+
}
|
|
10608
|
+
peerPubkeyHex = targetPubkey;
|
|
10609
|
+
}
|
|
10610
|
+
else {
|
|
10611
|
+
// We received this response, decrypt with sender's key
|
|
10612
|
+
peerPubkeyHex = event.pubkey;
|
|
10613
|
+
}
|
|
10614
|
+
// Decrypt the content
|
|
10615
|
+
const decrypted = await keyManager.decryptHex(event.content, peerPubkeyHex);
|
|
10616
|
+
// Validate prefix
|
|
10617
|
+
if (!decrypted.startsWith(RESPONSE_PREFIX)) {
|
|
10618
|
+
throw new Error('Invalid payment request response format: missing prefix');
|
|
10619
|
+
}
|
|
10620
|
+
// Parse JSON
|
|
10621
|
+
const responseJson = decrypted.slice(RESPONSE_PREFIX.length);
|
|
10622
|
+
const parsed = JSON.parse(responseJson);
|
|
10623
|
+
return {
|
|
10624
|
+
requestId: parsed.requestId,
|
|
10625
|
+
originalEventId: parsed.originalEventId,
|
|
10626
|
+
status: parsed.status,
|
|
10627
|
+
reason: parsed.reason,
|
|
10628
|
+
senderPubkey: event.pubkey,
|
|
10629
|
+
eventId: event.id,
|
|
10630
|
+
timestamp: event.created_at * 1000,
|
|
10631
|
+
};
|
|
10632
|
+
}
|
|
10633
|
+
/**
|
|
10634
|
+
* Check if an event is a payment request response.
|
|
10635
|
+
* @param event Event to check
|
|
10636
|
+
* @returns true if the event is a payment request response
|
|
10637
|
+
*/
|
|
10638
|
+
function isPaymentRequestResponse(event) {
|
|
10639
|
+
return (event.kind === PAYMENT_REQUEST_RESPONSE &&
|
|
10640
|
+
event.getTagValue('type') === 'payment_request_response');
|
|
10641
|
+
}
|
|
10642
|
+
/**
|
|
10643
|
+
* Get the response status from a payment request response event (from unencrypted tag).
|
|
10644
|
+
* @param event Payment request response event
|
|
10645
|
+
* @returns Status string, or undefined if not found
|
|
10646
|
+
*/
|
|
10647
|
+
function getResponseStatus(event) {
|
|
10648
|
+
return event.getTagValue('status');
|
|
10649
|
+
}
|
|
10650
|
+
/**
|
|
10651
|
+
* Get the referenced original event ID from the response event.
|
|
10652
|
+
* @param event Payment request response event
|
|
10653
|
+
* @returns Original event ID, or undefined if not found
|
|
10654
|
+
*/
|
|
10655
|
+
function getOriginalEventId(event) {
|
|
10656
|
+
return event.getTagValue('e');
|
|
10657
|
+
}
|
|
10416
10658
|
|
|
10417
10659
|
var PaymentRequestProtocol = /*#__PURE__*/Object.freeze({
|
|
10418
10660
|
__proto__: null,
|
|
10661
|
+
DEFAULT_DEADLINE_MS: DEFAULT_DEADLINE_MS,
|
|
10662
|
+
get ResponseStatus () { return ResponseStatus; },
|
|
10419
10663
|
createPaymentRequestEvent: createPaymentRequestEvent,
|
|
10664
|
+
createPaymentRequestResponseEvent: createPaymentRequestResponseEvent,
|
|
10420
10665
|
formatAmount: formatAmount,
|
|
10421
10666
|
getAmount: getAmount,
|
|
10667
|
+
getOriginalEventId: getOriginalEventId,
|
|
10422
10668
|
getRecipientNametag: getRecipientNametag,
|
|
10669
|
+
getRemainingTimeMs: getRemainingTimeMs,
|
|
10670
|
+
getResponseStatus: getResponseStatus,
|
|
10423
10671
|
getSender: getSender,
|
|
10424
10672
|
getTarget: getTarget,
|
|
10673
|
+
isExpired: isExpired,
|
|
10425
10674
|
isPaymentRequest: isPaymentRequest,
|
|
10675
|
+
isPaymentRequestResponse: isPaymentRequestResponse,
|
|
10426
10676
|
parseAmount: parseAmount,
|
|
10427
|
-
parsePaymentRequest: parsePaymentRequest
|
|
10677
|
+
parsePaymentRequest: parsePaymentRequest,
|
|
10678
|
+
parsePaymentRequestResponse: parsePaymentRequestResponse
|
|
10428
10679
|
});
|
|
10429
10680
|
|
|
10430
10681
|
/**
|
|
@@ -10443,5 +10694,5 @@ function isReadReceipt(message) {
|
|
|
10443
10694
|
return message.kind === 15;
|
|
10444
10695
|
}
|
|
10445
10696
|
|
|
10446
|
-
export { AGENT_LOCATION, AGENT_PROFILE, APP_DATA, bech32 as Bech32, CHAT_MESSAGE, CLOSED, CLOSING, CONNECTING, CONTACTS, CallbackEventListener, DELETION, ENCRYPTED_DM, Event, EventKinds, FILE_METADATA, Filter, FilterBuilder, GIFT_WRAP, nip04 as NIP04, nip17 as NIP17, nip44 as NIP44, NametagBinding, NametagUtils, NostrClient, NostrKeyManager, OPEN, PAYMENT_REQUEST, PROFILE, PaymentRequestProtocol, REACTION, READ_RECEIPT, RECOMMEND_RELAY, RELAY_LIST, SEAL, schnorr as SchnorrSigner, TEXT_NOTE, TOKEN_TRANSFER, TokenTransferProtocol, areSameNametag, createBindingEvent, createGiftWrap, createNametagToPubkeyFilter, createPubkeyToNametagFilter, createReadReceipt, createWebSocket, decode, decodeNpub, decodeNsec, encode, encodeNpub, encodeNsec, extractMessageData, formatForDisplay, getName, getPublicKey, getPublicKeyHex, hashNametag, isChatMessage, isEphemeral, isParameterizedReplaceable, isPhoneNumber, isReadReceipt, isReplaceable, isValidBindingEvent, normalizeNametag, parseAddressFromEvent, parseNametagHashFromEvent, sign, signHex, unwrap, verify, verifyHex };
|
|
10697
|
+
export { AGENT_LOCATION, AGENT_PROFILE, APP_DATA, AUTH, bech32 as Bech32, CHAT_MESSAGE, CLOSED, CLOSING, CONNECTING, CONTACTS, CallbackEventListener, DELETION, ENCRYPTED_DM, Event, EventKinds, FILE_METADATA, Filter, FilterBuilder, GIFT_WRAP, nip04 as NIP04, nip17 as NIP17, nip44 as NIP44, NametagBinding, NametagUtils, NostrClient, NostrKeyManager, OPEN, PAYMENT_REQUEST, PAYMENT_REQUEST_RESPONSE, PROFILE, PaymentRequestProtocol, REACTION, READ_RECEIPT, RECOMMEND_RELAY, RELAY_LIST, SEAL, schnorr as SchnorrSigner, TEXT_NOTE, TOKEN_TRANSFER, TokenTransferProtocol, areSameNametag, createBindingEvent, createGiftWrap, createNametagToPubkeyFilter, createPubkeyToNametagFilter, createReadReceipt, createWebSocket, decode, decodeNpub, decodeNsec, encode, encodeNpub, encodeNsec, extractMessageData, formatForDisplay, getName, getPublicKey, getPublicKeyHex, hashNametag, isChatMessage, isEphemeral, isParameterizedReplaceable, isPhoneNumber, isReadReceipt, isReplaceable, isValidBindingEvent, normalizeNametag, parseAddressFromEvent, parseNametagHashFromEvent, sign, signHex, unwrap, verify, verifyHex };
|
|
10447
10698
|
//# sourceMappingURL=index.js.map
|