Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

v3 close_position error ValueError: {'code': -32000, 'message': 'unknown account'}#382

Unanswered
gosupport1 asked this question inQ&A
Discussion options

I am try close my opened uniswap v3 positions with.close_position() method, but get this error:

ValueError: {'code': -32000, 'message': 'unknown account'}

So it find my position id 1547621 but crashing on close_position

why this can happen and how to fix?

this is script:

from uniswap import Uniswapfrom web3 import Web3from web3.middleware import geth_poa_middlewareprovider = "https://polygon-rpc.com"    # can also be set through the environment variable `PROVIDER`web3 = Web3(Web3.HTTPProvider(provider))web3.middleware_onion.inject(geth_poa_middleware, layer=0)address = "0x2017b2ad2e3f25F1F9354981Fd9a06341d178De5"          # or None if you're not going to make transactionsprivate_key = "xxx"  # or None if you're not going to make transactionsversion = 3                      # specify which version of Uniswap to useuniswap = Uniswap(address=address, private_key=private_key, version=version, provider=provider, web3 = web3)# Some token addresses we'll be using later in this guide#eth = "0x0000000000000000000000000000000000000000"#bat = "0x0D8775F648430679A709E98d2b0Cb6250d2887EF"#dai = "0x6B175474E89094C44Da98b954EedeAC495271d0F"usdce = Web3.to_checksum_address("0x2791bca1f2de4661ed88a30c99a7a9449aa84174")wbtc = Web3.to_checksum_address("0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6")nfpm_contract_address = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"print(uniswap.get_price_input(wbtc, usdce, 10**8))print(uniswap.get_liquidity_positions())for p in uniswap.get_liquidity_positions():    #uniswap.approve(p)    print(p)    print(uniswap.close_position(p))#uniswap.close_position()
You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@gosupport1

[8]ページ先頭

©2009-2025 Movatter.jp