@pioneer-platform/pioneer-sdk 4.21.8 → 4.21.9

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 CHANGED
@@ -3350,7 +3350,13 @@ async function getFees(pioneer, networkId) {
3350
3350
  };
3351
3351
  }
3352
3352
  } else {
3353
- feeResponse = await (pioneer.GetFeeRateByNetwork ? pioneer.GetFeeRateByNetwork({ networkId }) : pioneer.GetFeeRate({ networkId }));
3353
+ if (networkType === "EVM") {
3354
+ console.log(tag6, "Using GetGasPriceByNetwork for EVM network:", networkId);
3355
+ feeResponse = await (pioneer.GetGasPriceByNetwork ? pioneer.GetGasPriceByNetwork({ networkId }) : Promise.reject(new Error("GetGasPriceByNetwork not available")));
3356
+ } else {
3357
+ console.log(tag6, "Using GetFeeRateByNetwork for UTXO network:", networkId);
3358
+ feeResponse = await (pioneer.GetFeeRateByNetwork ? pioneer.GetFeeRateByNetwork({ networkId }) : pioneer.GetFeeRate({ networkId }));
3359
+ }
3354
3360
  }
3355
3361
  if (!feeResponse || !feeResponse.data) {
3356
3362
  throw new Error(`No fee data returned for ${networkId}`);
package/dist/index.es.js CHANGED
@@ -3526,7 +3526,13 @@ async function getFees(pioneer, networkId) {
3526
3526
  };
3527
3527
  }
3528
3528
  } else {
3529
- feeResponse = await (pioneer.GetFeeRateByNetwork ? pioneer.GetFeeRateByNetwork({ networkId }) : pioneer.GetFeeRate({ networkId }));
3529
+ if (networkType === "EVM") {
3530
+ console.log(tag6, "Using GetGasPriceByNetwork for EVM network:", networkId);
3531
+ feeResponse = await (pioneer.GetGasPriceByNetwork ? pioneer.GetGasPriceByNetwork({ networkId }) : Promise.reject(new Error("GetGasPriceByNetwork not available")));
3532
+ } else {
3533
+ console.log(tag6, "Using GetFeeRateByNetwork for UTXO network:", networkId);
3534
+ feeResponse = await (pioneer.GetFeeRateByNetwork ? pioneer.GetFeeRateByNetwork({ networkId }) : pioneer.GetFeeRate({ networkId }));
3535
+ }
3530
3536
  }
3531
3537
  if (!feeResponse || !feeResponse.data) {
3532
3538
  throw new Error(`No fee data returned for ${networkId}`);
package/dist/index.js CHANGED
@@ -3526,7 +3526,13 @@ async function getFees(pioneer, networkId) {
3526
3526
  };
3527
3527
  }
3528
3528
  } else {
3529
- feeResponse = await (pioneer.GetFeeRateByNetwork ? pioneer.GetFeeRateByNetwork({ networkId }) : pioneer.GetFeeRate({ networkId }));
3529
+ if (networkType === "EVM") {
3530
+ console.log(tag6, "Using GetGasPriceByNetwork for EVM network:", networkId);
3531
+ feeResponse = await (pioneer.GetGasPriceByNetwork ? pioneer.GetGasPriceByNetwork({ networkId }) : Promise.reject(new Error("GetGasPriceByNetwork not available")));
3532
+ } else {
3533
+ console.log(tag6, "Using GetFeeRateByNetwork for UTXO network:", networkId);
3534
+ feeResponse = await (pioneer.GetFeeRateByNetwork ? pioneer.GetFeeRateByNetwork({ networkId }) : pioneer.GetFeeRate({ networkId }));
3535
+ }
3530
3536
  }
3531
3537
  if (!feeResponse || !feeResponse.data) {
3532
3538
  throw new Error(`No fee data returned for ${networkId}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "highlander",
3
3
  "name": "@pioneer-platform/pioneer-sdk",
4
- "version": "4.21.8",
4
+ "version": "4.21.9",
5
5
  "dependencies": {
6
6
  "@keepkey/keepkey-sdk": "^0.2.62",
7
7
  "@pioneer-platform/loggerdog": "^8.11.0",
@@ -48,8 +48,6 @@
48
48
  },
49
49
  "react-native": "./src/index.ts",
50
50
  "repository": "https://github.com/thorswap/SwapKit.git",
51
- "type": "module",
52
- "types": "./dist/index.d.ts",
53
51
  "scripts": {
54
52
  "build": "bash scripts/build.sh",
55
53
  "build:watch": "nodemon --watch src --exec 'bun run build'",
@@ -57,5 +55,7 @@
57
55
  "lint": "eslint ./ --ext .ts,.tsx --fix; tsc --noEmit",
58
56
  "test": "echo 'vitest --run'",
59
57
  "test:coverage": "echo 'vitest run --coverage'"
60
- }
61
- }
58
+ },
59
+ "type": "module",
60
+ "types": "./dist/index.d.ts"
61
+ }
package/src/fees/index.ts CHANGED
@@ -172,10 +172,20 @@ export async function getFees(
172
172
  };
173
173
  }
174
174
  } else {
175
- // Normal API call for other networks
176
- feeResponse = await (pioneer.GetFeeRateByNetwork
177
- ? pioneer.GetFeeRateByNetwork({ networkId })
178
- : pioneer.GetFeeRate({ networkId }));
175
+ // Route to correct API endpoint based on network type
176
+ if (networkType === 'EVM') {
177
+ // For EVM networks, use GetGasPriceByNetwork endpoint
178
+ console.log(tag, 'Using GetGasPriceByNetwork for EVM network:', networkId);
179
+ feeResponse = await (pioneer.GetGasPriceByNetwork
180
+ ? pioneer.GetGasPriceByNetwork({ networkId })
181
+ : Promise.reject(new Error('GetGasPriceByNetwork not available')));
182
+ } else {
183
+ // For UTXO networks, use GetFeeRateByNetwork endpoint
184
+ console.log(tag, 'Using GetFeeRateByNetwork for UTXO network:', networkId);
185
+ feeResponse = await (pioneer.GetFeeRateByNetwork
186
+ ? pioneer.GetFeeRateByNetwork({ networkId })
187
+ : pioneer.GetFeeRate({ networkId }));
188
+ }
179
189
  }
180
190
 
181
191
  if (!feeResponse || !feeResponse.data) {