Bitcoin Forum
November 19, 2024, 03:50:45 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 »  All
  Print  
Author Topic: [Nxt] API of Nxt  (Read 37334 times)
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 24, 2014, 08:41:20 AM
 #281

I know this has been asked before but I can't find the answer. How do I retrieve AMs?

I sent myself an AM that reads "this is a test". Here: http://localhost:7874/nxt?requestType=getTransactionBytes&transaction=5483638297221124474

This returns:

Quote
{"bytes":"010090844f00a00565dc6bacf933e912af02076f1c84fff1549708aeeb979024bdc689ee6476295 f919b203dd7d5be7d00000000010000000000000000000000453405b0c89ab0a748d2c7cadabc07 23cffb311eea5bc17583b61d06864ef104b7dc4e58e38faa2b7c88a219baaa723d2a5ec34334c08 474aefd74a8de8220421400000048656c6c6f207468697320697320612074657374","confirmations":12}

However the "bytes" part has a bunch of stuff in the beginning that is not my message. How do I know where my message starts in "bytes"?

Use getTransaction.
l8orre
Legendary
*
Offline Offline

Activity: 1181
Merit: 1018


View Profile
January 24, 2014, 08:42:21 AM
 #282

I know this has been asked before but I can't find the answer. How do I retrieve AMs?

I sent myself an AM that reads "this is a test". Here: http://localhost:7874/nxt?requestType=getTransactionBytes&transaction=5483638297221124474

This returns:

Quote
{"bytes":"010090844f00a00565dc6bacf933e912af02076f1c84fff1549708aeeb979024bdc689ee6476295 f919b203dd7d5be7d00000000010000000000000000000000453405b0c89ab0a748d2c7cadabc07 23cffb311eea5bc17583b61d06864ef104b7dc4e58e38faa2b7c88a219baaa723d2a5ec34334c08 474aefd74a8de8220421400000048656c6c6f207468697320697320612074657374","confirmations":12}

However the "bytes" part has a bunch of stuff in the beginning that is not my message. How do I know where my message starts in "bytes"?


I think the 'bytes' part is s.t. else - the message as you sent it is accessible with its tTxId

MESSAGE SENT with apiCall:

https://192.168.178.24:7875/nxt?/nxt?&fee=1&secretPhrase=19letmyheartbestillamoment23&requestType=sendMessage&deadline=12&message=aaaaaaaaaaaabbbbbeeeeee1111&recipient=8208788471056955193

->message=aaaaaaaaaaaabbbbbeeeeee1111

transaction - 2440562297891784938
bytes - 0100a48a4f000c00390e4daf114f5628ed4d3cdb2f6dfbf41cc21c34b8c9bdca59a8fd612a84a63 b39f7ab559f79eb7100000000010000000000000000000000ca3153d90a91748d37b82eff79c5ef dd83e409d00d64c55d20414f1c3539e0029d6d96c690dd0a7075cd361e1baa0546ad75f21c95530 71642178b1d1710431c0d000000aaaaaaaaaaaabbbbbeeeeee111

                                                                                  in fact,  the message IS contained in 'BYTES' - interesting:   ^^^^^^^^^^^^^^^^^^



MSG RECVD on another account:

https://192.168.178.24:7875/nxt?/nxt?&requestType=getBlock&block=12844324000325204771

BLOCK:

payloadLength - 401
generator - 482115092852324318
transactions - [u'2440562297891784938', u'2896977874553576073', u'4889772855603033753']
timestamp - 5212956
numberOfTransactions - 3
previousBlock - 8946974642773827749
payloadHash - 15a5d862af5d1f65f6a905ff08fae9f2fa444c30c8cc9889993d346cd42652b1
baseTarget - 1532426424
version - 2
totalAmount - 1185
previousBlockHash - a520f6d4080a2a7c75a89a25a5267e8065e0ac1fab56fcca141bb4d9fd6d1dd4
height - 48473
blockSignature - 437d8ccf4bb1e6903cf877bfe6655c402ec0b100336cf1d224b74522d950cc0721793ea8da6697b 4c905a5a198be833003a34eb6263453289c8f39b7a89470b6
totalFee - 3
generationSignature - f233e37e16793f0a21f645da6e829220f6bfb561eb5690932ace4b68a38c500f



https://192.168.178.24:7875/nxt?/nxt?&requestType=getTransaction&transaction=2440562297891784938

Tx:

recipient - 8208788471056955193
fee - 1
sender - 8737506522730586553
timestamp - 5212836
senderPublicKey - 390e4daf114f5628ed4d3cdb2f6dfbf41cc21c34b8c9bdca59a8fd612a84a63b
subtype - 0
amount - 0
confirmations - 1
deadline - 12
attachment - {u'message': u'aaaaaaaaaaaabbbbbeeeeee111'}
signature - ca3153d90a91748d37b82eff79c5efdd83e409d00d64c55d20414f1c3539e0029d6d96c690dd0a7 075cd361e1baa0546ad75f21c9553071642178b1d1710431c
referencedTransaction - 0
type - 1
block - 12844324000325204771

Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 24, 2014, 08:44:28 AM
 #283

