Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Merge new commits in neo-project/neo-gui repo #93

Merged
merged 12 commits into from
Dec 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions Neo.Gui.Base/Controllers/IWalletController.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;

using Neo.Core;
using Neo.Cryptography.ECC;
using Neo.Gui.Base.Data;
using Neo.Network;
using Neo.SmartContract;
using Neo.Wallets;

using Neo.Gui.Base.Data;

namespace Neo.Gui.Base.Controllers
{
public interface IWalletController : IDisposable
Expand All @@ -19,21 +20,23 @@ public interface IWalletController : IDisposable

bool WalletIsSynchronized { get; }

bool WalletNeedUpgrade(string walletPath);
bool WalletCanBeMigrated(string walletPath);

void UpgradeWallet(string walletPath);
/// <summary>
/// Migrates to newer wallet format. This method does not open the migrated wallet.
/// </summary>
/// <returns>File path of new migrated wallet</returns>
string MigrateWallet(string walletPath, string password, string newWalletPath = null);

void CreateWallet(string walletPath, string password);

void OpenWallet(string walletPath, string password, bool repairMode);
void OpenWallet(string walletPath, string password);

void CloseWallet();

bool ChangePassword(string oldPassword, string newPassword);

void RebuildCurrentWallet();

void CreateNewKey();
void CreateNewAccount();

bool Sign(ContractParametersContext context);

Expand All @@ -45,21 +48,20 @@ public interface IWalletController : IDisposable

IEnumerable<UInt160> GetNEP5WatchScriptHashes();

KeyPair GetKeyByScriptHash(UInt160 scriptHash);

KeyPair GetKey(ECPoint publicKey);

KeyPair GetKey(UInt160 publicKeyHash);

IEnumerable<KeyPair> GetKeys();

IEnumerable<UInt160> GetAddresses();

VerificationContract GetContract(UInt160 scriptHash);
/// <summary>
/// Gets all accounts in wallets.
/// </summary>
IEnumerable<WalletAccount> GetAccounts();

IEnumerable<VerificationContract> GetContracts();
/// <summary>
/// Gets accounts that are not watch-only (i.e. standard and non-standard contract accounts).
/// </summary>
IEnumerable<WalletAccount> GetNonWatchOnlyAccounts();

IEnumerable<VerificationContract> GetContracts(UInt160 publicKeyHash);
/// <summary>
/// Gets standard contract accounts.
/// </summary>
IEnumerable<WalletAccount> GetStandardAccounts();

IEnumerable<Coin> GetCoins();

Expand Down Expand Up @@ -89,15 +91,15 @@ public interface IWalletController : IDisposable

Fixed8 CalculateUnavailableBonusGas(uint height);

bool WalletContainsAddress(UInt160 scriptHash);
bool WalletContainsAccount(UInt160 scriptHash);

BigDecimal GetAvailable(UIntBase assetId);

Fixed8 GetAvailable(UInt256 assetId);

void ImportWatchOnlyAddress(string addressToImport);

void DeleteAccount(AccountItem account);
bool DeleteAccount(AccountItem account);

Transaction MakeTransaction(Transaction transaction, UInt160 changeAddress = null, Fixed8 fee = default(Fixed8));

Expand Down
Loading