NIP-94 file headers (#488)

* feat: NIP-94 file headers

* Merge NIP-81 tags

* disable embedding nip94 for now

* merge error

* disable broken test

* bugfixes

* bug: validation failure
This commit is contained in:
2023-04-17 11:57:13 +01:00
committed by GitHub
parent c294f5f0bd
commit c59dda1e49
12 changed files with 134 additions and 25 deletions

View File

@ -1,11 +1,18 @@
import useLogin from "Hooks/useLogin";
import { RawEvent } from "@snort/nostr";
import NostrBuild from "Upload/NostrBuild";
import VoidCat from "Upload/VoidCat";
import NostrImg from "./NostrImg";
import NostrImg from "Upload/NostrImg";
export interface UploadResult {
url?: string;
error?: string;
/**
* NIP-94 File Header
*/
header?: RawEvent;
}
export interface Uploader {
@ -14,6 +21,7 @@ export interface Uploader {
export default function useFileUpload(): Uploader {
const fileUploader = useLogin().preferences.fileUploader;
//const publisher = useEventPublisher();
switch (fileUploader) {
case "nostr.build": {
@ -28,7 +36,7 @@ export default function useFileUpload(): Uploader {
}
default: {
return {
upload: VoidCat,
upload: (f, n) => VoidCat(f, n, undefined),
} as Uploader;
}
}