diff --git a/src/components/Vault.vue b/src/components/Vault.vue index ee263e3..6131028 100644 --- a/src/components/Vault.vue +++ b/src/components/Vault.vue @@ -39,7 +39,7 @@ :on-withdraw="onWithdrawNative" :on-wrap="()=>wrapShow=true"/> - + @@ -83,7 +83,7 @@ const balances = computed(()=>{ const empty = computed(()=>{ if(nativeBalance.value!==0n) return false for( const v of Object.values(balances.value) ) - if(v!==0n) + if(BigInt(v)!==0n) return false return true }) diff --git a/src/components/Withdraw.vue b/src/components/Withdraw.vue index 5d05cc1..f6ab55b 100644 --- a/src/components/Withdraw.vue +++ b/src/components/Withdraw.vue @@ -36,7 +36,7 @@ const props = defineProps(['modelValue', 'vault', 'token']) const emit = defineEmits(['update:modelValue']) const balance = computed(() => { console.log('balance', props.vault, props.token, s.vaultBalances) - return s.vaultBalances[props.vault][props.token.address] || 0 + return BigInt(s.vaultBalances[props.vault][props.token.address]) || 0n }) const balanceFloat = computed(() => tokenFloat(props.token, balance.value)) const floatAmount = ref(0) @@ -46,9 +46,9 @@ function withdraw() { const valueStr = floatAmount.value.toString(); 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 + console.log('pending withdrawal', valueStr, amount, props.token.s) pendTransaction(async (signer)=>{ const vault = await vaultContract(vaultAddr, signer) return await vault['withdraw(address,uint256)'](props.token.a, amount)