@ape.swap/bonds-sdk 1.0.579 → 1.0.581

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.
@@ -70,7 +70,7 @@ 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;
73
+ var billAddress, decimals, maxPrice, amount, maxPriceBigNumber;
74
74
  return __generator(this, function (_a) {
75
75
  billAddress = bondData[0].billAddress;
76
76
  decimals = 18;
@@ -78,14 +78,15 @@ var BondModal = function (_a) {
78
78
  console.log('HANDLEBUY CLICKED');
79
79
  maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
80
80
  amount = convertToTokenValue(inputValue, decimals);
81
- console.log('BillAddress: ', billAddress);
82
- console.log('Amount: ', amount);
83
- console.log('MaxPrice: ', maxPrice);
81
+ maxPriceBigNumber = ethers.BigNumber.from(maxPrice.toFixed(0));
82
+ console.log('BillAddress:', billAddress);
83
+ console.log('Amount:', amount);
84
+ console.log('MaxPrice:', maxPrice);
84
85
  writeContract({
85
86
  address: billAddress,
86
87
  abi: BOND_ABI,
87
88
  functionName: 'deposit',
88
- args: [1, 1, account],
89
+ args: [amount, maxPriceBigNumber, account],
89
90
  });
90
91
  console.log('BuyTransaction:', hash);
91
92
  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.579",
6
+ "version": "1.0.581",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",