Commit Graph

34 Commits

Author SHA1 Message Date
fiatjaf 6367bd71d4 nip11: add "supported_grasps" special field. 2025-11-25 14:50:14 -03:00
fiatjaf 1284f91629 nip11: fix test because no.str.cr is offline again. 2025-11-23 06:57:54 -03:00
fiatjaf f69c78cba7 irrelevant minor things. 2025-09-29 16:20:19 -03:00
Jon Staab 9ba61b56e6 Add Tags.Has and nip11.Self 2025-09-27 10:48:33 -03:00
fiatjaf adcab08bd7 nip11: catch one error that wasn't. 2025-09-24 07:38:17 -03:00
fiatjaf aec2dc318d actually it's better if nip11 pubkey is a pointer. 2025-09-04 00:35:46 -03:00
fiatjaf db2c1c7653 nip11: this relay pubkey doesn't have to be a pointer. 2025-08-25 18:48:30 -03:00
fiatjaf 6ab6b49940 nip11: omitempty all the things. 2025-08-25 07:32:21 -03:00
fiatjaf 4befaa0129 nip11, nip13, nip46 changes from promenade port.
and verify pubkey validity when decoding it from an arbitrary json object.
2025-05-11 17:42:19 -03:00
fiatjaf 376834cbf9 more conversions. 2025-04-15 00:00:03 -03:00
fiatjaf b4268d649c a bunch of [32]byte conversions. still more needed. 2025-04-14 17:47:53 -03:00
Kay 40535e6b19 feat(nip11): update to nips pr nostr-protocol/nip#1821 2025-04-13 14:15:43 -03:00
fiatjaf 201abf231b fix nip11 tests again because jellyfish.land is gone. 2025-02-25 18:23:19 -03:00
fiatjaf 7e06354b6f nip11: catch invalid/small urls. 2025-02-25 08:26:59 -03:00
Kay 7189cd7e02 add banner to nip-11. 2025-02-10 09:28:23 -03:00
ZigBalthazar ddd8976d3f fix: add retention to nip-11 2025-01-14 12:26:16 -03:00
fiatjaf 72d9aac9b1 replace all ocurrences of encoding/json with json-iterator so we get rid of HTML escaping and hopefully get faster too. 2024-12-03 00:49:27 -03:00
fiatjaf a546203758 nip11: support hex nip numbers as strings. 2024-11-30 08:53:08 -03:00
fiatjaf f9271a6802 fix two tests. 2024-10-14 17:50:37 -03:00
K c91e7b9765 using testify instead of testing.T methods. (#143) 2024-09-09 07:20:56 -03:00
fiatjaf 3862333dfa nip11: always return a struct from Fetch() with URL filled. 2024-06-19 19:54:40 -03:00
fiatjaf c844dc2ccb use NormalizeURL() on nip11.Fetch() 2024-03-10 18:44:56 -03:00
Daniele Tonon ec1e86e505 Support url without protocol in nip11.Fetch 2024-03-09 16:52:28 -03:00
fiatjaf 9c4ea87d0b use stdlib "slices". 2024-02-08 16:33:39 -03:00
fiatjaf 1ff7f826c2 nip11: url normalization improvement and Fetch test. 2024-01-13 12:46:59 -03:00
fiatjaf 8a540998b9 nip11 fetch better errors. 2023-11-20 14:59:12 -03:00
fiatjaf f3c081fcd6 remove nip11 min_prefix. 2023-11-18 10:43:29 -03:00
fiatjaf b33fe374c1 nip11's info.AddSupportedNIP() 2023-11-18 10:32:15 -03:00
fiatjaf fe32ecd440 nip11: "restricted_writes". 2023-11-18 09:42:19 -03:00
Kay ac2350c722 style: using effective go and refactoring 2023-08-21 15:50:05 -03:00
Yasuhiro Matsumoto f4102ea8d2 add icon to RelayInformationDocument 2023-06-20 12:03:45 -03:00
Patrick Bennett ebae5d41e6 Add most NIP-11 extension structures to the RelayInformationDocument struct. (#80)
* Fix race condition on status in Relay.Publish method and failure to send

A race-condition exists between setting of the (unprotected) status and the callback which sets the status upon receiving an OK.
The message is sent which can receive an OK in separate goroutine (setting status) prior to the status being set to 'sent.'
The OK can be received prior to the status being set.

This fix also sets the status to PublishStatusFailed if the WriteJSON call fails.

* Add some NIP-11 extension structures to the RelayInformationDocument struct.

Added additional NIP-11 fields for relays that want to provide additional details based on NIP-11 extensions.
The retention structure has been left out as it doesn't have a clean schema for kinds (array of kinds, or pairs of kinds?)
Specified the fields w/ omitempty so marshaled will be same as original NIP-11 if nothing else is specified.
Nested structs defined as pointers so they are omitted if not specified.

* Fix TestPublishWriteFailed so that the socket is given a brief amount of time to close prior to publish being called.
The test relies on Publish always failing.
2023-04-26 08:06:05 -03:00
Dylan Cant de78b2c054 added function to fetch NIP-11 documents 2023-01-31 14:06:15 -03:00
fiatjaf 66aa4e9de2 add nip-11 type. 2022-07-11 15:51:24 -03:00