Jump to content
Sign in to follow this  
Twarden

Frozen Balances and Obligations

Recommended Posts

Is there an API endpoint for either rippled or rippleapi that will allow you to query the network to determine which obligations at a gateway have been frozen?  A while ago, I had to freeze an account which created several suspicious transactions which ended up issuing USD from ~Xagate during a time when I did not remit CAD.  The user contacted me in regard to their frozen balances and refused to complete my extended due diligence protocol, so these funds have remained frozen on the network.

The gateway balances endpoint allows for anyone to query any address to see the balances and obligations of an issuer.  Will this endpoint be updated in the future to include which accounts, currency, and balance is frozen?  Are there other end points which can easily determine all balances which are frozen with a particular issuer? 

Share this post


Link to post
Share on other sites

There's no specific API for it. But you can just do an "account_lines" on the gateway account and search for "freeze". For example, I did an "account_lines" on rGgS5Hw3PhSp3VNT43PDTXze9YfdthHUH and the output included this:

 

	         {
	            "account" : "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
	            "balance" : "0",
	            "currency" : "USD",
	            "freeze" : true,    *** The queried account, the gateway, has frozen this line
	            "limit" : "0",
	            "limit_peer" : "0",
	            "no_ripple" : true,
	            "quality_in" : 0,
	            "quality_out" : 0
	         },
	         {
	            "account" : "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
	            "balance" : "0",
	            "currency" : "0158415500000000C1F76FF6ECB0BAC600000000",
	            "freeze_peer" : true,  *** The peer has frozen this line
	            "limit" : "0",
	            "limit_peer" : "0",
	            "no_ripple" : true,
	            "quality_in" : 0,
	            "quality_out" : 0
	         },
	


You should query the gateway account and pay attention to lines that have "freeze" set to true because that means the gateway froze the line.

Share this post


Link to post
Share on other sites

Active and frozen balances seem like information that both Gateway Operators and their Users should know about when visiting a Gateway.  So will this functionality be added one day to a future update to the rippled gateway_balances endpoint? 

Share this post


Link to post
Share on other sites
3 hours ago, Twarden said:

Active and frozen balances seem like information that both Gateway Operators and their Users should know about when visiting a Gateway.  So will this functionality be added one day to a future update to the rippled gateway_balances endpoint? 

That's a good idea. I'll open a ticket.

Share this post


Link to post
Share on other sites
1 hour ago, JoelKatz said:

That's a good idea. I'll open a ticket.

In this repo, PHP runs a Ruby script which executes the gateway_balances command for r..HUH and r..p1S. I was thinking based on your suggestion that in Ruby I could write a regular expression to find each account data line, parse each account line into an array, search that array for "freeze,"  and any positive matches are concatenated to the result message then display on my site via PHP when the script is invoked by a visitor.

Thank you for taking my consideration under advisement :) 

Edited by Twarden

Share this post


Link to post
Share on other sites
4 hours ago, Twarden said:

In this repo, PHP runs a Ruby script which executes the gateway_balances command for r..HUH and r..p1S. I was thinking based on your suggestion that in Ruby I could write a regular expression to find each account data line, parse each account line into an array, search that array for "freeze,"  and any positive matches are concatenated to the result message then display on my site via PHP when the script is invoked by a visitor.

Thank you for taking my consideration under advisement :) 

Don't use regular expressions to parse json. Just load it as json object using your favorite language/library. Your regex will most likely fail if you get a differently formatted (but still semantically valid) json response.

 

Edited by T8493

Share this post


Link to post
Share on other sites
3 hours ago, T8493 said:

Don't use regular expressions to parse json. Just load it as json object using your favorite language/library. Your regex will most likely fail if you get a differently formatted (but still semantically valid) json response.

 

Alright, will do.  Think that I could parse the json object line by line, then when the json is loaded into an array search for newline characters, then search the array between the known indexes of where a new account begins, then determine know where to search for "freeze." Gotcha :) I hope*.

* I know you have far more experience than I do; This could probably be done easier.

Edited by Twarden

Share this post


Link to post
Share on other sites

No, just use a standard json parser and ask for the relevant entry. I don't know enough ruby to debug your script, but I'm not sure if you even use the json library that you import in there...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...