forked from Eloise1988/CRYPTOBALANCE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCryptotools_MSFT.bas
121 lines (79 loc) · 3.31 KB
/
Cryptotools_MSFT.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Public Sub DefineFunction()
Dim sFunctionName As String
Dim sFunctionCategory As String
Dim sFunctionDescription As String
Dim aFunctionArguments(1 To 2) As String
sFunctionName = "CRYPTOBALANCE"
sFunctionDescription = "Returns cryptocurrency balances into Google spreadsheets."
sFunctionCategory = 7 ' Text category
aFunctionArguments(1) = "Cryptocurrency TICKER/SYMBOL data to fetch ex: BTC"
aFunctionArguments(2) = "Wallet address. DO NOT TO ENTER your private wallet address."
Application.MacroOptions Macro:=sFunctionName, _
Description:=sFunctionDescription, _
Category:=sFunctionCategory, _
ArgumentDescriptions:=aFunctionArguments
End Sub
Public Function CRYPTOBALANCE(ticker As String, address As String)
Application.Calculation = xlCalculationManual
Dim httpObject As Object
Set httpObject = CreateObject("Microsoft.XMLHTTP")
sUrl = "http://api.charmantadvisory.com/BALANCE/" & UCase(ticker) & "/" + address & "/ExcelMSFT"
sRequest = sUrl
httpObject.Open "GET", sRequest, False
httpObject.send
sGetResult = httpObject.responseText
If IsNumeric(sGetResult) Then
CRYPTOBALANCE = CDbl(sGetResult)
Else
CRYPTOBALANCE = "Error,reload or contact https://t.me/TheCryptoCurious or [email protected]"
End If
Application.Calculation = xlCalculationAutomatic
End Function
Function CRYPTOSTAKING(ticker As String, address As String)
Application.Calculation = xlCalculationManual
Dim httpObject As Object
Set httpObject = CreateObject("Microsoft.XMLHTTP")
sUrl = "http://api.charmantadvisory.com/STAKING/" & UCase(ticker) & "/" + address & "/ExcelMSFT"
sRequest = sUrl
httpObject.Open "GET", sRequest, False
httpObject.send
sGetResult = httpObject.responseText
If IsNumeric(sGetResult) Then
CRYPTOSTAKING = CDbl(sGetResult)
Else
CRYPTOSTAKING = "Error,reload or contact https://t.me/TheCryptoCurious or [email protected]"
End If
Application.Calculation = xlCalculationAutomatic
End Function
Function CRYPTOREWARDS(ticker As String, address As String)
Application.Calculation = xlCalculationManual
Dim httpObject As Object
Set httpObject = CreateObject("Microsoft.XMLHTTP")
sUrl = "http://api.charmantadvisory.com/REWARDS/" & UCase(ticker) & "/" + address & "/ExcelMSFT"
sRequest = sUrl
httpObject.Open "GET", sRequest, False
httpObject.send
sGetResult = httpObject.responseText
If IsNumeric(sGetResult) Then
CRYPTOREWARDS = CDbl(sGetResult)
Else
CRYPTOREWARDS = "Error,reload or contact https://t.me/TheCryptoCurious or [email protected]"
End If
Application.Calculation = xlCalculationAutomatic
End Function
Function CRYPTOLENDING(exchange As String, ticker As String, side As String)
Application.Calculation = xlCalculationManual
Dim httpObject As Object
Set httpObject = CreateObject("Microsoft.XMLHTTP")
sUrl = "http://api.charmantadvisory.com/LENDING/" & UCase(exchange) & "/" + UCase(ticker) & "/" + UCase(side) & "/ExcelMSFT"
sRequest = sUrl
httpObject.Open "GET", sRequest, False
httpObject.send
sGetResult = httpObject.responseText
If IsNumeric(sGetResult) Then
CRYPTOLENDING = CDbl(sGetResult)
Else
CRYPTOLENDING = "Error,reload or contact https://t.me/TheCryptoCurious or [email protected]"
End If
Application.Calculation = xlCalculationAutomatic
End Function