예제 #1
0
 public static NEP6Wallet Migrate(string path, string db3path, string password)
 {
     using (UserWallet wallet_old = UserWallet.Open(db3path, password))
     {
         NEP6Wallet wallet_new = new NEP6Wallet(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);
     }
 }
예제 #2
0
 public NEP6Account(NEP6Wallet wallet, UInt160 scriptHash, KeyPair key, string password)
     : this(wallet, scriptHash, key.Export(password))
 {
     this.key = key;
 }
예제 #3
0
 public NEP6Account(NEP6Wallet wallet, UInt160 scriptHash, string nep2key = null)
     : base(scriptHash)
 {
     this.wallet  = wallet;
     this.nep2key = nep2key;
 }
예제 #4
0
 /// <summary>
 /// 初始化账号 Add Code
 /// </summary>
 /// <param name="wallet"></param>
 /// <param name="scriptHash"></param>
 /// <param name="key"></param>
 public NEP6Account(NEP6Wallet wallet, UInt160 scriptHash, KeyPair key)
     : base(scriptHash)
 {
     this.wallet = wallet;
     this.key    = key;
 }
예제 #5
0
파일: NEP6Account.cs 프로젝트: xhnice/neo
 /// <summary>
 /// 测试16进制公钥导出WIF公钥
 /// </summary>
 public void TestExportNep2(NEP6Wallet wallet)
 {
     //string publicKey = "02883118351f8f47107c83ab634dc7e4ffe29d274e7d3dcf70159c8935ff769beb";//公钥
     //KeyPair keyPair = new KeyPair();
     //var key = keyPair.Export(password, wallet.Scrypt.N, wallet.Scrypt.R, wallet.Scrypt.P);
 }
예제 #6
0
파일: NEP6Account.cs 프로젝트: xhnice/neo
 public NEP6Account(NEP6Wallet wallet, UInt160 scriptHash, KeyPair key, string password)
     : this(wallet, scriptHash, key.Export(password, wallet.Scrypt.N, wallet.Scrypt.R, wallet.Scrypt.P))
 {
     //Console.WriteLine($"NEP6Account Key: {key.PublicKey.}"); // 20180423 TODO
     this.key = key;
 }
예제 #7
0
 public WalletLocker(NEP6Wallet wallet)
 {
     this.wallet = wallet;
 }
예제 #8
0
 public WalletLocker(NEP6Wallet wallet)
 {
     TR.Enter();
     this.wallet = wallet;
     TR.Exit();
 }