@zyfai/sdk 0.2.39 → 0.2.40

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.js CHANGED
@@ -495,15 +495,21 @@ var VAULT_ADDRESS = "0xD580071c47d4a667858B5FafAb85BC9C609beC5D";
495
495
  // src/config/constants.ts
496
496
  var MIN_PORTFOLIO_BALANCE = {
497
497
  1: {
498
- USDC: 10000n * 10n ** 6n,
499
- // 10,000 USDC (6 decimals)
500
- WETH: 5n * 10n ** 18n
501
- // 5 WETH (18 decimals)
498
+ USDC: 100n * 10n ** 6n,
499
+ // 100 USDC (6 decimals)
500
+ WETH: 5n * 10n ** 15n
501
+ // 0.005 WETH (18 decimals)
502
502
  }
503
503
  };
504
504
  var formatMinPortfolioLabel = (raw, decimals, symbol) => {
505
- const whole = raw / 10n ** BigInt(decimals);
506
- return `${whole.toString()} ${symbol}`;
505
+ const base2 = 10n ** BigInt(decimals);
506
+ const whole = raw / base2;
507
+ const fraction = raw % base2;
508
+ if (fraction === 0n) {
509
+ return `${whole.toString()} ${symbol}`;
510
+ }
511
+ const fractionStr = fraction.toString().padStart(decimals, "0").replace(/0+$/, "");
512
+ return `${whole.toString()}.${fractionStr} ${symbol}`;
507
513
  };
508
514
 
509
515
  // src/core/ZyfaiSDK.ts
package/dist/index.mjs CHANGED
@@ -452,15 +452,21 @@ var VAULT_ADDRESS = "0xD580071c47d4a667858B5FafAb85BC9C609beC5D";
452
452
  // src/config/constants.ts
453
453
  var MIN_PORTFOLIO_BALANCE = {
454
454
  1: {
455
- USDC: 10000n * 10n ** 6n,
456
- // 10,000 USDC (6 decimals)
457
- WETH: 5n * 10n ** 18n
458
- // 5 WETH (18 decimals)
455
+ USDC: 100n * 10n ** 6n,
456
+ // 100 USDC (6 decimals)
457
+ WETH: 5n * 10n ** 15n
458
+ // 0.005 WETH (18 decimals)
459
459
  }
460
460
  };
461
461
  var formatMinPortfolioLabel = (raw, decimals, symbol) => {
462
- const whole = raw / 10n ** BigInt(decimals);
463
- return `${whole.toString()} ${symbol}`;
462
+ const base2 = 10n ** BigInt(decimals);
463
+ const whole = raw / base2;
464
+ const fraction = raw % base2;
465
+ if (fraction === 0n) {
466
+ return `${whole.toString()} ${symbol}`;
467
+ }
468
+ const fractionStr = fraction.toString().padStart(decimals, "0").replace(/0+$/, "");
469
+ return `${whole.toString()}.${fractionStr} ${symbol}`;
464
470
  };
465
471
 
466
472
  // src/core/ZyfaiSDK.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyfai/sdk",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "description": "TypeScript SDK for Zyfai Yield Optimization Engine - Deploy Safe smart wallets, manage session keys, and interact with DeFi protocols",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",