@whetstone-research/doppler-sdk 1.0.13 → 1.0.14
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/README.md +48 -12
- package/dist/{chunk-AT33RY6T.cjs → chunk-3BW6IVP3.cjs} +46 -37
- package/dist/chunk-3BW6IVP3.cjs.map +1 -0
- package/dist/{chunk-ZQEEGBXT.js → chunk-NMTYI3TB.js} +23 -26
- package/dist/chunk-NMTYI3TB.js.map +1 -0
- package/dist/{chunk-2NFQKIOB.js → chunk-TVBSIQIX.js} +35 -26
- package/dist/chunk-TVBSIQIX.js.map +1 -0
- package/dist/{chunk-LL7TW3GU.cjs → chunk-W5TMS4RD.cjs} +56 -59
- package/dist/chunk-W5TMS4RD.cjs.map +1 -0
- package/dist/{oracle-CU-nZnja.d.cts → oracle-DN8BrGPh.d.cts} +28 -28
- package/dist/{oracle-CU-nZnja.d.ts → oracle-DN8BrGPh.d.ts} +28 -28
- package/dist/{pda-FLNTBIC5.js → pda-5D3GD5S6.js} +3 -3
- package/dist/pda-5D3GD5S6.js.map +1 -0
- package/dist/{pda-G25AJSXG.cjs → pda-GNZYNRUH.cjs} +17 -17
- package/dist/{pda-G25AJSXG.cjs.map → pda-GNZYNRUH.cjs.map} +1 -1
- package/dist/solana/index.cjs +875 -740
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +545 -471
- package/dist/solana/index.d.ts +545 -471
- package/dist/solana/index.js +738 -603
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +57 -57
- package/dist/solana/react/index.cjs.map +1 -1
- package/dist/solana/react/index.d.cts +5 -5
- package/dist/solana/react/index.d.ts +5 -5
- package/dist/solana/react/index.js +15 -15
- package/dist/solana/react/index.js.map +1 -1
- package/package.json +4 -2
- package/dist/chunk-2NFQKIOB.js.map +0 -1
- package/dist/chunk-AT33RY6T.cjs.map +0 -1
- package/dist/chunk-LL7TW3GU.cjs.map +0 -1
- package/dist/chunk-ZQEEGBXT.js.map +0 -1
- package/dist/pda-FLNTBIC5.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkW5TMS4RD_cjs = require('../../chunk-W5TMS4RD.cjs');
|
|
4
|
+
var chunk3BW6IVP3_cjs = require('../../chunk-3BW6IVP3.cjs');
|
|
5
5
|
require('../../chunk-Q7SFCCGT.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -10,7 +10,7 @@ var kit = require('@solana/kit');
|
|
|
10
10
|
var AmmContext = react.createContext(null);
|
|
11
11
|
function AmmProvider({
|
|
12
12
|
rpc,
|
|
13
|
-
programId =
|
|
13
|
+
programId = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
|
|
14
14
|
commitment = "confirmed",
|
|
15
15
|
refreshInterval = 3e4,
|
|
16
16
|
defaultSlippageBps = 50,
|
|
@@ -91,7 +91,7 @@ function createAmmContextValue(config) {
|
|
|
91
91
|
return {
|
|
92
92
|
rpc,
|
|
93
93
|
endpoint,
|
|
94
|
-
programId: programId ??
|
|
94
|
+
programId: programId ?? chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
|
|
95
95
|
commitment,
|
|
96
96
|
refreshInterval,
|
|
97
97
|
defaultSlippageBps
|
|
@@ -333,7 +333,7 @@ function usePool(poolAddress, options = {}) {
|
|
|
333
333
|
}
|
|
334
334
|
setError(null);
|
|
335
335
|
try {
|
|
336
|
-
const poolData = await
|
|
336
|
+
const poolData = await chunkW5TMS4RD_cjs.fetchPool(rpc, poolAddress, {
|
|
337
337
|
programId,
|
|
338
338
|
commitment
|
|
339
339
|
});
|
|
@@ -411,7 +411,7 @@ function usePools(poolAddresses, options = {}) {
|
|
|
411
411
|
try {
|
|
412
412
|
const results = await Promise.all(
|
|
413
413
|
poolAddresses.map(
|
|
414
|
-
(addr) =>
|
|
414
|
+
(addr) => chunkW5TMS4RD_cjs.fetchPool(rpc, addr, { programId, commitment }).then((pool) => [addr, pool]).catch(() => [addr, null])
|
|
415
415
|
)
|
|
416
416
|
);
|
|
417
417
|
if (mountedRef.current) {
|
|
@@ -473,14 +473,14 @@ function useSwap(options) {
|
|
|
473
473
|
slippageBps: defaultSlippageBps
|
|
474
474
|
});
|
|
475
475
|
const [quoting] = react.useState(false);
|
|
476
|
-
const
|
|
476
|
+
const tradeDirection = react.useMemo(() => {
|
|
477
477
|
if (!token0Mint || !token1Mint || !state.inputToken) return null;
|
|
478
478
|
if (state.inputToken === token0Mint) return 0;
|
|
479
479
|
if (state.inputToken === token1Mint) return 1;
|
|
480
480
|
return null;
|
|
481
481
|
}, [token0Mint, token1Mint, state.inputToken]);
|
|
482
482
|
const quote = react.useMemo(() => {
|
|
483
|
-
if (!pool ||
|
|
483
|
+
if (!pool || tradeDirection === null) {
|
|
484
484
|
return null;
|
|
485
485
|
}
|
|
486
486
|
if (state.exactInput) {
|
|
@@ -494,20 +494,20 @@ function useSwap(options) {
|
|
|
494
494
|
executionPrice: 0,
|
|
495
495
|
minAmountOut: 0n,
|
|
496
496
|
maxAmountIn: 0n,
|
|
497
|
-
|
|
497
|
+
tradeDirection,
|
|
498
498
|
isValid: false,
|
|
499
499
|
error: null
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
502
|
try {
|
|
503
|
-
const swapQuote =
|
|
504
|
-
const slippageFactor =
|
|
505
|
-
const minAmountOut = swapQuote.amountOut * slippageFactor /
|
|
503
|
+
const swapQuote = chunkW5TMS4RD_cjs.getSwapQuote(pool, state.inputAmount, tradeDirection);
|
|
504
|
+
const slippageFactor = chunk3BW6IVP3_cjs.BPS_DENOM - BigInt(state.slippageBps);
|
|
505
|
+
const minAmountOut = swapQuote.amountOut * slippageFactor / chunk3BW6IVP3_cjs.BPS_DENOM;
|
|
506
506
|
return {
|
|
507
507
|
...swapQuote,
|
|
508
508
|
minAmountOut,
|
|
509
509
|
maxAmountIn: state.inputAmount,
|
|
510
|
-
|
|
510
|
+
tradeDirection,
|
|
511
511
|
isValid: swapQuote.amountOut > 0n,
|
|
512
512
|
error: null
|
|
513
513
|
};
|
|
@@ -521,7 +521,7 @@ function useSwap(options) {
|
|
|
521
521
|
executionPrice: 0,
|
|
522
522
|
minAmountOut: 0n,
|
|
523
523
|
maxAmountIn: 0n,
|
|
524
|
-
|
|
524
|
+
tradeDirection,
|
|
525
525
|
isValid: false,
|
|
526
526
|
error: err instanceof Error ? err.message : "Failed to calculate quote"
|
|
527
527
|
};
|
|
@@ -537,20 +537,20 @@ function useSwap(options) {
|
|
|
537
537
|
executionPrice: 0,
|
|
538
538
|
minAmountOut: 0n,
|
|
539
539
|
maxAmountIn: 0n,
|
|
540
|
-
|
|
540
|
+
tradeDirection,
|
|
541
541
|
isValid: false,
|
|
542
542
|
error: null
|
|
543
543
|
};
|
|
544
544
|
}
|
|
545
545
|
try {
|
|
546
|
-
const { amountIn, feeTotal } =
|
|
546
|
+
const { amountIn, feeTotal } = chunkW5TMS4RD_cjs.getSwapQuoteExactOut(
|
|
547
547
|
pool,
|
|
548
548
|
state.outputAmount,
|
|
549
|
-
|
|
549
|
+
tradeDirection
|
|
550
550
|
);
|
|
551
|
-
const slippageFactor =
|
|
552
|
-
const maxAmountIn = amountIn * slippageFactor /
|
|
553
|
-
const forwardQuote =
|
|
551
|
+
const slippageFactor = chunk3BW6IVP3_cjs.BPS_DENOM + BigInt(state.slippageBps);
|
|
552
|
+
const maxAmountIn = amountIn * slippageFactor / chunk3BW6IVP3_cjs.BPS_DENOM;
|
|
553
|
+
const forwardQuote = chunkW5TMS4RD_cjs.getSwapQuote(pool, amountIn, tradeDirection);
|
|
554
554
|
return {
|
|
555
555
|
amountOut: state.outputAmount,
|
|
556
556
|
feeTotal,
|
|
@@ -558,10 +558,10 @@ function useSwap(options) {
|
|
|
558
558
|
// Not calculated for exact out
|
|
559
559
|
feeComp: 0n,
|
|
560
560
|
priceImpact: forwardQuote.priceImpact,
|
|
561
|
-
executionPrice:
|
|
561
|
+
executionPrice: chunkW5TMS4RD_cjs.ratioToNumber(state.outputAmount, amountIn),
|
|
562
562
|
minAmountOut: state.outputAmount,
|
|
563
563
|
maxAmountIn,
|
|
564
|
-
|
|
564
|
+
tradeDirection,
|
|
565
565
|
isValid: amountIn > 0n,
|
|
566
566
|
error: null
|
|
567
567
|
};
|
|
@@ -575,7 +575,7 @@ function useSwap(options) {
|
|
|
575
575
|
executionPrice: 0,
|
|
576
576
|
minAmountOut: 0n,
|
|
577
577
|
maxAmountIn: 0n,
|
|
578
|
-
|
|
578
|
+
tradeDirection,
|
|
579
579
|
isValid: false,
|
|
580
580
|
error: err instanceof Error ? err.message : "Failed to calculate quote"
|
|
581
581
|
};
|
|
@@ -583,7 +583,7 @@ function useSwap(options) {
|
|
|
583
583
|
}
|
|
584
584
|
}, [
|
|
585
585
|
pool,
|
|
586
|
-
|
|
586
|
+
tradeDirection,
|
|
587
587
|
state.inputAmount,
|
|
588
588
|
state.outputAmount,
|
|
589
589
|
state.exactInput,
|
|
@@ -683,13 +683,13 @@ function useLiquidity(options) {
|
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
try {
|
|
686
|
-
const quote =
|
|
686
|
+
const quote = chunkW5TMS4RD_cjs.getAddLiquidityQuote(
|
|
687
687
|
pool,
|
|
688
688
|
addState.amount0,
|
|
689
689
|
addState.amount1
|
|
690
690
|
);
|
|
691
|
-
const slippageFactor =
|
|
692
|
-
const minSharesOut = quote.sharesOut * slippageFactor /
|
|
691
|
+
const slippageFactor = chunk3BW6IVP3_cjs.BPS_DENOM - BigInt(addState.slippageBps);
|
|
692
|
+
const minSharesOut = quote.sharesOut * slippageFactor / chunk3BW6IVP3_cjs.BPS_DENOM;
|
|
693
693
|
return {
|
|
694
694
|
...quote,
|
|
695
695
|
minSharesOut,
|
|
@@ -723,10 +723,10 @@ function useLiquidity(options) {
|
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
725
|
try {
|
|
726
|
-
const quote =
|
|
727
|
-
const slippageFactor =
|
|
728
|
-
const minAmount0Out = quote.amount0 * slippageFactor /
|
|
729
|
-
const minAmount1Out = quote.amount1 * slippageFactor /
|
|
726
|
+
const quote = chunkW5TMS4RD_cjs.getRemoveLiquidityQuote(pool, removeState.shares);
|
|
727
|
+
const slippageFactor = chunk3BW6IVP3_cjs.BPS_DENOM - BigInt(removeState.slippageBps);
|
|
728
|
+
const minAmount0Out = quote.amount0 * slippageFactor / chunk3BW6IVP3_cjs.BPS_DENOM;
|
|
729
|
+
const minAmount1Out = quote.amount1 * slippageFactor / chunk3BW6IVP3_cjs.BPS_DENOM;
|
|
730
730
|
return {
|
|
731
731
|
...quote,
|
|
732
732
|
minAmount0Out,
|
|
@@ -843,7 +843,7 @@ function usePosition(poolAddress, positionId = 0n, options = {}) {
|
|
|
843
843
|
setLoading(true);
|
|
844
844
|
setError(null);
|
|
845
845
|
try {
|
|
846
|
-
const { getPositionAddress } = await import('../../pda-
|
|
846
|
+
const { getPositionAddress } = await import('../../pda-GNZYNRUH.cjs');
|
|
847
847
|
const [posAddr] = await getPositionAddress(
|
|
848
848
|
poolAddress,
|
|
849
849
|
ownerAddress,
|
|
@@ -852,8 +852,8 @@ function usePosition(poolAddress, positionId = 0n, options = {}) {
|
|
|
852
852
|
);
|
|
853
853
|
setPositionAddress(posAddr);
|
|
854
854
|
const [positionData, poolData] = await Promise.all([
|
|
855
|
-
|
|
856
|
-
providedPool ? Promise.resolve(providedPool) :
|
|
855
|
+
chunkW5TMS4RD_cjs.fetchPosition(rpc, posAddr, { programId, commitment }),
|
|
856
|
+
providedPool ? Promise.resolve(providedPool) : chunkW5TMS4RD_cjs.fetchPool(rpc, poolAddress, { programId, commitment })
|
|
857
857
|
]);
|
|
858
858
|
if (mountedRef.current) {
|
|
859
859
|
setPosition(positionData);
|
|
@@ -882,11 +882,11 @@ function usePosition(poolAddress, positionId = 0n, options = {}) {
|
|
|
882
882
|
}, [fetchPositionData]);
|
|
883
883
|
const pendingFees = react.useMemo(() => {
|
|
884
884
|
if (!pool || !position) return null;
|
|
885
|
-
return
|
|
885
|
+
return chunkW5TMS4RD_cjs.getPendingFees(pool, position);
|
|
886
886
|
}, [pool, position]);
|
|
887
887
|
const value = react.useMemo(() => {
|
|
888
888
|
if (!pool || !position) return null;
|
|
889
|
-
return
|
|
889
|
+
return chunkW5TMS4RD_cjs.getPositionValue(pool, position);
|
|
890
890
|
}, [pool, position]);
|
|
891
891
|
react.useEffect(() => {
|
|
892
892
|
mountedRef.current = true;
|
|
@@ -941,7 +941,7 @@ function useUserPositions(poolFilter, options = {}) {
|
|
|
941
941
|
setLoading(true);
|
|
942
942
|
setError(null);
|
|
943
943
|
try {
|
|
944
|
-
const positionsData = await
|
|
944
|
+
const positionsData = await chunkW5TMS4RD_cjs.fetchUserPositions(
|
|
945
945
|
rpc,
|
|
946
946
|
ownerAddress,
|
|
947
947
|
poolFilter,
|
|
@@ -986,7 +986,7 @@ function useUserPositions(poolFilter, options = {}) {
|
|
|
986
986
|
refetch: fetchPositions
|
|
987
987
|
};
|
|
988
988
|
}
|
|
989
|
-
function createCollectFeesInstruction(accounts, args, programId =
|
|
989
|
+
function createCollectFeesInstruction(accounts, args, programId = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID) {
|
|
990
990
|
const {
|
|
991
991
|
pool,
|
|
992
992
|
position,
|
|
@@ -998,7 +998,7 @@ function createCollectFeesInstruction(accounts, args, programId = chunkAT33RY6T_
|
|
|
998
998
|
token1Mint,
|
|
999
999
|
user0,
|
|
1000
1000
|
user1,
|
|
1001
|
-
tokenProgram =
|
|
1001
|
+
tokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS
|
|
1002
1002
|
} = accounts;
|
|
1003
1003
|
const keys = [
|
|
1004
1004
|
{ address: pool, role: kit.AccountRole.WRITABLE },
|
|
@@ -1013,9 +1013,9 @@ function createCollectFeesInstruction(accounts, args, programId = chunkAT33RY6T_
|
|
|
1013
1013
|
{ address: user1, role: kit.AccountRole.WRITABLE },
|
|
1014
1014
|
{ address: tokenProgram, role: kit.AccountRole.READONLY }
|
|
1015
1015
|
];
|
|
1016
|
-
const data =
|
|
1017
|
-
|
|
1018
|
-
|
|
1016
|
+
const data = chunkW5TMS4RD_cjs.encodeInstructionData(
|
|
1017
|
+
chunk3BW6IVP3_cjs.INSTRUCTION_DISCRIMINATORS.collectFees,
|
|
1018
|
+
chunkW5TMS4RD_cjs.collectFeesArgsCodec,
|
|
1019
1019
|
args
|
|
1020
1020
|
);
|
|
1021
1021
|
return {
|
|
@@ -1057,7 +1057,7 @@ function useFees(positionAddress, poolAddress, options = {}) {
|
|
|
1057
1057
|
}, [providedPool, providedPosition]);
|
|
1058
1058
|
const fees = react.useMemo(() => {
|
|
1059
1059
|
if (!pool || !position) return null;
|
|
1060
|
-
const { pending0, pending1 } =
|
|
1060
|
+
const { pending0, pending1 } = chunkW5TMS4RD_cjs.getPendingFees(pool, position);
|
|
1061
1061
|
return {
|
|
1062
1062
|
pending0,
|
|
1063
1063
|
pending1,
|
|
@@ -1084,13 +1084,13 @@ function useFees(positionAddress, poolAddress, options = {}) {
|
|
|
1084
1084
|
const promises = [];
|
|
1085
1085
|
if (!providedPosition && positionAddress) {
|
|
1086
1086
|
promises.push(
|
|
1087
|
-
|
|
1087
|
+
chunkW5TMS4RD_cjs.fetchPosition(rpc, positionAddress, { programId, commitment })
|
|
1088
1088
|
);
|
|
1089
1089
|
} else {
|
|
1090
1090
|
promises.push(Promise.resolve(providedPosition));
|
|
1091
1091
|
}
|
|
1092
1092
|
if (!providedPool && poolAddress) {
|
|
1093
|
-
promises.push(
|
|
1093
|
+
promises.push(chunkW5TMS4RD_cjs.fetchPool(rpc, poolAddress, { programId, commitment }));
|
|
1094
1094
|
} else {
|
|
1095
1095
|
promises.push(Promise.resolve(providedPool));
|
|
1096
1096
|
}
|
|
@@ -1243,7 +1243,7 @@ function useFees(positionAddress, poolAddress, options = {}) {
|
|
|
1243
1243
|
function useFeesFromData(pool, position) {
|
|
1244
1244
|
return react.useMemo(() => {
|
|
1245
1245
|
if (!pool || !position) return null;
|
|
1246
|
-
const { pending0, pending1 } =
|
|
1246
|
+
const { pending0, pending1 } = chunkW5TMS4RD_cjs.getPendingFees(pool, position);
|
|
1247
1247
|
return {
|
|
1248
1248
|
pending0,
|
|
1249
1249
|
pending1,
|
|
@@ -1278,9 +1278,9 @@ function useOracle(poolAddress, options = {}) {
|
|
|
1278
1278
|
setLoading(true);
|
|
1279
1279
|
setError(null);
|
|
1280
1280
|
try {
|
|
1281
|
-
const [oracleAddr] = await
|
|
1281
|
+
const [oracleAddr] = await chunk3BW6IVP3_cjs.getOracleAddress(poolAddress, programId);
|
|
1282
1282
|
setOracleAddress(oracleAddr);
|
|
1283
|
-
const oracleData = await
|
|
1283
|
+
const oracleData = await chunkW5TMS4RD_cjs.fetchOracle(rpc, oracleAddr, {
|
|
1284
1284
|
programId,
|
|
1285
1285
|
commitment
|
|
1286
1286
|
});
|
|
@@ -1303,34 +1303,34 @@ function useOracle(poolAddress, options = {}) {
|
|
|
1303
1303
|
const twap = react.useCallback(
|
|
1304
1304
|
(windowSeconds) => {
|
|
1305
1305
|
if (!oracle || !oracle.initialized) return null;
|
|
1306
|
-
return
|
|
1306
|
+
return chunkW5TMS4RD_cjs.consultTwap(oracle, windowSeconds);
|
|
1307
1307
|
},
|
|
1308
1308
|
[oracle]
|
|
1309
1309
|
);
|
|
1310
1310
|
const spotPrice = react.useMemo(() => {
|
|
1311
1311
|
if (!oracle || !oracle.initialized) return null;
|
|
1312
|
-
const prices =
|
|
1312
|
+
const prices = chunkW5TMS4RD_cjs.getOracleSpotPrices(oracle);
|
|
1313
1313
|
return { price0: prices.price0, price1: prices.price1 };
|
|
1314
1314
|
}, [oracle]);
|
|
1315
1315
|
const deviation = react.useMemo(() => {
|
|
1316
1316
|
if (!oracle || !oracle.initialized) return null;
|
|
1317
|
-
const dev =
|
|
1317
|
+
const dev = chunkW5TMS4RD_cjs.getOracleDeviation(oracle);
|
|
1318
1318
|
return { deviation0: dev.deviation0, deviation1: dev.deviation1 };
|
|
1319
1319
|
}, [oracle]);
|
|
1320
1320
|
const age = react.useMemo(() => {
|
|
1321
1321
|
if (!oracle || !oracle.initialized) return null;
|
|
1322
|
-
return
|
|
1322
|
+
return chunkW5TMS4RD_cjs.getOracleAge(oracle);
|
|
1323
1323
|
}, [oracle]);
|
|
1324
1324
|
const isStaleCheck = react.useCallback(
|
|
1325
1325
|
(maxAgeSeconds) => {
|
|
1326
1326
|
if (!oracle || !oracle.initialized) return true;
|
|
1327
|
-
return
|
|
1327
|
+
return chunkW5TMS4RD_cjs.isOracleStale(oracle, maxAgeSeconds);
|
|
1328
1328
|
},
|
|
1329
1329
|
[oracle]
|
|
1330
1330
|
);
|
|
1331
1331
|
const bufferStats = react.useMemo(() => {
|
|
1332
1332
|
if (!oracle || !oracle.initialized) return null;
|
|
1333
|
-
const stats =
|
|
1333
|
+
const stats = chunkW5TMS4RD_cjs.getOracleBufferStats(oracle);
|
|
1334
1334
|
return {
|
|
1335
1335
|
capacity: stats.capacity,
|
|
1336
1336
|
filledCount: stats.filledCount,
|
|
@@ -1341,7 +1341,7 @@ function useOracle(poolAddress, options = {}) {
|
|
|
1341
1341
|
const compareWithPool = react.useCallback(
|
|
1342
1342
|
(pool) => {
|
|
1343
1343
|
if (!oracle || !oracle.initialized) return null;
|
|
1344
|
-
return
|
|
1344
|
+
return chunkW5TMS4RD_cjs.comparePoolAndOraclePrices(pool, oracle);
|
|
1345
1345
|
},
|
|
1346
1346
|
[oracle]
|
|
1347
1347
|
);
|
|
@@ -1380,7 +1380,7 @@ function useTwap(poolAddress, windowSeconds, options = {}) {
|
|
|
1380
1380
|
const { oracle, loading, error, refetch } = useOracle(poolAddress, options);
|
|
1381
1381
|
const twap = react.useMemo(() => {
|
|
1382
1382
|
if (!oracle || !oracle.initialized) return null;
|
|
1383
|
-
return
|
|
1383
|
+
return chunkW5TMS4RD_cjs.consultTwap(oracle, windowSeconds);
|
|
1384
1384
|
}, [oracle, windowSeconds]);
|
|
1385
1385
|
return {
|
|
1386
1386
|
twap,
|
|
@@ -1419,7 +1419,7 @@ function useOracles(poolAddresses, options = {}) {
|
|
|
1419
1419
|
const results = await Promise.all(
|
|
1420
1420
|
poolAddresses.map(async (poolAddr) => {
|
|
1421
1421
|
try {
|
|
1422
|
-
const result = await
|
|
1422
|
+
const result = await chunkW5TMS4RD_cjs.getOracleForPool(rpc, poolAddr, {
|
|
1423
1423
|
programId,
|
|
1424
1424
|
commitment
|
|
1425
1425
|
});
|