Đang Thực Hiện

Basic function to access VirCurEx using Excel (VBA)

I would like a module programmed in Excels Visual Basic Applications that will access the [url removed, login to view] API and get the balances on the account.

The way the API works is that that the parameters are passed in the URL. Refer to the following link for information.

[url removed, login to view]

The data in the link needs to be encoded using SHA2. The following example code may help. However use any other code that you can find that will perform the SHA2 function.

SHA2 VBA Script

[url removed, login to view]

The final code should look something like this. However can be changed if required. The important thing is that you program the GetBalances function to obtain the balances and return the data. The data does not need to be formatted at all, as long as I can see the data can be retrieved I can format it to my needs later on.

sub GetBalance ()

ID = ID + 1

RetData = GetBalances (SecurityWord,UserName,ID)

msgbox RetData

end sub

To answer some of the questions.
Here is cut and paste from the vircurex website

Calculation of the Token
The token is calculated by concatenating the input parameters, separated by a semi-colon and then calculating a SHA2 hash over the complete string. See the column "Token calculation" in the above function API list for the required fields that need to be included to calculate the hash.
Here an examples (in Ruby) for creating an order:


t = Time.now.gmtime.strftime("%Y-%m-%dT%H:%M:%S")
trx_id = Digest::SHA2.hexdigest("#{t}-#{rand}")
user_name = "MY_USER_NAME"
secret_word = "123456789"
tok = Digest::SHA2.hexdigest("#{secret_word};#{user_name};#{t};#{trx_id};create_order;sell;10;btc;50;nmc")
Order.call_https("https://vircurex.com","/api/create_order.json?account=#{user_name}&id=#{trx_id}&token=#{tok}&timestamp=#{t}&ordertype=sell&amount=10&currency1=btc&unitprice=50&currency2=nmc")


def self.call_https(my_url,my_params)
uri = URI.parse(my_url)
http = Net::HTTP.new(uri.host, '443')
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
response=""
resp=""
http.start do |http|
cmd = my_params
req = Net::HTTP::Get.new(cmd)
response = http.request(req)
resp = response.body
end
return ActiveSupport::JSON.decode(resp)
end

This code creates an order using the api. Essentially once any function is coded it is a simple matter to change the paramterss to access any other functions. I choose the get balances function as I thought it would be simple.

Essentially if you can convert this code from ruby to vba this is the project done.

In order to do this, Vircurex requires a reigstered user on the web site.
Once registered, select the settings option at the top left and then select API.

You need to activate the API that you want to use which involves ticking the option and then entering is a password. Once done press save and vircurex will give you a message telling you that it was sucessfull.

Kỹ năng: Visual Basic cho Ứng dụng

Xem thêm: visual basic applications, vircurex vba code, vircurex api example, visual basic for applications, visual basic algorithm example, visual basic algorithm, algorithm in visual basic, algorithm function, algorithm applications, vbscript for, find in vba, excel vba long, excel vba help, excel 2013 vba, end vba, can you ru it, Visual Basic Excel, vba access excel, excel visual basic, excel vba script, Excel to Access, excel function, excel api vba, look algorithm program, 2013 visual basic applications excel

Về Bên Thuê:
( 2 nhận xét ) NSW, Australia

Mã Dự Án: #4545773

Đã trao cho:

tyrmit

I'd love to offer a solution to this project. Refer PM for details :)

$80 USD trong 1 ngày
(1 Đánh Giá)
2.0

3 freelancer đang chào giá trung bình $115 cho công việc này

svet63

VBA developer since 1997. Well experienced with APIs, too. Regards, Svet.

$150 USD trong 3 ngày
(4 Đánh Giá)
4.2
CARLOSHUGGINS

Hi VBA expert here...I will deliver high quality code on short time... thanks for considering my proposal

$115 USD trong 2 ngày
(0 Đánh Giá)
0.0