# 클레이 전송시 에러(insufficient funds of the sender for value)

**URL:** <https://devforum.kaia.io/t/insufficient-funds-of-the-sender-for-value/6360>\
**Category:** Kaia\
**Tags:** caver-js, klaytn\
**Created:** [1월 10, 2023, 3:19오전 UTC](https://devforum.kaia.io/t/insufficient-funds-of-the-sender-for-value/6360 "2023-01-10T03:19:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolmarvel](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/coolmarvel/32/2989_2.png) [@coolmarvel](https://devforum.kaia.io/u/coolmarvel)\
**Post date:** [1월 10, 2023, 3:19오전 UTC](https://devforum.kaia.io/t/insufficient-funds-of-the-sender-for-value/6360/1 "2023-01-10T03:19:26Z")

</div>

안녕하세요 클레이 전송에 관해서 이해가 안가는 부분이 있어 질문 드립니다.

```auto
const fromBalance = await getBalance(fromAddress);
console.log(fromBalance); // 149.97172499999999

```

이렇게 나온 balance를 toAddress에게 전송하려고 하는데

```auto
const a = parseFloat(balance) * 1000000 // 149.971725
const b = parseFloat("0.000525") * 1000000 // 525
const c = (a - b) / 1000000 // 149.9712
const d = c.toString() // "149.9712"

const tx = {
        type: "VALUE_TRANSFER",
        from: fromAddress,
        to: toAddress,
        gas: 300000,
        value: baobab.utils.toPeb(d, "KLAY"),
};
const result = await baobab.klay.sendTransaction(tx);

```

insufficient funds of the sender for value 가 뜹니다.

클레이 전송 가스비가 0.000525 klay가 소비되는거로 알고 있는데 잘못된 건가요???

---

<div class="post-metadata">

**Author:** ![jack\_jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/jack_jin/32/2305_2.png) [@jack\_jin](https://devforum.kaia.io/u/jack_jin)\
**Post date:** [1월 10, 2023, 5:22오전 UTC](https://devforum.kaia.io/t/insufficient-funds-of-the-sender-for-value/6360/2 "2023-01-10T05:22:18Z")

</div>

안녕하세요, 가스비는 기본적으로 2배를 측정해서 제출된 뒤에 환불되도록 되어있습니다.  
또한 네트워크 상황에 따라서 가스비가 상승할 수 있기때문에 가스비를 계산하실 때 [링크](https://ko.docs.klaytn.foundation/content/dapp/sdk/caver-js#use-tx.suggestgasprice-method)를 참고하셔서 계산하시는게 보다 유연한 방법인것 같습니다.

---

<div class="post-metadata">

**Author:** ![coolmarvel](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/coolmarvel/32/2989_2.png) [@coolmarvel](https://devforum.kaia.io/u/coolmarvel)\
**Post date:** [1월 10, 2023, 5:30오전 UTC](https://devforum.kaia.io/t/insufficient-funds-of-the-sender-for-value/6360/3 "2023-01-10T05:30:31Z")

</div>

감사합니다 다시 한번 해보겠습니다! 환불은 트랜잭션이 발생하면 즉각적으로 받는건가요?

---

<div class="post-metadata">

**Author:** ![jack\_jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/jack_jin/32/2305_2.png) [@jack\_jin](https://devforum.kaia.io/u/jack_jin)\
**Post date:** [1월 10, 2023, 5:31오전 UTC](https://devforum.kaia.io/t/insufficient-funds-of-the-sender-for-value/6360/4 "2023-01-10T05:31:55Z")

</div>

1블럭내의 트랜잭션을 모두 처리하면서 내부적으로 환불되기 때문에 클레이튼 네트워크 사용자입장에서는 체감하지는 못합니다. 다시한번 해보시고 잘 안되시면 또 문의주세요~
