@pyxisjs/chains 0.2.7 → 0.3.0
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 +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -8874,6 +8874,39 @@ function getFunctionSignature2(contractName, functionName, contractAddress) {
|
|
|
8874
8874
|
return signature.replace("{address}", contractAddress);
|
|
8875
8875
|
}
|
|
8876
8876
|
|
|
8877
|
+
// src/common/stats-client.ts
|
|
8878
|
+
var PyxisStatsClient = class {
|
|
8879
|
+
constructor(baseUrl = "https://stats.pyxisfinance.xyz/v1") {
|
|
8880
|
+
this.baseUrl = baseUrl;
|
|
8881
|
+
}
|
|
8882
|
+
async getManageOperations({
|
|
8883
|
+
vaultId,
|
|
8884
|
+
startTime,
|
|
8885
|
+
endTime,
|
|
8886
|
+
limit = 100
|
|
8887
|
+
}) {
|
|
8888
|
+
const params = new URLSearchParams({
|
|
8889
|
+
start_time: startTime.toString(),
|
|
8890
|
+
end_time: endTime.toString(),
|
|
8891
|
+
limit: limit.toString()
|
|
8892
|
+
});
|
|
8893
|
+
const url = `${this.baseUrl}/vaults/${vaultId}/manage-operations?${params}`;
|
|
8894
|
+
const response = await fetch(url);
|
|
8895
|
+
if (!response.ok) {
|
|
8896
|
+
throw new Error(
|
|
8897
|
+
`Failed to fetch manage operations: ${response.status} ${response.statusText}`
|
|
8898
|
+
);
|
|
8899
|
+
}
|
|
8900
|
+
const data = await response.json();
|
|
8901
|
+
if (data.code !== 0) {
|
|
8902
|
+
throw new Error(
|
|
8903
|
+
`Manage operations API error: ${data.message} (code: ${data.code})`
|
|
8904
|
+
);
|
|
8905
|
+
}
|
|
8906
|
+
return data.data.items;
|
|
8907
|
+
}
|
|
8908
|
+
};
|
|
8909
|
+
|
|
8877
8910
|
// src/aptos/analytics-client.ts
|
|
8878
8911
|
import_dayjs.default.extend(import_utc.default);
|
|
8879
8912
|
var MIN_APY_DATA_POINTS = 2;
|
|
@@ -8884,6 +8917,7 @@ var AptosAnalyticsClient = class {
|
|
|
8884
8917
|
constructor(chainAdapter, analyticsAdapter) {
|
|
8885
8918
|
this.chainAdapter = chainAdapter;
|
|
8886
8919
|
this.analyticsAdapter = analyticsAdapter;
|
|
8920
|
+
this.statsClient = new PyxisStatsClient();
|
|
8887
8921
|
const config = getChainConfig2(chainAdapter.chain.id);
|
|
8888
8922
|
invariant(
|
|
8889
8923
|
config.type === ChainType2.MoveVM,
|
|
@@ -9030,6 +9064,9 @@ var AptosAnalyticsClient = class {
|
|
|
9030
9064
|
}).filter((item) => item !== null);
|
|
9031
9065
|
return historicalApyData;
|
|
9032
9066
|
}
|
|
9067
|
+
async getManageOperations(args) {
|
|
9068
|
+
return this.statsClient.getManageOperations(args);
|
|
9069
|
+
}
|
|
9033
9070
|
};
|
|
9034
9071
|
|
|
9035
9072
|
// src/evm/adapter.ts
|
|
@@ -9526,6 +9563,7 @@ export {
|
|
|
9526
9563
|
CONTRACTS,
|
|
9527
9564
|
EthereumChainAdapter,
|
|
9528
9565
|
MultiChainLayerZeroTellerAptosABI,
|
|
9566
|
+
PyxisStatsClient,
|
|
9529
9567
|
TellerAptosABI,
|
|
9530
9568
|
TellerWithMultiAssetSupportABI,
|
|
9531
9569
|
VaultAptosABI,
|