Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions generated/models/PlatformFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8\\> 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
*/
Expand All @@ -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 {
Expand All @@ -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,
};
}

Expand All @@ -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;
}