KinAccount FetchAccount() { //https://github.com/kinecosystem/kin-sdk-unity#creating-and-retrieving-a-kin-account KinAccount ka = null; try { if (!kinClient.HasAccount()) //Check to see if user has a local account created { //If not, create one locally and return its reference ka = kinClient.AddAccount(); } else { //If already created, just return its reference ka = kinClient.GetAccount(0); } } catch (KinException e) { LogError("Error fetching account: " + e); } return(ka); }
public void TestGetPublicAddress() { KeyPair keyPair = KeyPair.Random(); KinAccount kinAccount = kinClient.GetAccount(keyPair); Assert.AreEqual(kinAccount.PublicAddress, keyPair.Address); }
public void TestGetAccount() { KeyPair keyPair = KeyPair.Random(); KinClient kinClient = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider); KinAccount kinAccount = kinClient.GetAccount(keyPair); Assert.AreEqual(kinAccount.keyPair, keyPair); }
void Start() { //https://github.com/kinecosystem/kin-sdk-unity#get-started kinClient = new KinClient(environment, appId); //Declare a new client kinAccount = FetchAccount(); //Return the user's *local* account. If doesn't exist, create it first. }
protected void ImportActivatedAccount() { _account = _client.ImportAccount(_exportedAccountJson, _exportedAccountPassphrase); }
protected void AddAccount() { _account = _client.AddAccount(); }
void OnDestroy() { _client.ClearAllAccounts(); _account = null; }