主流大模型写代码全军覆没:根据助记词查询钱包余额 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
landOfHeavens
V2EX    分享发现

主流大模型写代码全军覆没:根据助记词查询钱包余额

  •  
  •   landOfHeavens 2024-04-10 16:36:07 +08:00 1546 次点击
    这是一个创建于 556 天前的主题,其中的信息可能已经有所发展或是发生改变。

    根据钱包(区块链)助记词查询钱包的余额(可以是 btc ,eth 等)

    试了一下 gpt-4 、Claude-Opus 、谷歌 gemini-pro 、通义千问、百度灵码,结果全部翻车。没一个正常的,出现

    的错误发给它,反复修改几遍还是无法正常运行。

    选取部分错误

    Traceback (most recent call last): File "/root/pyu.py", line 3, in <module> from eth_account.hdaccount import mnemonic_to_private_key ImportError: cannot import name 'mnemonic_to_private_key' from 'eth_account.hdaccount' (/usr/local/lib/python3.10/dist-packages/eth_account/hdaccount/__init__.py) 
    Traceback (most recent call last): File "/root/e1.py", line 10, in <module> if web3.isConnected(): AttributeError: 'Web3' object has no attribute 'isConnected'. Did you mean: 'is_connected'? 
    Traceback (most recent call last): File "/root/e2.py", line 35, in <module> wallet_address = wallet.get_address(0, 0) AttributeError: 'Wallet' object has no attribute 'get_address' 
    Traceback (most recent call last): File "/root/e3.py", line 27, in <module> wallet = bip44.Wallet(seed) File "/usr/local/lib/python3.10/dist-packages/bip44/wallet.py", line 20, in __init__ self._seed = Mnemonic(language).to_seed(mnemonic, passphrase) File "/usr/local/lib/python3.10/dist-packages/mnemonic/mnemonic.py", line 234, in to_seed mnemOnic= cls.normalize_string(mnemonic) File "/usr/local/lib/python3.10/dist-packages/mnemonic/mnemonic.py", line 96, in normalize_string utxt = txt.decode("utf8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9e in position 0: invalid start byte 
    Traceback (most recent call last): File "/root/b1.py", line 30, in <module> balance = get_wallet_balance_from_mnemonic(mnemonic) File "/root/b1.py", line 5, in get_wallet_balance_from_mnemonic private_key = Web3.to_checksum_address(Web3.accounts.privateKeyFromMnemonic(mnemonic)) AttributeError: type object 'Web3' has no attribute 'accounts' 
    3 条回复    2024-04-10 18:20:45 +08:00
    zhutianjingtu
        1
    zhutianjingtu  
       2024-04-10 16:40:46 +08:00
    HojiOShi
        2
    HojiOShi  
       2024-04-10 17:37:05 +08:00
    zeusho871
        3
    zeusho871  
       2024-04-10 18:20:45 +08:00
    是这个库更新太快了吧。。。你得问问版本 或者看看代码 他们调用的 api 是对的
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2541 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 11:56 PVG 19:56 LAX 04:56 JFK 07:56
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86