What is the function to get the object of a NXT asset in javascript?

1

I want to get an object and its variables of a NXT asset. What is the function to retrieve an object of an nxt asset?

Patoshi パトシ

Posted 2015-07-31T22:12:18.243

Reputation: 8 911

Answers

1

You can get most of the nxt objects using NRS.sendRequest(""

The following code gets the asset object of whats in question.

NRS.sendRequest("getAsset", {"asset": asset}, function(response) { //do stuff with response}, false)

NRS.sendRequest("getAsset", {   
  "asset": <*Your Asset ID here*>
}, function(response) {         
  if (response && response.asset) {
    console.log(response);        
  }, false                          
});                             

You would get the following response from chrome's console log like this:

http://prntscr.com/7zm5fh

enter image description here

Patoshi パトシ

Posted 2015-07-31T22:12:18.243

Reputation: 8 911