From af0e935eeaff43f9b176fca873be9961b0896add Mon Sep 17 00:00:00 2001 From: Dickson Pang <34560707+dicksonpys@users.noreply.github.com> Date: Fri, 6 Jan 2023 16:53:01 +0800 Subject: [PATCH] support computeUnitPriceMicroLamports typing --- generated/models/InlineObject.ts | 8 +++++ package.json | 2 +- swagger.json | 51 +++++++++++++++++++++++++------- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/generated/models/InlineObject.ts b/generated/models/InlineObject.ts index 9529f02..91b774e 100644 --- a/generated/models/InlineObject.ts +++ b/generated/models/InlineObject.ts @@ -56,6 +56,12 @@ export interface InlineObject { * @memberof InlineObject */ asLegacyTransaction?: boolean; + /** + * compute unit price to prioritize the transaction, the additional fee will be compute unit consumed * computeUnitPriceMicroLamports + * @type {number} + * @memberof InlineObject + */ + computeUnitPriceMicroLamports?: number; /** * Public key of the wallet that will receive the output of the swap, this assumes the associated token account exists, currently adds a token transfer * @type {string} @@ -79,6 +85,7 @@ export function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolea 'wrapUnwrapSOL': !exists(json, 'wrapUnwrapSOL') ? undefined : json['wrapUnwrapSOL'], 'feeAccount': !exists(json, 'feeAccount') ? undefined : json['feeAccount'], 'asLegacyTransaction': !exists(json, 'asLegacyTransaction') ? undefined : json['asLegacyTransaction'], + 'computeUnitPriceMicroLamports': !exists(json, 'computeUnitPriceMicroLamports') ? undefined : json['computeUnitPriceMicroLamports'], 'destinationWallet': !exists(json, 'destinationWallet') ? undefined : json['destinationWallet'], }; } @@ -97,6 +104,7 @@ export function InlineObjectToJSON(value?: InlineObject | null): any { 'wrapUnwrapSOL': value.wrapUnwrapSOL, 'feeAccount': value.feeAccount, 'asLegacyTransaction': value.asLegacyTransaction, + 'computeUnitPriceMicroLamports': value.computeUnitPriceMicroLamports, 'destinationWallet': value.destinationWallet, }; } diff --git a/package.json b/package.json index 074788e..a46225f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jup-ag/api", - "version": "4.0.0", + "version": "4.0.1", "description": "## Generate typescript types from swagger schema", "main": "dist/index.js", "module": "dist/index.mjs", diff --git a/swagger.json b/swagger.json index c4b124b..7beb4d1 100644 --- a/swagger.json +++ b/swagger.json @@ -178,7 +178,10 @@ }, "swapMode": { "type": "string", - "enum": ["ExactIn", "ExactOut"] + "enum": [ + "ExactIn", + "ExactOut" + ] }, "fees": { "description": "Only returned when userPublicKey is given to /quote", @@ -303,7 +306,10 @@ }, { "type": "string", - "enum": ["ExactIn", "ExactOut"], + "enum": [ + "ExactIn", + "ExactOut" + ], "description": "Swap mode, default is ExactIn", "required": false, "in": "query", @@ -461,7 +467,10 @@ }, "swapMode": { "type": "string", - "enum": ["ExactIn", "ExactOut"] + "enum": [ + "ExactIn", + "ExactOut" + ] }, "fees": { "description": "Only returned when userPublicKey is given to /quote", @@ -522,7 +531,10 @@ "in": "body", "schema": { "type": "object", - "required": ["route", "userPublicKey"], + "required": [ + "route", + "userPublicKey" + ], "properties": { "route": { "$ref": "#/definitions/def-1" @@ -545,6 +557,11 @@ "nullable": true, "description": "Request a legacy transaction rather than the default versioned transaction, needs to be paired with a quote using asLegacyTransaction otherwise the transaction might be too large" }, + "computeUnitPriceMicroLamports": { + "type": "number", + "nullable": true, + "description": "compute unit price to prioritize the transaction, the additional fee will be compute unit consumed * computeUnitPriceMicroLamports" + }, "destinationWallet": { "type": "string", "description": "Public key of the wallet that will receive the output of the swap, this assumes the associated token account exists, currently adds a token transfer" @@ -692,8 +709,16 @@ } }, "example": { - "1": [2, 3, 4], - "2": [1, 3, 4] + "1": [ + 2, + 3, + 4 + ], + "2": [ + 1, + 3, + 4 + ] } } } @@ -703,7 +728,13 @@ } } }, - "schemes": ["https"], - "consumes": ["application/json"], - "produces": ["application/json"] -} + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] +} \ No newline at end of file