mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 07:34:28 +01:00
- Add project structure with TypeScript, React, and Vite - Implement nostr authentication using browser extension (NIP-07) - Add NIP-51 compliant bookmark fetching and display - Create minimal UI with login and bookmark components - Integrate applesauce-core and applesauce-react libraries - Add responsive styling with dark/light mode support - Include comprehensive README with setup instructions This is a minimal MVP for a nostr bookmark client that allows users to view their bookmarks according to NIP-51 specification.
65 lines
1.9 KiB
TypeScript
65 lines
1.9 KiB
TypeScript
import { ProjPointType } from '@noble/curves/abstract/weierstrass';
|
|
export type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
|
|
export type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
export type MintKeys = {
|
|
[k: string]: Uint8Array;
|
|
};
|
|
export type SerializedMintKeys = {
|
|
[k: string]: string;
|
|
};
|
|
export type Keyset = {
|
|
id: string;
|
|
unit: string;
|
|
active: boolean;
|
|
};
|
|
export type BlindSignature = {
|
|
C_: ProjPointType<bigint>;
|
|
amount: number;
|
|
id: string;
|
|
};
|
|
export type SerializedBlindSignature = {
|
|
C_: string;
|
|
amount: number;
|
|
id: string;
|
|
};
|
|
export type Proof = {
|
|
C: ProjPointType<bigint>;
|
|
secret: Uint8Array;
|
|
amount: number;
|
|
id: string;
|
|
witness?: Witness;
|
|
};
|
|
export type SerializedProof = {
|
|
C: string;
|
|
secret: string;
|
|
amount: number;
|
|
id: string;
|
|
witness?: string;
|
|
};
|
|
export type SerializedBlindedMessage = {
|
|
B_: string;
|
|
amount: number;
|
|
witness?: string;
|
|
};
|
|
export type Secret = [WellKnownSecret, SecretData];
|
|
export type WellKnownSecret = 'P2PK';
|
|
export type SecretData = {
|
|
nonce: string;
|
|
data: string;
|
|
tags?: Array<Array<string>>;
|
|
};
|
|
export type Witness = {
|
|
signatures: Array<string>;
|
|
};
|
|
export type Tags = {
|
|
[k: string]: string;
|
|
};
|
|
export type SigFlag = 'SIG_INPUTS' | 'SIG_ALL';
|
|
export declare function hashToCurve(secret: Uint8Array): ProjPointType<bigint>;
|
|
export declare function pointFromHex(hex: string): ProjPointType<bigint>;
|
|
export declare const getKeysetIdInt: (keysetId: string) => bigint;
|
|
export declare function createRandomPrivateKey(): Uint8Array;
|
|
export declare function serializeMintKeys(mintKeys: MintKeys): SerializedMintKeys;
|
|
export declare function deserializeMintKeys(serializedMintKeys: SerializedMintKeys): MintKeys;
|
|
export declare function deriveKeysetId(keys: MintKeys): string;
|
|
//# sourceMappingURL=index.d.ts.map
|