UNPKG

solana-framework-deno

Version:

solana-framework-deno is solana uni-tools for deno

87 lines 4.24 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Jupiter API v6 * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * The version of the OpenAPI document: 6.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. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.QuoteResponseToJSON = exports.QuoteResponseFromJSONTyped = exports.QuoteResponseFromJSON = exports.instanceOfQuoteResponse = void 0; const runtime_1 = require("../runtime"); const PlatformFee_1 = require("./PlatformFee"); const RoutePlanStep_1 = require("./RoutePlanStep"); const SwapMode_1 = require("./SwapMode"); /** * Check if a given object implements the QuoteResponse interface. */ function instanceOfQuoteResponse(value) { let isInstance = true; isInstance = isInstance && "inputMint" in value; isInstance = isInstance && "inAmount" in value; isInstance = isInstance && "outputMint" in value; isInstance = isInstance && "outAmount" in value; isInstance = isInstance && "otherAmountThreshold" in value; isInstance = isInstance && "swapMode" in value; isInstance = isInstance && "slippageBps" in value; isInstance = isInstance && "priceImpactPct" in value; isInstance = isInstance && "routePlan" in value; return isInstance; } exports.instanceOfQuoteResponse = instanceOfQuoteResponse; function QuoteResponseFromJSON(json) { return QuoteResponseFromJSONTyped(json, false); } exports.QuoteResponseFromJSON = QuoteResponseFromJSON; function QuoteResponseFromJSONTyped(json, _ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'inputMint': json['inputMint'], 'inAmount': json['inAmount'], 'outputMint': json['outputMint'], 'outAmount': json['outAmount'], 'otherAmountThreshold': json['otherAmountThreshold'], 'swapMode': (0, SwapMode_1.SwapModeFromJSON)(json['swapMode']), 'slippageBps': json['slippageBps'], 'computedAutoSlippage': !(0, runtime_1.exists)(json, 'computedAutoSlippage') ? undefined : json['computedAutoSlippage'], 'platformFee': !(0, runtime_1.exists)(json, 'platformFee') ? undefined : (0, PlatformFee_1.PlatformFeeFromJSON)(json['platformFee']), 'priceImpactPct': json['priceImpactPct'], 'routePlan': (json['routePlan'].map(RoutePlanStep_1.RoutePlanStepFromJSON)), 'contextSlot': !(0, runtime_1.exists)(json, 'contextSlot') ? undefined : json['contextSlot'], 'timeTaken': !(0, runtime_1.exists)(json, 'timeTaken') ? undefined : json['timeTaken'], }; } exports.QuoteResponseFromJSONTyped = QuoteResponseFromJSONTyped; function QuoteResponseToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'inputMint': value.inputMint, 'inAmount': value.inAmount, 'outputMint': value.outputMint, 'outAmount': value.outAmount, 'otherAmountThreshold': value.otherAmountThreshold, 'swapMode': (0, SwapMode_1.SwapModeToJSON)(value.swapMode), 'slippageBps': value.slippageBps, 'computedAutoSlippage': value.computedAutoSlippage, 'platformFee': (0, PlatformFee_1.PlatformFeeToJSON)(value.platformFee), 'priceImpactPct': value.priceImpactPct, 'routePlan': (value.routePlan.map(RoutePlanStep_1.RoutePlanStepToJSON)), 'contextSlot': value.contextSlot, 'timeTaken': value.timeTaken, }; } exports.QuoteResponseToJSON = QuoteResponseToJSON; //# sourceMappingURL=QuoteResponse.js.map