@pioneer-platform/pioneer-sdk 8.15.5 → 8.15.7
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.cjs +4 -12
- package/dist/index.es.js +4 -12
- package/dist/index.js +4 -12
- package/package.json +1 -1
- package/src/charts/cosmos-staking.ts +7 -16
package/dist/index.cjs
CHANGED
|
@@ -644,15 +644,6 @@ async function getCosmosStakingCharts(params) {
|
|
|
644
644
|
const { blockchains, pioneer, pubkeys, context } = params;
|
|
645
645
|
const balances = [];
|
|
646
646
|
try {
|
|
647
|
-
try {
|
|
648
|
-
const fastFlag = typeof process !== "undefined" && process.env && process.env.PIONEER_FAST === "1";
|
|
649
|
-
const isTestContext = typeof context === "string" && /test|e2e/i.test(context);
|
|
650
|
-
if (fastFlag || isTestContext) {
|
|
651
|
-
console.log(tag4, "Fast mode detected (test/e2e). Skipping cosmos staking fetch.");
|
|
652
|
-
return balances;
|
|
653
|
-
}
|
|
654
|
-
} catch (_) {
|
|
655
|
-
}
|
|
656
647
|
console.log(tag4, "Adding Cosmos staking positions to charts...");
|
|
657
648
|
console.log(tag4, "Total pubkeys:", pubkeys.length);
|
|
658
649
|
console.log(tag4, "All pubkeys:", pubkeys.map((p) => ({ address: p.address, networks: p.networks })));
|
|
@@ -696,12 +687,13 @@ async function fetchStakingPositionsForNetwork(networkId, address, context, pion
|
|
|
696
687
|
network,
|
|
697
688
|
address
|
|
698
689
|
});
|
|
699
|
-
|
|
690
|
+
const positions = stakingResponse?.data?.data || stakingResponse?.data || [];
|
|
691
|
+
if (!Array.isArray(positions) || positions.length === 0) {
|
|
700
692
|
console.log(tag4, `No staking positions found for ${address} on ${networkId}`);
|
|
701
693
|
return;
|
|
702
694
|
}
|
|
703
|
-
console.log(tag4, `Found ${
|
|
704
|
-
for (const position of
|
|
695
|
+
console.log(tag4, `Found ${positions.length} staking positions for ${networkId}`);
|
|
696
|
+
for (const position of positions) {
|
|
705
697
|
const processedPosition = processStakingPosition(position, address, context, networkId);
|
|
706
698
|
if (processedPosition && !checkDuplicateBalance(balances, processedPosition.caip, processedPosition.pubkey, processedPosition.validator)) {
|
|
707
699
|
balances.push(processedPosition);
|
package/dist/index.es.js
CHANGED
|
@@ -635,15 +635,6 @@ async function getCosmosStakingCharts(params) {
|
|
|
635
635
|
const { blockchains, pioneer, pubkeys, context } = params;
|
|
636
636
|
const balances = [];
|
|
637
637
|
try {
|
|
638
|
-
try {
|
|
639
|
-
const fastFlag = typeof process !== "undefined" && process.env && process.env.PIONEER_FAST === "1";
|
|
640
|
-
const isTestContext = typeof context === "string" && /test|e2e/i.test(context);
|
|
641
|
-
if (fastFlag || isTestContext) {
|
|
642
|
-
console.log(tag4, "Fast mode detected (test/e2e). Skipping cosmos staking fetch.");
|
|
643
|
-
return balances;
|
|
644
|
-
}
|
|
645
|
-
} catch (_2) {
|
|
646
|
-
}
|
|
647
638
|
console.log(tag4, "Adding Cosmos staking positions to charts...");
|
|
648
639
|
console.log(tag4, "Total pubkeys:", pubkeys.length);
|
|
649
640
|
console.log(tag4, "All pubkeys:", pubkeys.map((p) => ({ address: p.address, networks: p.networks })));
|
|
@@ -687,12 +678,13 @@ async function fetchStakingPositionsForNetwork(networkId, address, context, pion
|
|
|
687
678
|
network,
|
|
688
679
|
address
|
|
689
680
|
});
|
|
690
|
-
|
|
681
|
+
const positions = stakingResponse?.data?.data || stakingResponse?.data || [];
|
|
682
|
+
if (!Array.isArray(positions) || positions.length === 0) {
|
|
691
683
|
console.log(tag4, `No staking positions found for ${address} on ${networkId}`);
|
|
692
684
|
return;
|
|
693
685
|
}
|
|
694
|
-
console.log(tag4, `Found ${
|
|
695
|
-
for (const position of
|
|
686
|
+
console.log(tag4, `Found ${positions.length} staking positions for ${networkId}`);
|
|
687
|
+
for (const position of positions) {
|
|
696
688
|
const processedPosition = processStakingPosition(position, address, context, networkId);
|
|
697
689
|
if (processedPosition && !checkDuplicateBalance(balances, processedPosition.caip, processedPosition.pubkey, processedPosition.validator)) {
|
|
698
690
|
balances.push(processedPosition);
|
package/dist/index.js
CHANGED
|
@@ -635,15 +635,6 @@ async function getCosmosStakingCharts(params) {
|
|
|
635
635
|
const { blockchains, pioneer, pubkeys, context } = params;
|
|
636
636
|
const balances = [];
|
|
637
637
|
try {
|
|
638
|
-
try {
|
|
639
|
-
const fastFlag = typeof process !== "undefined" && process.env && process.env.PIONEER_FAST === "1";
|
|
640
|
-
const isTestContext = typeof context === "string" && /test|e2e/i.test(context);
|
|
641
|
-
if (fastFlag || isTestContext) {
|
|
642
|
-
console.log(tag4, "Fast mode detected (test/e2e). Skipping cosmos staking fetch.");
|
|
643
|
-
return balances;
|
|
644
|
-
}
|
|
645
|
-
} catch (_2) {
|
|
646
|
-
}
|
|
647
638
|
console.log(tag4, "Adding Cosmos staking positions to charts...");
|
|
648
639
|
console.log(tag4, "Total pubkeys:", pubkeys.length);
|
|
649
640
|
console.log(tag4, "All pubkeys:", pubkeys.map((p) => ({ address: p.address, networks: p.networks })));
|
|
@@ -687,12 +678,13 @@ async function fetchStakingPositionsForNetwork(networkId, address, context, pion
|
|
|
687
678
|
network,
|
|
688
679
|
address
|
|
689
680
|
});
|
|
690
|
-
|
|
681
|
+
const positions = stakingResponse?.data?.data || stakingResponse?.data || [];
|
|
682
|
+
if (!Array.isArray(positions) || positions.length === 0) {
|
|
691
683
|
console.log(tag4, `No staking positions found for ${address} on ${networkId}`);
|
|
692
684
|
return;
|
|
693
685
|
}
|
|
694
|
-
console.log(tag4, `Found ${
|
|
695
|
-
for (const position of
|
|
686
|
+
console.log(tag4, `Found ${positions.length} staking positions for ${networkId}`);
|
|
687
|
+
for (const position of positions) {
|
|
696
688
|
const processedPosition = processStakingPosition(position, address, context, networkId);
|
|
697
689
|
if (processedPosition && !checkDuplicateBalance(balances, processedPosition.caip, processedPosition.pubkey, processedPosition.validator)) {
|
|
698
690
|
balances.push(processedPosition);
|
package/package.json
CHANGED
|
@@ -6,20 +6,8 @@ const tag = '| charts-cosmos-staking |';
|
|
|
6
6
|
export async function getCosmosStakingCharts(params: ChartParams): Promise<ChartBalance[]> {
|
|
7
7
|
const { blockchains, pioneer, pubkeys, context } = params;
|
|
8
8
|
const balances: ChartBalance[] = [];
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
// Fast-path: skip staking in test/e2e or when explicitly requested
|
|
12
|
-
try {
|
|
13
|
-
const fastFlag = typeof process !== 'undefined' && process.env && process.env.PIONEER_FAST === '1';
|
|
14
|
-
const isTestContext = typeof context === 'string' && /test|e2e/i.test(context);
|
|
15
|
-
if (fastFlag || isTestContext) {
|
|
16
|
-
console.log(tag, 'Fast mode detected (test/e2e). Skipping cosmos staking fetch.');
|
|
17
|
-
return balances;
|
|
18
|
-
}
|
|
19
|
-
} catch (_) {
|
|
20
|
-
// ignore
|
|
21
|
-
}
|
|
22
9
|
|
|
10
|
+
try {
|
|
23
11
|
console.log(tag, 'Adding Cosmos staking positions to charts...');
|
|
24
12
|
console.log(tag, 'Total pubkeys:', pubkeys.length);
|
|
25
13
|
console.log(tag, 'All pubkeys:', pubkeys.map((p: any) => ({ address: p.address, networks: p.networks })));
|
|
@@ -105,17 +93,20 @@ async function fetchStakingPositionsForNetwork(
|
|
|
105
93
|
address,
|
|
106
94
|
});
|
|
107
95
|
|
|
108
|
-
|
|
96
|
+
// Extract positions array from nested data structure
|
|
97
|
+
const positions = stakingResponse?.data?.data || stakingResponse?.data || [];
|
|
98
|
+
|
|
99
|
+
if (!Array.isArray(positions) || positions.length === 0) {
|
|
109
100
|
console.log(tag, `No staking positions found for ${address} on ${networkId}`);
|
|
110
101
|
return;
|
|
111
102
|
}
|
|
112
103
|
|
|
113
104
|
console.log(
|
|
114
105
|
tag,
|
|
115
|
-
`Found ${
|
|
106
|
+
`Found ${positions.length} staking positions for ${networkId}`,
|
|
116
107
|
);
|
|
117
108
|
|
|
118
|
-
for (const position of
|
|
109
|
+
for (const position of positions) {
|
|
119
110
|
const processedPosition = processStakingPosition(
|
|
120
111
|
position,
|
|
121
112
|
address,
|