UNPKG

rosetta-sdk-typescript

Version:

Typescript SDK to create and interact with Rosetta API implementations.

48 lines (47 loc) 1.38 kB
"use strict"; /* 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.AmountToJSON = exports.AmountFromJSONTyped = exports.AmountFromJSON = void 0; const runtime_1 = require("../runtime"); const _1 = require("./"); function AmountFromJSON(json) { return AmountFromJSONTyped(json, false); } exports.AmountFromJSON = AmountFromJSON; function AmountFromJSONTyped(json, ignoreDiscriminator) { if (json === undefined || json === null) { return json; } return { value: json['value'], currency: _1.CurrencyFromJSON(json['currency']), metadata: !runtime_1.exists(json, 'metadata') ? undefined : json['metadata'], }; } exports.AmountFromJSONTyped = AmountFromJSONTyped; function AmountToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { value: value.value, currency: _1.CurrencyToJSON(value.currency), metadata: value.metadata, }; } exports.AmountToJSON = AmountToJSON;