diff --git a/generated/models/PlatformFee.ts b/generated/models/PlatformFee.ts index df666a4..323774b 100644 --- a/generated/models/PlatformFee.ts +++ b/generated/models/PlatformFee.ts @@ -2,31 +2,30 @@ /* eslint-disable */ /** * Swap API - * API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript https://github.com/jup-ag/jupiter-quote-api-node ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec are base64 encoded strings + * API reference for Jupiter's Swap API. * * The version of the OpenAPI document: 1.0.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'; + /** - * + * Defines a platform fee taken by the swap aggregator on top of DEX fees. * @export * @interface PlatformFee */ export interface PlatformFee { /** - * + * The actual **amount** of the fee collected (in the smallest unit of the output token). + * Typically a string to avoid precision issues with large numbers. * @type {string} * @memberof PlatformFee */ amount?: string; /** - * + * The **fee rate** in basis points (e.g., 10 = 0.1%). * @type {number} * @memberof PlatformFee */ @@ -35,11 +34,11 @@ export interface PlatformFee { /** * Check if a given object implements the PlatformFee interface. + * Note: Since all fields are optional, this mainly checks for non-null/undefined input. */ -export function instanceOfPlatformFee(value: object): boolean { - let isInstance = true; - - return isInstance; +export function instanceOfPlatformFee(value: object | null | undefined): value is PlatformFee { + // If the object has no required fields, we only check if it is not null or undefined. + return !!value; } export function PlatformFeeFromJSON(json: any): PlatformFee { @@ -51,9 +50,8 @@ export function PlatformFeeFromJSONTyped(json: any, ignoreDiscriminator: boolean return json; } return { - - 'amount': !exists(json, 'amount') ? undefined : json['amount'], - 'feeBps': !exists(json, 'feeBps') ? undefined : json['feeBps'], + 'amount': exists(json, 'amount') ? json['amount'] : undefined, + 'feeBps': exists(json, 'feeBps') ? json['feeBps'] : undefined, }; } @@ -64,10 +62,13 @@ export function PlatformFeeToJSON(value?: PlatformFee | null): any { if (value === null) { return null; } - return { - - 'amount': value.amount, - 'feeBps': value.feeBps, - }; + // Only map fields that are defined, as per typical API contract + const result: any = {}; + if (value.amount !== undefined) { + result['amount'] = value.amount; + } + if (value.feeBps !== undefined) { + result['feeBps'] = value.feeBps; + } + return result; } -