@ape.swap/bonds-sdk 1.0.577 → 1.0.579

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.
@@ -47,7 +47,7 @@ import { isNumber } from '../../../utils/numbers';
47
47
  import { TooltipBubble, Button, Svg, ListTag } from '../../uikit-sdk';
48
48
  import { TooltipText } from '../../../enum/tooltips';
49
49
  import { ethers } from 'ethers';
50
- import convertToTokenValue, { adjustDecimals } from "../../../utils/convertToTokenValue";
50
+ import convertToTokenValue from "../../../utils/convertToTokenValue";
51
51
  import TokenImage from '../../uikit-sdk/TokenImage';
52
52
  import BOND_ABI from '../../../config/abi/bond.json';
53
53
  import ERC_20_ABI from '../../../config/abi/erc20.json';
@@ -70,25 +70,22 @@ var BondModal = function (_a) {
70
70
  //user to buy
71
71
  //Check with Fede if this needs to be temp, if we force approval everytime, isn't this fine?
72
72
  var handleBuy = function () { return __awaiter(void 0, void 0, void 0, function () {
73
- var billAddress, decimals, maxPrice, amount, amountAlt, amountAlt2;
74
- var _a;
75
- return __generator(this, function (_b) {
73
+ var billAddress, decimals, maxPrice, amount;
74
+ return __generator(this, function (_a) {
76
75
  billAddress = bondData[0].billAddress;
77
76
  decimals = 18;
78
77
  try {
79
78
  console.log('HANDLEBUY CLICKED');
80
79
  maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
81
80
  amount = convertToTokenValue(inputValue, decimals);
82
- amountAlt = adjustDecimals(inputValue);
83
- amountAlt2 = new BigNumber(amountAlt).times(new BigNumber(10).pow((_a = bondData[0].principalTokenDecimals) !== null && _a !== void 0 ? _a : 18)).toString();
84
- console.log('Amount:', amount);
85
- console.log('MaxPrice:', maxPrice);
86
- // @ts-ignore
81
+ console.log('BillAddress: ', billAddress);
82
+ console.log('Amount: ', amount);
83
+ console.log('MaxPrice: ', maxPrice);
87
84
  writeContract({
88
85
  address: billAddress,
89
86
  abi: BOND_ABI,
90
87
  functionName: 'deposit',
91
- args: [amount, maxPrice.toFixed(0), account],
88
+ args: [1, 1, account],
92
89
  });
93
90
  console.log('BuyTransaction:', hash);
94
91
  if (hash) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.577",
6
+ "version": "1.0.579",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",