Pages:
Author

Topic: [Nxt] API of Nxt - page 3. (Read 37336 times)

legendary
Activity: 2142
Merit: 1010
Newbie
February 20, 2014, 09:06:48 AM
The only one I need right now is SEND NXT.

All numbers r little-endian.

01 B - type (00)
01 B - subtype (00)
04 B - timestamp (671e7400)
02 B - deadline (3c00)
32 B - sender public key (b1c9e22befa06aee2eb0ac2d13ad03df02abf7cdd5fb8c9903b74f65819eb84d)
08 B - recipient (252ab2f000b58ef7)
04 B - amount (e8030000)
04 B - fee (01000000)
08 B - referenced transaction (0000000000000000)
64 B - signature (a56d7368c792df694c72fcaf731544c4b710c9de4e906105cdb25b15fc10d1052c9fac66383c553 6500cea0782db28535c25095758029cb4d465b13f8850cf1e)

I used transaction 1360173339660761930 as the example (http://localhost:7874/nxt?requestType=getTransactionBytes&transaction=1360173339660761930)

NB: Before signing u must replace signature with ZEROs and sign the whole 128 bytes.
hero member
Activity: 750
Merit: 500
www.coinschedule.com
February 20, 2014, 07:51:20 AM
Questions regarding the BroadCastTransaction API:

1) Can I use to it SEND NXT?
2) If I can use it to send Nxt, if the broadcast bytes are intercepted can the attacker figure out the account password from the bytes?
3) Where can I find information on how to use the BroadCastTransaction API (i.e. how to prepare the bytes??)
4) Is there any examples in javascript that show how to prepare the bytes to be sent using BroadCastTransaction?

Many thanks!

1. Yes
2. No
3. I'll add prepareTransaction and sendTransaction to be used for that
4. Bytes r returned by sendMoney, sendMessage, etc.

I was actually trying to figure out if there's a way for me to prepare a transaction on the client browser (using javascript) and then broadcast the transaction bytes without ever having to call the NRS API (apart of course to broadcast the transaction).

So I gather that's not possible?

U can do it but u have to build transaction bytes by urself. What types/subtypes of transactions do u need?

The only one I need right now is SEND NXT.
legendary
Activity: 2142
Merit: 1010
Newbie
February 20, 2014, 06:41:18 AM
Questions regarding the BroadCastTransaction API:

1) Can I use to it SEND NXT?
2) If I can use it to send Nxt, if the broadcast bytes are intercepted can the attacker figure out the account password from the bytes?
3) Where can I find information on how to use the BroadCastTransaction API (i.e. how to prepare the bytes??)
4) Is there any examples in javascript that show how to prepare the bytes to be sent using BroadCastTransaction?

Many thanks!

1. Yes
2. No
3. I'll add prepareTransaction and sendTransaction to be used for that
4. Bytes r returned by sendMoney, sendMessage, etc.

I was actually trying to figure out if there's a way for me to prepare a transaction on the client browser (using javascript) and then broadcast the transaction bytes without ever having to call the NRS API (apart of course to broadcast the transaction).

So I gather that's not possible?

U can do it but u have to build transaction bytes by urself. What types/subtypes of transactions do u need?
hero member
Activity: 750
Merit: 500
www.coinschedule.com
February 20, 2014, 06:16:43 AM
Questions regarding the BroadCastTransaction API:

1) Can I use to it SEND NXT?
2) If I can use it to send Nxt, if the broadcast bytes are intercepted can the attacker figure out the account password from the bytes?
3) Where can I find information on how to use the BroadCastTransaction API (i.e. how to prepare the bytes??)
4) Is there any examples in javascript that show how to prepare the bytes to be sent using BroadCastTransaction?

Many thanks!

1. Yes
2. No
3. I'll add prepareTransaction and sendTransaction to be used for that
4. Bytes r returned by sendMoney, sendMessage, etc.

I was actually trying to figure out if there's a way for me to prepare a transaction on the client browser (using javascript) and then broadcast the transaction bytes without ever having to call the NRS API (apart of course to broadcast the transaction).

So I gather that's not possible?
legendary
Activity: 2142
Merit: 1010
Newbie
February 20, 2014, 05:39:02 AM
Questions regarding the BroadCastTransaction API:

1) Can I use to it SEND NXT?
2) If I can use it to send Nxt, if the broadcast bytes are intercepted can the attacker figure out the account password from the bytes?
3) Where can I find information on how to use the BroadCastTransaction API (i.e. how to prepare the bytes??)
4) Is there any examples in javascript that show how to prepare the bytes to be sent using BroadCastTransaction?

Many thanks!

1. Yes
2. No
3. I'll add prepareTransaction and sendTransaction to be used for that
4. Bytes r returned by sendMoney, sendMessage, etc.
hero member
Activity: 750
Merit: 500
www.coinschedule.com
February 20, 2014, 05:14:32 AM
Questions regarding the BroadCastTransaction API:

1) Can I use to it SEND NXT?
2) If I can use it to send Nxt, if the broadcast bytes are intercepted can the attacker figure out the account password from the bytes?
3) Where can I find information on how to use the BroadCastTransaction API (i.e. how to prepare the bytes??)
4) Is there any examples in javascript that show how to prepare the bytes to be sent using BroadCastTransaction?

Many thanks!
legendary
Activity: 2142
Merit: 1010
Newbie
February 16, 2014, 03:25:45 AM
Is there a way to get blockid by block_height directly?

Not sure, have to check it.

Didnt found any way yet .. did you?

No, Jean-Luc rewritten the code completely. I need more time to become familiar with the code.
legendary
Activity: 2212
Merit: 1199
February 15, 2014, 08:06:03 PM
Is there a way to get blockid by block_height directly?

