Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Action CreateAccount #7

Open
Okhotnik-V opened this issue Apr 21, 2022 · 6 comments
Open

Error Action CreateAccount #7

Okhotnik-V opened this issue Apr 21, 2022 · 6 comments

Comments

@Okhotnik-V
Copy link

Okhotnik-V commented Apr 21, 2022

Nice lib)
Creating an account does not work.

https://explorer.testnet.near.org/transactions/DSRgJocq3kLm5KXVC6m4zMG4D5857N1Auy9Q1DwPNp1N

@Okhotnik-V
Copy link
Author

If it works for you, please provide a code on how to do it)

@Ctzzhang
Copy link

which action is createAccount? I can not find it

@Okhotnik-V
Copy link
Author

Okhotnik-V commented Apr 26, 2022

which action is createAccount? I can not find it

https://docs.near.org/docs/concepts/transaction#action

https://nomicon.io/RuntimeSpec/Actions#addkeyaction

https://github.com/syntifi/near-java-api/blob/main/src/main/java/com/syntifi/near/api/model/transaction/Action.java

`

    List<Action> list = new ArrayList<>();
    list.add(CreateAccountAction.builder().build());
    list.add(AddKeyAction.builder()
            .publicKey(publicKey2)
            .accessKey(accessKey2)
            .build());
    list.add(TransferAction.builder().deposit(deposit).build());

    TransactionAwait encodedHash = TransactionService.sendTransactionAwait(
            nearService,
            signer1,
            receiver,
            publicKey,
            privateKey,
            list
    );

`

@Ctzzhang
Copy link

which action is createAccount? I can not find it

https://docs.near.org/docs/concepts/transaction#action

https://nomicon.io/RuntimeSpec/Actions#addkeyaction

https://github.com/syntifi/near-java-api/blob/main/src/main/java/com/syntifi/near/api/model/transaction/Action.java

`

    List<Action> list = new ArrayList<>();
    list.add(CreateAccountAction.builder().build());
    list.add(AddKeyAction.builder()
            .publicKey(publicKey2)
            .accessKey(accessKey2)
            .build());
    list.add(TransferAction.builder().deposit(deposit).build());

    TransactionAwait encodedHash = TransactionService.sendTransactionAwait(
            nearService,
            signer1,
            receiver,
            publicKey,
            privateKey,
            list
    );

`

how to create a top level account ? I cannot find the function CreateAccountOnlyByRegistrar()

@Okhotnik-V
Copy link
Author

Okhotnik-V commented Apr 26, 2022

Just write in
String receiver ="example.testnet";
and that's it. But the problem is that you need to make the access keys manually. At the moment I don't know how to do it. I hope the developer of the library will create such a function)

@AB3rtz
Copy link
Contributor

AB3rtz commented May 28, 2022

yes, it is here AccountService, with example here AccountServiceTest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants