@0dotxyz/p0-ts-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +15 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -13507,6 +13507,14 @@ function serializeOracleSetup(oracleSetup) {
|
|
|
13507
13507
|
return { kaminoSwitchboardPull: {} };
|
|
13508
13508
|
case "Fixed" /* Fixed */:
|
|
13509
13509
|
return { fixed: {} };
|
|
13510
|
+
case "DriftPythPull" /* DriftPythPull */:
|
|
13511
|
+
return { driftPythPull: {} };
|
|
13512
|
+
case "DriftSwitchboardPull" /* DriftSwitchboardPull */:
|
|
13513
|
+
return { driftSwitchboardPull: {} };
|
|
13514
|
+
case "SolendPythPull" /* SolendPythPull */:
|
|
13515
|
+
return { solendPythPull: {} };
|
|
13516
|
+
case "SolendSwitchboardPull" /* SolendSwitchboardPull */:
|
|
13517
|
+
return { solendSwitchboardPull: {} };
|
|
13510
13518
|
default:
|
|
13511
13519
|
throw new Error(`Invalid oracle setup "${oracleSetup}"`);
|
|
13512
13520
|
}
|
|
@@ -42645,7 +42653,8 @@ async function buildLoopFlashloanTx({
|
|
|
42645
42653
|
},
|
|
42646
42654
|
authority: marginfiAccount.authority,
|
|
42647
42655
|
connection,
|
|
42648
|
-
destinationTokenAccount
|
|
42656
|
+
destinationTokenAccount,
|
|
42657
|
+
configParams: swapOpts.jupiterOptions?.configParams
|
|
42649
42658
|
});
|
|
42650
42659
|
swapResponse.forEach((response) => {
|
|
42651
42660
|
const outAmountThreshold = nativeToUi(
|
|
@@ -43010,7 +43019,8 @@ async function buildRepayWithCollatFlashloanTx({
|
|
|
43010
43019
|
},
|
|
43011
43020
|
authority: marginfiAccount.authority,
|
|
43012
43021
|
connection,
|
|
43013
|
-
destinationTokenAccount
|
|
43022
|
+
destinationTokenAccount,
|
|
43023
|
+
configParams: swapOpts.jupiterOptions?.configParams
|
|
43014
43024
|
});
|
|
43015
43025
|
swapResponse.forEach((response) => {
|
|
43016
43026
|
const { swapInstruction, addressLookupTableAddresses, quoteResponse } = response;
|
|
@@ -43808,11 +43818,10 @@ var getJupiterSwapIxsForFlashloan = async ({
|
|
|
43808
43818
|
quoteParams,
|
|
43809
43819
|
authority,
|
|
43810
43820
|
connection,
|
|
43811
|
-
destinationTokenAccount
|
|
43821
|
+
destinationTokenAccount,
|
|
43822
|
+
configParams
|
|
43812
43823
|
}) => {
|
|
43813
|
-
const jupiterApiClient = api.createJupiterApiClient(
|
|
43814
|
-
basePath: "https://lite-api.jup.ag/swap/v1"
|
|
43815
|
-
});
|
|
43824
|
+
const jupiterApiClient = configParams?.basePath ? new api.SwapApi(new api.Configuration(configParams)) : api.createJupiterApiClient(configParams);
|
|
43816
43825
|
const feeMint = quoteParams.swapMode === "ExactIn" ? quoteParams.outputMint : quoteParams.inputMint;
|
|
43817
43826
|
const feeAccount = getFeeAccount(new web3_js.PublicKey(feeMint));
|
|
43818
43827
|
const hasFeeAccount = !!await connection.getAccountInfo(new web3_js.PublicKey(feeAccount));
|
|
@@ -43840,7 +43849,6 @@ var getJupiterSwapIxsForFlashloan = async ({
|
|
|
43840
43849
|
swapRequest: {
|
|
43841
43850
|
quoteResponse: quote,
|
|
43842
43851
|
userPublicKey: authority.toBase58(),
|
|
43843
|
-
programAuthorityId: JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX,
|
|
43844
43852
|
feeAccount: hasFeeAccount ? feeAccount : void 0,
|
|
43845
43853
|
wrapAndUnwrapSol: false,
|
|
43846
43854
|
destinationTokenAccount: destinationTokenAccount.toBase58()
|