2024-09-26 15:50:28 +03:00
|
|
|
interface OpenTimestamps {
|
|
|
|
// Create a detached timestamp file from a buffer or file hash
|
|
|
|
DetachedTimestampFile: {
|
|
|
|
fromHash(op: any, hash: Uint8Array): any
|
2024-09-27 16:03:40 +03:00
|
|
|
fromBytes(op: any, buffer: Uint8Array): any
|
2024-10-02 14:47:32 +02:00
|
|
|
deserialize(buffer: any): any
|
2024-09-26 15:50:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Stamp the provided timestamp file and return a Promise
|
|
|
|
stamp(file: any): Promise<void>
|
|
|
|
|
|
|
|
// Verify the provided timestamp proof file
|
2024-10-06 15:37:04 +02:00
|
|
|
verify(
|
|
|
|
ots: string,
|
|
|
|
file: string
|
|
|
|
): Promise<TimestampVerficiationResponse | Record<string, never>>
|
2024-09-26 15:50:28 +03:00
|
|
|
|
|
|
|
// Other utilities or operations (like OpSHA256, serialization)
|
|
|
|
Ops: {
|
|
|
|
OpSHA256: any
|
|
|
|
OpSHA1?: any
|
|
|
|
}
|
|
|
|
|
|
|
|
Context: {
|
|
|
|
StreamSerialization: any
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load a timestamp file from a buffer
|
|
|
|
deserialize(bytes: Uint8Array): any
|
|
|
|
|
|
|
|
// Other potential methods based on repo functions
|
2024-10-02 14:47:32 +02:00
|
|
|
upgrade(file: any): Promise<boolean>
|
2024-09-26 15:50:28 +03:00
|
|
|
}
|
2024-10-06 15:37:04 +02:00
|
|
|
|
|
|
|
interface TimestampVerficiationResponse {
|
|
|
|
bitcoin: { timestamp: number; height: number }
|
|
|
|
}
|