UNPKG

rosetta-sdk-typescript

Version:

Typescript SDK to create and interact with Rosetta API implementations.

50 lines (49 loc) 1.81 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.SigningPayloadToJSON = exports.SigningPayloadFromJSONTyped = exports.SigningPayloadFromJSON = void 0; const runtime_1 = require("../runtime"); const _1 = require("./"); function SigningPayloadFromJSON(json) { return SigningPayloadFromJSONTyped(json, false); } exports.SigningPayloadFromJSON = SigningPayloadFromJSON; function SigningPayloadFromJSONTyped(json, ignoreDiscriminator) { if (json === undefined || json === null) { return json; } return { address: !runtime_1.exists(json, 'address') ? undefined : json['address'], account_identifier: !runtime_1.exists(json, 'account_identifier') ? undefined : _1.AccountIdentifierFromJSON(json['account_identifier']), hex_bytes: json['hex_bytes'], signature_type: !runtime_1.exists(json, 'signature_type') ? undefined : _1.SignatureTypeFromJSON(json['signature_type']), }; } exports.SigningPayloadFromJSONTyped = SigningPayloadFromJSONTyped; function SigningPayloadToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { address: value.address, account_identifier: _1.AccountIdentifierToJSON(value.account_identifier), hex_bytes: value.hex_bytes, signature_type: _1.SignatureTypeToJSON(value.signature_type), }; } exports.SigningPayloadToJSON = SigningPayloadToJSON;