rosetta-sdk-typescript
Version:
Typescript SDK to create and interact with Rosetta API implementations.
63 lines (57 loc) • 1.95 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Rosetta
* Build Once. Integrate Your Blockchain Everywhere.
*
* The version of the OpenAPI document: 1.4.10
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { BlockEvent, BlockEventFromJSON, BlockEventToJSON } from './';
/**
* EventsBlocksResponse contains an ordered collection of BlockEvents and the max retrievable sequence.
* @export
* @interface EventsBlocksResponse
*/
export interface EventsBlocksResponse {
/**
* max_sequence is the maximum available sequence number to fetch.
* @type {number}
* @memberof EventsBlocksResponse
*/
max_sequence: number;
/**
* events is an array of BlockEvents indicating the order to add and remove blocks to maintain a canonical view of blockchain state. Lightweight clients can use this event stream to update state without implementing their own block syncing logic.
* @type {Array<BlockEvent>}
* @memberof EventsBlocksResponse
*/
events: Array<BlockEvent>;
}
export function EventsBlocksResponseFromJSON(json: any): EventsBlocksResponse {
return EventsBlocksResponseFromJSONTyped(json, false);
}
export function EventsBlocksResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsBlocksResponse {
if (json === undefined || json === null) {
return json;
}
return {
max_sequence: json['max_sequence'],
events: (json['events'] as Array<any>).map(BlockEventFromJSON),
};
}
export function EventsBlocksResponseToJSON(value?: EventsBlocksResponse | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
max_sequence: value.max_sequence,
events: (value.events as Array<any>).map(BlockEventToJSON),
};
}