bug:cannnot locate the asset

step 1:
http://holms.cloudapp.net:6874/nxt?requestType=issueAsset&secretPhrase=myphrasez&amount=10&fee=1001&deadline=900&name=Dog&quantity=10
{"transaction":"14069547964793243165"}

so issue asset is ok

but
step2 :
getAssetIds don't contain 14069547964793243165
and getAsset
{"errorCode":5,"errorDescription":"Unknown asset"}

now i repeat step 1
{"errorCode":8,"errorDescription":"\"Dog\" is already used"}
 

know details about api, please visit here :
http://wiki.nxtcrypto.org/wiki/Nxt_API

http://holms.cloudapp.net:6874/nxt?requestType=getAsset&asset=7849724807799454521
btc2nxt
Full Member
***
Offline Offline

Activity: 236
Merit: 100


View Profile
January 26, 2014, 02:35:29 AM
 #284

1. assetid 15328485893864579482
{"description":"ImagineFairness","name":"NEX","account":"16155265664111966451","quantity":1000000000}

2. askorder
http://holms.cloudapp.net:6874/nxt?requestType=placeAskOrder&secretPhrase=myphrase&asset=15328485893864579482&quantity=21&price=12&fee=2&deadline=8440

{"errorCode":6,"errorDescription":"Not enough funds"}

3. this is my balance
{"balance":1798600,"effectiveBalance":1798600,"unconfirmedBalance":1798600}

4.
use another assetid 14269709746849295412
return
{"errorCode":6,"errorDescription":"Not enough funds"} too

5.placebidorder
ok
{"transaction":"9414020448077975079"}


l8orre
Legendary
*
Offline Offline

Activity: 1181
Merit: 1018


View Profile
January 26, 2014, 10:01:01 AM
 #285

1. assetid 15328485893864579482
{"description":"ImagineFairness","name":"NEX","account":"16155265664111966451","quantity":1000000000}

2. askorder
http://holms.cloudapp.net:6874/nxt?requestType=placeAskOrder&secretPhrase=myphrase&asset=15328485893864579482&quantity=21&price=12&fee=2&deadline=8440

{"errorCode":6,"errorDescription":"Not enough funds"}

3. this is my balance
{"balance":1798600,"effectiveBalance":1798600,"unconfirmedBalance":1798600}

4.
use another assetid 14269709746849295412
return
{"errorCode":6,"errorDescription":"Not enough funds"} too

5.placebidorder
ok
{"transaction":"9414020448077975079"}




yes, I keep getting things like that also. first guess would be that it is s-t- related to the testnet ...
l8orre
Legendary
*
Offline Offline

Activity: 1181
Merit: 1018


View Profile
January 26, 2014, 10:33:50 AM
 #286


so ... what does the NRS do when the client is sending queries faster than it can answer? discard them, or put them into a queue?
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 28, 2014, 02:13:10 PM
 #287


so ... what does the NRS do when the client is sending queries faster than it can answer? discard them, or put them into a queue?

Depends on Jetty settings. I think it has a backlog.
BaiMangal
Member
**
Offline Offline

Activity: 111
Merit: 10


View Profile
January 28, 2014, 02:39:33 PM
 #288

Posted this earlier in the main "messy" thread but will put it in here too:

______________________________________________________________
Issue:
I don't think the deadline in placing BID_ASK orders works.
I created some orders 2-3 days ago and they are still available. Then I created one today with deadline 5mins

Here is the API call
http://holms.cloudapp.net:6874/nxt?requestType=placeAskOrder&secretPhrase=PASSPHRASE&asset=2514416012262277241&quantity=888&price=88&fee=1&deadline=5

Result:
{"transaction":"15792899347256983572"}

here is the order
http://holms.cloudapp.net:6874/nxt?requestType=getAskOrder&order=15792899347256983572
Result:
{"price":88,"asset":"2514416012262277241","account":"4432258843260249105","quantity":888}

is it a bug? maybe deadline has another meaning if so can we have some sort of expiry of the Orders?

Also do you think we should be able to see the deadline (expiry time left) for the order when we do getAskOrder?

______________________________________________________________

Can we have an API that can return the asset qty owned by an account?
I am thinking in terms of our gateway. When we transfer asset to someone how can he then check he got the asset an API would be cool.




Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 28, 2014, 02:40:43 PM
 #289

Orders don't expire. Deadline means deadline of a transaction.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 28, 2014, 02:43:15 PM
 #290

Can we have an API that can return the asset qty owned by an account?
I am thinking in terms of our gateway. When we transfer asset to someone how can he then check he got the asset an API would be cool.

I already implemented this API request. I'm waiting for other requests info to implement and release them. I don't have time to read all posts, could u guys cooperate and send me the "total" list?
bootch
Newbie
*
Offline Offline

Activity: 56
Merit: 0



View Profile
January 28, 2014, 05:36:56 PM
 #291

Is there full documentation for API in one place?
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 28, 2014, 05:38:05 PM
 #292

Is there full documentation for API in one place?

Check http://wiki.nxtcrypto.org/wiki/Nxt_API
l8orre
Legendary
*
Offline Offline

Activity: 1181
Merit: 1018


