native coin handling

This commit is contained in:
tim
2024-09-06 19:42:33 -04:00
parent 93dfb8bdcd
commit 84cadc6e6f
13 changed files with 460 additions and 265 deletions

View File

@@ -44,7 +44,8 @@ const floatAmount = ref(0)
function withdraw() {
const vaultAddr = props.vault
const valueStr = floatAmount.value.toString();
const amount = FixedNumber.fromString(valueStr,{decimals:props.token.d, width:256, signed: false}).value;
const amount = floatAmount.value === balanceFloat.value ? balance.value :
FixedNumber.fromString(valueStr,{decimals:props.token.d, width:256, signed: false}).value;
console.log('pending withdrawal', valueStr, amount, props.token.s)
if( amount === 0n )
return