originstamp-client-fetch
Version:
TypeScript Fetch client for the OriginStamp service
123 lines (112 loc) • 4.09 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* OriginStamp Timestamping
* OriginStamp Timestamping leverages decentralized blockchain technology to create anonymous, tamper-proof timestamps for digital content. This service enables users to timestamp files, emails, or plain text, and store the resulting hashes on the blockchain. Users can also retrieve and verify timestamps that have been committed. The trusted timestamping mechanism ensures that a hash fingerprint can be generated and used as proof that specific data existed at a given point in time.
*
* The version of the OpenAPI document: 1.0.0
* Contact: support@originstamp.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface TimestampData
*/
export interface TimestampData {
/**
* ID of associated seed which can be used to request separate seed information.
* @type {string}
* @memberof TimestampData
*/
treeId: string;
/**
* 0: Bitcoin
* @type {number}
* @memberof TimestampData
*/
currencyId: number;
/**
* Acronym for blockchain.
* @type {string}
* @memberof TimestampData
*/
currency: string;
/**
* The submit status of the hash:
*
* 0: the hash was not broadcasted yet
* 1: the hash was included into a transaction and broadcasted to the network, but not included into a block
* 2: the transaction was included into the latest block
* 3: the timestamp for your hash was successfully created.
* @type {number}
* @memberof TimestampData
*/
submitStatus: number;
/**
* The date is returned in the following format: [ms] since 1.1.1970 (unix epoch), timezone: UTC. This is a true timestamp.
* @type {number}
* @memberof TimestampData
*/
timestamp?: number;
/**
*
* @type {string}
* @memberof TimestampData
*/
rootSha256?: string;
/**
* If available: the transaction hash on the blockchain.
* @type {string}
* @memberof TimestampData
*/
transaction?: string;
}
/**
* Check if a given object implements the TimestampData interface.
*/
export function instanceOfTimestampData(value: object): value is TimestampData {
if (!('treeId' in value) || value['treeId'] === undefined) return false;
if (!('currencyId' in value) || value['currencyId'] === undefined) return false;
if (!('currency' in value) || value['currency'] === undefined) return false;
if (!('submitStatus' in value) || value['submitStatus'] === undefined) return false;
return true;
}
export function TimestampDataFromJSON(json: any): TimestampData {
return TimestampDataFromJSONTyped(json, false);
}
export function TimestampDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimestampData {
if (json == null) {
return json;
}
return {
'treeId': json['treeId'],
'currencyId': json['currencyId'],
'currency': json['currency'],
'submitStatus': json['submitStatus'],
'timestamp': json['timestamp'] == null ? undefined : json['timestamp'],
'rootSha256': json['rootSha256'] == null ? undefined : json['rootSha256'],
'transaction': json['transaction'] == null ? undefined : json['transaction'],
};
}
export function TimestampDataToJSON(json: any): TimestampData {
return TimestampDataToJSONTyped(json, false);
}
export function TimestampDataToJSONTyped(value?: TimestampData | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'treeId': value['treeId'],
'currencyId': value['currencyId'],
'currency': value['currency'],
'submitStatus': value['submitStatus'],
'timestamp': value['timestamp'],
'rootSha256': value['rootSha256'],
'transaction': value['transaction'],
};
}