/** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import {AxiosResponse} from "axios"; export class FireblocksResponse { public constructor( public data: T, public statusCode: number, public headers: Record, ) {} } function copyHeaders(response: AxiosResponse): Record { const headersJSON: Record = {}; for (const [key, value] of Object.entries(response.headers)) { if (typeof value === 'string') { headersJSON[key] = value; } else if (Array.isArray(value)) { headersJSON[key] = value.join(','); } } return headersJSON; } export function convertToFireblocksResponse(response: AxiosResponse): FireblocksResponse{ return new FireblocksResponse(response.data, response.status, copyHeaders(response)); }