Skip to content

Use in Java - wallet1.getAccountInfo(provider) cannot find symbol method getAccountInfo(SubstrateProvider) #6

Description

@paulvi

Similar to #5 get compilation for wallet1.getAccountInfo(provider)

package bcd.java;

import io.nodle.substratesdk.account.InvalidAccount;
import io.nodle.substratesdk.rpc.SubstrateProvider;
import io.nodle.substratesdk.account.Wallet;
//@Slf4j
public class UsingSubstrateClientKotlin {
    private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(UsingSubstrateClientKotlin.class);

    public static void main(String[] args) {
        String rpcUrl = "ws://127.0.0.1:9944";
        var provider = new SubstrateProvider(rpcUrl);
        var specVersion = provider.getTransactionVersion().blockingGet();
        log.info("getTransactionVersion specVersion={}", specVersion); //OK

        String mnemonic = "";
        Wallet wallet1 = null;
        try {
            wallet1 = new Wallet(mnemonic);
        } catch (InvalidAccount e) {
            e.printStackTrace();
        }
        var balance1 = wallet1.getAccountInfo(provider).blockingGet();
    }
}

and get error

bcd-java/src/main/java/bcd/java/UsingSubstrateClientKotlin.java:34: error: cannot find symbol
        var balance1 = wallet1.getAccountInfo(provider).blockingGet();
                              ^
  symbol:   method getAccountInfo(SubstrateProvider)
  location: variable wallet1 of type Wallet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions