@scallop-io/sui-scallop-sdk 2.3.1 → 2.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -95,8 +95,12 @@ export const updatePythPriceFeeds = async (
95
95
  '0xa8b8dcc9880166edb57b53e05f8df7364d31b5d9b7d107fd27f0b69cf338b687',
96
96
  }
97
97
  );
98
- const priceIds = assetCoinNames.map((assetCoinName) =>
99
- builder.address.get(`core.coins.${assetCoinName}.oracle.pyth.feed`)
98
+ const priceIds = Array.from(
99
+ new Set(
100
+ assetCoinNames.map((assetCoinName) =>
101
+ builder.address.get(`core.coins.${assetCoinName}.oracle.pyth.feed`)
102
+ )
103
+ )
100
104
  );
101
105
 
102
106
  const endpoints = builder.utils.pythEndpoints ?? [
@@ -106,7 +110,11 @@ export const updatePythPriceFeeds = async (
106
110
  // iterate through the endpoints
107
111
  for (const endpoint of endpoints) {
108
112
  try {
109
- const pythConnection = new SuiPriceServiceConnection(endpoint);
113
+ const pythConnection = new SuiPriceServiceConnection(endpoint, {
114
+ priceFeedRequestConfig: {
115
+ binary: true,
116
+ },
117
+ });
110
118
  const priceUpdateData =
111
119
  await pythConnection.getPriceFeedsUpdateData(priceIds);
112
120
 
@@ -74,6 +74,10 @@ export const queryKeys = {
74
74
  },
75
75
  },
76
76
  oracle: {
77
- getPythLatestPriceFeeds: () => ['oracle', 'getPythPriceIds'],
77
+ getPythLatestPriceFeeds: (priceIds: string[]) => [
78
+ 'oracle',
79
+ 'getPythPriceIds',
80
+ priceIds,
81
+ ],
78
82
  },
79
83
  };
@@ -542,11 +542,12 @@ class ScallopUtils implements ScallopUtilsInterface {
542
542
  const priceIds = priceIdPairs.map(([_, priceId]) => priceId);
543
543
  const pythConnection = new SuiPriceServiceConnection(endpoint, {
544
544
  timeout: this.timeout,
545
+ httpRetries: 0,
545
546
  });
546
547
 
547
548
  try {
548
549
  const feeds = await this.queryClient.fetchQuery({
549
- queryKey: queryKeys.oracle.getPythLatestPriceFeeds(),
550
+ queryKey: queryKeys.oracle.getPythLatestPriceFeeds(priceIds),
550
551
  queryFn: async () => {
551
552
  return await pythConnection.getLatestPriceFeeds(priceIds);
552
553
  },