Tag published photos (kind 360), deletions (kind 5) and zap requests (kind 9734) with ["client","Marco","31990:1f79058c…:marco.earth","wss://nostr.kosmos.org/"] so clients can attribute them to Marco. Uses applesauce's EventFactory clientTag via a shared app/utils/client-tag helper.
22 lines
803 B
JavaScript
22 lines
803 B
JavaScript
// NIP-89 `client` tag for events published by Marco. It points at Marco's own
|
|
// app handler (kind 31990) so other clients can attribute the event to the app.
|
|
|
|
export const MARCO_CLIENT_NAME = 'Marco';
|
|
|
|
export const MARCO_HANDLER_POINTER = {
|
|
pubkey: '1f79058c77a224e5be226c8f024cacdad4d741855d75ed9f11473ba8eb86e1cb',
|
|
identifier: 'marco.earth',
|
|
relays: ['wss://nostr.kosmos.org'],
|
|
};
|
|
|
|
/**
|
|
* Adds the NIP-89 client tag to an EventFactory (or subclass) and returns it,
|
|
* so it can be chained: `withMarcoClientTag(factory).as(signer).sign()`.
|
|
*
|
|
* @param {object} factory An applesauce EventFactory
|
|
* @returns {object} The same factory with the client tag operation queued
|
|
*/
|
|
export function withMarcoClientTag(factory) {
|
|
return factory.clientTag(MARCO_CLIENT_NAME, MARCO_HANDLER_POINTER);
|
|
}
|