|
1 | | -using SYNCWallet.Models; |
2 | | - |
3 | | -namespace SYNCWallet.Services.Definitions |
4 | | -{ |
5 | | - public interface IUtilities |
6 | | - { |
7 | | - /// <summary> |
8 | | - /// Returns a list of NetworkSettings, executes a query against the main github repository |
9 | | - /// retruves the officially supported networks and then checks if there are any local networks returns the combined result |
10 | | - /// </summary> |
11 | | - public Task<List<NetworkSettings>> SetupNetworks(); |
12 | | - |
13 | | - /// <summary> |
14 | | - /// Returns the result of a Generic GET request as a model of T |
15 | | - /// Parameters: |
16 | | - /// <paramref name="url"/> |
17 | | - /// <param name="url">The weboage url to get, must be a JSON that matches the T properties.</param> |
18 | | - /// </summary> |
19 | | - public Task<T> GetRequest<T>(string url); |
20 | | - |
21 | | - /// <summary> |
22 | | - /// Splits a string to equal chunks |
23 | | - /// Parameters: |
24 | | - /// <paramref name="str"/> |
25 | | - /// <param name="str">The original string that has to be split to equal chunks</param> |
26 | | - /// <paramref name="chunkSize"/> |
27 | | - /// <param name="chunkSize">The number of piaces that the string has to be broken to</param> |
28 | | - /// </summary> |
29 | | - public IEnumerable<string> Split(string str, int chunkSize); |
30 | | - |
31 | | - /// <summary> |
32 | | - /// Converts a binary to string |
33 | | - /// Example: 101-> 1 |
34 | | - /// Parameters: |
35 | | - /// <paramref name="data"/> |
36 | | - /// <param name="data">Any text UTF 8 encoded</param> |
37 | | - /// </summary> |
38 | | - public string BinaryToString(string data); |
39 | | - |
40 | | - /// <summary> |
41 | | - /// Converts a string to binary |
42 | | - /// Example: 1-> 101 |
43 | | - /// Parameters: |
44 | | - /// <param name="data">Any text UTF 8 encoded</param> |
45 | | - /// </summary> |
46 | | - public string StringToBinary(string data); |
47 | | - |
48 | | - |
49 | | - /// <summary> |
50 | | - /// Multiplies the value to the 10 of the power of the delimiter, |
51 | | - /// used for interaction with solidity smart contracts. |
52 | | - /// Parameters: |
53 | | - /// <paramref name="value"/> |
54 | | - /// <param name="value">The value that has to be multiplied</param> |
55 | | - /// <paramref name="delimeter"/> |
56 | | - /// <param name="delimeter">the number to rise 10 to the power over</param> |
57 | | - /// </summary> |
58 | | - public decimal SetDecimalPoint(decimal value, int delimeter); |
59 | | - |
60 | | - /// <summary> |
61 | | - /// Divides the value to the 10 of the power of the delimiter, |
62 | | - /// used for interaction with solidity smart contracts. |
63 | | - /// Parameters: |
64 | | - /// <paramref name="value"/> |
65 | | - /// <param name="value">The value that has to be multiplied</param> |
66 | | - /// <paramref name="delimeter"/> |
67 | | - /// <param name="delimeter">the number to rise 10 to the power over</param> |
68 | | - /// </summary> |
69 | | - public decimal ConvertToDex(decimal value, int delimeter); |
70 | | - |
71 | | - |
72 | | - /// <summary> |
73 | | - /// Multiplies the value to the 10 of the power of the delimiter, |
74 | | - /// used for interaction with solidity smart contracts. |
75 | | - /// Parameters: |
76 | | - /// <paramref name="value"/> |
77 | | - /// <param name="value">The value that has to be multiplied BigInteger</param> |
78 | | - /// <paramref name="delimeter"/> |
79 | | - /// <param name="delimeter">the number to rise 10 to the power over</param> |
80 | | - /// </summary> |
81 | | - public decimal ConvertToBigIntDex(System.Numerics.BigInteger value, int delimeter); |
82 | | - |
83 | | - |
84 | | - /// <summary> |
85 | | - /// Divides the value to the 10 of the power of the delimiter, |
86 | | - /// used for interaction with solidity smart contracts. |
87 | | - /// Parameters: |
88 | | - /// <paramref name="value"/> |
89 | | - /// <param name="value">The value that has to be multiplied</param> |
90 | | - /// <paramref name="delimeter"/> |
91 | | - /// <param name="delimeter">the number to rise 10 to the power over</param> |
92 | | - /// </summary> |
93 | | - public decimal ConvertToDexDecimal(decimal number, int decimals); |
94 | | - |
95 | | - /// <summary> |
96 | | - /// Returns the active device operating system |
97 | | - /// </summary> |
98 | | - public int GetSystemOs(); |
99 | | - |
100 | | - |
101 | | - /// <summary> |
102 | | - /// Returns the device files safe path, not onwed by system OS for downloads and local settings such as imported tokens, imported networks. |
103 | | - /// </summary> |
104 | | - public string GetOsSavePath(); |
105 | | - |
106 | | - /// <summary> |
107 | | - /// Opens a popup window that shows an alert |
108 | | - /// Parameters: |
109 | | - /// <paramref name="msg"/> |
110 | | - /// <param name="msg">The message that has to be displayed on the screen</param> |
111 | | - /// <paramref name="attempts"/> |
112 | | - /// <param name="attempts">Obsolete not being utilized, part of an old API, to be removed next V</param> |
113 | | - /// </summary> |
114 | | - public void OpenErrorView(string title, string msg, int attempts); |
115 | | - |
116 | | - /// <summary> |
117 | | - /// Truncates a price to the 14th decimal to make it more user friendly |
118 | | - /// Example 0.00000000275465465654 -> 0.0000000027 |
119 | | - /// Parameters: |
120 | | - /// <paramref name="price"/> |
121 | | - /// <param name="price">The input amount to be truncated, returns the same value if it's less then 14 characters.</param> |
122 | | - /// </summary> |
123 | | - public string TruncateDecimals(decimal price); |
124 | | - } |
125 | | -} |
| 1 | +using SYNCWallet.Models; |
| 2 | + |
| 3 | +namespace SYNCWallet.Services.Definitions |
| 4 | +{ |
| 5 | + public interface IUtilities |
| 6 | + { |
| 7 | + /// <summary> |
| 8 | + /// Returns a list of NetworkSettings, executes a query against the main github repository |
| 9 | + /// retruves the officially supported networks and then checks if there are any local networks returns the combined result |
| 10 | + /// </summary> |
| 11 | + public Task<List<NetworkSettings>> SetupNetworks(); |
| 12 | + |
| 13 | + /// <summary> |
| 14 | + /// Returns the result of a Generic GET request as a model of T |
| 15 | + /// Parameters: |
| 16 | + /// <paramref name="url"/> |
| 17 | + /// <param name="url">The weboage url to get, must be a JSON that matches the T properties.</param> |
| 18 | + /// </summary> |
| 19 | + public Task<T> GetRequest<T>(string url); |
| 20 | + |
| 21 | + /// <summary> |
| 22 | + /// Splits a string to equal chunks |
| 23 | + /// Parameters: |
| 24 | + /// <paramref name="str"/> |
| 25 | + /// <param name="str">The original string that has to be split to equal chunks</param> |
| 26 | + /// <paramref name="chunkSize"/> |
| 27 | + /// <param name="chunkSize">The number of piaces that the string has to be broken to</param> |
| 28 | + /// </summary> |
| 29 | + public IEnumerable<string> Split(string str, int chunkSize); |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Converts a binary to string |
| 33 | + /// Example: 101-> 1 |
| 34 | + /// Parameters: |
| 35 | + /// <paramref name="data"/> |
| 36 | + /// <param name="data">Any text UTF 8 encoded</param> |
| 37 | + /// </summary> |
| 38 | + public string BinaryToString(string data); |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Converts a string to binary |
| 42 | + /// Example: 1-> 101 |
| 43 | + /// Parameters: |
| 44 | + /// <param name="data">Any text UTF 8 encoded</param> |
| 45 | + /// </summary> |
| 46 | + public string StringToBinary(string data); |
| 47 | + |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// Multiplies the value to the 10 of the power of the delimiter, |
| 51 | + /// used for interaction with solidity smart contracts. |
| 52 | + /// Parameters: |
| 53 | + /// <paramref name="value"/> |
| 54 | + /// <param name="value">The value that has to be multiplied</param> |
| 55 | + /// <paramref name="delimeter"/> |
| 56 | + /// <param name="delimeter">the number to rise 10 to the power over</param> |
| 57 | + /// </summary> |
| 58 | + public decimal SetDecimalPoint(decimal value, int delimeter); |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Divides the value to the 10 of the power of the delimiter, |
| 62 | + /// used for interaction with solidity smart contracts. |
| 63 | + /// Parameters: |
| 64 | + /// <paramref name="value"/> |
| 65 | + /// <param name="value">The value that has to be multiplied</param> |
| 66 | + /// <paramref name="delimeter"/> |
| 67 | + /// <param name="delimeter">the number to rise 10 to the power over</param> |
| 68 | + /// </summary> |
| 69 | + public decimal ConvertToDex(decimal value, int delimeter); |
| 70 | + |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// Multiplies the value to the 10 of the power of the delimiter, |
| 74 | + /// used for interaction with solidity smart contracts. |
| 75 | + /// Parameters: |
| 76 | + /// <paramref name="value"/> |
| 77 | + /// <param name="value">The value that has to be multiplied BigInteger</param> |
| 78 | + /// <paramref name="delimeter"/> |
| 79 | + /// <param name="delimeter">the number to rise 10 to the power over</param> |
| 80 | + /// </summary> |
| 81 | + public decimal ConvertToBigIntDex(System.Numerics.BigInteger value, int delimeter); |
| 82 | + |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Divides the value to the 10 of the power of the delimiter, |
| 86 | + /// used for interaction with solidity smart contracts. |
| 87 | + /// Parameters: |
| 88 | + /// <paramref name="value"/> |
| 89 | + /// <param name="value">The value that has to be multiplied</param> |
| 90 | + /// <paramref name="delimeter"/> |
| 91 | + /// <param name="delimeter">the number to rise 10 to the power over</param> |
| 92 | + /// </summary> |
| 93 | + public decimal ConvertToDexDecimal(decimal number, int decimals); |
| 94 | + |
| 95 | + /// <summary> |
| 96 | + /// Returns the active device operating system |
| 97 | + /// </summary> |
| 98 | + public int GetSystemOs(); |
| 99 | + |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// Returns the device files safe path, not onwed by system OS for downloads and local settings such as imported tokens, imported networks. |
| 103 | + /// </summary> |
| 104 | + public string GetOsSavePath(); |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// Opens a popup window that shows an alert |
| 108 | + /// Parameters: |
| 109 | + /// <paramref name="msg"/> |
| 110 | + /// <param name="msg">The message that has to be displayed on the screen</param> |
| 111 | + /// <paramref name="attempts"/> |
| 112 | + /// <param name="attempts">Obsolete not being utilized, part of an old API, to be removed next V</param> |
| 113 | + /// </summary> |
| 114 | + public void OpenErrorView(string title, string msg, int attempts); |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// Truncates a price to the 14th decimal to make it more user friendly |
| 118 | + /// Example 0.00000000275465465654 -> 0.0000000027 |
| 119 | + /// Parameters: |
| 120 | + /// <paramref name="price"/> |
| 121 | + /// <param name="price">The input amount to be truncated, returns the same value if it's less then 14 characters.</param> |
| 122 | + /// </summary> |
| 123 | + public string TruncateDecimals(decimal price); |
| 124 | + |
| 125 | + /// <summary> |
| 126 | + /// Starts a system process to launch the default user browser |
| 127 | + /// Parameters: |
| 128 | + /// <paramref name="url"/> |
| 129 | + /// <param name="url">The webpage address that has to be opened..</param> |
| 130 | + /// </summary> |
| 131 | + public void OpenBrowser(string url); |
| 132 | + } |
| 133 | +} |
0 commit comments