Exemple #1
0
        public Result <bool> AddNewAddressBookItem(string account, string tag)
        {
            var status = GetBlockChainStatus();

            if (status.IsFail)
            {
                return new Result <bool> {
                           IsFail = true
                }
            }
            ;

            var check = VerfyAddress(status.Value.ChainNetwork, account);

            if (!check)
            {
                return(new Result <bool>()
                {
                    IsFail = true, ErrorCode = 70000001
                });
            }
            ApiResponse response = AddressBookApi.AddNewAddressBookItem(account, tag).Result;

            return(GetResult <bool>(response));
        }
Exemple #2
0
        public Result <bool> AddNewAddressBookItem(string account, string tag)
        {
            var check = VerfyAddress(OmniCoinSetting.CurrentNetworkType, account);

            if (!check)
            {
                return(new Result <bool>()
                {
                    IsFail = true, ErrorCode = 70000001
                });
            }
            ApiResponse response = AddressBookApi.AddNewAddressBookItem(account, tag).Result;

            return(GetResult <bool>(response));
        }
        public async Task AddNewAddressBookItem()
        {
            //fiiit6ZgKDM5ZyDYhkSWDsUmRZpkbRQf7NWiKT
            //先根据接口获取网络类型
            ApiResponse blockChainResponse = await BlockChainEngineApi.GetBlockChainStatus();

            if (!blockChainResponse.HasError)
            {
                BlockChainStatus blockChainStatus = blockChainResponse.GetResult <BlockChainStatus>();
                //验证address
                if (AddressTools.AddressVerfy(blockChainStatus.ChainNetwork, "fiiit6ZgKDM5ZyDYhkSWDsUmRZpkbRQf7NWiKT"))
                {
                    ApiResponse addressBookResponse = await AddressBookApi.AddNewAddressBookItem("fiiit6ZgKDM5ZyDYhkSWDsUmRZpkbRQf7NWiKT", "label or comment");

                    if (!addressBookResponse.HasError)
                    {
                        //do something
                    }
                }
            }
        }