rosetta-sdk-typescript
Version:
Typescript SDK to create and interact with Rosetta API implementations.
62 lines (57 loc) • 1.3 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 { exists } from '../runtime';
/**
* A Peer is a representation of a node's peer.
* @export
* @interface Peer
*/
export interface Peer {
/**
*
* @type {string}
* @memberof Peer
*/
peer_id: string;
/**
*
* @type {object}
* @memberof Peer
*/
metadata?: object;
}
export function PeerFromJSON(json: any): Peer {
return PeerFromJSONTyped(json, false);
}
export function PeerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Peer {
if (json === undefined || json === null) {
return json;
}
return {
peer_id: json['peer_id'],
metadata: !exists(json, 'metadata') ? undefined : json['metadata'],
};
}
export function PeerToJSON(value?: Peer | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
peer_id: value.peer_id,
metadata: value.metadata,
};
}