elective-stereophonic
elective-stereophonic
A Framework example  
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client: Nxt 1.11.15

Author Topic: A Framework example  (Read 3783 times)

jones

  • Board Moderator
  • Hero Member
  • ****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
A Framework example
« on: March 23, 2015, 12:26:38 am »

I was playing around with Jay Framework today and get SendMoney to print out a TX_ string to use with Jay client.

So I ended up making a basic client with 13 lines of code:

Code: [Select]
<script src="util/jquery.js"></script>
<script src="js/jay.js"></script>
<script>
$("document").ready(function() {
    $("button").click(function() {
        $("span").text((new Jay()).sendMoney($("#acc").val(), $("#amt").val()));
    })
})
</script>
amount: <input id="amt" type="text"> <br/>
recipient: <input id="acc" type="text">
<button type="button">Create Tx</button><br/>
<span></span>

Just an example of what will be possible with the Jay Framework, 10 days left :)
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

TheCoinWizard

  • Hero Member
  • *****
  • Karma: +97/-55
  • Offline Offline
  • Posts: 614
  • Learn by questioning everything!
    • View Profile
Re: A Framework example
« Reply #1 on: March 23, 2015, 12:35:04 am »

10 days left till what?
Logged
Welcome to the After Nxt Calendar era...
Which started in the year 222 of the French Republic, Frost month, on the fifth day of the first week, better known as the 2456621th Julian day,
even better known as 24 November 2013 at 12:00:00 UTC.

jones

  • Board Moderator
  • Hero Member
  • ****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: A Framework example
« Reply #2 on: March 23, 2015, 12:39:11 am »

http://jnxt.org/jay

Until Jay v. 1 is released
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

Riker

  • Core Dev
  • Hero Member
  • *****
  • Karma: +439/-42
  • Offline Offline
  • Posts: 1794
    • View Profile
Re: A Framework example
« Reply #3 on: March 23, 2015, 06:40:41 am »

I was playing around with Jay Framework today and get SendMoney to print out a TX_ string to use with Jay client.

So I ended up making a basic client with 13 lines of code:

Code: [Select]
<script src="util/jquery.js"></script>
<script src="js/jay.js"></script>
<script>
$("document").ready(function() {
    $("button").click(function() {
        $("span").text((new Jay()).sendMoney($("#acc").val(), $("#amt").val()));
    })
})
</script>
amount: <input id="amt" type="text"> <br/>
recipient: <input id="acc" type="text">
<button type="button">Create Tx</button><br/>
<span></span>

Just an example of what will be possible with the Jay Framework, 10 days left :)

So this will create the TRF transaction bytes that you can later sign and broadcast to the network using RUN ?
Logged
NXT Core Dev
Account: NXT-HBFW-X8TE-WXPW-DZFAG
Public Key: D8311651 Key fingerprint: 0560 443B 035C EE08 0EC0  D2DD 275E 94A7 D831 1651

m19

  • Jr. Member
  • **
  • Karma: +10/-0
  • Offline Offline
  • Posts: 65
    • View Profile
Re: A Framework example
« Reply #4 on: March 23, 2015, 07:14:10 am »

Awesome, good job!   :)
Logged

jones

  • Board Moderator
  • Hero Member
  • ****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: A Framework example
« Reply #5 on: March 23, 2015, 01:40:38 pm »

I was playing around with Jay Framework today and get SendMoney to print out a TX_ string to use with Jay client.

So I ended up making a basic client with 13 lines of code:

Code: [Select]
<script src="util/jquery.js"></script>
<script src="js/jay.js"></script>
<script>
$("document").ready(function() {
    $("button").click(function() {
        $("span").text((new Jay()).sendMoney($("#acc").val(), $("#amt").val()));
    })
})
</script>
amount: <input id="amt" type="text"> <br/>
recipient: <input id="acc" type="text">
<button type="button">Create Tx</button><br/>
<span></span>

Just an example of what will be possible with the Jay Framework, 10 days left :)

So this will create the TRF transaction bytes that you can later sign and broadcast to the network using RUN ?

Correct, I've started calling run the Jay client for convenience.

I've gotten to the point where I can start to make transactions with the framework, then sign and broadcast them with the client. Things are starting to come together.
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

Riker

  • Core Dev
  • Hero Member
  • *****
  • Karma: +439/-42
  • Offline Offline
  • Posts: 1794
    • View Profile
Re: A Framework example
« Reply #6 on: March 23, 2015, 02:14:41 pm »

I've gotten to the point where I can start to make transactions with the framework, then sign and broadcast them with the client. Things are starting to come together.

Did you implement the serialization of each server side transaction type to TRF separately in JavaScript like we do in nrs.server.js or did you find some way to generalize it ?
Logged
NXT Core Dev
Account: NXT-HBFW-X8TE-WXPW-DZFAG
Public Key: D8311651 Key fingerprint: 0560 443B 035C EE08 0EC0  D2DD 275E 94A7 D831 1651

