rosetta-sdk-typescript
Version:
Typescript SDK to create and interact with Rosetta API implementations.
52 lines (51 loc) • 1.75 kB
JavaScript
;
/* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockToJSON = exports.BlockFromJSONTyped = exports.BlockFromJSON = void 0;
const runtime_1 = require("../runtime");
const _1 = require("./");
function BlockFromJSON(json) {
return BlockFromJSONTyped(json, false);
}
exports.BlockFromJSON = BlockFromJSON;
function BlockFromJSONTyped(json, ignoreDiscriminator) {
if (json === undefined || json === null) {
return json;
}
return {
block_identifier: _1.BlockIdentifierFromJSON(json['block_identifier']),
parent_block_identifier: _1.BlockIdentifierFromJSON(json['parent_block_identifier']),
timestamp: json['timestamp'],
transactions: json['transactions'].map(_1.TransactionFromJSON),
metadata: !runtime_1.exists(json, 'metadata') ? undefined : json['metadata'],
};
}
exports.BlockFromJSONTyped = BlockFromJSONTyped;
function BlockToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
block_identifier: _1.BlockIdentifierToJSON(value.block_identifier),
parent_block_identifier: _1.BlockIdentifierToJSON(value.parent_block_identifier),
timestamp: value.timestamp,
transactions: value.transactions.map(_1.TransactionToJSON),
metadata: value.metadata,
};
}
exports.BlockToJSON = BlockToJSON;