目前正在阅读文档并尝试提出一个工作示例来创建一个新帐户,但遇到一些问题JsonRpcProvider
- 想在此处发布完整示例,因为我认为它对任何搜索者都有用
const keyStore = new nearLib.keyStores.UnencryptedFileSystemKeyStore('/path/to/file.txt');
const provider = new nearLib.providers.JsonRpcProvider('default') // TAKES URL
const signer = new nearLib.InMemorySigner(keyStore)
const connection = new nearLib.Connection("default", provider, signer);
const master_account = new nearLib.Account(connection, 'chicken');
const local_creator = new nearLib.accountCreator.LocalAccountCreator(master_account, 1000000000000);
const newAccount = await local_creator.createAccount('new_account_id',nearLib.utils.KeyPairEd25519.fromRandom().toString())
不确定要传递到的 URL provider
!