damus-io / damus

iOS nostr client
GNU General Public License v3.0
1.95k stars 290 forks source link

Detect nostr.build account #2215

Open jb55 opened 1 week ago

jb55 commented 1 week ago

We need to know if we are authed to nostr.build and have an active account. This is needed for warning about file size limits before upload.

Perhaps we can do an http nostr auth check somehow, but we would still want to know the upload size limit. We may need:

for this

fishcakeday commented 1 week ago

I can implement an API that will tell you the actual upload limit for NB and probably make it compliant with NIP-96 or any other API. Should not be too hard.

jb55 commented 1 week ago

@fishcakeday no rush, we don't have this scheduled in any sprint atm

fishcakeday commented 1 week ago

@fishcakeday no rush, we don't have this scheduled in any sprint atm

curl https://nostr.build/api/v2/upload/limit is implemented, it will check based on your NIP98 authentication or return a free upload limit by default with no headers:

{
  "status": "success",
  "message": "Upload limit retrieved successfully",
  "data": {
    "limit": 11534336
  }
}
jb55 commented 1 week ago

On Mon, May 06, 2024 at 02:52:34PM GMT, Fishcake wrote:

@fishcakeday no rush, we don't have this scheduled in any sprint atm

curl https://nostr.build/api/v2/upload/limit is implemented, it will check based on your NIP98 authentication or return a free upload limit by default with no headers:

{
 "status": "success",
 "message": "Upload limit retrieved successfully",
 "data": {
   "limit": 11534336
 }
}

perfect, thanks!