rosetta-sdk-typescript
Version:
Typescript SDK to create and interact with Rosetta API implementations.
78 lines (72 loc) • 2.04 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 {
BlockEventType,
BlockEventTypeFromJSON,
BlockEventTypeToJSON,
BlockIdentifier,
BlockIdentifierFromJSON,
BlockIdentifierToJSON,
} from './';
/**
* BlockEvent represents the addition or removal of a BlockIdentifier from storage. Streaming BlockEvents allows lightweight clients to update their own state without needing to implement their own syncing logic.
* @export
* @interface BlockEvent
*/
export interface BlockEvent {
/**
* sequence is the unique identifier of a BlockEvent within the context of a NetworkIdentifier.
* @type {number}
* @memberof BlockEvent
*/
sequence: number;
/**
*
* @type {BlockIdentifier}
* @memberof BlockEvent
*/
block_identifier: BlockIdentifier;
/**
*
* @type {BlockEventType}
* @memberof BlockEvent
*/
type: BlockEventType;
}
export function BlockEventFromJSON(json: any): BlockEvent {
return BlockEventFromJSONTyped(json, false);
}
export function BlockEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockEvent {
if (json === undefined || json === null) {
return json;
}
return {
sequence: json['sequence'],
block_identifier: BlockIdentifierFromJSON(json['block_identifier']),
type: BlockEventTypeFromJSON(json['type']),
};
}
export function BlockEventToJSON(value?: BlockEvent | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
sequence: value.sequence,
block_identifier: BlockIdentifierToJSON(value.block_identifier),
type: BlockEventTypeToJSON(value.type),
};
}