Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support computeUnitPriceMicroLamports typing #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions generated/models/InlineObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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'],
};
}
Expand All @@ -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,
};
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
51 changes: 41 additions & 10 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@
},
"swapMode": {
"type": "string",
"enum": ["ExactIn", "ExactOut"]
"enum": [
"ExactIn",
"ExactOut"
]
},
"fees": {
"description": "Only returned when userPublicKey is given to /quote",
Expand Down Expand Up @@ -303,7 +306,10 @@
},
{
"type": "string",
"enum": ["ExactIn", "ExactOut"],
"enum": [
"ExactIn",
"ExactOut"
],
"description": "Swap mode, default is ExactIn",
"required": false,
"in": "query",
Expand Down Expand Up @@ -461,7 +467,10 @@
},
"swapMode": {
"type": "string",
"enum": ["ExactIn", "ExactOut"]
"enum": [
"ExactIn",
"ExactOut"
]
},
"fees": {
"description": "Only returned when userPublicKey is given to /quote",
Expand Down Expand Up @@ -522,7 +531,10 @@
"in": "body",
"schema": {
"type": "object",
"required": ["route", "userPublicKey"],
"required": [
"route",
"userPublicKey"
],
"properties": {
"route": {
"$ref": "#/definitions/def-1"
Expand All @@ -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"
Expand Down Expand Up @@ -692,8 +709,16 @@
}
},
"example": {
"1": [2, 3, 4],
"2": [1, 3, 4]
"1": [
2,
3,
4
],
"2": [
1,
3,
4
]
}
}
}
Expand All @@ -703,7 +728,13 @@
}
}
},
"schemes": ["https"],
"consumes": ["application/json"],
"produces": ["application/json"]
}
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
]
}