Skip to main content
ArcBlock Community

React Native中client.declare is not a function(it is undefined) 该如何创建用户

shenxiuqiang
Support
qawont-fix

用React Native 开发,在使用

javascript
await client.declare({ moniker, wallet });

创建用户的时候报错 client.declare is not a function(it is undefined)

用console.log(client);打印看不到这个方法。在React Native中该如何创建用户?

javascript
"@ocap/client": "^1.20.14",
"@ocap/mcrypto": "^1.20.14",
"@ocap/util": "^1.20.14",
"@ocap/wallet": "^1.20.14",       

3 replies

shenxiuqiang15 months ago

比较了@ocap/client 1.20.14 和 1.18.145,方法确实是删除了:

image.png

wangshijun15 months ago

你好,declare 方法已经被弃用,账户如果发生一笔交易就会自动创建出来,如果没有需要上链的需要,不出现在链上会更好。

shenxiuqiang15 months ago(edited)

我理解了,因为发送加密邮件需要查询对方账户,获取公钥,我还要看看没有生成账户的情况下流程怎么改。 这里的文档需要完善修改说明一下 https://www.arcblock.io/docs/blockchain/zh/create-account 在接口定义上这个方法仍然在,有却无法使用会让开发者疑惑。

image.png

Reply