使用web3js v1.0.0,您可以使用web3.eth.accounts.create();创建帐户,并使用newWallet.address和newWallet.privateKey访问公共地址和私钥。
如何使用web3j或web3Swift完成此操作。
文档中很难找到这一点。
谢谢你的帮助。
发布于 2018-09-17 17:48:10
在这里,通过使用web3swift库:
// Create keystore and account with password.
let keystore = try! EthereumKeystoreV3(password: "changeme"); // generates a private key internally if node "privateKey" parameter supplied
let account = keystore!.addresses![0]
print(account)我们还在努力统一API格式。我已经在问题中公开了你的需求:https://github.com/matterinc/web3swift/issues/40
下面是库的下一个主要更新的用法示例:
newWallet = web3.eth.accounts.create()
// access the public address
newWallet.address
//private key:
newWallet.privateKeyhttps://ethereum.stackexchange.com/questions/55085
复制相似问题