jones

  • Board Moderator
  • Hero Member
  • ****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: A Framework example
« Reply #7 on: March 23, 2015, 04:34:01 pm »

I've gotten to the point where I can start to make transactions with the framework, then sign and broadcast them with the client. Things are starting to come together.

Did you implement the serialization of each server side transaction type to TRF separately in JavaScript like we do in nrs.server.js or did you find some way to generalize it ?

I have a generalized version done, now I'm making shortcuts for each type to simplify the process.

So by release there will be both.

I just finished the appendage code also, so you will be able to affix messages to transactions also, encrypted messages will be competed for v.2 most likely.
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

Bernard Lerring

  • Sr. Member
  • ****
  • Karma: +30/-3
  • Offline Offline
  • Posts: 296
    • View Profile
Re: A Framework example
« Reply #8 on: March 26, 2015, 08:16:57 pm »

How well would this work if I was logged in to one account via Jay and simultaneously had NRS running in Ubuntu and was logged into a different account in the same browser? Or maybe two Jay tabs running two different accounts at once.

Would there be a clash in network API functions?

I'm not necessarily planning to use both at the same time. Just wondering?
Logged

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile
Re: A Framework example
« Reply #9 on: March 26, 2015, 09:04:55 pm »

How well would this work if I was logged in to one account via Jay and simultaneously had NRS running in Ubuntu and was logged into a different account in the same browser? Or maybe two Jay tabs running two different accounts at once.

Would there be a clash in network API functions?

I'm not necessarily planning to use both at the same time. Just wondering?
being "logged" into an account doesnt have the same meaning as people are used to
it only means that the browser is cached the password and can sign new tx without prompting you.
there is no state change due to this as far as the blockchain is concerned

different accts are no issue at all, I have had a dozen tabs, each with different accts and sometimes some with the same ones,
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

Bernard Lerring

  • Sr. Member
  • ****
  • Karma: +30/-3
  • Offline Offline
  • Posts: 296
    • View Profile
Re: A Framework example
« Reply #10 on: March 27, 2015, 03:55:32 am »

Thanks. Another bit of knowledge gained :)
Logged

jones

  • Board Moderator
  • Hero Member
  • ****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: A Framework example
« Reply #11 on: March 27, 2015, 01:21:23 pm »

How well would this work if I was logged in to one account via Jay and simultaneously had NRS running in Ubuntu and was logged into a different account in the same browser? Or maybe two Jay tabs running two different accounts at once.

Would there be a clash in network API functions?

I'm not necessarily planning to use both at the same time. Just wondering?

Yes, you may use as many accounts as you wish at one time.

Jay client has a multiwallet structure too, so when you start a transaction you can choose from a drop down of all accounts included in your wallet. You can also have multiple Jay tabs open at the same time. I'm sure it will still run smoothly with 100 accounts on the system open in 100 different tabs.
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

capodieci

  • Hero Member
  • *****
  • Karma: +256/-19
  • Offline Offline
  • Posts: 1344
  • Tips go to DeBuNe Dev fund
    • View Profile
    • DeBuNe - Decentralised Business Network
Re: A Framework example
« Reply #12 on: March 28, 2015, 04:37:29 am »

Just an example of what will be possible with the Jay Framework, 10 days left :)

Can't wait the 33rd of March for the release of Jay Framework!
Logged
- Decentralised Business Network: DeBuNe -
Asset: 6926770479287491943 - Issuer: NXT-GQ27-DD53-YM6K-ER6HK
OTDocs.com - debune.org - nxtforum.org/debune - NEW: thesoundkey.com

nxtrules

  • Sr. Member
  • ****
  • Karma: +15/-1
  • Offline Offline
  • Posts: 254
    • View Profile
Re: A Framework example
« Reply #13 on: May 24, 2015, 05:09:35 pm »

I was playing around with Jay Framework today and get SendMoney to print out a TX_ string to use with Jay client.

So I ended up making a basic client with 13 lines of code:

Code: [Select]
<script src="util/jquery.js"></script>
<script src="js/jay.js"></script>
<script>
$("document").ready(function() {
    $("button").click(function() {
        $("span").text((new Jay()).sendMoney($("#acc").val(), $("#amt").val()));
    })
})
</script>
amount: <input id="amt" type="text"> <br/>
recipient: <input id="acc" type="text">
<button type="button">Create Tx</button><br/>
<span></span>

Just an example of what will be possible with the Jay Framework, 10 days left :)

Super job Jones. Assuming we can just take this code and integrate into our sites ;-)
Logged
http://nxtrules.mooo.com {NXT investment tracking with multiple account support}
 

elective-stereophonic
elective-stereophonic
assembly
assembly