|
@@ -1047,6 +1047,9 @@ export class PythStakingClient {
|
|
|
public async getAllStakeAccountPositionsAllOwners(): Promise<
|
|
public async getAllStakeAccountPositionsAllOwners(): Promise<
|
|
|
StakeAccountPositions[]
|
|
StakeAccountPositions[]
|
|
|
> {
|
|
> {
|
|
|
|
|
+ // eslint-disable-next-line no-console
|
|
|
|
|
+ console.log("Calling RPC");
|
|
|
|
|
+
|
|
|
const res = await fetch(this.connection.rpcEndpoint, {
|
|
const res = await fetch(this.connection.rpcEndpoint, {
|
|
|
method: "POST",
|
|
method: "POST",
|
|
|
headers: {
|
|
headers: {
|
|
@@ -1075,6 +1078,9 @@ export class PythStakingClient {
|
|
|
}),
|
|
}),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // eslint-disable-next-line no-console
|
|
|
|
|
+ console.log("Received response");
|
|
|
|
|
+
|
|
|
if (res.ok) {
|
|
if (res.ok) {
|
|
|
const { body } = res;
|
|
const { body } = res;
|
|
|
if (body) {
|
|
if (body) {
|
|
@@ -1095,11 +1101,17 @@ export class PythStakingClient {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // eslint-disable-next-line no-console
|
|
|
|
|
+ console.log("Running JSON parser");
|
|
|
|
|
+
|
|
|
parse().catch((error: unknown) => {
|
|
parse().catch((error: unknown) => {
|
|
|
reject(error instanceof Error ? error : new Error("Unknown Error"));
|
|
reject(error instanceof Error ? error : new Error("Unknown Error"));
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // eslint-disable-next-line no-console
|
|
|
|
|
+ console.log("Parsed JSON");
|
|
|
|
|
+
|
|
|
return accountSchema
|
|
return accountSchema
|
|
|
.parse(accounts)
|
|
.parse(accounts)
|
|
|
.map(({ pubkey, account }) =>
|
|
.map(({ pubkey, account }) =>
|