Closed NikolaiYurchenko closed 1 year ago
@NikolaiYurchenko I tried to borrow and the tooltip didn't show up and realized you made a mistake.
You shouldn't use the needsAllowance
function, that's not what we're trying to know. Use borrow.store
's needsSignature
property instead. They're two completely separate things.
Sdk.needSignature(route.actions)
)sdk.getAllowanceFor(token, Address.from(address))
Actually you'll have to simplify the code. Remove needsAllowance
function and replace with the needsSignaure
prop.
that was my first sollution but seems like we additionally call sdk on every input change because we arent doing this now i believe. I'll work on this more
that was my first sollution but seems like we additionally call sdk on every input change because we arent doing this now i believe. I'll work on this more
Yes, we are because in order to know the operation type we need to check the user's input in real-time. Let me give you an example:
DEPOSIT_AND_BORROW
.BORROW
DEPOSIT_AND_BORROW
.DEPOSIT
Remove position
All of the above change the operation type and so we make a lot of calls to know if the user needs to sign the thing or not. Now, if we're still making too many calls and we can improve, great.
https://github.com/Fujicracy/fuji-v2/issues/370