@whetstone-research/doppler-sdk 1.0.9 → 1.0.11

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.
Files changed (36) hide show
  1. package/README.md +170 -29
  2. package/dist/{chunk-I5JME35L.cjs → chunk-5USQGM5X.cjs} +36 -77
  3. package/dist/chunk-5USQGM5X.cjs.map +1 -0
  4. package/dist/{chunk-O6FR7TXY.cjs → chunk-6FRZFA5R.cjs} +3 -4
  5. package/dist/chunk-6FRZFA5R.cjs.map +1 -0
  6. package/dist/{chunk-RF4NM4ES.js → chunk-MPM2L56F.js} +5 -44
  7. package/dist/chunk-MPM2L56F.js.map +1 -0
  8. package/dist/{chunk-YWZCHTXQ.js → chunk-QGJA5CFL.js} +4 -4
  9. package/dist/chunk-QGJA5CFL.js.map +1 -0
  10. package/dist/evm/index.cjs +6411 -3526
  11. package/dist/evm/index.cjs.map +1 -1
  12. package/dist/evm/index.d.cts +1512 -78
  13. package/dist/evm/index.d.ts +1512 -78
  14. package/dist/evm/index.js +6408 -3527
  15. package/dist/evm/index.js.map +1 -1
  16. package/dist/{pda-UKFLYQGA.cjs → pda-B7RUPQNR.cjs} +16 -16
  17. package/dist/pda-B7RUPQNR.cjs.map +1 -0
  18. package/dist/{pda-NKKMVQ4N.js → pda-MLEPNVY5.js} +3 -3
  19. package/dist/pda-MLEPNVY5.js.map +1 -0
  20. package/dist/solana/index.cjs +3293 -795
  21. package/dist/solana/index.cjs.map +1 -1
  22. package/dist/solana/index.d.cts +1838 -1084
  23. package/dist/solana/index.d.ts +1838 -1084
  24. package/dist/solana/index.js +3146 -648
  25. package/dist/solana/index.js.map +1 -1
  26. package/dist/solana/react/index.cjs +84 -45
  27. package/dist/solana/react/index.cjs.map +1 -1
  28. package/dist/solana/react/index.js +43 -4
  29. package/dist/solana/react/index.js.map +1 -1
  30. package/package.json +2 -1
  31. package/dist/chunk-I5JME35L.cjs.map +0 -1
  32. package/dist/chunk-O6FR7TXY.cjs.map +0 -1
  33. package/dist/chunk-RF4NM4ES.js.map +0 -1
  34. package/dist/chunk-YWZCHTXQ.js.map +0 -1
  35. package/dist/pda-NKKMVQ4N.js.map +0 -1
  36. package/dist/pda-UKFLYQGA.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
- import { fetchPool, getSwapQuote, getSwapQuoteExactOut, ratioToNumber, getAddLiquidityQuote, getRemoveLiquidityQuote, fetchPosition, getPendingFees, getPositionValue, fetchUserPositions, MAX_FEE_AMOUNT, createCollectFeesInstruction, fetchOracle, consultTwap, getOracleSpotPrices, getOracleDeviation, getOracleAge, isOracleStale, getOracleBufferStats, comparePoolAndOraclePrices, getOracleForPool } from '../../chunk-RF4NM4ES.js';
2
- import { CPMM_PROGRAM_ID, BPS_DENOM, getOracleAddress } from '../../chunk-YWZCHTXQ.js';
1
+ import { fetchPool, getSwapQuote, getSwapQuoteExactOut, ratioToNumber, getAddLiquidityQuote, getRemoveLiquidityQuote, fetchPosition, getPendingFees, getPositionValue, fetchUserPositions, fetchOracle, consultTwap, getOracleSpotPrices, getOracleDeviation, getOracleAge, isOracleStale, getOracleBufferStats, comparePoolAndOraclePrices, getOracleForPool, encodeInstructionData, collectFeesArgsCodec } from '../../chunk-MPM2L56F.js';
2
+ import { CPMM_PROGRAM_ID, BPS_DENOM, getOracleAddress, TOKEN_PROGRAM_ADDRESS, INSTRUCTION_DISCRIMINATORS } from '../../chunk-QGJA5CFL.js';
3
3
  import '../../chunk-PZ5AY32C.js';
4
4
  import { createContext, useMemo, useContext, useState, useEffect, useCallback, useRef } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import { createSolanaRpc, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstruction, signTransactionMessageWithSigners, getBase64EncodedWireTransaction } from '@solana/kit';
6
+ import { createSolanaRpc, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstruction, signTransactionMessageWithSigners, getBase64EncodedWireTransaction, AccountRole } from '@solana/kit';
7
7
 
8
8
  var AmmContext = createContext(null);
9
9
  function AmmProvider({
@@ -841,7 +841,7 @@ function usePosition(poolAddress, positionId = 0n, options = {}) {
841
841
  setLoading(true);
842
842
  setError(null);
843
843
  try {
844
- const { getPositionAddress } = await import('../../pda-NKKMVQ4N.js');
844
+ const { getPositionAddress } = await import('../../pda-MLEPNVY5.js');
845
845
  const [posAddr] = await getPositionAddress(
846
846
  poolAddress,
847
847
  ownerAddress,
@@ -984,6 +984,45 @@ function useUserPositions(poolFilter, options = {}) {
984
984
  refetch: fetchPositions
985
985
  };
986
986
  }
987
+ function createCollectFeesInstruction(accounts, args, programId = CPMM_PROGRAM_ID) {
988
+ const {
989
+ pool,
990
+ position,
991
+ owner,
992
+ authority,
993
+ vault0,
994
+ vault1,
995
+ token0Mint,
996
+ token1Mint,
997
+ user0,
998
+ user1,
999
+ tokenProgram = TOKEN_PROGRAM_ADDRESS
1000
+ } = accounts;
1001
+ const keys = [
1002
+ { address: pool, role: AccountRole.WRITABLE },
1003
+ { address: position, role: AccountRole.WRITABLE },
1004
+ { address: owner, role: AccountRole.READONLY_SIGNER },
1005
+ { address: authority, role: AccountRole.READONLY },
1006
+ { address: vault0, role: AccountRole.WRITABLE },
1007
+ { address: vault1, role: AccountRole.WRITABLE },
1008
+ { address: token0Mint, role: AccountRole.READONLY },
1009
+ { address: token1Mint, role: AccountRole.READONLY },
1010
+ { address: user0, role: AccountRole.WRITABLE },
1011
+ { address: user1, role: AccountRole.WRITABLE },
1012
+ { address: tokenProgram, role: AccountRole.READONLY }
1013
+ ];
1014
+ const data = encodeInstructionData(
1015
+ INSTRUCTION_DISCRIMINATORS.collectFees,
1016
+ collectFeesArgsCodec,
1017
+ args
1018
+ );
1019
+ return {
1020
+ programAddress: programId,
1021
+ accounts: keys,
1022
+ data
1023
+ };
1024
+ }
1025
+ var MAX_FEE_AMOUNT = BigInt("18446744073709551615");
987
1026
  function useFees(positionAddress, poolAddress, options = {}) {
988
1027
  const {
989
1028
  rpc,