# KAS를 통한 FeeDelegationTransaction 간헐적 오류

**URL:** <https://devforum.kaia.io/t/kas-feedelegationtransaction/792>\
**Category:** KAS (아카이브)\
**Tags:** fee-delegation\
**Created:** [3월 24, 2021, 7:18오전 UTC](https://devforum.kaia.io/t/kas-feedelegationtransaction/792 "2021-03-24T07:18:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev\_psx](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@dev\_psx](https://devforum.kaia.io/u/dev_psx)\
**Post date:** [3월 24, 2021, 7:18오전 UTC](https://devforum.kaia.io/t/kas-feedelegationtransaction/792/1 "2021-03-24T07:18:55Z")

</div>

안녕하세요, KAS wallet API를 통해 FDTx를 보내고 있습니다.

간헐적으로

(body={‘code’: 1065001, ‘message’: ‘failed to send a raw transaction to klaytn node; -32000::there is another tx which has the same nonce in the tx pool’, ‘requestId’: ‘a5cff3d7-da12-4e52-bc24-95a69972302e’})args: url: [https://wallet-api.klaytnapi.com/v2/tx/fd/value](https://wallet-api.klaytnapi.com/v2/tx/fd/value), method: POST, kwargs: {‘headers’: {‘Content-Type’: ‘application/json’, ‘x-chain-id’: ‘8217’}, ‘auth’: \<requests.auth.HTTPBasicAuth object at 0x7f08ed83d908\>, ‘data’: '{“from” … (trunacted)

아래같은 에러가 뜨는데, 이유를 알 수 있을까요?  
[https://refs.klaytnapi.com/ko/wallet/latest#section/Error-Codes/400:-Bad-Request](https://refs.klaytnapi.com/ko/wallet/latest#section/Error-Codes/400:-Bad-Request)  
의 에러코드 1065001 는  
failed to send a raw transaction to klaytn node; -32000::insufficient funds of the sender for value  
failed to send a raw transaction to klaytn node; -32000::not a program account (e.g., an account having code and storage)  
failed to send a raw transaction to klaytn node; -32000::nonce too low  
failed to send a raw transaction to klaytn node; -32000::insufficient funds of the fee payer for gas \* price  
로 나와있는데,  
위 400 response의 이유는 there is another tx which has the same nonce in the tx pool 라고 써있습니다.

nonce는 0 (=default) 로 보내고 있습니다.  
감사합니다.

---

<div class="post-metadata">

**Author:** ![\_Luffy](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/_luffy/32/33_2.png) [@\_Luffy](https://devforum.kaia.io/u/_Luffy)\
**Post date:** [3월 24, 2021, 3:13오후 UTC](https://devforum.kaia.io/t/kas-feedelegationtransaction/792/2 "2021-03-24T15:13:53Z")

</div>

@dev_psx 안녕하십니까. KAS 개발팀입니다.

해당 에러는 빠르게 트랜잭션이 유입되는 경우에 발생할 수 있는에러입니다.  
현재 Wallet API 에서 제공하는 자동 nonce 기능은 해당 클레이튼 계정의 마지막으로 성공한 nonce 를 기준으로 사용하고 있습니다.  
따라서 동일한 nonce 를 가진 트랜잭션중에 처리되지 않은 트랜잭션이 있다면 한계가 있습니다.

추후 이 부분에 대한 개선을 하기 위해서 노력을 하고 있지만, 지금 현재는 빠르게 트랜잭션을 넣고 싶은 경우에는 수동으로 nonce 를 관리해서 같이 넣어주시면 해당 문제를 해결할 수 있습니다.

감사합니다.

---

<div class="post-metadata">

**Author:** ![wook](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/wook/32/2214_2.png) [@wook](https://devforum.kaia.io/u/wook)\
**Post date:** [3월 28, 2022, 5:35오전 UTC](https://devforum.kaia.io/t/kas-feedelegationtransaction/792/3 "2022-03-28T05:35:31Z")

</div>

@_Luffy

caver-java 에서 nonce를 수동으로 관리하는 방법이 있을까요?

문서를 다 찾아보고있는데도 특별히 나오는게 없어 여쭤봅니다.