Not sure, have to check it.

Didnt found any way yet .. did you?
newbie
Activity: 29
Merit: 0
February 15, 2014, 08:00:50 PM
mark
legendary
Activity: 2142
Merit: 1010
Newbie
February 14, 2014, 02:43:16 AM
Can you give as a preview of the changes in the existing API for using fees smaller than 1 NTX?

Currently only the API result for balances and the API parameters for asset prices are in cent.

Will all amounts (fees, nxt amounts) change to cents in the API calls and results or just the fees?

Will you introduce new requestTypes like "sendMessage2" that accepts the fee in cents or will the meaning of the fee in the old requestTypes actually change?

I don't know how Jean-Luc will solve this problem.
full member
Activity: 224
Merit: 100
February 14, 2014, 02:38:47 AM
Can you give as a preview of the changes in the existing API for using fees smaller than 1 NTX?

Currently only the API result for balances and the API parameters for asset prices are in cent.

Will all amounts (fees, nxt amounts) change to cents in the API calls and results or just the fees?

Will you introduce new requestTypes like "sendMessage2" that accepts the fee in cents or will the meaning of the fee in the old requestTypes actually change?
legendary
Activity: 2142
Merit: 1010
Newbie
February 13, 2014, 01:39:51 AM
Is there a way to get blockid by block_height directly?

Not sure, have to check it.
full member
Activity: 143
Merit: 100
February 13, 2014, 01:30:16 AM
about  getAccountTransactionIds,
when I use this API to get all transactions of account 6483973064837388393, I only got 86 transactions:
http://localhost:7874/nxt?requestType=getAccountTransactionIds&account=6483973064837388393×tamp=0
but from http://87.230.14.1/nxt/nxt.cgi?action=3000&acc=6635869272840226493
there're more than 10k transactions
is it a bug?

Yes, u use different accounts in ur requests.

I'm sorry for the mistake! I checked it and it's ok.
another question:
Is there a way to get blockid by block_height directly?
sometimes I need to start from the genenesis block to access each block in an increasing order, currently I have to start from the most recent block and follow the "previousBlock" to reach the genesis block, store all blockids in an array, and then restart the loop.
this can also be solved by adding an alternative parameter to getBlock request: getBlock&blockheight=XXX
legendary
Activity: 2142
Merit: 1010
Newbie
February 13, 2014, 12:30:59 AM
about  getAccountTransactionIds,
when I use this API to get all transactions of account 6483973064837388393, I only got 86 transactions:
http://localhost:7874/nxt?requestType=getAccountTransactionIds&account=6483973064837388393×tamp=0
but from http://87.230.14.1/nxt/nxt.cgi?action=3000&acc=6635869272840226493
there're more than 10k transactions
is it a bug?

Yes, u use different accounts in ur requests.
full member
Activity: 143
Merit: 100
February 12, 2014, 10:29:21 PM
about  getAccountTransactionIds,
when I use this API to get all transactions of account 6483973064837388393, I only got 86 transactions:
http://localhost:7874/nxt?requestType=getAccountTransactionIds&account=6483973064837388393×tamp=0
but from http://87.230.14.1/nxt/nxt.cgi?action=3000&acc=6635869272840226493
there're more than 10k transactions
is it a bug?
full member
Activity: 224
Merit: 100
February 12, 2014, 12:16:19 PM
Fullfilled orders are immediately deleted from the system, right? So no way to show the seller and buyer account for a trade?

Right. Use getTransaction and feed orderId as transactionId.

Works! :-) Thanks again!
legendary
Activity: 2142
Merit: 1010
Newbie
February 12, 2014, 11:36:20 AM
Fullfilled orders are immediately deleted from the system, right? So no way to show the seller and buyer account for a trade?

Right. Use getTransaction and feed orderId as transactionId.
hero member
Activity: 905
Merit: 1001
February 12, 2014, 11:33:35 AM
guys i am a huge fan of NXT and saw that the asset exchange feature is coming alive!
checked the API documentation and looks like its easy to get a list of assets, their orderbook and the trades.
i want to make a completely new section on cryptocoincharts.info . beside cryptocoins and exchanges i want to show charts for assets. and i want to start with NXT assets as a promotion.

is somebody here willing to help me implementing this? i dont have deep knowledge of the NXT api so it would be good if somebody could implement the cronjobs which are polling the orderbook/trades of an asset and my part is doing the charts and info pages.
please contact me at [email protected] if you want to help.
thank and keep up the good work!!!

Very nice!

https://bitcointalksearch.org/topic/m.5101634

thx. sent a message Smiley
hero member
Activity: 910
Merit: 1000
February 12, 2014, 10:32:50 AM
guys i am a huge fan of NXT and saw that the asset exchange feature is coming alive!
checked the API documentation and looks like its easy to get a list of assets, their orderbook and the trades.
i want to make a completely new section on cryptocoincharts.info . beside cryptocoins and exchanges i want to show charts for assets. and i want to start with NXT assets as a promotion.

is somebody here willing to help me implementing this? i dont have deep knowledge of the NXT api so it would be good if somebody could implement the cronjobs which are polling the orderbook/trades of an asset and my part is doing the charts and info pages.
please contact me at [email protected] if you want to help.
thank and keep up the good work!!!

Very nice!

https://bitcointalksearch.org/topic/m.5101634
full member
Activity: 224
Merit: 100
February 12, 2014, 09:31:04 AM
I was trying to get the account number of buyers and sellers by calling  getAskOrder/getBidOrder on the orderIDs that are returned with getTrades, but they are no longer available.

Fullfilled orders are immediately deleted from the system, right? So no way to show the seller and buyer account for a trade?
Pages:
Jump to: