@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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/builders/oracles/pyth.ts +11 -3
- package/src/constants/queryKeys.ts +5 -1
- package/src/models/scallopUtils.ts +2 -1
package/package.json
CHANGED
|
@@ -95,8 +95,12 @@ export const updatePythPriceFeeds = async (
|
|
|
95
95
|
'0xa8b8dcc9880166edb57b53e05f8df7364d31b5d9b7d107fd27f0b69cf338b687',
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
|
-
const priceIds =
|
|
99
|
-
|
|
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
|
|
|
@@ -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
|
},
|