public static TERC1Account FromJson(JObject json, TERC1Wallet wallet) { return(new TERC1Account(wallet, json["address"].AsString().ToScriptHash(), json["key"]?.AsString()) { Label = json["label"]?.AsString(), IsDefault = json["isDefault"].AsBoolean(), Lock = json["lock"].AsBoolean(), Contract = TERC1Contract.FromJson(json["contract"]), Extra = json["extra"] }); }
public static TERC1Wallet Migrate(WalletIndexer indexer, string path, string db3path, string password) { using (UserWallet wallet_old = UserWallet.Open(indexer, db3path, password)) { TERC1Wallet wallet_new = new TERC1Wallet(indexer, path, wallet_old.Name); using (wallet_new.Unlock(password)) { foreach (WalletAccount account in wallet_old.GetAccounts()) { wallet_new.CreateAccount(account.Contract, account.GetKey()); } } return(wallet_new); } }
public WalletLocker(TERC1Wallet wallet) { this.wallet = wallet; }
public TERC1Account(TERC1Wallet wallet, UInt160 scriptHash, KeyPair key, string password) : this(wallet, scriptHash, key.Export(password, wallet.Scrypt.N, wallet.Scrypt.R, wallet.Scrypt.P)) { this.key = key; }
public TERC1Account(TERC1Wallet wallet, UInt160 scriptHash, string tercKey = null) : base(scriptHash) { this.wallet = wallet; this.tercKey = tercKey; }