@pioneer-platform/pioneer-sdk 4.20.11 → 4.20.12

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
@@ -1891,7 +1891,7 @@ async function createUnsignedEvmTx(caip, to, amount, memo, pubkeys, pioneer, pub
1891
1891
  let nonce;
1892
1892
  try {
1893
1893
  const nonceData = await pioneer.GetNonceByNetwork({ networkId, address });
1894
- nonce = nonceData.data;
1894
+ nonce = nonceData.data.nonce;
1895
1895
  if (nonce === undefined || nonce === null) {
1896
1896
  console.log(tag5, "No nonce found for address (likely fresh address), defaulting to 0");
1897
1897
  nonce = 0;
@@ -1901,7 +1901,7 @@ async function createUnsignedEvmTx(caip, to, amount, memo, pubkeys, pioneer, pub
1901
1901
  nonce = 0;
1902
1902
  }
1903
1903
  const balanceData = await pioneer.GetBalanceAddressByNetwork({ networkId, address });
1904
- const balanceEth = balanceData.data;
1904
+ const balanceEth = parseFloat(balanceData.data.balance);
1905
1905
  const balance = BigInt(Math.round(balanceEth * 1000000000000000000));
1906
1906
  if (balance <= 0n)
1907
1907
  throw new Error("Wallet balance is zero");
package/dist/index.es.js CHANGED
@@ -2067,7 +2067,7 @@ async function createUnsignedEvmTx(caip, to, amount, memo, pubkeys, pioneer, pub
2067
2067
  let nonce;
2068
2068
  try {
2069
2069
  const nonceData = await pioneer.GetNonceByNetwork({ networkId, address });
2070
- nonce = nonceData.data;
2070
+ nonce = nonceData.data.nonce;
2071
2071
  if (nonce === undefined || nonce === null) {
2072
2072
  console.log(tag5, "No nonce found for address (likely fresh address), defaulting to 0");
2073
2073
  nonce = 0;
@@ -2077,7 +2077,7 @@ async function createUnsignedEvmTx(caip, to, amount, memo, pubkeys, pioneer, pub
2077
2077
  nonce = 0;
2078
2078
  }
2079
2079
  const balanceData = await pioneer.GetBalanceAddressByNetwork({ networkId, address });
2080
- const balanceEth = balanceData.data;
2080
+ const balanceEth = parseFloat(balanceData.data.balance);
2081
2081
  const balance = BigInt(Math.round(balanceEth * 1000000000000000000));
2082
2082
  if (balance <= 0n)
2083
2083
  throw new Error("Wallet balance is zero");
package/dist/index.js CHANGED
@@ -2067,7 +2067,7 @@ async function createUnsignedEvmTx(caip, to, amount, memo, pubkeys, pioneer, pub
2067
2067
  let nonce;
2068
2068
  try {
2069
2069
  const nonceData = await pioneer.GetNonceByNetwork({ networkId, address });
2070
- nonce = nonceData.data;
2070
+ nonce = nonceData.data.nonce;
2071
2071
  if (nonce === undefined || nonce === null) {
2072
2072
  console.log(tag5, "No nonce found for address (likely fresh address), defaulting to 0");
2073
2073
  nonce = 0;
@@ -2077,7 +2077,7 @@ async function createUnsignedEvmTx(caip, to, amount, memo, pubkeys, pioneer, pub
2077
2077
  nonce = 0;
2078
2078
  }
2079
2079
  const balanceData = await pioneer.GetBalanceAddressByNetwork({ networkId, address });
2080
- const balanceEth = balanceData.data;
2080
+ const balanceEth = parseFloat(balanceData.data.balance);
2081
2081
  const balance = BigInt(Math.round(balanceEth * 1000000000000000000));
2082
2082
  if (balance <= 0n)
2083
2083
  throw new Error("Wallet balance is zero");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "highlander",
3
3
  "name": "@pioneer-platform/pioneer-sdk",
4
- "version": "4.20.11",
4
+ "version": "4.20.12",
5
5
  "dependencies": {
6
6
  "@keepkey/keepkey-sdk": "^0.2.62",
7
7
  "@pioneer-platform/loggerdog": "^8.11.0",
@@ -241,8 +241,8 @@ export async function createUnsignedEvmTx(
241
241
  let nonce;
242
242
  try {
243
243
  const nonceData = await pioneer.GetNonceByNetwork({ networkId, address });
244
- nonce = nonceData.data;
245
-
244
+ nonce = nonceData.data.nonce;
245
+
246
246
  // Handle fresh addresses that have never sent a transaction
247
247
  if (nonce === undefined || nonce === null) {
248
248
  console.log(tag, 'No nonce found for address (likely fresh address), defaulting to 0');
@@ -256,7 +256,7 @@ export async function createUnsignedEvmTx(
256
256
  //console.log(tag, 'nonce:', nonce);
257
257
 
258
258
  const balanceData = await pioneer.GetBalanceAddressByNetwork({ networkId, address });
259
- const balanceEth = balanceData.data; // Assuming this is in ETH
259
+ const balanceEth = parseFloat(balanceData.data.balance); // Assuming this is in ETH
260
260
  const balance = BigInt(Math.round(balanceEth * 1e18)); // Convert to wei
261
261
  //console.log(tag, 'balance (wei):', balance.toString());
262
262
  if (balance <= 0n) throw new Error('Wallet balance is zero');