@glamsystems/glam-cli 0.1.21 → 0.1.22
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/main.js +17 -7
- package/package.json +2 -2
package/main.js
CHANGED
|
@@ -1716,7 +1716,9 @@ class DriftClient {
|
|
|
1716
1716
|
async fetchAndParseSpotMarkets(marketIndexes) {
|
|
1717
1717
|
const indexesToFetch = marketIndexes.filter((marketIndex) => !this.spotMarkets.has(marketIndex));
|
|
1718
1718
|
if (indexesToFetch.length > 0) {
|
|
1719
|
-
|
|
1719
|
+
if (process.env.NODE_ENV === "development") {
|
|
1720
|
+
console.log("Fetching spot markets:", indexesToFetch);
|
|
1721
|
+
}
|
|
1720
1722
|
const marketPdas = indexesToFetch.map((marketIndex) => this.getMarketPda(driftTypes_1.MarketType.SPOT, marketIndex));
|
|
1721
1723
|
const accounts = await this.base.provider.connection.getMultipleAccountsInfo(marketPdas);
|
|
1722
1724
|
accounts.forEach((account) => {
|
|
@@ -1741,7 +1743,9 @@ class DriftClient {
|
|
|
1741
1743
|
async fetchAndParsePerpMarkets(marketIndexes) {
|
|
1742
1744
|
const indexesToFetch = marketIndexes.filter((marketIndex) => !this.perpMarkets.has(marketIndex));
|
|
1743
1745
|
if (indexesToFetch.length > 0) {
|
|
1744
|
-
|
|
1746
|
+
if (process.env.NODE_ENV === "development") {
|
|
1747
|
+
console.log("Fetching perp markets:", indexesToFetch);
|
|
1748
|
+
}
|
|
1745
1749
|
const marketPdas = marketIndexes.map((marketIndex) => this.getMarketPda(driftTypes_1.MarketType.PERP, marketIndex));
|
|
1746
1750
|
const accounts = await this.base.provider.connection.getMultipleAccountsInfo(marketPdas);
|
|
1747
1751
|
accounts.forEach((account) => {
|
|
@@ -1752,7 +1756,9 @@ class DriftClient {
|
|
|
1752
1756
|
});
|
|
1753
1757
|
}
|
|
1754
1758
|
else {
|
|
1755
|
-
|
|
1759
|
+
if (process.env.NODE_ENV === "development") {
|
|
1760
|
+
console.log("Requested perp markets already cached:", marketIndexes);
|
|
1761
|
+
}
|
|
1756
1762
|
}
|
|
1757
1763
|
return marketIndexes
|
|
1758
1764
|
.map((marketIndex) => this.perpMarkets.get(marketIndex))
|
|
@@ -1903,15 +1909,19 @@ class DriftClient {
|
|
|
1903
1909
|
}
|
|
1904
1910
|
const spotMarkets = await this.fetchAndParseSpotMarkets(spotMarketIndexes);
|
|
1905
1911
|
const perpMarkets = await this.fetchAndParsePerpMarkets(perpMarketIndexes);
|
|
1906
|
-
|
|
1912
|
+
if (process.env.NODE_ENV === "development") {
|
|
1913
|
+
console.log("[composeRemainingAccounts] perpMarkets:", perpMarkets);
|
|
1914
|
+
}
|
|
1907
1915
|
const oracles = spotMarkets
|
|
1908
1916
|
.map((m) => m.oracle)
|
|
1909
1917
|
.concat(perpMarkets.map((m) => m.oracle));
|
|
1910
1918
|
const markets = spotMarkets
|
|
1911
1919
|
.map((m) => m.marketPda)
|
|
1912
1920
|
.concat(perpMarkets.map((m) => m.marketPda));
|
|
1913
|
-
|
|
1914
|
-
|
|
1921
|
+
if (process.env.NODE_ENV === "development") {
|
|
1922
|
+
console.log("[composeRemainingAccounts] markets:", markets.map((m) => m.toBase58()));
|
|
1923
|
+
console.log("[composeRemainingAccounts] oracles:", oracles.map((o) => o.toBase58()));
|
|
1924
|
+
}
|
|
1915
1925
|
return oracles
|
|
1916
1926
|
.map((o) => ({
|
|
1917
1927
|
pubkey: new web3_js_1.PublicKey(o),
|
|
@@ -8076,7 +8086,7 @@ let globalOpts = { skipSimulation: false };
|
|
|
8076
8086
|
program
|
|
8077
8087
|
.name("glam-cli")
|
|
8078
8088
|
.description("CLI for interacting with the GLAM Protocol")
|
|
8079
|
-
.version("0.1.
|
|
8089
|
+
.version("0.1.22")
|
|
8080
8090
|
.option("-S, --skip-simulation", "Skip transaction simulation");
|
|
8081
8091
|
program
|
|
8082
8092
|
.command("env")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glamsystems/glam-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "CLI for interacting with the GLAM Protocol",
|
|
5
5
|
"main": "./main.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"node": ">=20.18.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@glamsystems/glam-sdk": "0.1.
|
|
24
|
+
"@glamsystems/glam-sdk": "0.1.22",
|
|
25
25
|
"commander": "^11.1.0",
|
|
26
26
|
"inquirer": "^8.2.6",
|
|
27
27
|
"@switchboard-xyz/common": "^3.0.0"
|