gondi 0.54.0 → 0.58.1

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/README.md CHANGED
@@ -68,11 +68,12 @@ const wallet = createWalletClient({
68
68
  chain: mainnet,
69
69
  });
70
70
  const gondi = new Gondi({ wallet });
71
+ const MSL = gondi.offerContractAddress(); // The loan contract makeCollectionOffer signs for on this chain.
71
72
 
72
73
  // 1. Let the loan contract pull the principal when a borrower takes the offer (onchain, once).
73
74
  const principalAmount = parseEther('1');
74
- if (!(await gondi.isApprovedToken({ tokenAddress: WETH, amount: principalAmount }))) {
75
- const approval = await gondi.approveToken({ tokenAddress: WETH }); // Unlimited unless you pass `amount`.
75
+ if (!(await gondi.isApprovedToken({ tokenAddress: WETH, amount: principalAmount, to: MSL }))) {
76
+ const approval = await gondi.approveToken({ tokenAddress: WETH, to: MSL }); // Unlimited unless you pass `amount`.
76
77
  await approval.waitTxInBlock();
77
78
  }
78
79