View Profile
January 29, 2014, 02:05:42 PM
 #293

too much blablabla and talking about the color of the coin,thats all

U should add that we talk about color of the coins for 3 months already.

hey CfB - sorry, this is going quite quickly.

Do you have 'getAccountAssets' call on your list? Sort of an inventory that lists which assets and how much of it an account has? Was mentioned before, just asking to make sure becasue it seems essential to me!

Aslo, there is the questions of conditional BUY/SELL offers: Can you make a BUY or SELL l
limit order, that has th efollowing properties:

1: the issuer can NOT revoke it
2: it expires at a certain point in time if it is not matched
3: it is coded to a SPECIFIC account OR to a SPECIFIC key, and only the owner of the account / holder of the key can execute it

I think it could be possible with the present NRS infrastructre, and this would provide an extremely powerful method to issue options on virtual assets.

ALSO: in certail combinations, this might allow schemes to implement SMART ESCROW - not sure yet, but there might be a way to do this.

Think of the utility value of these two things that can be done with options contracts!

I am just posing these here in case it goes too fast, but I'll also put it over to the API dev thread..
 
opticalcarrier
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
January 29, 2014, 04:01:21 PM
 #294

2: it expires at a certain point in time if it is not matched

I wish I had thought of this when I submitted my list to CfB on requested asset exchange APIs.  maybe it can make it in.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 29, 2014, 04:05:10 PM
 #295

2: it expires at a certain point in time if it is not matched

I wish I had thought of this when I submitted my list to CfB on requested asset exchange APIs.  maybe it can make it in.

Current orders don't expire.
l8orre
Legendary
*
Offline Offline

Activity: 1181
Merit: 1018


View Profile
January 29, 2014, 05:40:19 PM
 #296

2: it expires at a certain point in time if it is not matched

I wish I had thought of this when I submitted my list to CfB on requested asset exchange APIs.  maybe it can make it in.

Current orders don't expire.

guess those go on the wishlist for API2 - hey kids, don't unwrap your presents all at once  Grin

but really: consider the potential of this stuff  Shocked
alpha_one_x86
Sr. Member
****
Offline Offline

Activity: 281
Merit: 250


Developer of Ultracopier and Supercopier


View Profile WWW
January 31, 2014, 12:10:52 PM
 #297

I have always:
{"errorCode":7,"errorDescription":"Not allowed"}
Or access denied, client runing at cli
I try:
wget 'http://localhost:7874/nxt?request=getBalance&account=398532577100249608' -O - -q

Developer of Ultracopier/Supercopier and of the game CatchChallenger sold in crypto curency. Include on the nextcoin market.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 31, 2014, 12:12:20 PM
 #298

I have always:
{"errorCode":7,"errorDescription":"Not allowed"}
Or access denied, client runing at cli
I try:
wget 'http://localhost:7874/nxt?request=getBalance&account=398532577100249608' -O - -q

Put "*" into "allowedBotHosts" in "web.xml".
alpha_one_x86
Sr. Member
****
Offline Offline

Activity: 281
Merit: 250


Developer of Ultracopier and Supercopier


View Profile WWW
January 31, 2014, 12:49:17 PM
 #299

I have always:
{"errorCode":7,"errorDescription":"Not allowed"}
Or access denied, client runing at cli
I try:
wget 'http://localhost:7874/nxt?request=getBalance&account=398532577100249608' -O - -q

Put "*" into "allowedBotHosts" in "web.xml".
Why it work? Because the destination is well 127.0.0.1, and source too, then <param-value>127.0.0.1; localhost; 0:0:0:0:0:0:0:1;</param-value> is correct.
With:
wget -O - -q 'http://localhost:7874/nxt?user=0.8690339662134647&requestType=unlockAccount&secretPhrase=toto&0.7187995600979775'
I have:
{"responses":[{"response":"denyAccess"}]}
And:
wget -O - -q 'http://localhost:7874/nxt?requestType=unlockAccount&secretPhrase=toto'
{"errorCode":1,"errorDescription":"Incorrect request"}

Developer of Ultracopier/Supercopier and of the game CatchChallenger sold in crypto curency. Include on the nextcoin market.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
January 31, 2014, 12:51:25 PM
 #300

I have always:
{"errorCode":7,"errorDescription":"Not allowed"}
Or access denied, client runing at cli
I try:
wget 'http://localhost:7874/nxt?request=getBalance&account=398532577100249608' -O - -q

Put "*" into "allowedBotHosts" in "web.xml".
Why it work? Because the destination is well 127.0.0.1, and source too, then <param-value>127.0.0.1; localhost; 0:0:0:0:0:0:0:1;</param-value> is correct.
With:
wget -O - -q 'http://localhost:7874/nxt?user=0.8690339662134647&requestType=unlockAccount&secretPhrase=toto&0.7187995600979775'
I have:
{"responses":[{"response":"denyAccess"}]}
And:
wget -O - -q 'http://localhost:7874/nxt?requestType=unlockAccount&secretPhrase=toto'
{"errorCode":1,"errorDescription":"Incorrect request"}

If u add "user" HTTP parameter then allowedUserHosts works.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!