/* tslint:disable */ /* eslint-disable */ // @ts-nocheck /** * Audius API * * The version of the OpenAPI document: 1.0 * * * 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, mapValues } from '../runtime'; import type { UserCoinAccount } from './UserCoinAccount'; import { UserCoinAccountFromJSON, UserCoinAccountFromJSONTyped, UserCoinAccountToJSON, } from './UserCoinAccount'; /** * * @export * @interface UserCoinWithAccounts */ export interface UserCoinWithAccounts { /** * The coin mint address * @type {string} * @memberof UserCoinWithAccounts */ mint: string; /** * The coin symbol * @type {string} * @memberof UserCoinWithAccounts */ ticker: string; /** * The number of decimals for the coin * @type {number} * @memberof UserCoinWithAccounts */ decimals: number; /** * URL to the coin's logo image * @type {string} * @memberof UserCoinWithAccounts */ logoUri?: string | null; /** * The total balance of the coin in the user's account (in wei) * @type {number} * @memberof UserCoinWithAccounts */ balance: number; /** * The total balance of the coin in the user's account in USD * @type {number} * @memberof UserCoinWithAccounts */ balanceUsd: number; /** * * @type {Array} * @memberof UserCoinWithAccounts */ accounts: Array; } /** * Check if a given object implements the UserCoinWithAccounts interface. */ export function instanceOfUserCoinWithAccounts(value: object): value is UserCoinWithAccounts { let isInstance = true; isInstance = isInstance && "mint" in value && value["mint"] !== undefined; isInstance = isInstance && "ticker" in value && value["ticker"] !== undefined; isInstance = isInstance && "decimals" in value && value["decimals"] !== undefined; isInstance = isInstance && "balance" in value && value["balance"] !== undefined; isInstance = isInstance && "balanceUsd" in value && value["balanceUsd"] !== undefined; isInstance = isInstance && "accounts" in value && value["accounts"] !== undefined; return isInstance; } export function UserCoinWithAccountsFromJSON(json: any): UserCoinWithAccounts { return UserCoinWithAccountsFromJSONTyped(json, false); } export function UserCoinWithAccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCoinWithAccounts { if ((json === undefined) || (json === null)) { return json; } return { 'mint': json['mint'], 'ticker': json['ticker'], 'decimals': json['decimals'], 'logoUri': !exists(json, 'logo_uri') ? undefined : json['logo_uri'], 'balance': json['balance'], 'balanceUsd': json['balance_usd'], 'accounts': ((json['accounts'] as Array).map(UserCoinAccountFromJSON)), }; } export function UserCoinWithAccountsToJSON(value?: UserCoinWithAccounts | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'mint': value.mint, 'ticker': value.ticker, 'decimals': value.decimals, 'logo_uri': value.logoUri, 'balance': value.balance, 'balance_usd': value.balanceUsd, 'accounts': ((value.accounts as Array).map(UserCoinAccountToJSON)), }; }