示例#1
0
        public static Wallet New()
        {
            string url = Wallet.GetUrl_WalletNew();

            Net.APIServer apiServer = new Net.APIServer();
            return(apiServer.Request_Get <WalletResponse>(url).Wallet);
        }
示例#2
0
        public static string FormatParameter_Marker(string existingParameter, int ledger, int seq)
        {
            if (ledger > 0)
            {
                string parameter = "marker={ledger:" + ledger + ",seq:" + seq + "}";
                existingParameter = APIServer.FormatParameter(existingParameter, parameter);
            }

            return(existingParameter);
        }
示例#3
0
        public static string FormatParameter_Result_Per_Page(string existingParameter, int results_per_page, int page)
        {
            if (results_per_page > 0)
            {
                existingParameter = APIServer.FormatParameter(existingParameter, "results_per_page", results_per_page.ToString());
            }

            if (page > 0)
            {
                existingParameter = APIServer.FormatParameter(existingParameter, "page", page.ToString());
            }

            return(existingParameter);
        }
示例#4
0
        public static string FormatParameter_Issuer(string existingParameter, string issuer)
        {
            if (issuer != string.Empty)
            {
                if (Utility.IsValidAddress(issuer))
                {
                    existingParameter = APIServer.FormatParameter(existingParameter, "issuer", issuer);
                }
                else
                {
                    throw new InvalidParameterException(JingtumMessage.INVALID_JINGTUM_ADDRESS, issuer);
                }
            }

            return(existingParameter);
        }
示例#5
0
        public static string FormatParameter_Currency(string existingParameter, string currency)
        {
            if (currency != string.Empty)
            {
                if (Utility.IsValidCurrency(currency))
                {
                    existingParameter = APIServer.FormatParameter(existingParameter, "currency", currency);
                }
                else
                {
                    throw new InvalidParameterException(JingtumMessage.INVALID_CURRENCY, currency);
                }
            }

            return(existingParameter);
        }