metaplex-foundation / SolanaKT

This is a open source library on kotlin for Solana protocol.
MIT License
71 stars 36 forks source link

How to get account #65

Open kaushal-inexture opened 2 years ago

kaushal-inexture commented 2 years ago

I am trying to get account using below code but I am not getting account so please help.

var router = NetworkingRouter(RPCEndpoint.devnetSolana) var account: Account? = null var solana = Solana(router, auth = object : SolanaAccountStorage{ override fun save(account1: Account): Result { account = account1 Log.d("Account Publik key", account?.publicKey.toString()) Log.d("Account Secrect key", account?.secretKey.toString()) return Result.success(Unit) }

        override fun account(): Result<Account> {
            Log.d("Account ", "Account")
            account?.let {
                return Result.success(account!!)
            }
            return Result.failure(Throwable(""))
        }

        override fun clear(): Result<Unit> {
            Log.d("Account ", "Account Clear")
            account = null
            return Result.success(Unit)
        }
    })
dreamchaser96 commented 2 years ago

have you make it work?