2024-04-29 18:55:15 +03:00
|
|
|
import type { NetIdType } from './networkConfig';
|
2024-10-16 17:19:49 +03:00
|
|
|
export interface DepositType {
|
2024-04-29 18:55:15 +03:00
|
|
|
currency: string;
|
|
|
|
amount: string;
|
|
|
|
netId: NetIdType;
|
2024-10-16 17:19:49 +03:00
|
|
|
}
|
|
|
|
export interface createDepositParams {
|
2024-04-29 18:55:15 +03:00
|
|
|
nullifier: bigint;
|
|
|
|
secret: bigint;
|
2024-10-16 17:19:49 +03:00
|
|
|
}
|
|
|
|
export interface createDepositObject {
|
2024-04-29 18:55:15 +03:00
|
|
|
preimage: Uint8Array;
|
|
|
|
noteHex: string;
|
|
|
|
commitment: bigint;
|
|
|
|
commitmentHex: string;
|
|
|
|
nullifierHash: bigint;
|
|
|
|
nullifierHex: string;
|
2024-10-16 17:19:49 +03:00
|
|
|
}
|
|
|
|
export interface createNoteParams extends DepositType {
|
2024-04-29 18:55:15 +03:00
|
|
|
nullifier?: bigint;
|
|
|
|
secret?: bigint;
|
2024-10-16 17:19:49 +03:00
|
|
|
}
|
|
|
|
export interface parsedNoteExec extends DepositType {
|
2024-04-29 18:55:15 +03:00
|
|
|
note: string;
|
2024-10-24 15:38:27 +03:00
|
|
|
noteHex: string;
|
|
|
|
}
|
|
|
|
export interface parsedInvoiceExec extends DepositType {
|
|
|
|
invoice: string;
|
|
|
|
commitmentHex: string;
|
2024-10-16 17:19:49 +03:00
|
|
|
}
|
2024-10-24 15:38:27 +03:00
|
|
|
export declare function parseNote(noteString: string): parsedNoteExec | undefined;
|
|
|
|
export declare function parseInvoice(invoiceString: string): parsedInvoiceExec | undefined;
|
2024-04-29 18:55:15 +03:00
|
|
|
export declare function createDeposit({ nullifier, secret }: createDepositParams): Promise<createDepositObject>;
|
|
|
|
export interface DepositConstructor {
|
|
|
|
currency: string;
|
|
|
|
amount: string;
|
|
|
|
netId: NetIdType;
|
|
|
|
nullifier: bigint;
|
|
|
|
secret: bigint;
|
|
|
|
note: string;
|
|
|
|
noteHex: string;
|
|
|
|
invoice: string;
|
|
|
|
commitmentHex: string;
|
|
|
|
nullifierHex: string;
|
|
|
|
}
|
|
|
|
export declare class Deposit {
|
|
|
|
currency: string;
|
|
|
|
amount: string;
|
|
|
|
netId: NetIdType;
|
|
|
|
nullifier: bigint;
|
|
|
|
secret: bigint;
|
|
|
|
note: string;
|
|
|
|
noteHex: string;
|
|
|
|
invoice: string;
|
|
|
|
commitmentHex: string;
|
|
|
|
nullifierHex: string;
|
|
|
|
constructor({ currency, amount, netId, nullifier, secret, note, noteHex, invoice, commitmentHex, nullifierHex, }: DepositConstructor);
|
|
|
|
toString(): string;
|
|
|
|
static createNote({ currency, amount, netId, nullifier, secret }: createNoteParams): Promise<Deposit>;
|
|
|
|
static parseNote(noteString: string): Promise<Deposit>;
|
|
|
|
}
|
|
|
|
export declare class Invoice {
|
|
|
|
currency: string;
|
|
|
|
amount: string;
|
|
|
|
netId: NetIdType;
|
2024-10-24 15:38:27 +03:00
|
|
|
commitmentHex: string;
|
2024-04-29 18:55:15 +03:00
|
|
|
invoice: string;
|
|
|
|
constructor(invoiceString: string);
|
|
|
|
toString(): string;
|
|
|
|
}
|